1 // RUN: %clang_cc1 -triple x86_64 %s -fno-use-cxa-atexit -emit-llvm -o - | FileCheck %s
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)
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)
46 // CHECK: attributes [[NUW]] = { noinline nounwind{{.*}} }