[llvm-commits] [compiler-rt] r150384 - in /compiler-rt/trunk/lib/asan/output_tests: clone_test.cc deep_tail_call.cc dlclose-test.cc global-overflow.cc heap-overflow.cc large_func_test.cc match_output.py null_deref.cc shared-lib-test.cc stack-overflow.cc stack-use-after-return.cc.disabled strncpy-overflow.cc test_output.sh use-after-free.cc

Alexey Samsonov samsonov at google.com
Mon Feb 13 05:59:25 PST 2012


Author: samsonov
Date: Mon Feb 13 07:59:24 2012
New Revision: 150384

URL: http://llvm.org/viewvc/llvm-project?rev=150384&view=rev
Log:
AddressSanitizer: remove match_output.py, split expected output into OS-specific and OS-independent parts

Removed:
    compiler-rt/trunk/lib/asan/output_tests/match_output.py
Modified:
    compiler-rt/trunk/lib/asan/output_tests/clone_test.cc
    compiler-rt/trunk/lib/asan/output_tests/deep_tail_call.cc
    compiler-rt/trunk/lib/asan/output_tests/dlclose-test.cc
    compiler-rt/trunk/lib/asan/output_tests/global-overflow.cc
    compiler-rt/trunk/lib/asan/output_tests/heap-overflow.cc
    compiler-rt/trunk/lib/asan/output_tests/large_func_test.cc
    compiler-rt/trunk/lib/asan/output_tests/null_deref.cc
    compiler-rt/trunk/lib/asan/output_tests/shared-lib-test.cc
    compiler-rt/trunk/lib/asan/output_tests/stack-overflow.cc
    compiler-rt/trunk/lib/asan/output_tests/stack-use-after-return.cc.disabled
    compiler-rt/trunk/lib/asan/output_tests/strncpy-overflow.cc
    compiler-rt/trunk/lib/asan/output_tests/test_output.sh
    compiler-rt/trunk/lib/asan/output_tests/use-after-free.cc

Modified: compiler-rt/trunk/lib/asan/output_tests/clone_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/clone_test.cc?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/clone_test.cc (original)
+++ compiler-rt/trunk/lib/asan/output_tests/clone_test.cc Mon Feb 13 07:59:24 2012
@@ -29,6 +29,6 @@
 #include <stdio.h>
 int main() {
   printf("PASSED\n");
-  // CHECK: PASSED
+  // Check-Common: PASSED
 }
 #endif

Modified: compiler-rt/trunk/lib/asan/output_tests/deep_tail_call.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/deep_tail_call.cc?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/deep_tail_call.cc (original)
+++ compiler-rt/trunk/lib/asan/output_tests/deep_tail_call.cc Mon Feb 13 07:59:24 2012
@@ -1,14 +1,14 @@
-// CHECK: AddressSanitizer global-buffer-overflow
+// Check-Common: AddressSanitizer global-buffer-overflow
 int global[10];
-// CHECK: {{#0.*call4}}
+// Check-Common: {{#0.*call4}}
 void __attribute__((noinline)) call4(int i) { global[i+10]++; }
-// CHECK: {{#1.*call3}}
+// Check-Common: {{#1.*call3}}
 void __attribute__((noinline)) call3(int i) { call4(i); }
-// CHECK: {{#2.*call2}}
+// Check-Common: {{#2.*call2}}
 void __attribute__((noinline)) call2(int i) { call3(i); }
-// CHECK: {{#3.*call1}}
+// Check-Common: {{#3.*call1}}
 void __attribute__((noinline)) call1(int i) { call2(i); }
-// CHECK: {{#4.*main}}
+// Check-Common: {{#4.*main}}
 int main(int argc, char **argv) {
   call1(argc);
   return global[0];

Modified: compiler-rt/trunk/lib/asan/output_tests/dlclose-test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/dlclose-test.cc?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/dlclose-test.cc (original)
+++ compiler-rt/trunk/lib/asan/output_tests/dlclose-test.cc Mon Feb 13 07:59:24 2012
@@ -69,6 +69,6 @@
   }
   addr[1] = 2;  // BOOM (if the bug is not fixed).
   printf("PASS\n");
