Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / InstCombine / setcc-strength-reduce.ll
1 ; This test ensures that "strength reduction" of conditional expressions are
2 ; working.  Basically this boils down to converting setlt,gt,le,ge instructions
3 ; into equivalent setne,eq instructions.
4 ;
5
6 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v seteq | grep -v setne | not grep set
7
8 bool %test1(uint %A) {
9         %B = setge uint %A, 1   ; setne %A, 0
10         ret bool %B
11 }
12
13 bool %test2(uint %A) {
14         %B = setgt uint %A, 0   ; setne %A, 0
15         ret bool %B
16 }
17
18 bool %test3(sbyte %A) {
19         %B = setge sbyte %A, -127   ; setne %A, -128
20         ret bool %B
21 }
22
23 bool %test4(sbyte %A) {
24         %B = setle sbyte %A, 126  ; setne %A, 127
25         ret bool %B
26 }
27
28 bool %test5(sbyte %A) {
29         %B = setlt sbyte %A, 127 ; setne %A, 127
30         ret bool %B
31 }