[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / apple-kext.cpp
bloba3007e5a49e2c31a3d29df99b6f67f62ce09bd29
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fno-use-cxa-atexit -fapple-kext -emit-llvm -o - %s | FileCheck %s
3 // CHECK: @_ZN5test01aE ={{.*}} global [[A:%.*]] zeroinitializer
4 // CHECK: @llvm.global_ctors = appending global {{.*}} { i32 65535, ptr [[CTOR0:@.*]], ptr null }
5 // CHECK: @llvm.global_dtors = appending global {{.*}} { i32 65535, ptr [[DTOR0:@.*]], ptr null }
7 // Check that the base destructor is marked as always_inline when generating
8 // code for kext.
10 namespace testBaseDestructor {
11 #pragma clang optimize off
12 struct D {
13 virtual ~D();
16 D::~D() {}
17 #pragma clang optimize on
20 // CHECK: define{{.*}} void @_ZN18testBaseDestructor1DD2Ev({{.*}}) unnamed_addr #[[ATTR0:.*]] align 2 {
22 // CHECK: define{{.*}} void @_ZN18testBaseDestructor1DD1Ev({{.*}}) unnamed_addr #[[ATTR1:.*]] align 2 {
24 // CHECK: define{{.*}} void @_ZN18testBaseDestructor1DD0Ev({{.*}}) unnamed_addr #[[ATTR1]] align 2 {
26 // rdar://11241230
27 namespace test0 {
28 struct A { A(); ~A(); };
29 A a;
31 // CHECK: define internal void [[CTOR0_:@.*]]()
32 // CHECK: call void @_ZN5test01AC1Ev(ptr {{[^,]*}} @_ZN5test01aE)
33 // CHECK-NEXT: ret void
35 // CHECK: define internal void [[CTOR0]]()
36 // CHECK: call void [[CTOR0_]]()
37 // CHECK-NEXT: ret void
39 // CHECK: define internal void [[DTOR0]]()
40 // CHECK: call void @_ZN5test01AD1Ev(ptr @_ZN5test01aE)
41 // CHECK-NEXT: ret void
43 // CHECK: attributes #[[ATTR0]] = { alwaysinline nounwind {{.*}} }
44 // CHECK: attributes #[[ATTR1]] = { noinline nounwind {{.*}} }