-  // CHECK: PASS
+  // Check-Common: PASS
   return 0;
 }

Modified: compiler-rt/trunk/lib/asan/output_tests/global-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/global-overflow.cc?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/global-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/output_tests/global-overflow.cc Mon Feb 13 07:59:24 2012
@@ -7,9 +7,9 @@
   memset(YYY, 0, 10);
   memset(ZZZ, 0, 10);
   int res = YYY[argc * 10];  // BOOOM
-  // CHECK: {{READ of size 1 at 0x.* thread T0}}
-  // CHECK: {{    #0 0x.* in main .*global-overflow.cc:9}}
-  // CHECK: {{0x.* is located 0 bytes to the right of global variable .*YYY.* of size 10}}
+  // Check-Common: {{READ of size 1 at 0x.* thread T0}}
+  // Check-Common: {{    #0 0x.* in main .*global-overflow.cc:9}}
+  // Check-Common: {{0x.* is located 0 bytes to the right of global variable .*YYY.* of size 10}}
   res += XXX[argc] + ZZZ[argc];
   return res;
 }

Modified: compiler-rt/trunk/lib/asan/output_tests/heap-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/heap-overflow.cc?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/heap-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/output_tests/heap-overflow.cc Mon Feb 13 07:59:24 2012
@@ -8,18 +8,15 @@
   return res;
 }
 
-// CHECK: {{READ of size 1 at 0x.* thread T0}}
-// CHECK: {{    #0 0x.* in main .*heap-overflow.cc:6}}
-// CHECK: {{0x.* is located 0 bytes to the right of 10-byte region}}
-// CHECK: {{allocated by thread T0 here:}}
-// CHECK: {{    #0 0x.* in malloc}}
-// CHECK: {{    #1 0x.* in main .*heap-overflow.cc:[45]}}
+// Check-Common: {{READ of size 1 at 0x.* thread T0}}
+// Check-Common: {{    #0 0x.* in main .*heap-overflow.cc:6}}
+// Check-Common: {{0x.* is located 0 bytes to the right of 10-byte region}}
+// Check-Common: {{allocated by thread T0 here:}}
 
-// Darwin: {{READ of size 1 at 0x.* thread T0}}
-// Darwin: {{    #0 0x.* in main .*heap-overflow.cc:6}}
-// Darwin: {{0x.* is located 0 bytes to the right of 10-byte region}}
-// Darwin: {{allocated by thread T0 here:}}
-// Darwin: {{    #0 0x.* in .*mz_malloc.*}}
-// Darwin: {{    #1 0x.* in malloc_zone_malloc.*}}
-// Darwin: {{    #2 0x.* in malloc.*}}
-// Darwin: {{    #3 0x.* in main heap-overflow.cc:[45]}}
+// Check-Linux: {{    #0 0x.* in malloc}}
+// Check-Linux: {{    #1 0x.* in main .*heap-overflow.cc:[45]}}
+
+// Check-Darwin: {{    #0 0x.* in .*mz_malloc.*}}
+// Check-Darwin: {{    #1 0x.* in malloc_zone_malloc.*}}
+// Check-Darwin: {{    #2 0x.* in malloc.*}}
+// Check-Darwin: {{    #3 0x.* in main heap-overflow.cc:[45]}}

Modified: compiler-rt/trunk/lib/asan/output_tests/large_func_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/large_func_test.cc?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/large_func_test.cc (original)
+++ compiler-rt/trunk/lib/asan/output_tests/large_func_test.cc Mon Feb 13 07:59:24 2012
@@ -32,11 +32,11 @@
   delete x;
 }
 
