Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-upgrade %s | llvm-as -f -o %t.bc |
| 2 | ; RUN: lli %t.bc > /dev/null |
| 3 | |
| 4 | ; test shifts |
| 5 | int %main() { |
| 6 | %shamt = add ubyte 0, 1 |
| 7 | |
| 8 | ; Left shifts... |
| 9 | %t1.s = shl int 1, ubyte %shamt |
| 10 | %t2.s = shl int 1, ubyte 4 |
| 11 | |
| 12 | %t1 = shl uint 1, ubyte %shamt |
| 13 | %t2 = shl uint 1, ubyte 5 |
| 14 | |
| 15 | ;%t1 = shl long 1, ubyte %shamt |
| 16 | %t2.s = shl long 1, ubyte 4 |
| 17 | |
| 18 | ;%t1 = shl ulong 1, ubyte %shamt |
| 19 | %t2 = shl ulong 1, ubyte 5 |
| 20 | |
| 21 | ; Right shifts... |
| 22 | %tr1.s = shr int 1, ubyte %shamt |
| 23 | %tr2.s = shr int 1, ubyte 4 |
| 24 | |
| 25 | %tr1 = shr uint 1, ubyte %shamt |
| 26 | %tr2 = shr uint 1, ubyte 5 |
| 27 | |
| 28 | ;%tr1 = shr long 1, ubyte %shamt |
| 29 | %tr1.l = shr long 1, ubyte 4 |
| 30 | %tr2.l = shr long 1, ubyte %shamt |
| 31 | %tr3.l = shl long 1, ubyte 4 |
| 32 | %tr4.l = shl long 1, ubyte %shamt |
| 33 | |
| 34 | ;%t1 = shr ulong 1, ubyte %shamt |
| 35 | %tr1.u = shr ulong 1, ubyte 5 |
| 36 | %tr2.u = shr ulong 1, ubyte %shamt |
| 37 | %tr3.u = shl ulong 1, ubyte 5 |
| 38 | %tr4.u = shl ulong 1, ubyte %shamt |
| 39 | ret int 0 |
| 40 | } |