[llvm-commits] [llvm] r91810 - /llvm/trunk/test/Transforms/InstCombine/icmp.ll
Chris Lattner
sabre at nondot.org
Sun Dec 20 19:11:06 PST 2009
Author: lattner
Date: Sun Dec 20 21:11:05 2009
New Revision: 91810
URL: http://llvm.org/viewvc/llvm-project?rev=91810&view=rev
Log:
convert to filecheck
Modified:
llvm/trunk/test/Transforms/InstCombine/icmp.ll
Modified: llvm/trunk/test/Transforms/InstCombine/icmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp.ll?rev=91810&r1=91809&r2=91810&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/icmp.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/icmp.ll Sun Dec 20 21:11:05 2009
@@ -1,10 +1,13 @@
-; RUN: opt < %s -instcombine -S | not grep icmp
+; RUN: opt < %s -instcombine -S | FileCheck %s
define i32 @test1(i32 %X) {
entry:
icmp slt i32 %X, 0 ; <i1>:0 [#uses=1]
zext i1 %0 to i32 ; <i32>:1 [#uses=1]
ret i32 %1
+; CHECK: @test1
+; CHECK: lshr i32 %X, 31
+; CHECK-NEXT: ret i32
}
define i32 @test2(i32 %X) {
@@ -12,6 +15,10 @@
icmp ult i32 %X, -2147483648 ; <i1>:0 [#uses=1]
zext i1 %0 to i32 ; <i32>:1 [#uses=1]
ret i32 %1
+; CHECK: @test2
+; CHECK: lshr i32 %X, 31
+; CHECK-NEXT: xor i32
+; CHECK-NEXT: ret i32
}
define i32 @test3(i32 %X) {
@@ -19,6 +26,9 @@
icmp slt i32 %X, 0 ; <i1>:0 [#uses=1]
sext i1 %0 to i32 ; <i32>:1 [#uses=1]
ret i32 %1
+; CHECK: @test3
+; CHECK: ashr i32 %X, 31
+; CHECK-NEXT: ret i32
}
define i32 @test4(i32 %X) {
@@ -26,6 +36,10 @@
icmp ult i32 %X, -2147483648 ; <i1>:0 [#uses=1]
sext i1 %0 to i32 ; <i32>:1 [#uses=1]
ret i32 %1
+; CHECK: @test4
+; CHECK: ashr i32 %X, 31
+; CHECK-NEXT: xor i32
+; CHECK-NEXT: ret i32
}
; PR4837
@@ -33,6 +47,8 @@
entry:
%V = icmp eq <2 x i64> %x, undef
ret <2 x i1> %V
+; CHECK: @test5
+; CHECK: ret <2 x i1> undef
}
define i32 @test6(i32 %a, i32 %b) {
@@ -41,4 +57,8 @@
%e = sub i32 0, %d
%f = and i32 %e, %b
ret i32 %f
+; CHECK: @test6
+; CHECK-NEXT: ashr i32 %a, 31
+; CHECK-NEXT: %f = and i32 %e, %b
+; CHECK-NEXT: ret i32 %f
}
More information about the llvm-commits
mailing list