[Clang] replace 'bitfield' with 'bit-field' for consistency (#117881)
[llvm-project.git] / clang / test / CodeGenCXX / global-dtor-no-atexit.cpp
blobe4084b6db009e934a9538185ef95f3e47c191760
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(ptr {{[^,]*}} @a)
7 // CHECK-NEXT: call i32 @atexit(ptr @__dtor_a)
8 // CHECK: define internal void @__dtor_a() [[NUW:#[0-9]+]]
9 // CHECK: call void @_ZN1AD1Ev(ptr @a)
11 // CHECK: call void @_ZN1AC1Ev(ptr {{[^,]*}} @b)
12 // CHECK-NEXT: call i32 @atexit(ptr @__dtor_b)
13 // CHECK: define internal void @__dtor_b() [[NUW]]
14 // CHECK: call void @_ZN1AD1Ev(ptr @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(ptr @_ZGVZ4funcvE2a1)
27 // CHECK: call void @_ZN1AC1Ev(ptr {{[^,]*}} @_ZZ4funcvE2a1)
28 // CHECK-NEXT: call i32 @atexit(ptr @__dtor__ZZ4funcvE2a1)
29 // CHECK-NEXT: call void @__cxa_guard_release(ptr @_ZGVZ4funcvE2a1)
31 // CHECK: call i32 @__cxa_guard_acquire(ptr @_ZGVZ4funcvE2a2)
32 // CHECK: call void @_ZN1AC1Ev(ptr {{[^,]*}} @_ZZ4funcvE2a2)
33 // CHECK-NEXT: call i32 @atexit(ptr @__dtor__ZZ4funcvE2a2)
34 // CHECK-NEXT: call void @__cxa_guard_release(ptr @_ZGVZ4funcvE2a2)
36 // CHECK: define internal void @__dtor__ZZ4funcvE2a1() [[NUW]]
37 // CHECK: call void @_ZN1AD1Ev(ptr @_ZZ4funcvE2a1)
39 // CHECK: define internal void @__dtor__ZZ4funcvE2a2() [[NUW]]
40 // CHECK: call void @_ZN1AD1Ev(ptr @_ZZ4funcvE2a2)
42 void func() {
43 static A a1, a2;
46 // CHECK: attributes [[NUW]] = { noinline nounwind{{.*}} }