Eliminate more redundant llvm-as calls.
[oota-llvm.git] / test / Transforms / InstCombine / 2008-11-08-FCmp.ll
1 ; RUN: opt < %s -instcombine -S > %t
2 ; RUN: grep {icmp eq} %t
3 ; RUN: grep {ret i1 false} %t | count 2
4 ; RUN: grep {ret i1 true} %t | count 2
5 ; RUN: grep {icmp ne} %t
6 ; RUN: not grep {icmp slt} %t
7 ; PR3021
8
9 ; When inst combining an FCMP with the LHS coming from a uitofp instruction, we
10 ; can't lower it to signed ICMP instructions.
11
12 define i1 @test1(i32 %val) {
13   %1 = uitofp i32 %val to double
14   %2 = fcmp ole double %1, 0.000000e+00
15   ret i1 %2
16 }
17
18 define i1 @test2(i32 %val) {
19   %1 = uitofp i32 %val to double
20   %2 = fcmp olt double %1, 0.000000e+00
21   ret i1 %2
22 }
23
24 define i1 @test3(i32 %val) {
25   %1 = uitofp i32 %val to double
26   %2 = fcmp oge double %1, 0.000000e+00
27   ret i1 %2
28 }
29
30 define i1 @test4(i32 %val) {
31   %1 = uitofp i32 %val to double
32   %2 = fcmp ogt double %1, 0.000000e+00
33   ret i1 %2
34 }
35
36 define i1 @test5(i32 %val) {
37   %1 = uitofp i32 %val to double
38   %2 = fcmp ogt double %1, -4.400000e+00
39   ret i1 %2
40 }
41
42 define i1 @test6(i32 %val) {
43   %1 = uitofp i32 %val to double
44   %2 = fcmp olt double %1, -4.400000e+00
45   ret i1 %2
46 }