1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -o - %s | FileCheck %s 2 3// Copy constructor 4struct X0 { 5 X0(); 6 X0(const X0 &) throw(); 7 X0(X0 &); 8}; 9 10struct X1 { 11 X1(); 12 X1(const X1 &) throw(); 13}; 14 15struct X2 : X1 { 16 X2(); 17}; 18struct X3 : X0, X1 { 19 X3(); 20}; 21 22struct X4 { 23 X4(X4 &) throw(); 24}; 25 26struct X5 : X0, X4 { }; 27 28void test(X2 x2, X3 x3, X5 x5) { 29 // CHECK: define linkonce_odr void @_ZN2X2C1ERKS_(%struct.X2* %this, %struct.X2*) unnamed_addr 30 // CHECK: call void @_ZN2X2C2ERKS_({{.*}}) nounwind 31 // CHECK-NEXT: ret void 32 // CHECK-NEXT: } 33 X2 x2a(x2); 34 // CHECK: define linkonce_odr void @_ZN2X3C1ERKS_(%struct.X3* %this, %struct.X3*) unnamed_addr 35 // CHECK: call void @_ZN2X3C2ERKS_({{.*}}) nounwind 36 // CHECK-NEXT: ret void 37 // CHECK-NEXT: } 38 X3 x3a(x3); 39 // CHECK: define linkonce_odr void @_ZN2X5C1ERS_({{.*}}) unnamed_addr 40 // CHECK-NOT: call void @__cxa_call_unexpected 41 // CHECK: ret void 42 X5 x5a(x5); 43} 44 45// Default constructor 46struct X6 { 47 X6() throw(); 48}; 49 50struct X7 { 51 X7(); 52}; 53 54struct X8 : X6 { }; 55struct X9 : X6, X7 { }; 56 57void test() { 58 // CHECK: define linkonce_odr void @_ZN2X8C1Ev(%struct.X8* %this) unnamed_addr 59 // CHECK: call void @_ZN2X8C2Ev({{.*}}) nounwind 60 // CHECK-NEXT: ret void 61 X8(); 62 63 // CHECK: define linkonce_odr void @_ZN2X9C1Ev(%struct.X9* %this) unnamed_addr 64 // FIXME: check that this is the end of the line here: 65 // CHECK: call void @_ZN2X9C2Ev({{.*}}) 66 // CHECK-NEXT: ret void 67 X9(); 68 69 // CHECK: define linkonce_odr void @_ZN2X9C2Ev(%struct.X9* %this) unnamed_addr 70 // CHECK: call void @_ZN2X6C2Ev({{.*}}) nounwind 71 // FIXME: and here: 72 // CHECK-NEXT: bitcast 73 // CHECK-NEXT: call void @_ZN2X7C2Ev({{.*}}) 74 // CHECK: ret void 75 76 // CHECK: define linkonce_odr void @_ZN2X8C2Ev(%struct.X8* %this) unnamed_addr 77 // CHECK: call void @_ZN2X6C2Ev({{.*}}) nounwind 78 // CHECK-NEXT: ret void 79} 80