// 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.
// 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();
// 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.
// 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
// 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>
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) {