Make test more lenient for custom clang version strings
[llvm-project.git] / compiler-rt / test / asan / TestCases / initialization-bug-no-global.cpp
blob26dc0f0d29a6ded9d97ddcefc82dfe046c5784d4
1 // RUN: %clangxx_asan %min_macos_deployment_target=10.11 -O0 %s %p/Helpers/initialization-bug-extra.cpp -o %t
2 // RUN: %env_asan_opts=check_initialization_order=true:strict_init_order=true not %run %t 2>&1 | FileCheck %s
4 // Do not test with optimization -- the error may be optimized away.
6 // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=186
7 // XFAIL: target={{.*windows-msvc.*}}
9 // Fails on some Darwin bots, probably iOS.
10 // XFAIL: ios
12 #include <stdio.h>
14 extern int y;
16 void __attribute__((constructor)) ctor() {
17 printf("%d\n", y);
18 // CHECK: AddressSanitizer: initialization-order-fiasco
21 int main() {
22 // ASan should have caused an exit before main runs.
23 printf("PASS\n");
24 // CHECK-NOT: PASS
25 return 0;