1 // RUN: %clang_cc1 %s -triple=armv7-apple-darwin10 -emit-llvm -o - -fexceptions -fcxx-exceptions | FileCheck %s
3 // Check that we annotate all compiler-synthesized runtime calls and
4 // functions with the actual ABI-determined CC. This usually doesn't
5 // matter as long as we're internally consistent (and the LLVM-default
6 // CC is consistent with the real one), but it's possible for user
7 // translation units to define these runtime functions (or, equivalently,
8 // for us to get LTO'ed with such a translation unit), and then the
9 // mismatch will kill us.
13 // CHECK: [[A:%.*]] = type { double }
23 // CHECK-LABEL: define internal void @__cxx_global_var_init()
24 // CHECK: call noundef ptr @_ZN5test01AC1Ev(ptr {{[^,]*}} @_ZN5test06globalE)
25 // CHECK-NEXT: call i32 @__cxa_atexit(ptr @_ZN5test01AD1Ev, ptr @_ZN5test06globalE, ptr @__dso_handle) [[NOUNWIND:#[0-9]+]]
26 // CHECK-NEXT: ret void
29 // CHECK: declare i32 @__cxa_atexit(ptr, ptr, ptr) [[NOUNWIND]]
36 // CHECK-LABEL: define{{.*}} void @_ZN5test14testEv()
37 // CHECK: [[T0:%.*]] = call ptr @__cxa_allocate_exception(i32 4) [[NOUNWIND]]
38 // CHECK-NEXT: store i32 0, ptr [[T0]]
39 // CHECK-NEXT: call void @__cxa_throw(ptr [[T0]], ptr @_ZTIi, ptr null) [[NORETURN:#[0-9]+]]
40 // CHECK-NEXT: unreachable
43 // CHECK: declare ptr @__cxa_allocate_exception(i32)
45 // CHECK: declare void @__cxa_throw(ptr, ptr, ptr)
47 // CHECK-LABEL: define internal void @_GLOBAL__sub_I_runtimecc.cpp()
48 // CHECK: call void @__cxx_global_var_init()
51 // CHECK: attributes [[NOUNWIND]] = { nounwind }
52 // CHECK: attributes [[NORETURN]] = { noreturn }