[compiler-rt] r209699 - [asan] use relative line numbers in tests

Greg Fitzgerald gregf at codeaurora.org
Tue May 27 16:13:53 PDT 2014


Author: garious
Date: Tue May 27 18:13:52 2014
New Revision: 209699

URL: http://llvm.org/viewvc/llvm-project?rev=209699&view=rev
Log:
[asan] use relative line numbers in tests

Modified:
    compiler-rt/trunk/test/asan/TestCases/asan-symbolize-sanity-test.cc
    compiler-rt/trunk/test/asan/TestCases/use-after-delete.cc
    compiler-rt/trunk/test/asan/TestCases/use-after-free-right.cc
    compiler-rt/trunk/test/asan/TestCases/use-after-free.cc

Modified: compiler-rt/trunk/test/asan/TestCases/asan-symbolize-sanity-test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/asan-symbolize-sanity-test.cc?rev=209699&r1=209698&r2=209699&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/asan-symbolize-sanity-test.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/asan-symbolize-sanity-test.cc Tue May 27 18:13:52 2014
@@ -32,7 +32,7 @@ int main(int argc, char *argv[]) {
   inc2(array, -1);  // BOOM
   // CHECK: ERROR: AddressSanitizer: heap-buffer-overflow
   // CHECK: READ of size 4 at 0x{{.*}}
-  // CHECK: #0 {{.*}} in inc2 {{.*}}asan-symbolize-sanity-test.cc:56
+  // CHECK: #0 {{.*}} in inc2 {{.*}}asan-symbolize-sanity-test.cc:[[@LINE+21]]
   // CHECK: #1 {{.*}} in main {{.*}}asan-symbolize-sanity-test.cc:[[@LINE-4]]
   // CHECK: allocated by thread T{{.*}} here:
   // CHECK: #{{.*}} in {{(wrap_|__interceptor_)?}}malloc

Modified: compiler-rt/trunk/test/asan/TestCases/use-after-delete.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/use-after-delete.cc?rev=209699&r1=209698&r2=209699&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/use-after-delete.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/use-after-delete.cc Tue May 27 18:13:52 2014
@@ -11,17 +11,17 @@ int main() {
   // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
   // CHECK:   {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
   // CHECK: {{READ of size 1 at 0x.* thread T0}}
-  // CHECK: {{    #0 0x.* in main .*use-after-delete.cc:10}}
+  // CHECK: {{    #0 0x.* in main .*use-after-delete.cc:}}[[@LINE-4]]
   // CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
   // CHECK: {{freed by thread T0 here:}}
 
   // CHECK-Linux: {{    #0 0x.* in operator delete\[\]}}
-  // CHECK-Linux: {{    #1 0x.* in main .*use-after-delete.cc:9}}
+  // CHECK-Linux: {{    #1 0x.* in main .*use-after-delete.cc:}}[[@LINE-10]]
 
   // CHECK: {{previously allocated by thread T0 here:}}
 
   // CHECK-Linux: {{    #0 0x.* in operator new\[\]}}
-  // CHECK-Linux: {{    #1 0x.* in main .*use-after-delete.cc:8}}
+  // CHECK-Linux: {{    #1 0x.* in main .*use-after-delete.cc:}}[[@LINE-16]]
 
   // CHECK: Shadow byte legend (one shadow byte represents 8 application bytes):
   // CHECK: Global redzone:

Modified: compiler-rt/trunk/test/asan/TestCases/use-after-free-right.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/use-after-free-right.cc?rev=209699&r1=209698&r2=209699&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/use-after-free-right.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/use-after-free-right.cc Tue May 27 18:13:52 2014
@@ -14,21 +14,21 @@ int main() {
   // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
   // CHECK:   {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
   // CHECK: {{WRITE of size 1 at 0x.* thread T0}}
-  // CHECK: {{    #0 0x.* in main .*use-after-free-right.cc:13}}
+  // CHECK: {{    #0 0x.* in main .*use-after-free-right.cc:}}[[@LINE-4]]
   // CHECK: {{0x.* is located 0 bytes inside of 1-byte region .0x.*,0x.*}}
   // CHECK: {{freed by thread T0 here:}}
 
   // CHECK-Linux: {{    #0 0x.* in .*free}}
-  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free-right.cc:12}}
+  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-10]]
 
   // CHECK-Darwin: {{    #0 0x.* in wrap_free}}
-  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free-right.cc:12}}
+  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-13]]
 
   // CHECK: {{previously allocated by thread T0 here:}}
 
   // CHECK-Linux: {{    #0 0x.* in .*malloc}}
-  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free-right.cc:11}}
+  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-19]]
 
   // CHECK-Darwin: {{    #0 0x.* in wrap_malloc.*}}
-  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free-right.cc:11}}
+  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-22]]
 }

Modified: compiler-rt/trunk/test/asan/TestCases/use-after-free.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/use-after-free.cc?rev=209699&r1=209698&r2=209699&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/use-after-free.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/use-after-free.cc Tue May 27 18:13:52 2014
@@ -11,23 +11,23 @@ int main() {
   // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
   // CHECK:   {{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:10}}
+  // CHECK: {{    #0 0x.* in main .*use-after-free.cc:}}[[@LINE-4]]
   // CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
   // CHECK: {{freed by thread T0 here:}}
 
   // CHECK-Linux: {{    #0 0x.* in .*free}}
-  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free.cc:9}}
+  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free.cc:}}[[@LINE-10]]
 
   // CHECK-Darwin: {{    #0 0x.* in wrap_free}}
-  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free.cc:9}}
+  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free.cc:}}[[@LINE-13]]
 
   // CHECK: {{previously allocated by thread T0 here:}}
 
   // CHECK-Linux: {{    #0 0x.* in .*malloc}}
-  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free.cc:8}}
+  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free.cc:}}[[@LINE-19]]
 
   // CHECK-Darwin: {{    #0 0x.* in wrap_malloc.*}}
-  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free.cc:8}}
+  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free.cc:}}[[@LINE-22]]
   // CHECK: Shadow byte legend (one shadow byte represents 8 application bytes):
   // CHECK: Global redzone:
   // CHECK: ASan internal:





More information about the llvm-commits mailing list