From 92b2846c4a1f1c204be9a64d9bbb882d82614ca6 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Fri, 31 Mar 2017 17:51:12 +0000 Subject: [PATCH] Improve DebugInfo/strip-loop-metadata.ll test This wasn't covering for the case where you have multiple latches and hence the use of the same loop-id which needs to be mapped to the same loop-id. llvm-svn: 299237 --- llvm/test/DebugInfo/strip-loop-metadata.ll | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/llvm/test/DebugInfo/strip-loop-metadata.ll b/llvm/test/DebugInfo/strip-loop-metadata.ll index 2d5addd97316..e0d8cdfaf469 100644 --- a/llvm/test/DebugInfo/strip-loop-metadata.ll +++ b/llvm/test/DebugInfo/strip-loop-metadata.ll @@ -18,6 +18,7 @@ return: } declare void @_Z3barv() +declare i1 @_Z3bazv() ; CHECK-LABEL: _Z5test2v ; CHECK: br {{.*}} !llvm.loop [[LOOP:![0-9]+]] @@ -34,13 +35,21 @@ return: } ; CHECK-LABEL: _Z5test3v -; CHECK: br {{.*}} !llvm.loop [[LOOP2:![0-9]+]] define void @_Z5test3v() !dbg !22 { entry: br label %while.body, !dbg !23 while.body: + %c = call i1 @_Z3bazv() + br i1 %c, label %if, label %then + +if: call void @_Z3barv(), !dbg !24 +; CHECK: br {{.*}} !llvm.loop [[LOOP2:![0-9]+]] + br label %while.body, !dbg !25, !llvm.loop !26 + +then: +; CHECK: br {{.*}} !llvm.loop [[LOOP2]] br label %while.body, !dbg !25, !llvm.loop !26 return: