1 // RUN: %clangxx -target x86_64-apple-darwin10 %s -flto -S -o - |\
2 // RUN:   FileCheck --check-prefix=CHECK-NO-KEXT %s
3 // RUN: %clangxx -target x86_64-apple-darwin10 %s -fapple-kext -flto -S -o - |\
4 // RUN:   FileCheck --check-prefix=CHECK-KEXT %s
5 
6 // CHECK-NO-KEXT-NOT: _GLOBAL__D_a
7 // CHECK-NO-KEXT: @is_hosted = global
8 // CHECK-NO-KEXT: @_ZTI3foo = {{.*}} @_ZTVN10__cxxabiv117
9 // CHECK-NO-KEXT: call i32 @__cxa_atexit({{.*}} @_ZN3fooD1Ev
10 // CHECK-NO-KEXT: declare i32 @__cxa_atexit
11 
12 // CHECK-KEXT: @_ZTV3foo =
13 // CHECK-KEXT-NOT: @_ZTVN10__cxxabiv117
14 // CHECK-KEXT-NOT: call i32 @__cxa_atexit({{.*}} @_ZN3fooD1Ev
15 // CHECK-KEXT-NOT: declare i32 @__cxa_atexit
16 // CHECK-KEXT: @is_freestanding = global
17 // CHECK-KEXT: _GLOBAL__D_a
18 // CHECK-KEXT: call void @_ZN3fooD1Ev(%class.foo* @a)
19 
20 class foo {
21 public:
22   foo();
23   virtual ~foo();
24 };
25 
26 foo a;
27 foo::~foo() {}
28 
29 #if !(__STDC_HOSTED__ == 1)
30 int is_freestanding = 1;
31 #else
32 int is_hosted = 1;
33 #endif
34 
35 extern "C" void f1() {
36 }
37