2012-11-03 04:49:01 +08:00
|
|
|
struct foo;
|
2013-02-02 03:09:49 +08:00
|
|
|
void func(foo *f) {
|
2012-11-03 04:49:01 +08:00
|
|
|
}
|
|
|
|
class bar;
|
2013-02-02 03:09:49 +08:00
|
|
|
void func(bar *f) {
|
2012-11-03 04:49:01 +08:00
|
|
|
}
|
|
|
|
union baz;
|
2013-02-02 03:09:49 +08:00
|
|
|
void func(baz *f) {
|
2012-11-03 04:49:01 +08:00
|
|
|
}
|
2013-02-03 20:52:54 +08:00
|
|
|
|
2013-02-02 03:09:49 +08:00
|
|
|
class B {
|
2012-12-14 06:29:06 +08:00
|
|
|
public:
|
|
|
|
virtual ~B();
|
|
|
|
};
|
2013-08-19 00:55:33 +08:00
|
|
|
|
2013-08-20 09:28:15 +08:00
|
|
|
B::~B() {
|
|
|
|
}
|
|
|
|
|
2013-08-19 00:55:33 +08:00
|
|
|
struct C {
|
2013-08-20 09:28:15 +08:00
|
|
|
static int s;
|
|
|
|
virtual ~C();
|
|
|
|
};
|
|
|
|
|
|
|
|
C::~C() {
|
|
|
|
}
|
|
|
|
|
|
|
|
struct D {
|
|
|
|
D();
|
|
|
|
virtual ~D();
|
|
|
|
void func() {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct E {
|
|
|
|
E();
|
|
|
|
virtual ~E();
|
|
|
|
virtual void func() {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct F {
|
|
|
|
struct inner {
|
|
|
|
};
|
|
|
|
static const int i = 2;
|
|
|
|
virtual ~F();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct G {
|
2013-08-19 00:55:33 +08:00
|
|
|
virtual void func();
|
|
|
|
struct inner {
|
|
|
|
int j;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2013-08-22 23:23:05 +08:00
|
|
|
struct H {};
|
|
|
|
struct I : virtual H {};
|
|
|
|
struct J : I {};
|
|
|
|
J j;
|
|
|
|
|
2013-02-02 03:09:49 +08:00
|
|
|
struct A {
|
2010-08-12 08:02:44 +08:00
|
|
|
int one;
|
2013-02-02 03:09:49 +08:00
|
|
|
static const int HdrSize = 52;
|
2010-08-12 08:02:44 +08:00
|
|
|
int two;
|
|
|
|
A() {
|
|
|
|
int x = 1;
|
|
|
|
}
|
|
|
|
};
|
2012-12-14 06:29:06 +08:00
|
|
|
|
2013-08-20 09:28:15 +08:00
|
|
|
void f1() {
|
|
|
|
D x;
|
|
|
|
x.func();
|
|
|
|
E y;
|
|
|
|
int i = F::i;
|
|
|
|
F::inner z;
|
|
|
|
}
|
2012-12-14 06:29:06 +08:00
|
|
|
|
2013-02-02 03:09:49 +08:00
|
|
|
int main(int argc, char **argv) {
|
2012-11-03 04:49:01 +08:00
|
|
|
B b;
|
2013-08-20 09:28:15 +08:00
|
|
|
G::inner c_i;
|
2013-02-02 03:09:49 +08:00
|
|
|
if (argc) {
|
|
|
|
A a;
|
|
|
|
}
|
|
|
|
return 0;
|
2010-08-12 08:02:44 +08:00
|
|
|
}
|
2013-02-02 03:09:49 +08:00
|
|
|
|
2016-03-14 05:05:23 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-unknown_unknown -emit-llvm -debug-info-kind=limited -fexceptions %s -o - | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -triple i686-cygwin -emit-llvm -debug-info-kind=limited -fexceptions %s -o - | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -triple armv7l-unknown-linux-gnueabihf -emit-llvm -debug-info-kind=limited -fexceptions %s -o - | FileCheck %s
|
2013-02-03 20:52:54 +08:00
|
|
|
|
|
|
|
// CHECK: invoke {{.+}} @_ZN1BD1Ev(%class.B* %b)
|
2013-02-02 06:53:19 +08:00
|
|
|
// CHECK-NEXT: unwind label %{{.+}}, !dbg ![[EXCEPTLOC:.*]]
|
|
|
|
// CHECK: store i32 0, i32* %{{.+}}, !dbg ![[RETLOC:.*]]
|
2016-04-24 05:08:27 +08:00
|
|
|
|
|
|
|
// CHECK: [[F:![0-9]*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "F"
|
|
|
|
// CHECK-SAME: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: identifier: "_ZTS1F"
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "I"
|
|
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: ){{$}}
|
|
|
|
|
|
|
|
// CHECK: ![[INT:[0-9]+]] = !DIBasicType(name: "int"
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo"
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "bar"
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_union_type, name: "baz"
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "B"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: ){{$}}
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "_vptr$B",
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-SAME: DIFlagArtificial
|
|
|
|
|
2016-04-17 15:45:08 +08:00
|
|
|
// CHECK: [[C:![0-9]*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "C",
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: elements: [[C_MEM:![0-9]*]]
|
2016-04-24 05:08:27 +08:00
|
|
|
// CHECK-SAME: vtableHolder: [[C]]
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-SAME: identifier: "_ZTS1C"
|
2014-12-16 03:10:08 +08:00
|
|
|
// CHECK: [[C_MEM]] = !{[[C_VPTR:![0-9]*]], [[C_S:![0-9]*]], [[C_DTOR:![0-9]*]]}
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: [[C_VPTR]] = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$C"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-SAME: DIFlagArtificial
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: [[C_S]] = !DIDerivedType(tag: DW_TAG_member, name: "s"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-SAME: baseType: ![[INT]]
|
|
|
|
// CHECK-SAME: DIFlagStaticMember
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: [[C_DTOR]] = !DISubprogram(name: "~C"
|
2015-03-04 01:25:55 +08:00
|
|
|
|
2016-04-24 05:08:27 +08:00
|
|
|
// CHECK: [[D:![0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "D"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-SAME: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: identifier: "_ZTS1D"
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "E"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-SAME: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: identifier: "_ZTS1E"
|
|
|
|
|
2016-04-24 05:08:27 +08:00
|
|
|
// CHECK: !DISubprogram(name: "func",{{.*}} scope: [[D]]
|
|
|
|
// CHECK-SAME: isDefinition: true
|
|
|
|
// CHECK-SAME: declaration: [[D_FUNC_DECL:![0-9]*]]
|
|
|
|
// CHECK: [[D_FUNC_DECL]] = !DISubprogram(name: "func",{{.*}} scope: [[D]]
|
|
|
|
// CHECK-SAME: isDefinition: false
|
|
|
|
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "inner",{{.*}} line: 50
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: elements: [[G_INNER_MEM:![0-9]*]]
|
|
|
|
// CHECK-SAME: identifier: "_ZTSN1G5innerE"
|
2016-04-24 05:08:27 +08:00
|
|
|
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "G"
|
|
|
|
// CHECK-SAME: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: identifier: "_ZTS1G"
|
2014-12-16 03:10:08 +08:00
|
|
|
// CHECK: [[G_INNER_MEM]] = !{[[G_INNER_I:![0-9]*]]}
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: [[G_INNER_I]] = !DIDerivedType(tag: DW_TAG_member, name: "j"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-SAME: baseType: ![[INT]]
|
|
|
|
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "A"
|
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "HdrSize"
|
2013-12-21 07:19:47 +08:00
|
|
|
//
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: ![[EXCEPTLOC]] = !DILocation(line: 84,
|
|
|
|
// CHECK: ![[RETLOC]] = !DILocation(line: 83,
|