1 struct foo; 2 void func(foo *f) { 3 } 4 class bar; 5 void func(bar *f) { 6 } 7 union baz; 8 void func(baz *f) { 9 } 10 11 class B { 12 public: 13 virtual ~B(); 14 }; 15 16 B::~B() { 17 } 18 19 struct C { 20 static int s; 21 virtual ~C(); 22 }; 23 24 C::~C() { 25 } 26 27 struct D { 28 D(); 29 virtual ~D(); 30 void func() { 31 } 32 }; 33 34 struct E { 35 E(); 36 virtual ~E(); 37 virtual void func() { 38 } 39 }; 40 41 struct F { 42 struct inner { 43 }; 44 static const int i = 2; 45 virtual ~F(); 46 }; 47 48 struct G { 49 virtual void func(); 50 struct inner { 51 int j; 52 }; 53 }; 54 55 struct H {}; 56 struct I : virtual H {}; 57 struct J : I {}; 58 J j; 59 60 struct A { 61 int one; 62 static const int HdrSize = 52; 63 int two; 64 A() { 65 int x = 1; 66 } 67 }; 68 69 void f1() { 70 D x; 71 x.func(); 72 E y; 73 int i = F::i; 74 F::inner z; 75 } 76 77 int main(int argc, char **argv) { 78 B b; 79 G::inner c_i; 80 if (argc) { 81 A a; 82 } 83 return 0; 84 } 85 86 // RUN: %clang -target x86_64-unknown_unknown -emit-llvm -g -S %s -o - | FileCheck %s 87 // RUN: %clang -target i686-cygwin -emit-llvm -g -S %s -o - | FileCheck %s 88 // RUN: %clang -target armv7l-unknown-linux-gnueabihf -emit-llvm -g -S %s -o - | FileCheck %s 89 90 // CHECK: invoke {{.+}} @_ZN1BD1Ev(%class.B* %b) 91 // CHECK-NEXT: unwind label %{{.+}}, !dbg ![[EXCEPTLOC:.*]] 92 // CHECK: store i32 0, i32* %{{.+}}, !dbg ![[RETLOC:.*]] 93 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo" 94 // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "bar" 95 // CHECK: !DICompositeType(tag: DW_TAG_union_type, name: "baz" 96 // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "B" 97 // CHECK-NOT: DIFlagFwdDecl 98 // CHECK-SAME: ){{$}} 99 // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "_vptr$B", 100 // CHECK-SAME: DIFlagArtificial 101 102 // CHECK: ![[INT:[0-9]+]] = !DIBasicType(name: "int" 103 104 // CHECK: [[C:![0-9]*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "C", 105 // CHECK-NOT: DIFlagFwdDecl 106 // CHECK-SAME: elements: [[C_MEM:![0-9]*]] 107 // CHECK-SAME: vtableHolder: !"_ZTS1C" 108 // CHECK-SAME: identifier: "_ZTS1C" 109 // CHECK: [[C_MEM]] = !{[[C_VPTR:![0-9]*]], [[C_S:![0-9]*]], [[C_DTOR:![0-9]*]]} 110 // CHECK: [[C_VPTR]] = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$C" 111 // CHECK-SAME: DIFlagArtificial 112 // CHECK: [[C_S]] = !DIDerivedType(tag: DW_TAG_member, name: "s" 113 // CHECK-SAME: baseType: ![[INT]] 114 // CHECK-SAME: DIFlagStaticMember 115 // CHECK: [[C_DTOR]] = !DISubprogram(name: "~C" 116 117 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "D" 118 // CHECK-SAME: DIFlagFwdDecl 119 // CHECK-SAME: identifier: "_ZTS1D" 120 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "E" 121 // CHECK-SAME: DIFlagFwdDecl 122 // CHECK-SAME: identifier: "_ZTS1E" 123 // CHECK: [[F:![0-9]*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "F" 124 // CHECK-SAME: DIFlagFwdDecl 125 // CHECK-SAME: identifier: "_ZTS1F" 126 127 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "G" 128 // CHECK-SAME: DIFlagFwdDecl 129 // CHECK-SAME: identifier: "_ZTS1G" 130 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "inner" 131 // CHECK: line: 50 132 // CHECK-NOT: DIFlagFwdDecl 133 // CHECK-SAME: elements: [[G_INNER_MEM:![0-9]*]] 134 // CHECK-SAME: identifier: "_ZTSN1G5innerE" 135 // CHECK: [[G_INNER_MEM]] = !{[[G_INNER_I:![0-9]*]]} 136 // CHECK: [[G_INNER_I]] = !DIDerivedType(tag: DW_TAG_member, name: "j" 137 // CHECK-SAME: baseType: ![[INT]] 138 139 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "A" 140 // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "HdrSize" 141 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "I" 142 // CHECK-NOT: DIFlagFwdDecl 143 // CHECK-SAME: ){{$}} 144 // 145 // CHECK: !DISubprogram(name: "func",{{.*}} scope: !"_ZTS1D" 146 // CHECK-SAME: isDefinition: true 147 // CHECK-SAME: declaration: [[D_FUNC_DECL:![0-9]*]] 148 // CHECK: [[D_FUNC_DECL]] = !DISubprogram(name: "func",{{.*}} scope: !"_ZTS1D" 149 // CHECK-SAME: isDefinition: false 150 151 // CHECK: ![[EXCEPTLOC]] = !DILocation(line: 84, 152 // CHECK: ![[RETLOC]] = !DILocation(line: 83, 153