summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-22 22:29:50 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-22 22:29:50 +0000
commit86084661482dc942d7ea6afdad3e9e982590b5b0 (patch)
tree87f97163aee83b893508ef7606a406d997cf0822
parent7bc2da19e7b148a233038e7c8b615aaa4993f3f4 (diff)
downloadbcm5719-llvm-86084661482dc942d7ea6afdad3e9e982590b5b0.tar.gz
bcm5719-llvm-86084661482dc942d7ea6afdad3e9e982590b5b0.zip
DebugInfo: Test that the loop backedge in a range-for is attribute to the loop header.
This already works, but somewhat by accident (due to the order of emission in clang, the location is set to the loop header (during the emission of the iteratior increment) before the loop backedge is emitted), so let's just add a test for symmetry and future-proofing. llvm-svn: 216298
-rw-r--r--clang/test/CodeGenCXX/debug-info-line-if.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-line-if.cpp b/clang/test/CodeGenCXX/debug-info-line-if.cpp
index 6319993b14b..bd963773252 100644
--- a/clang/test/CodeGenCXX/debug-info-line-if.cpp
+++ b/clang/test/CodeGenCXX/debug-info-line-if.cpp
@@ -37,7 +37,19 @@ int main() {
// CHECK: br label
// CHECK: br label {{.*}}, !dbg [[DBG3:!.*]]
+#line 400
+ int x[] = {1, 2};
+ for (int y : x)
+ if (b)
+ ++b; // CHECK: add nsw{{.*}}, 1
+ else
+ ++a; // CHECK: add nsw{{.*}}, 1
+
+ // CHECK: br label
+ // CHECK: br label {{.*}}, !dbg [[DBG4:!.*]]
+
// CHECK: [[DBG1]] = metadata !{i32 100, i32 0, metadata !{{.*}}, null}
// CHECK: [[DBG2]] = metadata !{i32 200, i32 0, metadata !{{.*}}, null}
// CHECK: [[DBG3]] = metadata !{i32 300, i32 0, metadata !{{.*}}, null}
+ // CHECK: [[DBG4]] = metadata !{i32 401, i32 0, metadata !{{.*}}, null}
}
OpenPOWER on IntegriCloud