-// CHECK: {{.*ERROR: AddressSanitizer heap-buffer-overflow on address 0x.* at pc 0x.* bp 0x.* sp 0x.*}}
-// CHECK: {{READ of size 4 at 0x.* thread T0}}
-// CHECK: {{    #0 0x.* in LargeFunction .*large_func_test.cc:15}}
-// CHECK: {{    #1 0x.* in main .*large_func_test.cc:3[012]}}
-// CHECK: {{0x.* is located 44 bytes to the right of 400-byte region}}
-// CHECK: {{allocated by thread T0 here:}}
-// CHECK: {{    #0 0x.* in operator new.*}}
-// CHECK: {{    #1 0x.* in main .*large_func_test.cc:30}}
+// Check-Common: {{.*ERROR: AddressSanitizer heap-buffer-overflow on address 0x.* at pc 0x.* bp 0x.* sp 0x.*}}
+// Check-Common: {{READ of size 4 at 0x.* thread T0}}
+// Check-Common: {{    #0 0x.* in LargeFunction .*large_func_test.cc:15}}
+// Check-Common: {{    #1 0x.* in main .*large_func_test.cc:3[012]}}
+// Check-Common: {{0x.* is located 44 bytes to the right of 400-byte region}}
+// Check-Common: {{allocated by thread T0 here:}}
+// Check-Common: {{    #0 0x.* in operator new.*}}
+// Check-Common: {{    #1 0x.* in main .*large_func_test.cc:30}}

Removed: compiler-rt/trunk/lib/asan/output_tests/match_output.py
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/match_output.py?rev=150383&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/match_output.py (original)
+++ compiler-rt/trunk/lib/asan/output_tests/match_output.py (removed)
@@ -1,35 +0,0 @@
-#!/usr/bin/python
-
-import re
-import sys
-
-def matchFile(f, f_re):
-  for line_re in f_re:
-    line_re = line_re.rstrip()
-    if not line_re:
-      continue
-    if line_re[0] == '#':
-      continue
-    match = False
-    for line in f:
-      line = line.rstrip()
-      # print line
-      if re.search(line_re, line):
-        match = True
-        #print 'match: %s =~ %s' % (line, line_re)
-        break
-    if not match:
-      print 'no match for: %s' % (line_re)
-      return False
-  return True
-
-if len(sys.argv) != 2:
-  print >>sys.stderr, 'Usage: %s <template file>'
-  sys.exit(1)
-
-f = sys.stdin
-f_re = open(sys.argv[1])
-
-if not matchFile(f, f_re):
-  print >>sys.stderr, 'File does not match the template'
-  sys.exit(1)

Modified: compiler-rt/trunk/lib/asan/output_tests/null_deref.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/null_deref.cc?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/null_deref.cc (original)
+++ compiler-rt/trunk/lib/asan/output_tests/null_deref.cc Mon Feb 13 07:59:24 2012
@@ -6,13 +6,11 @@
   NullDeref((int*)0);
 }
 
-// CHECK: {{.*ERROR: AddressSanitizer crashed on unknown address 0x0*00028 .*pc 0x.*}}
-// CHECK: {{AddressSanitizer can not provide additional info. ABORTING}}
-// CHECK: {{    #0 0x.* in NullDeref.*null_deref.cc:3}}
-// CHECK: {{    #1 0x.* in main.*null_deref.cc:[67]}}
+// Check-Common: {{.*ERROR: AddressSanitizer crashed on unknown address 0x0*00028 .*pc 0x.*}}
+// Check-Common: {{AddressSanitizer can not provide additional info. ABORTING}}
 
-// Darwin: {{.*ERROR: AddressSanitizer crashed on unknown address 0x0*00028 .*pc 0x.*}}
-// Darwin: {{AddressSanitizer can not provide additional info. ABORTING}}
-// atos cannot resolve the file:line info for frame 0 on the O1 level
-// Darwin: {{    #0 0x.* in NullDeref.*}}
-// Darwin: {{    #1 0x.* in main.*null_deref.cc:[67]}}
+// atos on Mac cannot resolve the file:line info for frame 0 on the O1 level
+// Check-Linux: {{    #0 0x.* in NullDeref.*null_deref.cc:3}}
+// Check-Darwin: {{    #0 0x.* in NullDeref.*}}
+
+// Check-Common: {{    #1 0x.* in main.*null_deref.cc:[67]}}

