[ASan] Use new feature of FileCheck: provide multiple --check-prefix args
llvm-svn: 194578
diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/heap-overflow.cc b/compiler-rt/lib/asan/lit_tests/TestCases/heap-overflow.cc
index a5f68e2..2c943a3 100644
--- a/compiler-rt/lib/asan/lit_tests/TestCases/heap-overflow.cc
+++ b/compiler-rt/lib/asan/lit_tests/TestCases/heap-overflow.cc
@@ -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 @@
// 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;
}
diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/large_func_test.cc b/compiler-rt/lib/asan/lit_tests/TestCases/large_func_test.cc
index 5010950..0534bcd 100644
--- a/compiler-rt/lib/asan/lit_tests/TestCases/large_func_test.cc
+++ b/compiler-rt/lib/asan/lit_tests/TestCases/large_func_test.cc
@@ -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))
diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/null_deref.cc b/compiler-rt/lib/asan/lit_tests/TestCases/null_deref.cc
index da0ca4b..4764183 100644
--- a/compiler-rt/lib/asan/lit_tests/TestCases/null_deref.cc
+++ b/compiler-rt/lib/asan/lit_tests/TestCases/null_deref.cc
@@ -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) {
diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/strncpy-overflow.cc b/compiler-rt/lib/asan/lit_tests/TestCases/strncpy-overflow.cc
index 5b89dad..f91e191 100644
--- a/compiler-rt/lib/asan/lit_tests/TestCases/strncpy-overflow.cc
+++ b/compiler-rt/lib/asan/lit_tests/TestCases/strncpy-overflow.cc
@@ -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
diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/use-after-free-right.cc b/compiler-rt/lib/asan/lit_tests/TestCases/use-after-free-right.cc
index ceb7a19..88d91f5 100644
--- a/compiler-rt/lib/asan/lit_tests/TestCases/use-after-free-right.cc
+++ b/compiler-rt/lib/asan/lit_tests/TestCases/use-after-free-right.cc
@@ -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 @@
// 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}}
}
diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/use-after-free.cc b/compiler-rt/lib/asan/lit_tests/TestCases/use-after-free.cc
index cad2819..84ba479 100644
--- a/compiler-rt/lib/asan/lit_tests/TestCases/use-after-free.cc
+++ b/compiler-rt/lib/asan/lit_tests/TestCases/use-after-free.cc
@@ -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 @@
// 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}}
}