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