summaryrefslogtreecommitdiff
path: root/test/Transforms/LoopSimplify/indirectbr.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-11-20 20:51:18 +0000
committerDan Gohman <gohman@apple.com>2009-11-20 20:51:18 +0000
commita58a04921deba911d6ead8d24f495cec234681c1 (patch)
treeb051c1c24f3d53ceea308c0a6ca0ddb599f21e57 /test/Transforms/LoopSimplify/indirectbr.ll
parent6a2392131e2e5b8c4123d69cc959831b4fe719ca (diff)
downloadllvm-a58a04921deba911d6ead8d24f495cec234681c1.tar.gz
llvm-a58a04921deba911d6ead8d24f495cec234681c1.tar.bz2
llvm-a58a04921deba911d6ead8d24f495cec234681c1.tar.xz
Make Loop::getLoopLatch() work on loops which don't have preheaders, as
it may be used in contexts where preheader insertion may have failed due to an indirectbr. Make LoopSimplify's LoopSimplify::SeparateNestedLoop properly fail in the case that it would require splitting an indirectbr edge. These fix PR5502. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopSimplify/indirectbr.ll')
-rw-r--r--test/Transforms/LoopSimplify/indirectbr.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/LoopSimplify/indirectbr.ll b/test/Transforms/LoopSimplify/indirectbr.ll
index b0238473b6..2e4549d1e9 100644
--- a/test/Transforms/LoopSimplify/indirectbr.ll
+++ b/test/Transforms/LoopSimplify/indirectbr.ll
@@ -81,3 +81,20 @@ L1:
%y = phi i64 [ %z, %L0 ], [ 1, %entry ]
ret i64 %y
}
+
+define void @pr5502() nounwind {
+entry:
+ br label %while.cond
+
+while.cond:
+ br i1 undef, label %while.body, label %while.end
+
+while.body:
+ indirectbr i8* undef, [label %end_opcode, label %end_opcode]
+
+end_opcode:
+ br i1 false, label %end_opcode, label %while.cond
+
+while.end:
+ ret void
+}