[ASan] use brand new -fsanitize= values for init-order/use-after-return ASan output...
authorAlexey Samsonov <samsonov@google.com>
Thu, 29 Nov 2012 22:56:01 +0000 (22:56 +0000)
committerAlexey Samsonov <samsonov@google.com>
Thu, 29 Nov 2012 22:56:01 +0000 (22:56 +0000)
llvm-svn: 168951

compiler-rt/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc
compiler-rt/lib/asan/lit_tests/initialization-blacklist.cc
compiler-rt/lib/asan/lit_tests/initialization-bug.cc
compiler-rt/lib/asan/lit_tests/initialization-nobug.cc
compiler-rt/lib/asan/lit_tests/stack-use-after-return.cc

index 6405d3c..c43b1f5 100644 (file)
@@ -3,10 +3,10 @@
 // independently on order in which we list source files.
 
 // RUN: %clangxx_asan -m64 -O0 %s %p/../Helpers/initialization-bug-extra.cc\
-// RUN:   -mllvm -asan-initialization-order -o %t && %t 2>&1 \
+// RUN:   -fsanitize=init-order -o %t && %t 2>&1 \
 // RUN:    | %symbolize | FileCheck %s
 // RUN: %clangxx_asan -m64 -O0 %p/../Helpers/initialization-bug-extra.cc %s\
-// RUN:   -mllvm -asan-initialization-order -o %t && %t 2>&1 \
+// RUN:   -fsanitize=init-order -o %t && %t 2>&1 \
 // RUN:    | %symbolize | FileCheck %s
 
 // Do not test with optimization -- the error may be optimized away.
index a505779..a8e543b 100644 (file)
@@ -2,22 +2,22 @@
 
 // RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-blacklist-extra.cc\
 // RUN:   -mllvm -asan-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN:   -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m64 -O1 %s %p/Helpers/initialization-blacklist-extra.cc\
 // RUN:   -mllvm -asan-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN:   -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m64 -O2 %s %p/Helpers/initialization-blacklist-extra.cc\
 // RUN:   -mllvm -asan-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN:   -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-blacklist-extra.cc\
 // RUN:   -mllvm -asan-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN:   -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m32 -O1 %s %p/Helpers/initialization-blacklist-extra.cc\
 // RUN:   -mllvm -asan-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN:   -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m32 -O2 %s %p/Helpers/initialization-blacklist-extra.cc\
 // RUN:   -mllvm -asan-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN:   -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   -fsanitize=init-order -o %t && %t 2>&1
 
 // Function is defined in another TU.
 int readBadGlobal();
index 90e4db9..8f4e33e 100644 (file)
@@ -1,10 +1,10 @@
 // Test to make sure basic initialization order errors are caught.
 
 // RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-bug-extra2.cc\
-// RUN:   -mllvm -asan-initialization-order -o %t && %t 2>&1 \
+// RUN:   -fsanitize=init-order -o %t && %t 2>&1 \
 // RUN:    | %symbolize | FileCheck %s
 // RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-bug-extra2.cc\
-// RUN:   -mllvm -asan-initialization-order -o %t && %t 2>&1 \
+// RUN:   -fsanitize=init-order -o %t && %t 2>&1 \
 // RUN:     | %symbolize | FileCheck %s
 
 // Do not test with optimization -- the error may be optimized away.
index cd68b13..1b89616 100644 (file)
@@ -2,23 +2,23 @@
 // order checking.  If successful, this will just return 0.
 
 // RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-nobug-extra.cc\
-// RUN:   --std=c++11 -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m64 -O1 %s %p/Helpers/initialization-nobug-extra.cc\
-// RUN:   --std=c++11 -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m64 -O2 %s %p/Helpers/initialization-nobug-extra.cc\
-// RUN:   --std=c++11 -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m64 -O3 %s %p/Helpers/initialization-nobug-extra.cc\
-// RUN:   --std=c++11 -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-nobug-extra.cc\
-// RUN:   --std=c++11 -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-nobug-extra.cc\
-// RUN:   --std=c++11 -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m32 -O1 %s %p/Helpers/initialization-nobug-extra.cc\
-// RUN:   --std=c++11 -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m32 -O2 %s %p/Helpers/initialization-nobug-extra.cc\
-// RUN:   --std=c++11 -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
 // RUN: %clangxx_asan -m32 -O3 %s %p/Helpers/initialization-nobug-extra.cc\
-// RUN:   --std=c++11 -mllvm -asan-initialization-order -o %t && %t 2>&1
+// RUN:   --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
 
 // Simple access:
 // Make sure that accessing a global in the same TU is safe
index 201efa6..f8d8a1a 100644 (file)
@@ -1,12 +1,20 @@
 // XFAIL: *
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
+// RUN: %clangxx_asan -fsanitize=use-after-return -m64 -O0 %s -o %t && \
+// RUN:   %t 2>&1 | %symbolize | FileCheck %s
+// RUN: %clangxx_asan -fsanitize=use-after-return -m64 -O1 %s -o %t && \
+// RUN:   %t 2>&1 | %symbolize | FileCheck %s
+// RUN: %clangxx_asan -fsanitize=use-after-return -m64 -O2 %s -o %t && \
+// RUN:   %t 2>&1 | %symbolize | FileCheck %s
+// RUN: %clangxx_asan -fsanitize=use-after-return -m64 -O3 %s -o %t && \
+// RUN:   %t 2>&1 | %symbolize | FileCheck %s
+// RUN: %clangxx_asan -fsanitize=use-after-return -m32 -O0 %s -o %t && \
+// RUN:   %t 2>&1 | %symbolize | FileCheck %s
+// RUN: %clangxx_asan -fsanitize=use-after-return -m32 -O1 %s -o %t && \
+// RUN:   %t 2>&1 | %symbolize | FileCheck %s
+// RUN: %clangxx_asan -fsanitize=use-after-return -m32 -O2 %s -o %t && \
+// RUN:   %t 2>&1 | %symbolize | FileCheck %s
+// RUN: %clangxx_asan -fsanitize=use-after-return -m32 -O3 %s -o %t && \
+// RUN:   %t 2>&1 | %symbolize | FileCheck %s
 
 #include <stdio.h>
 
@@ -26,9 +34,9 @@ __attribute__((noinline))
 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:28}}
-  // CHECK: {{is located in frame <.*Func1.*> of T0's stack}}
+  // CHECK: WRITE of size 1 {{.*}} thread T0
+  // CHECK:     #0{{.*}}Func2{{.*}}stack-use-after-return.cc:[[@LINE-2]]
+  // CHECK: is located {{.*}} in frame <{{.*}}Func1{{.*}}> of T0's stack
 }
 
 int main(int argc, char **argv) {