summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/debug-info-scope.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-22 21:54:29 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-22 21:54:29 +0000
commitdce8b37fc66a5b9f9f2fc7c17242de10164e612b (patch)
tree75b468339b0a842885bcf67e2aade69d7b2ac298 /test/CodeGenCXX/debug-info-scope.cpp
parentf256e04534c85bab1452837b7d93c13a56ed23e8 (diff)
DebugInfo: Provide scopes for C++11 range-for loop variables similar to r216288 (which was for plain-for loop condition variables).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/debug-info-scope.cpp')
-rw-r--r--test/CodeGenCXX/debug-info-scope.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/CodeGenCXX/debug-info-scope.cpp b/test/CodeGenCXX/debug-info-scope.cpp
index 58195e3778..8b045f4666 100644
--- a/test/CodeGenCXX/debug-info-scope.cpp
+++ b/test/CodeGenCXX/debug-info-scope.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -g -emit-llvm %s -o -| FileCheck %s
+// RUN: %clang_cc1 -g -std=c++11 -emit-llvm %s -o -| FileCheck %s
//
// Two variables with the same name in subsequent if staments need to be in separate scopes.
//
@@ -44,4 +44,12 @@ void func() {
// CHECK: [[FOR_COMPOUND]] = metadata !{i32 {{.*}}, metadata [[FOR_BODY]], i32 [[@LINE-6]], {{.*}}} ; [ DW_TAG_lexical_block ]
bool b = i % 2;
}
+
+ int x[] = {1, 2};
+ // CHECK: = metadata !{i32 786688, metadata [[RANGE_FOR:![0-9]*]], {{.*}} ; [ DW_TAG_auto_variable ] [__range] [line 0]
+ // CHECK: [[RANGE_FOR]] = metadata !{i32 {{.*}}, metadata !{{.*}}, i32 [[@LINE+1]], {{.*}}} ; [ DW_TAG_lexical_block ]
+ for (int i : x) {
+ // CHECK: = metadata !{i32 786688, metadata [[RANGE_FOR_BODY:![0-9]*]], {{.*}} ; [ DW_TAG_auto_variable ] [i] [line [[@LINE-1]]]
+ // CHECK: [[RANGE_FOR_BODY]] = metadata !{i32 {{.*}}, metadata [[RANGE_FOR]], i32 [[@LINE-2]], {{.*}}} ; [ DW_TAG_lexical_block ]
+ }
}