Add a test for the foldSelectICmpAndOr fix committed in r180779.
[oota-llvm.git] / test / Transforms / InstCombine / not.ll
index 757e1de940ce2db87d31d20e6fc3fa6b42963637..4a8825b15c4e15102d3f1ba6bfbc94e7eb493c81 100644 (file)
@@ -1,7 +1,7 @@
 ; This test makes sure that these instructions are properly eliminated.
 ;
 
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep xor
+; RUN: opt < %s -instcombine -S | not grep xor
 
 define i32 @test1(i32 %A) {
         %B = xor i32 %A, -1             ; <i32> [#uses=1]
@@ -42,3 +42,13 @@ define i32 @test5(i32 %A, i32 %B) {
         ret i32 %d
 }
 
+; PR2298
+define zeroext i8 @test6(i32 %a, i32 %b)  nounwind  {
+entry:
+       %tmp1not = xor i32 %a, -1               ; <i32> [#uses=1]
+       %tmp2not = xor i32 %b, -1               ; <i32> [#uses=1]
+       %tmp3 = icmp slt i32 %tmp1not, %tmp2not         ; <i1> [#uses=1]
+       %retval67 = zext i1 %tmp3 to i8         ; <i8> [#uses=1]
+       ret i8 %retval67
+}
+