Modified: compiler-rt/trunk/lib/asan/output_tests/shared-lib-test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/shared-lib-test.cc?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/shared-lib-test.cc (original)
+++ compiler-rt/trunk/lib/asan/output_tests/shared-lib-test.cc Mon Feb 13 07:59:24 2012
@@ -36,7 +36,7 @@
   return 0;
 }
 
-// CHECK: {{.*ERROR: AddressSanitizer global-buffer-overflow}}
-// CHECK: {{READ of size 4 at 0x.* thread T0}}
-// CHECK: {{    #0 0x.*}}
-// CHECK: {{    #1 0x.* in main .*shared-lib-test.cc:3[567]}}
+// Check-Common: {{.*ERROR: AddressSanitizer global-buffer-overflow}}
+// Check-Common: {{READ of size 4 at 0x.* thread T0}}
+// Check-Common: {{    #0 0x.*}}
+// Check-Common: {{    #1 0x.* in main .*shared-lib-test.cc:3[567]}}

Modified: compiler-rt/trunk/lib/asan/output_tests/stack-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/stack-overflow.cc?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/stack-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/output_tests/stack-overflow.cc Mon Feb 13 07:59:24 2012
@@ -6,6 +6,6 @@
   return res;
 }
 
-// CHECK: {{READ of size 1 at 0x.* thread T0}}
-// CHECK: {{    #0 0x.* in main .*stack-overflow.cc:5}}
-// CHECK: {{Address 0x.* is .* frame <main>}}
+// Check-Common: {{READ of size 1 at 0x.* thread T0}}
+// Check-Common: {{    #0 0x.* in main .*stack-overflow.cc:5}}
+// Check-Common: {{Address 0x.* is .* frame <main>}}

Modified: compiler-rt/trunk/lib/asan/output_tests/stack-use-after-return.cc.disabled
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/stack-use-after-return.cc.disabled?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/stack-use-after-return.cc.disabled (original)
+++ compiler-rt/trunk/lib/asan/output_tests/stack-use-after-return.cc.disabled Mon Feb 13 07:59:24 2012
@@ -16,9 +16,9 @@
 void Func2(char *x) {
   fprintf(stderr, "2: %p\n", x);
   *x = 1;
-  // CHECK: {{WRITE of size 1 .* thread T0}}
-  // CHECK: {{    #0.*Func2.*stack-use-after-return.cc:18}}
-  // CHECK: {{is located in frame <.*Func1.*> of T0's stack}}
+  // Check-Common: {{WRITE of size 1 .* thread T0}}
+  // Check-Common: {{    #0.*Func2.*stack-use-after-return.cc:18}}
+  // Check-Common: {{is located in frame <.*Func1.*> of T0's stack}}
 }
 
 int main(int argc, char **argv) {

Modified: compiler-rt/trunk/lib/asan/output_tests/strncpy-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/strncpy-overflow.cc?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/strncpy-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/output_tests/strncpy-overflow.cc Mon Feb 13 07:59:24 2012
@@ -8,20 +8,17 @@
   return short_buffer[8];
 }
 
-// CHECK: {{WRITE of size 1 at 0x.* thread T0}}
-// CHECK: {{    #0 0x.* in strncpy}}
-// CHECK: {{    #1 0x.* in main .*strncpy-overflow.cc:[78]}}
-// CHECK: {{0x.* is located 0 bytes to the right of 9-byte region}}
-// CHECK: {{allocated by thread T0 here:}}
-// CHECK: {{    #0 0x.* in malloc}}
-// CHECK: {{    #1 0x.* in main .*strncpy-overflow.cc:6}}
+// Check-Common: {{WRITE of size 1 at 0x.* thread T0}}
+// Check-Linux: {{    #0 0x.* in strncpy}}
+// Check-Darwin: {{    #0 0x.* in wrap_strncpy}}
+// Check-Common: {{    #1 0x.* in main .*strncpy-overflow.cc:[78]}}
+// Check-Common: {{0x.* is located 0 bytes to the right of 9-byte region}}
+// Check-Common: {{allocated by thread T0 here:}}
 
