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
|
|
|
|
2020-07-16 05:47:45 +08:00
|
|
|
B::~B() { extern void mayThrow(); mayThrow();
|
2013-08-20 09:28:15 +08:00
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
2019-04-26 04:05:47 +08:00
|
|
|
struct K {
|
|
|
|
virtual void func() {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
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;
|
2019-04-26 04:05:47 +08:00
|
|
|
K k;
|
|
|
|
k.func();
|
2013-08-20 09:28:15 +08:00
|
|
|
}
|
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
|
|
|
|
2019-04-26 02:11:48 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-unknown_unknown -emit-llvm -debug-info-kind=limited -fexceptions -std=c++98 %s -o - | FileCheck -check-prefix=CHECK98 -check-prefix=CHECK %s
|
|
|
|
// RUN: %clang_cc1 -triple i686-cygwin -emit-llvm -debug-info-kind=limited -fexceptions -std=c++98 %s -o - | FileCheck -check-prefix=CHECK98 -check-prefix=CHECK %s
|
|
|
|
// RUN: %clang_cc1 -triple armv7l-unknown-linux-gnueabihf -emit-llvm -debug-info-kind=limited -fexceptions -std=c++98 %s -o - | FileCheck -check-prefix=CHECK98 -check-prefix=CHECK %s
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-unknown_unknown -emit-llvm -debug-info-kind=limited -fexceptions -std=c++11 %s -o - | FileCheck -check-prefix=CHECK11 -check-prefix=CHECK %s
|
|
|
|
// RUN: %clang_cc1 -triple i686-cygwin -emit-llvm -debug-info-kind=limited -fexceptions -std=c++11 %s -o - | FileCheck -check-prefix=CHECK11 -check-prefix=CHECK %s
|
|
|
|
// RUN: %clang_cc1 -triple armv7l-unknown-linux-gnueabihf -emit-llvm -debug-info-kind=limited -fexceptions -std=c++11 %s -o - | FileCheck -check-prefix=CHECK11 -check-prefix=CHECK %s
|
2017-01-10 02:24:16 +08:00
|
|
|
|
|
|
|
// CHECK98: invoke {{.+}} @_ZN1BD1Ev(%class.B* %b)
|
|
|
|
// CHECK98-NEXT: unwind label %{{.+}}, !dbg ![[EXCEPTLOC:.*]]
|
|
|
|
// CHECK11: call {{.+}} @_ZN1BD1Ev(%class.B* %b){{.*}}, !dbg ![[EXCEPTLOC:.*]]
|
2013-02-03 20:52:54 +08:00
|
|
|
|
2013-02-02 06:53:19 +08:00
|
|
|
// 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
|
2019-04-26 04:05:47 +08:00
|
|
|
// CHECK-NOT: identifier:
|
|
|
|
// CHECK-SAME: ){{$}}
|
2016-04-24 05:08:27 +08:00
|
|
|
// 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]]
|
2019-04-26 04:05:47 +08:00
|
|
|
// CHECK-NOT: identifier:
|
|
|
|
// CHECK-SAME: ){{$}}
|
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"
|
2016-12-28 06:05:35 +08:00
|
|
|
// CHECK-NOT: size:
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-SAME: DIFlagFwdDecl
|
2019-04-26 04:05:47 +08:00
|
|
|
// CHECK-NOT: identifier:
|
|
|
|
// CHECK-SAME: ){{$}}
|
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
|
2019-04-26 04:05:47 +08:00
|
|
|
// CHECK-NOT: identifier:
|
|
|
|
// CHECK-SAME: ){{$}}
|
|
|
|
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "K"
|
|
|
|
// CHECK-SAME: identifier: "_ZTS1K"
|
|
|
|
// CHECK-SAME: ){{$}}
|
2015-03-04 01:25:55 +08:00
|
|
|
|
2016-04-24 05:08:27 +08:00
|
|
|
// CHECK: !DISubprogram(name: "func",{{.*}} scope: [[D]]
|
2019-04-26 02:11:48 +08:00
|
|
|
// CHECK-SAME: DISPFlagDefinition
|
2016-04-24 05:08:27 +08:00
|
|
|
// CHECK-SAME: declaration: [[D_FUNC_DECL:![0-9]*]]
|
|
|
|
// CHECK: [[D_FUNC_DECL]] = !DISubprogram(name: "func",{{.*}} scope: [[D]]
|
|
|
|
|
|
|
|
// 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
|
2019-04-26 04:05:47 +08:00
|
|
|
// CHECK-NOT: identifier:
|
|
|
|
// CHECK-SAME: ){{$}}
|
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
|
|
|
//
|
2019-04-26 04:05:47 +08:00
|
|
|
// CHECK: ![[EXCEPTLOC]] = !DILocation(line: 91,
|
|
|
|
// CHECK: ![[RETLOC]] = !DILocation(line: 90,
|