summaryrefslogtreecommitdiff
path: root/test/Transforms/LoopSimplify
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-10-19 16:04:50 +0000
committerDan Gohman <gohman@apple.com>2009-10-19 16:04:50 +0000
commit841a14753175bb9a02a8f5286ffe03d050b0da26 (patch)
tree5e545d4efd18acb564b73ca09f0563ca2816c3ce /test/Transforms/LoopSimplify
parentdfffba6a83b7f79c8853e1412a93442b7a9b825d (diff)
downloadllvm-841a14753175bb9a02a8f5286ffe03d050b0da26.tar.gz
llvm-841a14753175bb9a02a8f5286ffe03d050b0da26.tar.bz2
llvm-841a14753175bb9a02a8f5286ffe03d050b0da26.tar.xz
Fix SplitBlockPredecessors' LoopInfo updating code to handle the case
where a loop's header is being split and it has predecessors which are not contained by the most-nested loop which contains the loop. This fixes PR5235. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84505 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopSimplify')
-rw-r--r--test/Transforms/LoopSimplify/unreachable-loop-pred.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/LoopSimplify/unreachable-loop-pred.ll b/test/Transforms/LoopSimplify/unreachable-loop-pred.ll
new file mode 100644
index 0000000000..faaaf97d72
--- /dev/null
+++ b/test/Transforms/LoopSimplify/unreachable-loop-pred.ll
@@ -0,0 +1,20 @@
+; RUN: opt -S -loopsimplify -disable-output -verify-loop-info -verify-dom-info < %s
+; PR5235
+
+; When loopsimplify inserts a preheader for this loop, it should add the new
+; block to the enclosing loop and not get confused by the unreachable
+; bogus loop entry.
+
+define void @is_extract_cab() nounwind {
+entry:
+ br label %header
+
+header: ; preds = %if.end206, %cond.end66, %if.end23
+ br label %while.body115
+
+while.body115: ; preds = %9, %if.end192, %if.end101
+ br i1 undef, label %header, label %while.body115
+
+foo:
+ br label %while.body115
+}