summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/debug-info.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-04 20:56:17 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-04 20:56:17 +0000
commit531ba2d1b9b4728ee5a80c475d9617bf45867bab (patch)
tree7c0dbdf6f94511a1fd2fee6b4b3c6e14bb86e439 /test/CodeGenCXX/debug-info.cpp
parenta92b40825a9a8345984433093b166d3b08353f8b (diff)
DebugInfo: PR19298: function local const variables duplicated in the root scope
See the comment for CodeGenFunction::tryEmitAsConstant that describes how in some contexts (lambdas) we must not emit references to the variable, but instead use the constant directly - because of this we end up emitting a constant for the variable, as well as emitting the variable itself. Should we just skip putting the variable on the stack at all and omit the debug info for the constant? It's not clear to me - what if the address of the local is taken? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205651 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/debug-info.cpp')
-rw-r--r--test/CodeGenCXX/debug-info.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/CodeGenCXX/debug-info.cpp b/test/CodeGenCXX/debug-info.cpp
index 2e7226d869..7c89dfc04c 100644
--- a/test/CodeGenCXX/debug-info.cpp
+++ b/test/CodeGenCXX/debug-info.cpp
@@ -51,11 +51,6 @@ namespace VirtualBase {
}
}
-void foo() {
- const wchar_t c = L'x';
- wchar_t d = c;
-}
-
namespace b5249287 {
template <typename T> class A {
struct B;
@@ -88,6 +83,13 @@ foo func(foo f) {
// CHECK: [[FUNC:![0-9]*]] = {{.*}} metadata !"_ZN7pr147634funcENS_3fooE", i32 {{[0-9]*}}, metadata [[FUNC_TYPE:![0-9]*]], {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func]
}
+void foo() {
+ const wchar_t c = L'x';
+ wchar_t d = c;
+}
+
+// CHECK-NOT: ; [ DW_TAG_variable ] [c]
+
namespace pr9608 { // also pr9600
struct incomplete;
incomplete (*x)[3];
@@ -96,9 +98,11 @@ incomplete (*x)[3];
// CHECK: [[INCARRAY]] = {{.*}}metadata !"_ZTSN6pr960810incompleteE", metadata {{![0-9]*}}, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 0, align 0, offset 0] [from _ZTSN6pr960810incompleteE]
}
-// For some reason the argument for PR14763 ended up all the way down here
+// For some reason function arguments ended up down here
// CHECK: = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], {{.*}}, metadata !"[[FOO]]", i32 8192, i32 0} ; [ DW_TAG_arg_variable ] [f]
+// CHECK: ; [ DW_TAG_auto_variable ] [c]
+
namespace pr16214 {
struct a {
int i;