convert to filecheck

llvm-svn: 91810
This commit is contained in:
Chris Lattner 2009-12-21 03:11:05 +00:00
parent 9025ec2ee5
commit d18b455086
1 changed files with 21 additions and 1 deletions

View File

@ -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 @@ entry:
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 @@ entry:
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 @@ entry:
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 @@ define <2 x i1> @test5(<2 x i64> %x) {
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 @@ define i32 @test6(i32 %a, i32 %b) {
%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
}