Make test more lenient for custom clang version strings
[llvm-project.git] / compiler-rt / test / asan / TestCases / init-order-atexit.cpp
blob687707667ebd16a78d7d967b6341453a5c6cc787
1 // Test for the following situation:
2 // (1) global A is constructed.
3 // (2) exit() is called during construction of global B.
4 // (3) destructor of A reads uninitialized global C from another module.
5 // We do *not* want to report init-order bug in this case.
7 // RUN: %clangxx_asan -O0 %s %p/Helpers/init-order-atexit-extra.cpp -o %t
8 // RUN: %env_asan_opts=strict_init_order=true not %run %t 2>&1 | FileCheck %s
10 // FIXME: Investigate failure on MinGW
11 // XFAIL: target={{.*-windows-gnu}}
13 #include <stdio.h>
14 #include <stdlib.h>
16 void AccessC();
18 class A {
19 public:
20 A() { }
21 ~A() { AccessC(); printf("PASSED\n"); }
22 // CHECK-NOT: AddressSanitizer
23 // CHECK: PASSED
26 A a;
28 class B {
29 public:
30 B() { exit(1); }
31 ~B() { }
34 B b;