1*532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -o - %s | FileCheck %s
28453ddb5SDouglas Gregor
36d880b1aSDouglas Gregor // Copy constructor
48453ddb5SDouglas Gregor struct X0 {
58453ddb5SDouglas Gregor X0();
68453ddb5SDouglas Gregor X0(const X0 &) throw();
78453ddb5SDouglas Gregor X0(X0 &);
88453ddb5SDouglas Gregor };
98453ddb5SDouglas Gregor
108453ddb5SDouglas Gregor struct X1 {
118453ddb5SDouglas Gregor X1();
128453ddb5SDouglas Gregor X1(const X1 &) throw();
138453ddb5SDouglas Gregor };
148453ddb5SDouglas Gregor
158453ddb5SDouglas Gregor struct X2 : X1 {
168453ddb5SDouglas Gregor X2();
178453ddb5SDouglas Gregor };
188453ddb5SDouglas Gregor struct X3 : X0, X1 {
198453ddb5SDouglas Gregor X3();
208453ddb5SDouglas Gregor };
218453ddb5SDouglas Gregor
228453ddb5SDouglas Gregor struct X4 {
238453ddb5SDouglas Gregor X4(X4 &) throw();
248453ddb5SDouglas Gregor };
258453ddb5SDouglas Gregor
268453ddb5SDouglas Gregor struct X5 : X0, X4 { };
278453ddb5SDouglas Gregor
test(X2 x2,X3 x3,X5 x5)288453ddb5SDouglas Gregor void test(X2 x2, X3 x3, X5 x5) {
291b1c8d83Shyeongyu kim // CHECK: define linkonce_odr void @_ZN2X2C1ERKS_(%struct.X2* {{[^,]*}} %this, %struct.X2* noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0) unnamed_addr
30e1c4a1baSBill Wendling // CHECK: call void @_ZN2X2C2ERKS_({{.*}}) [[NUW:#[0-9]+]]
31be349defSJohn McCall // CHECK-NEXT: ret void
32be349defSJohn McCall // CHECK-NEXT: }
338453ddb5SDouglas Gregor X2 x2a(x2);
341b1c8d83Shyeongyu kim // CHECK: define linkonce_odr void @_ZN2X3C1ERKS_(%struct.X3* {{[^,]*}} %this, %struct.X3* noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0) unnamed_addr
35e1c4a1baSBill Wendling // CHECK: call void @_ZN2X3C2ERKS_({{.*}}) [[NUW]]
36be349defSJohn McCall // CHECK-NEXT: ret void
37be349defSJohn McCall // CHECK-NEXT: }
388453ddb5SDouglas Gregor X3 x3a(x3);
3905842dabSRafael Espindola // CHECK: define linkonce_odr void @_ZN2X5C1ERS_({{.*}}) unnamed_addr
408453ddb5SDouglas Gregor // CHECK-NOT: call void @__cxa_call_unexpected
418453ddb5SDouglas Gregor // CHECK: ret void
428453ddb5SDouglas Gregor X5 x5a(x5);
438453ddb5SDouglas Gregor }
446d880b1aSDouglas Gregor
456d880b1aSDouglas Gregor // Default constructor
466d880b1aSDouglas Gregor struct X6 {
476d880b1aSDouglas Gregor X6() throw();
486d880b1aSDouglas Gregor };
496d880b1aSDouglas Gregor
506d880b1aSDouglas Gregor struct X7 {
516d880b1aSDouglas Gregor X7();
526d880b1aSDouglas Gregor };
536d880b1aSDouglas Gregor
546d880b1aSDouglas Gregor struct X8 : X6 { };
556d880b1aSDouglas Gregor struct X9 : X6, X7 { };
566d880b1aSDouglas Gregor
test()576d880b1aSDouglas Gregor void test() {
5869cd776eSCJ Johnson // CHECK: define linkonce_odr void @_ZN2X8C1Ev(%struct.X8* {{[^,]*}} %this) unnamed_addr
59e1c4a1baSBill Wendling // CHECK: call void @_ZN2X8C2Ev({{.*}}) [[NUW]]
60be349defSJohn McCall // CHECK-NEXT: ret void
616d880b1aSDouglas Gregor X8();
62b5081affSJohn McCall
6369cd776eSCJ Johnson // CHECK: define linkonce_odr void @_ZN2X9C1Ev(%struct.X9* {{[^,]*}} %this) unnamed_addr
64b5081affSJohn McCall // FIXME: check that this is the end of the line here:
65b5081affSJohn McCall // CHECK: call void @_ZN2X9C2Ev({{.*}})
66be349defSJohn McCall // CHECK-NEXT: ret void
676d880b1aSDouglas Gregor X9();
68be349defSJohn McCall
6969cd776eSCJ Johnson // CHECK: define linkonce_odr void @_ZN2X8C2Ev(%struct.X8* {{[^,]*}} %this) unnamed_addr
70e5df59ffSRafael Espindola // CHECK: call void @_ZN2X6C2Ev({{.*}}) [[NUW]]
71e5df59ffSRafael Espindola // CHECK-NEXT: ret void
72e5df59ffSRafael Espindola
7369cd776eSCJ Johnson // CHECK: define linkonce_odr void @_ZN2X9C2Ev(%struct.X9* {{[^,]*}} %this) unnamed_addr
74e1c4a1baSBill Wendling // CHECK: call void @_ZN2X6C2Ev({{.*}}) [[NUW]]
75b5081affSJohn McCall // FIXME: and here:
76a5f58b05SChris Lattner // CHECK-NEXT: bitcast
77b5081affSJohn McCall // CHECK-NEXT: call void @_ZN2X7C2Ev({{.*}})
78be349defSJohn McCall // CHECK: ret void
796d880b1aSDouglas Gregor }
80e1c4a1baSBill Wendling
81e1c4a1baSBill Wendling // CHECK: attributes [[NUW]] = { nounwind{{.*}} }
82