summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info-lb.cpp
diff options
context:
space:
mode:
authorAmjad Aboud <amjad.aboud@intel.com>2016-02-23 13:37:18 +0000
committerAmjad Aboud <amjad.aboud@intel.com>2016-02-23 13:37:18 +0000
commit30e7a8f694a19553f64b3a3a5de81ce317b9ec2f (patch)
tree2aebeb9b2230ca22f960ade5a34ddc4c64d81e8b /clang/test/CodeGenCXX/debug-info-lb.cpp
parentfc8f296782caf06e71fc7b1ed215173a388f3b77 (diff)
downloadbcm5719-llvm-30e7a8f694a19553f64b3a3a5de81ce317b9ec2f.tar.gz
bcm5719-llvm-30e7a8f694a19553f64b3a3a5de81ce317b9ec2f.zip
Supporting all entities declared in lexical scope in LLVM debug info.
Differential Revision: http://reviews.llvm.org/D15977 llvm-svn: 261634
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-lb.cpp')
-rw-r--r--clang/test/CodeGenCXX/debug-info-lb.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-lb.cpp b/clang/test/CodeGenCXX/debug-info-lb.cpp
new file mode 100644
index 00000000000..beb160c8c76
--- /dev/null
+++ b/clang/test/CodeGenCXX/debug-info-lb.cpp
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
+
+void foo() {
+ static int bar = 1;
+ {
+ struct X {};
+ typedef char Y;
+ static int bar = 0;
+ // The following basic block is intended, in order to check the case where
+ // types "X", "Y" are defined in a different scope than where they are used.
+ // They should have the scope they are defined at as their parent scope.
+ {
+ X a;
+ Y b;
+ }
+ }
+}
+
+// CHECK: !{{[0-9]+}} = !DICompositeType(tag: DW_TAG_structure_type, name: "X", scope: [[LBScope:![0-9]+]],
+// CHECK: [[LBScope]] = distinct !DILexicalBlock(scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: 5)
+
+// CHECK: [[FuncScope:![0-9]+]] = distinct !DISubprogram(name: "foo",
+
+// CHECK: !{{[0-9]+}} = !DIDerivedType(tag: DW_TAG_typedef, name: "Y", scope: [[LBScope]],
+// CHECK: !{{[0-9]+}} = !DIGlobalVariable(name: "bar", scope: [[FuncScope]], file: !{{[0-9]+}}, line: 4
+// CHECK: !{{[0-9]+}} = !DIGlobalVariable(name: "bar", scope: [[LBScope]], file: !{{[0-9]+}}, line: 8
+
OpenPOWER on IntegriCloud