diff options
Diffstat (limited to 'clang/test/CodeGenCXX')
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-class.cpp | 4 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-static-member.cpp | 18 |
2 files changed, 18 insertions, 4 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-class.cpp b/clang/test/CodeGenCXX/debug-info-class.cpp index 783c00c0d07..5da53210c46 100644 --- a/clang/test/CodeGenCXX/debug-info-class.cpp +++ b/clang/test/CodeGenCXX/debug-info-class.cpp @@ -118,9 +118,5 @@ int main(int argc, char **argv) { // CHECK: metadata !"_ZTS1D", {{.*}}, metadata [[D_FUNC_DECL:![0-9]*]], metadata {{![0-9]*}}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func] // CHECK: [[D_FUNC_DECL]] = metadata !{metadata !"0x2e\00func\00{{.*}}\000\00{{[0-9]+}}"{{.*}}, metadata !"_ZTS1D", {{.*}}, null} ; [ DW_TAG_subprogram ] {{.*}} [func] -// CHECK: [[F_I_DEF:![0-9]*]] = {{.*}}, metadata !"_ZTS1F", metadata {{![0-9]*}}, metadata {{![0-9]*}}, i32 2, metadata [[F_I:![0-9]*]]} ; [ DW_TAG_variable ] [i] - -// CHECK: [[F_I]] = {{.*}}, metadata !"_ZTS1F", {{.*}} ; [ DW_TAG_member ] [i] - // CHECK: ![[EXCEPTLOC]] = metadata !{i32 84, // CHECK: ![[RETLOC]] = metadata !{i32 83, diff --git a/clang/test/CodeGenCXX/debug-info-static-member.cpp b/clang/test/CodeGenCXX/debug-info-static-member.cpp index c65ccd64dd7..803d0dc1c7f 100644 --- a/clang/test/CodeGenCXX/debug-info-static-member.cpp +++ b/clang/test/CodeGenCXX/debug-info-static-member.cpp @@ -43,10 +43,28 @@ int main() // CHECK: metadata !"0xd\00const_c\00{{.*}}", {{.*}} [ DW_TAG_member ] [const_c] [line {{.*}}, size 0, align 0, offset 0] [public] [static] // CHECK: metadata !"0xd\00x_a\00{{.*}}", {{.*}} [ DW_TAG_member ] [x_a] {{.*}} [public] [static] // CHECK: [[NS_X:![0-9]+]] = {{.*}} ; [ DW_TAG_namespace ] [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. +namespace { +struct anon_static_decl_struct { + static const int anon_static_decl_var = 117; +}; +} + +// CHECK: ; [ DW_TAG_structure_type ] [anon_static_decl_struct] {{.*}} [def] +// CHECK: ; [ DW_TAG_member ] [anon_static_decl_var] + +int ref() { + return anon_static_decl_struct::anon_static_decl_var; +} + // CHECK: metadata !{metadata !"0x34\00a\00{{.*}}", null, {{.*}} @_ZN1C1aE, metadata ![[DECL_A]]} ; [ DW_TAG_variable ] [a] {{.*}} [def] // CHECK: metadata !{metadata !"0x34\00b\00{{.*}}", null, {{.*}} @_ZN1C1bE, metadata ![[DECL_B]]} ; [ DW_TAG_variable ] [b] {{.*}} [def] // CHECK: metadata !{metadata !"0x34\00c\00{{.*}}", null, {{.*}} @_ZN1C1cE, metadata ![[DECL_C]]} ; [ DW_TAG_variable ] [c] {{.*}} [def] +// CHECK-NOT: ; [ DW_TAG_variable ] [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 // declaration, not the definition. Also, since we look at the canonical |

