brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 48d0669 Raw
81 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -o - %s | FileCheck %s2 3// Copy constructor4struct 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_(ptr {{[^,]*}} %this, ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0) unnamed_addr30  // CHECK:      call void @_ZN2X2C2ERKS_({{.*}}) [[NUW:#[0-9]+]]31  // CHECK-NEXT: ret void32  // CHECK-NEXT: }33  X2 x2a(x2);34  // CHECK: define linkonce_odr void @_ZN2X3C1ERKS_(ptr {{[^,]*}} %this, ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0) unnamed_addr35  // CHECK:      call void @_ZN2X3C2ERKS_({{.*}}) [[NUW]]36  // CHECK-NEXT: ret void37  // CHECK-NEXT: }38  X3 x3a(x3);39  // CHECK: define linkonce_odr void @_ZN2X5C1ERS_({{.*}}) unnamed_addr40  // CHECK-NOT: call void @__cxa_call_unexpected41  // CHECK: ret void42  X5 x5a(x5);43}44 45// Default constructor46struct 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(ptr {{[^,]*}} %this) unnamed_addr59  // CHECK:      call void @_ZN2X8C2Ev({{.*}}) [[NUW]]60  // CHECK-NEXT: ret void61  X8();62 63  // CHECK: define linkonce_odr void @_ZN2X9C1Ev(ptr {{[^,]*}} %this) unnamed_addr64  //   FIXME: check that this is the end of the line here:65  // CHECK:      call void @_ZN2X9C2Ev({{.*}})66  // CHECK-NEXT: ret void67  X9();68 69  // CHECK: define linkonce_odr void @_ZN2X8C2Ev(ptr {{[^,]*}} %this) unnamed_addr70  // CHECK:      call void @_ZN2X6C2Ev({{.*}}) [[NUW]]71  // CHECK-NEXT: ret void72 73  // CHECK: define linkonce_odr void @_ZN2X9C2Ev(ptr {{[^,]*}} %this) unnamed_addr74  // CHECK:      call void @_ZN2X6C2Ev({{.*}}) [[NUW]]75  //   FIXME: and here:76  // CHECK-NEXT: call void @_ZN2X7C2Ev({{.*}})77  // CHECK: ret void78}79 80// CHECK: attributes [[NUW]] = { nounwind{{.*}} }81