summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-09-19 21:58:15 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-09-19 21:58:15 +0000
commitc6b8ba86738cb6187835e440f2baafaa24dea0b2 (patch)
tree4b308426bc45ed2e7470f73bcbe17c89dea5ae84 /test/Transforms
parent1494c496e2827f991f75eae4acf8f7bf9952abdd (diff)
downloadllvm-c6b8ba86738cb6187835e440f2baafaa24dea0b2.tar.gz
llvm-c6b8ba86738cb6187835e440f2baafaa24dea0b2.tar.bz2
llvm-c6b8ba86738cb6187835e440f2baafaa24dea0b2.tar.xz
Fix an infinite loop where a transform in InstCombiner::visitAnd claims a construct is changed when it is not. (See included testcase.)
Patch by Xiaoyi Guo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140072 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/InstCombine/and2.ll7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/and2.ll b/test/Transforms/InstCombine/and2.ll
index a8881522ea..531aedb668 100644
--- a/test/Transforms/InstCombine/and2.ll
+++ b/test/Transforms/InstCombine/and2.ll
@@ -35,3 +35,10 @@ define i1 @test4(i32 %X) {
; CHECK: @test4
; CHECK-NEXT: ret i1 false
}
+
+; Make sure we don't go into an infinite loop with this test
+define <4 x i32> @test5(<4 x i32> %A) {
+ %1 = xor <4 x i32> %A, <i32 1, i32 2, i32 3, i32 4>
+ %2 = and <4 x i32> <i32 1, i32 2, i32 3, i32 4>, %1
+ ret <4 x i32> %2
+}