InstCombine: Match min/max hidden by sext/zext
[oota-llvm.git] / test / Transforms / InstCombine / and2.ll
index 3b80d94e1a61c706cb459d8330ab7efba41f3667..d898ea3b037a863a360620570cb0f9d2742e8887 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and
-
+; RUN: opt < %s -instcombine -S | FileCheck %s
 
 ; PR1738
 define i1 @test1(double %X, double %Y) {
@@ -7,6 +6,23 @@ define i1 @test1(double %X, double %Y) {
         %tmp13 = fcmp ord double %Y, 0.000000e+00
         %bothcond = and i1 %tmp13, %tmp9
         ret i1 %bothcond
+; CHECK:  fcmp ord double %Y, %X
 }
 
+define i1 @test2(i1 %X, i1 %Y) {
+  %a = and i1 %X, %Y
+  %b = and i1 %a, %X
+  ret i1 %b
+; CHECK: @test2
+; CHECK-NEXT: and i1 %X, %Y
+; CHECK-NEXT: ret
+}
 
+define i32 @test3(i32 %X, i32 %Y) {
+  %a = and i32 %X, %Y
+  %b = and i32 %Y, %a
+  ret i32 %b
+; CHECK: @test3
+; CHECK-NEXT: and i32 %X, %Y
+; CHECK-NEXT: ret
+}