Chris Lattner | a0aec0a | 2006-05-06 18:15:50 +0000 | [diff] [blame] | 1 | ; These tests should not contain a sign extend. |
| 2 | ; RUN: llvm-as < %s | llc -march=ppc32 && |
| 3 | ; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsh && |
| 4 | ; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsb |
Nate Begeman | d44d3d5 | 2006-02-17 21:22:08 +0000 | [diff] [blame] | 5 | |
Chris Lattner | a0aec0a | 2006-05-06 18:15:50 +0000 | [diff] [blame] | 6 | int %test1(uint %mode.0.i.0) { |
| 7 | %tmp.79 = cast uint %mode.0.i.0 to short |
| 8 | %tmp.80 = cast short %tmp.79 to int |
| 9 | %tmp.81 = and int %tmp.80, 24 |
Nate Begeman | d44d3d5 | 2006-02-17 21:22:08 +0000 | [diff] [blame] | 10 | ret int %tmp.81 |
| 11 | } |
Chris Lattner | a0aec0a | 2006-05-06 18:15:50 +0000 | [diff] [blame] | 12 | |
| 13 | short %test2(short %X, short %x) { |
| 14 | %tmp = cast short %X to int |
| 15 | %tmp1 = cast short %x to int |
| 16 | %tmp2 = add int %tmp, %tmp1 |
| 17 | %tmp4 = shr int %tmp2, ubyte 1 |
| 18 | %tmp4 = cast int %tmp4 to short |
| 19 | %tmp45 = cast short %tmp4 to int |
| 20 | %retval = cast int %tmp45 to short |
| 21 | ret short %retval |
| 22 | } |
| 23 | |