diff options
author | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2013-08-30 05:37:02 +0000 |
---|---|---|
committer | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2013-08-30 05:37:02 +0000 |
commit | be8d7ba93a5e19017096faaf5df54335a6d52000 (patch) | |
tree | 2075bfb4188bd16bfa22392c4b4fab81f47bd777 /clang/test/CodeGenCXX/debug-info-namespace.cpp | |
parent | b7ecc3e6afefc521fb0aa1e48ff3e64e34a46b8e (diff) | |
download | bcm5719-llvm-be8d7ba93a5e19017096faaf5df54335a6d52000.tar.gz bcm5719-llvm-be8d7ba93a5e19017096faaf5df54335a6d52000.zip |
Fixing a bug where debug info for a local variable gets emitted at file scope.
The patch was discussed in Phabricator. See:
http://llvm-reviews.chandlerc.com/D1281
llvm-svn: 189649
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-namespace.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/debug-info-namespace.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-namespace.cpp b/clang/test/CodeGenCXX/debug-info-namespace.cpp index ec7e69a0cc7..17352e88182 100644 --- a/clang/test/CodeGenCXX/debug-info-namespace.cpp +++ b/clang/test/CodeGenCXX/debug-info-namespace.cpp @@ -39,6 +39,16 @@ int func(bool b) { // This should work even if 'i' and 'func' were declarations & not definitions, // but it doesn't yet. +namespace C +{ + const int j = 32; +} + +int func2() +{ + return C::j; +} + // CHECK: [[CU:![0-9]*]] = {{.*}}[[MODULES:![0-9]*]], metadata !""} ; [ DW_TAG_compile_unit ] // CHECK: [[FILE:![0-9]*]] {{.*}}debug-info-namespace.cpp" // CHECK: [[FOO:![0-9]*]] {{.*}} ; [ DW_TAG_structure_type ] [foo] [line 5, size 0, align 0, offset 0] [decl] [from ] @@ -50,6 +60,8 @@ int func(bool b) { // CHECK: [[FUNC:![0-9]*]] {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func] // CHECK: [[FILE2]]} ; [ DW_TAG_file_type ] [{{.*}}foo.cpp] // CHECK: [[I:![0-9]*]] = {{.*}}, metadata [[NS]], metadata !"i", {{.*}} ; [ DW_TAG_variable ] [i] +// CHECK: [[VAR:![0-9]*]] = {{.*}}, metadata [[SPACE:![0-9]*]], metadata !"j", {{.*}} ; [ DW_TAG_variable ] [j] +// CHECK: [[SPACE]] = {{.*}}, metadata !"C", {{.*}} ; [ DW_TAG_namespace ] [C] // CHECK: [[MODULES]] = metadata !{metadata [[M1:![0-9]*]], metadata [[M2:![0-9]*]], metadata [[M3:![0-9]*]], metadata [[M4:![0-9]*]], metadata [[M5:![0-9]*]], metadata [[M6:![0-9]*]], metadata [[M7:![0-9]*]], metadata [[M8:![0-9]*]], metadata [[M9:![0-9]*]], metadata [[M10:![0-9]*]], metadata [[M11:![0-9]*]], metadata [[M12:![0-9]*]]} // CHECK: [[M1]] = metadata !{i32 {{[0-9]*}}, metadata [[CTXT]], metadata [[NS]], i32 11} ; [ DW_TAG_imported_module ] // CHECK: [[M2]] = metadata !{i32 {{[0-9]*}}, metadata [[CU]], metadata [[CTXT]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_module ] |