[compiler-rt] r194578 - [ASan] Use new feature of FileCheck: provide multiple --check-prefix args

Alexey Samsonov samsonov at google.com
Wed Nov 13 06:16:40 PST 2013


Author: samsonov
Date: Wed Nov 13 08:16:40 2013
New Revision: 194578

URL: http://llvm.org/viewvc/llvm-project?rev=194578&view=rev
Log:
[ASan] Use new feature of FileCheck: provide multiple --check-prefix args

Modified:
    compiler-rt/trunk/lib/asan/lit_tests/TestCases/heap-overflow.cc
    compiler-rt/trunk/lib/asan/lit_tests/TestCases/large_func_test.cc
    compiler-rt/trunk/lib/asan/lit_tests/TestCases/null_deref.cc
    compiler-rt/trunk/lib/asan/lit_tests/TestCases/strncpy-overflow.cc
    compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free-right.cc
    compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free.cc

Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/heap-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/heap-overflow.cc?rev=194578&r1=194577&r2=194578&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/heap-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/heap-overflow.cc Wed Nov 13 08:16:40 2013
@@ -1,11 +1,7 @@
-// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
+// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
 
 #include <stdlib.h>
 #include <string.h>
@@ -19,10 +15,10 @@ int main(int argc, char **argv) {
   // CHECK: {{allocated by thread T0 here:}}
 
   // CHECK-Linux: {{    #0 0x.* in .*malloc}}
-  // CHECK-Linux: {{    #1 0x.* in main .*heap-overflow.cc:13}}
+  // CHECK-Linux: {{    #1 0x.* in main .*heap-overflow.cc:9}}
 
   // CHECK-Darwin: {{    #0 0x.* in wrap_malloc.*}}
-  // CHECK-Darwin: {{    #1 0x.* in main .*heap-overflow.cc:13}}
+  // CHECK-Darwin: {{    #1 0x.* in main .*heap-overflow.cc:9}}
   free(x);
   return res;
 }

Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/large_func_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/large_func_test.cc?rev=194578&r1=194577&r2=194578&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/large_func_test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/large_func_test.cc Wed Nov 13 08:16:40 2013
@@ -1,11 +1,7 @@
-// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
+// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
 
 #include <stdlib.h>
 __attribute__((noinline))

Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/null_deref.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/null_deref.cc?rev=194578&r1=194577&r2=194578&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/null_deref.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/null_deref.cc Wed Nov 13 08:16:40 2013
@@ -1,11 +1,7 @@
-// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
+// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
 
 __attribute__((noinline))
 static void NullDeref(int *ptr) {

Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/strncpy-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/strncpy-overflow.cc?rev=194578&r1=194577&r2=194578&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/strncpy-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/strncpy-overflow.cc Wed Nov 13 08:16:40 2013
@@ -1,11 +1,7 @@
-// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
+// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
 
 // REQUIRES: compiler-rt-optimized
 

Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free-right.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free-right.cc?rev=194578&r1=194577&r2=194578&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free-right.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free-right.cc Wed Nov 13 08:16:40 2013
@@ -1,14 +1,10 @@
-// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
+// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
 
 // Test use-after-free report in the case when access is at the right border of
-//  the allocation.
+// the allocation.
 
 #include <stdlib.h>
 int main() {
@@ -18,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:17}}
+  // CHECK: {{    #0 0x.* in main .*use-after-free-right.cc:13}}
   // 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:16}}
+  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free-right.cc:12}}
 
   // CHECK-Darwin: {{    #0 0x.* in wrap_free}}
-  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free-right.cc:16}}
+  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free-right.cc:12}}
 
   // CHECK: {{previously allocated by thread T0 here:}}
 
   // CHECK-Linux: {{    #0 0x.* in .*malloc}}
-  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free-right.cc:15}}
+  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free-right.cc:11}}
 
   // CHECK-Darwin: {{    #0 0x.* in wrap_malloc.*}}
-  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free-right.cc:15}}
+  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free-right.cc:11}}
 }

Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free.cc?rev=194578&r1=194577&r2=194578&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free.cc Wed Nov 13 08:16:40 2013
@@ -1,11 +1,7 @@
-// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>%t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
+// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
+// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
 
 #include <stdlib.h>
 int main() {
@@ -15,21 +11,21 @@ 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:14}}
+  // CHECK: {{    #0 0x.* in main .*use-after-free.cc:10}}
   // 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:13}}
+  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free.cc:9}}
 
   // CHECK-Darwin: {{    #0 0x.* in wrap_free}}
-  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free.cc:13}}
+  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free.cc:9}}
 
   // CHECK: {{previously allocated by thread T0 here:}}
 
   // CHECK-Linux: {{    #0 0x.* in .*malloc}}
-  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free.cc:12}}
+  // CHECK-Linux: {{    #1 0x.* in main .*use-after-free.cc:8}}
 
   // CHECK-Darwin: {{    #0 0x.* in wrap_malloc.*}}
-  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free.cc:12}}
+  // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free.cc:8}}
 }





More information about the llvm-commits mailing list