[llvm-commits] [compiler-rt] r168951 - in /compiler-rt/trunk/lib/asan/lit_tests: Linux/initialization-bug-any-order.cc initialization-blacklist.cc initialization-bug.cc initialization-nobug.cc stack-use-after-return.cc
Alexey Samsonov
samsonov at google.com
Thu Nov 29 14:56:02 PST 2012
Author: samsonov
Date: Thu Nov 29 16:56:01 2012
New Revision: 168951
URL: http://llvm.org/viewvc/llvm-project?rev=168951&view=rev
Log:
[ASan] use brand new -fsanitize= values for init-order/use-after-return ASan output tests
Modified:
compiler-rt/trunk/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc
compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc
compiler-rt/trunk/lib/asan/lit_tests/initialization-bug.cc
compiler-rt/trunk/lib/asan/lit_tests/initialization-nobug.cc
compiler-rt/trunk/lib/asan/lit_tests/stack-use-after-return.cc
Modified: compiler-rt/trunk/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc?rev=168951&r1=168950&r2=168951&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc Thu Nov 29 16:56:01 2012
@@ -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.
Modified: compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc?rev=168951&r1=168950&r2=168951&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc Thu Nov 29 16:56:01 2012
@@ -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();
Modified: compiler-rt/trunk/lib/asan/lit_tests/initialization-bug.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/initialization-bug.cc?rev=168951&r1=168950&r2=168951&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/initialization-bug.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/initialization-bug.cc Thu Nov 29 16:56:01 2012
@@ -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.
Modified: compiler-rt/trunk/lib/asan/lit_tests/initialization-nobug.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/initialization-nobug.cc?rev=168951&r1=168950&r2=168951&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/initialization-nobug.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/initialization-nobug.cc Thu Nov 29 16:56:01 2012
@@ -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
Modified: compiler-rt/trunk/lib/asan/lit_tests/stack-use-after-return.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-use-after-return.cc?rev=168951&r1=168950&r2=168951&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/stack-use-after-return.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/stack-use-after-return.cc Thu Nov 29 16:56:01 2012
@@ -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 @@
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) {
More information about the llvm-commits
mailing list