From 7bc2da19e7b148a233038e7c8b615aaa4993f3f4 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 22 Aug 2014 22:25:37 +0000 Subject: DebugInfo: for loop backedge should be attributed to the start of the for statement. Similar to r215768 (which fixed the same case for while loops). To quote r215768's commit message: "A little test case simplification - this could be simplified further, though there are certainly interesting connections to the if/else construct so I'm hesitant to remove that entirely though it does appear somewhat unrelated. (similar fix to r215766, related to PR19864)" llvm-svn: 216297 --- clang/test/CodeGenCXX/debug-info-line-if.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'clang/test/CodeGenCXX/debug-info-line-if.cpp') diff --git a/clang/test/CodeGenCXX/debug-info-line-if.cpp b/clang/test/CodeGenCXX/debug-info-line-if.cpp index 1ebe51cee5e..6319993b14b 100644 --- a/clang/test/CodeGenCXX/debug-info-line-if.cpp +++ b/clang/test/CodeGenCXX/debug-info-line-if.cpp @@ -26,6 +26,18 @@ int main() { // CHECK: br label // CHECK: br label {{.*}}, !dbg [[DBG2:!.*]] + +#line 300 + for (; a; ) + if (b) + ++b; // CHECK: add nsw{{.*}}, 1 + else + ++a; // CHECK: add nsw{{.*}}, 1 + + // CHECK: br label + // CHECK: br label {{.*}}, !dbg [[DBG3:!.*]] + // 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} } -- cgit v1.2.3