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([[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)
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)
46 // CHECK: attributes [[NUW]] = { noinline nounwind{{.*}} }