summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/debug-info-vla.c
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2018-02-01 11:25:10 +0000
committerSander de Smalen <sander.desmalen@arm.com>2018-02-01 11:25:10 +0000
commit17c4633e7faf76682e7c999576128848b10fb815 (patch)
treecef6c0668b787ede92f8ebf7e6d0c590136ae5c7 /clang/test/CodeGen/debug-info-vla.c
parente11f0545db7a0a6939befb31f5f2c43a8ba4874e (diff)
downloadbcm5719-llvm-17c4633e7faf76682e7c999576128848b10fb815.tar.gz
bcm5719-llvm-17c4633e7faf76682e7c999576128848b10fb815.zip
[DebugInfo] Enable debug information for C99 VLA types
Summary: This patch enables debugging of C99 VLA types by generating more precise LLVM Debug metadata, using the extended DISubrange 'count' field that takes a DIVariable. This should implement: Bug 30553: Debug info generated for arrays is not what GDB expects (not as good as GCC's) https://bugs.llvm.org/show_bug.cgi?id=30553 Reviewers: echristo, aprantl, dexonsmith, clayborg, pcc, kristof.beyls, dblaikie Reviewed By: aprantl Subscribers: jholewinski, schweitz, davide, fhahn, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D41698 llvm-svn: 323952
Diffstat (limited to 'clang/test/CodeGen/debug-info-vla.c')
-rw-r--r--clang/test/CodeGen/debug-info-vla.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/test/CodeGen/debug-info-vla.c b/clang/test/CodeGen/debug-info-vla.c
index 7928ca76139..35a219b955a 100644
--- a/clang/test/CodeGen/debug-info-vla.c
+++ b/clang/test/CodeGen/debug-info-vla.c
@@ -2,9 +2,11 @@
void testVLAwithSize(int s)
{
-// CHECK: dbg.declare
-// CHECK: dbg.declare({{.*}}, metadata ![[VAR:.*]], metadata !DIExpression())
-// CHECK: ![[VAR]] = !DILocalVariable(name: "vla",{{.*}} line: [[@LINE+1]]
+// CHECK-DAG: dbg.declare({{.*}} %vla_expr, metadata ![[VLAEXPR:[0-9]+]]
+// CHECK-DAG: dbg.declare({{.*}} %vla, metadata ![[VAR:[0-9]+]]
+// CHECK-DAG: ![[VLAEXPR]] = !DILocalVariable(name: "vla_expr"
+// CHECK-DAG: ![[VAR]] = !DILocalVariable(name: "vla",{{.*}} line: [[@LINE+2]]
+// CHECK-DAG: !DISubrange(count: ![[VLAEXPR]])
int vla[s];
int i;
for (i = 0; i < s; i++) {
OpenPOWER on IntegriCloud