summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/JumpThreading/crash.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-23 19:21:31 +0000
committerChris Lattner <sabre@nondot.org>2010-01-23 19:21:31 +0000
commit29b15c5cfdbbbc9bba895ab17b86fea5bda41fad (patch)
tree5b2f3fe829f87bd7ddf22207689d3949aaa9c5ee /llvm/test/Transforms/JumpThreading/crash.ll
parent32966aed9dc8f3cf3df3b337d5b52d7b48b40731 (diff)
downloadbcm5719-llvm-29b15c5cfdbbbc9bba895ab17b86fea5bda41fad.tar.gz
bcm5719-llvm-29b15c5cfdbbbc9bba895ab17b86fea5bda41fad.zip
third bug from PR6119: the xor dupe extension allows
for arbitrary terminators in predecessors, don't assume it is a conditional or uncond branch. The testcase shows an example where they can happen with switches. llvm-svn: 94323
Diffstat (limited to 'llvm/test/Transforms/JumpThreading/crash.ll')
-rw-r--r--llvm/test/Transforms/JumpThreading/crash.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/Transforms/JumpThreading/crash.ll b/llvm/test/Transforms/JumpThreading/crash.ll
index ff980ffcc62..cf292df0f71 100644
--- a/llvm/test/Transforms/JumpThreading/crash.ll
+++ b/llvm/test/Transforms/JumpThreading/crash.ll
@@ -286,3 +286,30 @@ for.body: ; preds = %for.cond
br label %for.cond
}
+; PR6119
+define i32 @test10(i32 %action, i32 %type) nounwind {
+entry:
+ %cmp2 = icmp eq i32 %type, 0 ; <i1> [#uses=1]
+ switch i32 %action, label %lor.rhs [
+ i32 1, label %if.then
+ i32 0, label %lor.end
+ ]
+
+if.then: ; preds = %for.cond, %lor.end, %entry
+ ret i32 undef
+
+lor.rhs: ; preds = %entry
+ %cmp101 = icmp eq i32 %action, 2 ; <i1> [#uses=1]
+ br label %lor.end
+
+lor.end: ; preds = %lor.rhs, %entry
+ %0 = phi i1 [ %cmp101, %lor.rhs ], [ true, %entry ] ; <i1> [#uses=1]
+ %cmp103 = xor i1 %cmp2, %0 ; <i1> [#uses=1]
+ br i1 %cmp103, label %for.cond, label %if.then
+
+for.cond: ; preds = %for.body, %lor.end
+ br i1 undef, label %if.then, label %for.body
+
+for.body: ; preds = %for.cond
+ br label %for.cond
+}
OpenPOWER on IntegriCloud