summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info-class.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-08-18 17:59:12 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-08-18 17:59:12 +0000
commit25b2085490aaf5370b4d18e5d91ccd55f21bf110 (patch)
treeaac79860480da17405335a178387d6fd8a3009bd /clang/test/CodeGenCXX/debug-info-class.cpp
parent5a050016bb8e33f8e53b1fe05de7adb8ff00d4aa (diff)
downloadbcm5719-llvm-25b2085490aaf5370b4d18e5d91ccd55f21bf110.tar.gz
bcm5719-llvm-25b2085490aaf5370b4d18e5d91ccd55f21bf110.zip
Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not have the vtable for that class""
This reverts commit r188600. r188640/r188639 fixed the root cause of the crash-on-valid that r188600 originally introduced. This now appears to bootstrap debug clang successfully to the best of my testing. llvm-svn: 188642
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-class.cpp')
-rw-r--r--clang/test/CodeGenCXX/debug-info-class.cpp76
1 files changed, 67 insertions, 9 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-class.cpp b/clang/test/CodeGenCXX/debug-info-class.cpp
index 0a337dc05d8..e63eeb5eae5 100644
--- a/clang/test/CodeGenCXX/debug-info-class.cpp
+++ b/clang/test/CodeGenCXX/debug-info-class.cpp
@@ -13,7 +13,39 @@ public:
virtual ~B();
};
+B::~B() {
+}
+
struct C {
+ 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 {
virtual void func();
struct inner {
int j;
@@ -29,10 +61,17 @@ struct A {
}
};
+void f1() {
+ D x;
+ x.func();
+ E y;
+ int i = F::i;
+ F::inner z;
+}
int main(int argc, char **argv) {
B b;
- C::inner c_i;
+ G::inner c_i;
if (argc) {
A a;
}
@@ -49,15 +88,34 @@ int main(int argc, char **argv) {
// CHECK: DW_TAG_structure_type ] [foo]
// CHECK: DW_TAG_class_type ] [bar]
// CHECK: DW_TAG_union_type ] [baz]
-// CHECK: DW_TAG_structure_type ] [A]
-// CHECK: HdrSize
// CHECK: DW_TAG_class_type ] [B]
// CHECK: metadata !"_vptr$B", {{.*}}, i32 64, metadata !{{.*}}} ; [ DW_TAG_member ]
-// CHECK: metadata [[C_INNER_MEM:![0-9]*]], i32 0, null, null} ; [ DW_TAG_structure_type ] [inner] {{.*}} [def]
+
+// CHECK: [[C:![0-9]*]] = {{.*}} metadata [[C_MEM:![0-9]*]], i32 0, metadata [[C]], null} ; [ DW_TAG_structure_type ] [C] {{.*}} [def]
+// CHECK: [[C_MEM]] = metadata !{metadata [[C_VPTR:![0-9]*]], metadata [[C_S:![0-9]*]], metadata [[C_DTOR:![0-9]*]]}
+// CHECK: [[C_VPTR]] = {{.*}} ; [ DW_TAG_member ] [_vptr$C] {{.*}} [artificial]
+// CHECK: [[C_S]] = {{.*}} ; [ DW_TAG_member ] [s] {{.*}} [static] [from int]
+// CHECK: [[C_DTOR]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [~C]
+
+// CHECK: ; [ DW_TAG_structure_type ] [A]
+// CHECK: HdrSize
+// CHECK: metadata [[D_MEM:![0-9]*]], i32 0, null} ; [ DW_TAG_structure_type ] [D] {{.*}} [decl]
+// CHECK: [[D_MEM]] = metadata !{metadata [[D_FUNC:![0-9]*]]}
+// CHECK: [[D_FUNC]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [func]
+
+// CHECK: [[F_I_DEF:![0-9]*]] = {{.*}}, metadata [[F_I:![0-9]*]]} ; [ DW_TAG_variable ] [i]
+// CHECK: [[F_I]] = {{.*}} ; [ DW_TAG_member ] [i]
+// CHECK: [[F:![0-9]*]] = {{.*}} metadata [[F_MEM:![0-9]*]], i32 0, null, null} ; [ DW_TAG_structure_type ] [F] {{.*}} [def]
+// CHECK: [[F_MEM]] = metadata !{metadata [[F_I]]}
+
+// CHECK: null, i32 0, null} ; [ DW_TAG_structure_type ] [E] {{.*}} [decl]
+
+// CHECK: metadata [[G_INNER_MEM:![0-9]*]], i32 0, null, null} ; [ DW_TAG_structure_type ] [inner] [line 50, {{.*}} [def]
// Context chains (in Clang -flimit-debug-info and in GCC generally) contain
// definitions without members (& without a vbase 'containing type'):
-// CHECK: null, i32 0, null, null} ; [ DW_TAG_structure_type ] [C] {{.*}} [def]
-// CHECK: [[C_INNER_MEM]] = metadata !{metadata [[C_INNER_I:![0-9]*]]}
-// CHECK: [[C_INNER_I]] = {{.*}} ; [ DW_TAG_member ] [j] {{.*}} [from int]
-// CHECK: ![[EXCEPTLOC]] = metadata !{i32 40,
-// CHECK: ![[RETLOC]] = metadata !{i32 39,
+// CHECK: null, i32 0, null, null} ; [ DW_TAG_structure_type ] [G] {{.*}} [def]
+// CHECK: [[G_INNER_MEM]] = metadata !{metadata [[G_INNER_I:![0-9]*]]}
+// CHECK: [[G_INNER_I]] = {{.*}} ; [ DW_TAG_member ] [j] {{.*}} [from int]
+
+// CHECK: ![[EXCEPTLOC]] = metadata !{i32 79,
+// CHECK: ![[RETLOC]] = metadata !{i32 78,
OpenPOWER on IntegriCloud