xref: /llvm-project/llvm/test/Transforms/InstCombine/JavaCompare.ll (revision 91948d4cad557dea2c1c42224dd7c850ed6ed825)
1; This is the sequence of stuff that the Java front-end expands for a single
2; <= comparison.  Check to make sure we turn it into a <= (only)
3
4; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
5; RUN:    grep -v {icmp sle} | not grep #uses
6
7bool %le(int %A, int %B) {
8        %c1 = setgt int %A, %B;
9        %tmp = select bool %c1, int 1, int 0;
10        %c2 = setlt int %A, %B;
11        %result = select bool %c2, int -1, int %tmp;
12        %c3 = setle int %result, 0;
13        ret bool %c3;
14}
15
16