[asan] Fix aligned_alloc test case

Summary:
Under some circumstances (that I haven't dug further into), the first stack
frame for the test looks like:
`#0 0x4e6038 in __interceptor_memalign.localalias.1 ...compiler-rt/lib/asan/asan_malloc_linux.cc:113`
which isn't matched by the current CHECK.

Expand the CHECK to match aligned_alloc or memalign. Hopefully this should fix
the PowerPC issue as well, otherwise we'll bring back the FIXME.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D45281

llvm-svn: 329226
This commit is contained in:
Kostya Kortchinsky 2018-04-04 20:03:16 +00:00
parent 604f036394
commit 0716fb9376
1 changed files with 2 additions and 3 deletions

View File

@ -2,8 +2,7 @@
// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t 2>&1 | FileCheck %s
// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NULL
// FIXME(alekseyshl): #0 frame does not look as expected on ppc64be, fix it.
// UNSUPPORTED: android,powerpc64
// UNSUPPORTED: android
// REQUIRES: stable-runtime
@ -15,7 +14,7 @@ extern void *aligned_alloc(size_t alignment, size_t size);
int main() {
void *p = aligned_alloc(17, 100);
// CHECK: ERROR: AddressSanitizer: invalid allocation alignment: 17
// CHECK: {{#0 0x.* in .*aligned_alloc}}
// CHECK: {{#0 0x.* in .*}}{{aligned_alloc|memalign}}
// CHECK: {{#1 0x.* in main .*aligned_alloc-alignment.cc:}}[[@LINE-3]]
// CHECK: SUMMARY: AddressSanitizer: invalid-allocation-alignment