-// Darwin: {{WRITE of size 1 at 0x.* thread T0}}
-// Darwin: {{    #0 0x.* in wrap_strncpy}}
-// Darwin: {{    #1 0x.* in main .*strncpy-overflow.cc:[78]}}
-// Darwin: {{0x.* is located 0 bytes to the right of 9-byte region}}
-// Darwin: {{allocated by thread T0 here:}}
-// Darwin: {{    #0 0x.* in .*mz_malloc.*}}
-// Darwin: {{    #1 0x.* in malloc_zone_malloc.*}}
-// Darwin: {{    #2 0x.* in malloc.*}}
-// Darwin: {{    #3 0x.* in main .*strncpy-overflow.cc:6}}
+// Check-Linux: {{    #0 0x.* in malloc}}
+// Check-Linux: {{    #1 0x.* in main .*strncpy-overflow.cc:6}}
+
+// Check-Darwin: {{    #0 0x.* in .*mz_malloc.*}}
+// Check-Darwin: {{    #1 0x.* in malloc_zone_malloc.*}}
+// Check-Darwin: {{    #2 0x.* in malloc.*}}
+// Check-Darwin: {{    #3 0x.* in main .*strncpy-overflow.cc:6}}

Modified: compiler-rt/trunk/lib/asan/output_tests/test_output.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/test_output.sh?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/test_output.sh (original)
+++ compiler-rt/trunk/lib/asan/output_tests/test_output.sh Mon Feb 13 07:59:24 2012
@@ -8,28 +8,27 @@
 FILE_CHECK=$3
 CXXFLAGS="-mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls"
 SYMBOLIZER=../scripts/asan_symbolize.py
+TMP_ASAN_REPORT=/tmp/asan_report
 
-# check_program exe_file src_file [check_prefix]
+run_program() {
+  ./$1 2>&1 | $SYMBOLIZER 2> /dev/null | c++filt > $TMP_ASAN_REPORT
+}
+
+# check_program exe_file source_file check_prefix
 check_program() {
-  exe=$1
-  src=$2
-  prefix="CHECK"
-  if [ "z$3" != "z" ] ; then
-    prefix=$3
-  fi
-  ./$exe 2>&1 | $SYMBOLIZER 2> /dev/null | c++filt | \
-        $FILE_CHECK $src --check-prefix=$prefix
+  run_program $1
+  $FILE_CHECK $2 --check-prefix=$3 < $TMP_ASAN_REPORT
 }
 
 C_TEST=use-after-free
 echo "Sanity checking a test in pure C"
 $CC -g -faddress-sanitizer -O2 $C_TEST.c
-check_program a.out $C_TEST.c
+check_program a.out $C_TEST.c CHECK
 rm ./a.out
 
 echo "Sanity checking a test in pure C with -pie"
 $CC -g -faddress-sanitizer -O2 $C_TEST.c -pie
-check_program a.out $C_TEST.c
+check_program a.out $C_TEST.c CHECK
 rm ./a.out
 
 echo "Testing sleep_before_dying"
@@ -55,15 +54,14 @@
       [ "$DEBUG" == "1" ] && echo $build_command
       $build_command
       [ -e "$c_so.cc" ] && $CXX $CXXFLAGS -g -m$b -faddress-sanitizer -O$O $c_so.cc -fPIC -shared -o $so
-      # If there's an OS-specific template, use it.
-      # Otherwise use default template.
-      if [ `grep -c "$OS" $c.cc` -gt 0 ]
+      run_program $exe
+      # Check common expected lines for OS.
+      $FILE_CHECK $c.cc --check-prefix="Check-Common" < $TMP_ASAN_REPORT
+      # Check OS-specific lines.
+      if [ `grep -c "Check-$OS" $c.cc` -gt 0 ]
       then
