summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-11-29 22:56:01 +0000
committerAlexey Samsonov <samsonov@google.com>2012-11-29 22:56:01 +0000
commitb90501d7da1938621bcd1290491e2f29ca23d0dd (patch)
treef3e077a3a385276580f6b2c21a917ec6fe72ac9d
parent0e96becfb16ac05902917c9e71f43b023ac28ca5 (diff)
downloadbcm5719-llvm-b90501d7da1938621bcd1290491e2f29ca23d0dd.tar.gz
bcm5719-llvm-b90501d7da1938621bcd1290491e2f29ca23d0dd.zip
[ASan] use brand new -fsanitize= values for init-order/use-after-return ASan output tests
llvm-svn: 168951
-rw-r--r--compiler-rt/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc4
-rw-r--r--compiler-rt/lib/asan/lit_tests/initialization-blacklist.cc12
-rw-r--r--compiler-rt/lib/asan/lit_tests/initialization-bug.cc4
-rw-r--r--compiler-rt/lib/asan/lit_tests/initialization-nobug.cc18
-rw-r--r--compiler-rt/lib/asan/lit_tests/stack-use-after-return.cc30
5 files changed, 38 insertions, 30 deletions
diff --git a/compiler-rt/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc b/compiler-rt/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc
index 6405d3c73b8..c43b1f5b5ee 100644
--- a/compiler-rt/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc
+++ b/compiler-rt/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc
@@ -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.
diff --git a/compiler-rt/lib/asan/lit_tests/initialization-blacklist.cc b/compiler-rt/lib/asan/lit_tests/initialization-blacklist.cc
index a505779ac92..a8e543b631d 100644
--- a/compiler-rt/lib/asan/lit_tests/initialization-blacklist.cc
+++ b/compiler-rt/lib/asan/lit_tests/initialization-blacklist.cc
@@ -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();
diff --git a/compiler-rt/lib/asan/lit_tests/initialization-bug.cc b/compiler-rt/lib/asan/lit_tests/initialization-bug.cc
index 90e4db9aefc..8f4e33ef5a3 100644
--- a/compiler-rt/lib/asan/lit_tests/initialization-bug.cc
+++ b/compiler-rt/lib/asan/lit_tests/initialization-bug.cc
@@ -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.
diff --git a/compiler-rt/lib/asan/lit_tests/initialization-nobug.cc b/compiler-rt/lib/asan/lit_tests/initialization-nobug.cc
index cd68b135be3..1b896160681 100644
--- a/compiler-rt/lib/asan/lit_tests/initialization-nobug.cc
+++ b/compiler-rt/lib/asan/lit_tests/initialization-nobug.cc
@@ -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
diff --git a/compiler-rt/lib/asan/lit_tests/stack-use-after-return.cc b/compiler-rt/lib/asan/lit_tests/stack-use-after-return.cc
index 201efa603cd..f8d8a1a2ae3 100644
--- a/compiler-rt/lib/asan/lit_tests/stack-use-after-return.cc
+++ b/compiler-rt/lib/asan/lit_tests/stack-use-after-return.cc
@@ -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) {
OpenPOWER on IntegriCloud