summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/debug-info-static-member.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/debug-info-static-member.cpp')
-rw-r--r--test/CodeGenCXX/debug-info-static-member.cpp84
1 files changed, 62 insertions, 22 deletions
diff --git a/test/CodeGenCXX/debug-info-static-member.cpp b/test/CodeGenCXX/debug-info-static-member.cpp
index 18fd691..8e5207d 100644
--- a/test/CodeGenCXX/debug-info-static-member.cpp
+++ b/test/CodeGenCXX/debug-info-static-member.cpp
@@ -33,20 +33,57 @@ int main()
// why the definition of "a" comes before the declarations while
// "b" and "c" come after.
-// CHECK: !"_ZTS1X"} ; [ DW_TAG_enumeration_type ] [X]
-// CHECK: !"_ZTS1C"} ; [ DW_TAG_class_type ] [C]
-// CHECK: ![[DECL_A:[0-9]+]] = {{.*}} [ DW_TAG_member ] [a] [line {{.*}}, size 0, align 0, offset 0] [static]
-// CHECK: !"0xd\00const_a\00{{.*}}", {{.*}}, i1 true} ; [ DW_TAG_member ] [const_a] [line {{.*}}, size 0, align 0, offset 0] [static]
-// CHECK: ![[DECL_B:[0-9]+]] = !{!"0xd\00b\00{{.*}}", {{.*}} [ DW_TAG_member ] [b] [line {{.*}}, size 0, align 0, offset 0] [protected] [static]
-// CHECK: !"0xd\00const_b\00{{.*}}", {{.*}}, float 0x{{.*}}} ; [ DW_TAG_member ] [const_b] [line {{.*}}, size 0, align 0, offset 0] [protected] [static]
-// CHECK: ![[DECL_C:[0-9]+]] = !{!"0xd\00c\00{{.*}}", {{.*}} [ DW_TAG_member ] [c] [line {{.*}}, size 0, align 0, offset 0] [public] [static]
-// CHECK: !"0xd\00const_c\00{{.*}}", {{.*}} [ DW_TAG_member ] [const_c] [line {{.*}}, size 0, align 0, offset 0] [public] [static]
-// CHECK: !"0xd\00x_a\00{{.*}}", {{.*}} [ DW_TAG_member ] [x_a] {{.*}} [public] [static]
-
-// CHECK: ; [ DW_TAG_structure_type ] [static_decl_templ<int>] {{.*}} [def]
-// CHECK: ; [ DW_TAG_member ] [static_decl_templ_var]
-
-// CHECK: [[NS_X:![0-9]+]] = {{.*}} ; [ DW_TAG_namespace ] [x]
+// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "X"{{.*}}, identifier: "_ZTS1X")
+// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "C"{{.*}}, identifier: "_ZTS1C")
+//
+// CHECK: ![[DECL_A:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "a"
+// CHECK-NOT: size:
+// CHECK-NOT: align:
+// CHECK-NOT: offset:
+// CHECK-SAME: flags: DIFlagStaticMember)
+//
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "const_a"
+// CHECK-NOT: size:
+// CHECK-NOT: align:
+// CHECK-NOT: offset:
+// CHECK-SAME: flags: DIFlagStaticMember,
+// CHECK-SAME: extraData: i1 true)
+//
+// CHECK: ![[DECL_B:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "b"
+// CHECK-NOT: size:
+// CHECK-NOT: align:
+// CHECK-NOT: offset:
+// CHECK-SAME: flags: DIFlagProtected | DIFlagStaticMember)
+//
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "const_b"
+// CHECK-NOT: size:
+// CHECK-NOT: align:
+// CHECK-NOT: offset:
+// CHECK-SAME: flags: DIFlagProtected | DIFlagStaticMember,
+// CHECK-SAME: extraData: float 0x{{.*}})
+//
+// CHECK: ![[DECL_C:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "c"
+// CHECK-NOT: size:
+// CHECK-NOT: align:
+// CHECK-NOT: offset:
+// CHECK-SAME: flags: DIFlagPublic | DIFlagStaticMember)
+//
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "const_c"
+// CHECK-NOT: size:
+// CHECK-NOT: align:
+// CHECK-NOT: offset:
+// CHECK-SAME: flags: DIFlagPublic | DIFlagStaticMember,
+// CHECK-SAME: extraData: i32 18)
+//
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "x_a"
+// CHECK-SAME: flags: DIFlagPublic | DIFlagStaticMember)
+
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "static_decl_templ<int>"
+// CHECK-NOT: DIFlagFwdDecl
+// CHECK-SAME: ){{$}}
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "static_decl_templ_var"
+
+// CHECK: [[NS_X:![0-9]+]] = !DINamespace(name: "x"
// Test this in an anonymous namespace to ensure the type is retained even when
// it doesn't get automatically retained by the string type reference machinery.
@@ -57,8 +94,8 @@ struct anon_static_decl_struct {
}
-// CHECK: ; [ DW_TAG_structure_type ] [anon_static_decl_struct] {{.*}} [def]
-// CHECK: ; [ DW_TAG_member ] [anon_static_decl_var]
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "anon_static_decl_struct"
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "anon_static_decl_var"
int ref() {
return anon_static_decl_struct::anon_static_decl_var;
@@ -76,11 +113,11 @@ int static_decl_templ_ref() {
return static_decl_templ<int>::static_decl_templ_var;
}
-// CHECK: !"0x34\00a\00{{.*}}", null, {{.*}} @_ZN1C1aE, ![[DECL_A]]} ; [ DW_TAG_variable ] [a] {{.*}} [def]
-// CHECK: !"0x34\00b\00{{.*}}", null, {{.*}} @_ZN1C1bE, ![[DECL_B]]} ; [ DW_TAG_variable ] [b] {{.*}} [def]
-// CHECK: !"0x34\00c\00{{.*}}", null, {{.*}} @_ZN1C1cE, ![[DECL_C]]} ; [ DW_TAG_variable ] [c] {{.*}} [def]
+// CHECK: !DIGlobalVariable(name: "a", {{.*}}variable: i32* @_ZN1C1aE, declaration: ![[DECL_A]])
+// CHECK: !DIGlobalVariable(name: "b", {{.*}}variable: i32* @_ZN1C1bE, declaration: ![[DECL_B]])
+// CHECK: !DIGlobalVariable(name: "c", {{.*}}variable: i32* @_ZN1C1cE, declaration: ![[DECL_C]])
-// CHECK-NOT: ; [ DW_TAG_variable ] [anon_static_decl_var]
+// CHECK-NOT: !DIGlobalVariable(name: "anon_static_decl_var"
// Verify that even when a static member declaration is created lazily when
// creating the definition, the declaration line is that of the canonical
@@ -91,7 +128,9 @@ struct V {
virtual ~V(); // cause the definition of 'V' to be omitted by no-standalone-debug optimization
static const int const_va = 42;
};
-// CHECK: i32 42} ; [ DW_TAG_member ] [const_va] [line [[@LINE-2]],
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "const_va",
+// CHECK-SAME: line: [[@LINE-3]]
+// CHECK-SAME: extraData: i32 42
const int V::const_va;
namespace x {
@@ -101,4 +140,5 @@ struct y {
int y::z;
}
-// CHECK: !"0x34\00z\00{{.*}}", [[NS_X]], {{.*}} ; [ DW_TAG_variable ] [z] {{.*}} [def]
+// CHECK: !DIGlobalVariable(name: "z",
+// CHECK-SAME: scope: [[NS_X]]
OpenPOWER on IntegriCloud