[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / global-dtor-no-atexit.cpp
blobf4dbb878e47eb9473991f87b63b1d367edc0a38e
1 // RUN: %clang_cc1 -triple x86_64 %s -fno-use-cxa-atexit -emit-llvm -o - | FileCheck %s
3 // PR7097
4 // RUN: %clang_cc1 -triple x86_64 %s -fno-use-cxa-atexit -mconstructor-aliases -emit-llvm -o - | FileCheck %s
6 // CHECK: call void @_ZN1AC1Ev([[A:%.*]]* {{[^,]*}} @a)
7 // CHECK-NEXT: call i32 @atexit(void ()* @__dtor_a)
8 // CHECK: define internal void @__dtor_a() [[NUW:#[0-9]+]]
9 // CHECK: call void @_ZN1AD1Ev([[A]]* @a)
11 // CHECK: call void @_ZN1AC1Ev([[A]]* {{[^,]*}} @b)
12 // CHECK-NEXT: call i32 @atexit(void ()* @__dtor_b)
13 // CHECK: define internal void @__dtor_b() [[NUW]]
14 // CHECK: call void @_ZN1AD1Ev([[A]]* @b)
16 class A {
17 public:
18 A();
19 ~A();
22 A a, b;
24 // PR9593
25 // CHECK-LABEL: define{{.*}} void @_Z4funcv()
26 // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZ4funcvE2a1)
27 // CHECK: call void @_ZN1AC1Ev([[A]]* {{[^,]*}} @_ZZ4funcvE2a1)
28 // CHECK-NEXT: call i32 @atexit(void ()* @__dtor__ZZ4funcvE2a1)
29 // CHECK-NEXT: call void @__cxa_guard_release(i64* @_ZGVZ4funcvE2a1)
31 // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZ4funcvE2a2)
32 // CHECK: call void @_ZN1AC1Ev([[A]]* {{[^,]*}} @_ZZ4funcvE2a2)
33 // CHECK-NEXT: call i32 @atexit(void ()* @__dtor__ZZ4funcvE2a2)
34 // CHECK-NEXT: call void @__cxa_guard_release(i64* @_ZGVZ4funcvE2a2)
36 // CHECK: define internal void @__dtor__ZZ4funcvE2a1() [[NUW]]
37 // CHECK: call void @_ZN1AD1Ev([[A]]* @_ZZ4funcvE2a1)
39 // CHECK: define internal void @__dtor__ZZ4funcvE2a2() [[NUW]]
40 // CHECK: call void @_ZN1AD1Ev([[A]]* @_ZZ4funcvE2a2)
42 void func() {
43 static A a1, a2;
46 // CHECK: attributes [[NUW]] = { noinline nounwind{{.*}} }