-        check_prefix="$OS"
-      else
-        check_prefix="CHECK"
+        $FILE_CHECK $c.cc --check-prefix="Check-$OS" < $TMP_ASAN_REPORT
       fi
-      check_program $exe $c.cc $check_prefix
       rm ./$exe
       [ -e "$so" ] && rm ./$so
     done

Modified: compiler-rt/trunk/lib/asan/output_tests/use-after-free.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/use-after-free.cc?rev=150384&r1=150383&r2=150384&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/output_tests/use-after-free.cc (original)
+++ compiler-rt/trunk/lib/asan/output_tests/use-after-free.cc Mon Feb 13 07:59:24 2012
@@ -5,28 +5,26 @@
   return x[5];
 }
 
-// CHECK: {{.*ERROR: AddressSanitizer heap-use-after-free on address 0x.* at pc 0x.* bp 0x.* sp 0x.*}}
-// CHECK: {{READ of size 1 at 0x.* thread T0}}
-// CHECK: {{    #0 0x.* in main .*use-after-free.cc:5}}
-// CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
-// CHECK: {{freed by thread T0 here:}}
-// CHECK: {{    #0 0x.* in free}}
-// CHECK: {{    #1 0x.* in main .*use-after-free.cc:[45]}}
-// CHECK: {{previously allocated by thread T0 here:}}
-// CHECK: {{    #0 0x.* in malloc}}
-// CHECK: {{    #1 0x.* in main .*use-after-free.cc:3}}
-
-// Darwin: {{.*ERROR: AddressSanitizer heap-use-after-free on address 0x.* at pc 0x.* bp 0x.* sp 0x.*}}
-// Darwin: {{READ of size 1 at 0x.* thread T0}}
-// Darwin: {{    #0 0x.* in main .*use-after-free.cc:5}}
-// Darwin: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
-// Darwin: {{freed by thread T0 here:}}
-// Darwin: {{    #0 0x.* in .*mz_free.*}}
+// Check-Common: {{.*ERROR: AddressSanitizer heap-use-after-free on address 0x.* at pc 0x.* bp 0x.* sp 0x.*}}
+// Check-Common: {{READ of size 1 at 0x.* thread T0}}
+// Check-Common: {{    #0 0x.* in main .*use-after-free.cc:5}}
+// Check-Common: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
+// Check-Common: {{freed by thread T0 here:}}
+
+// Check-Linux: {{    #0 0x.* in free}}
+// Check-Linux: {{    #1 0x.* in main .*use-after-free.cc:[45]}}
+
+// Check-Darwin: {{    #0 0x.* in .*mz_free.*}}
 // We override free() on Darwin, thus no malloc_zone_free
-// Darwin: {{    #1 0x.* in free}}
-// Darwin: {{    #2 0x.* in main .*use-after-free.cc:[45]}}
-// Darwin: {{previously allocated by thread T0 here:}}
-// Darwin: {{    #0 0x.* in .*mz_malloc.*}}
-// Darwin: {{    #1 0x.* in malloc_zone_malloc.*}}
-// Darwin: {{    #2 0x.* in malloc.*}}
-// Darwin: {{    #3 0x.* in main .*use-after-free.cc:3}}
+// Check-Darwin: {{    #1 0x.* in free}}
+// Check-Darwin: {{    #2 0x.* in main .*use-after-free.cc:[45]}}
+
+// Check-Common: {{previously allocated by thread T0 here:}}
+
+// Check-Linux: {{    #0 0x.* in malloc}}
+// Check-Linux: {{    #1 0x.* in main .*use-after-free.cc:3}}
+
+// Check-Darwin: {{    #0 0x.* in .*mz_malloc.*}}
+// Check-Darwin: {{    #1 0x.* in malloc_zone_malloc.*}}
+// Check-Darwin: {{    #2 0x.* in malloc.*}}
+// Check-Darwin: {{    #3 0x.* in main .*use-after-free.cc:3}}





More information about the llvm-commits mailing list