Chris Lattner | 16ea43b | 2004-06-09 05:07:01 +0000 | [diff] [blame] | 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 | |
Reid Spencer | e4d87aa | 2006-12-23 06:05:41 +0000 | [diff] [blame] | 4 | ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v 'icmp sle'| not grep '#uses' |
Chris Lattner | 16ea43b | 2004-06-09 05:07:01 +0000 | [diff] [blame] | 5 | |
| 6 | bool %le(int %A, int %B) { |
| 7 | %c1 = setgt int %A, %B; |
| 8 | %tmp = select bool %c1, int 1, int 0; |
| 9 | %c2 = setlt int %A, %B; |
| 10 | %result = select bool %c2, int -1, int %tmp; |
| 11 | %c3 = setle int %result, 0; |
| 12 | ret bool %c3; |
| 13 | } |
| 14 | |