[PATCH] D45281: [asan] Fix aligned_alloc test case

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 12:58:21 PDT 2018


cryptoad created this revision.
cryptoad added a reviewer: alekseyshl.
Herald added subscribers: Sanitizers, delcypher, kubamracek, srhines.

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.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D45281

Files:
  test/asan/TestCases/Linux/aligned_alloc-alignment.cc


Index: test/asan/TestCases/Linux/aligned_alloc-alignment.cc
===================================================================
--- test/asan/TestCases/Linux/aligned_alloc-alignment.cc
+++ test/asan/TestCases/Linux/aligned_alloc-alignment.cc
@@ -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 @@
 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
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45281.141029.patch
Type: text/x-patch
Size: 1007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180404/40bbfd37/attachment-0001.bin>


More information about the llvm-commits mailing list