Reid Spencer | 4dc9e5a | 2006-12-03 16:17:19 +0000 | [diff] [blame] | 1 | ; RUN: llvm-upgrade %s | llvm-as -f -o %t.bc |
Tanya Lattner | e9789ef | 2004-11-06 23:32:43 +0000 | [diff] [blame] | 2 | ; RUN: lli %t.bc > /dev/null |
| 3 | |
Brian Gaeke | 8e0a6bf | 2002-10-31 23:05:22 +0000 | [diff] [blame] | 4 | ; test shifts |
Misha Brukman | 297372c | 2002-12-13 05:44:21 +0000 | [diff] [blame] | 5 | int %main() { |
Chris Lattner | 8e4a914 | 2003-01-13 00:57:49 +0000 | [diff] [blame] | 6 | %shamt = add ubyte 0, 1 |
| 7 | |
| 8 | ; Left shifts... |
Reid Spencer | eacb702 | 2006-12-31 06:02:00 +0000 | [diff] [blame] | 9 | %t1.s = shl int 1, ubyte %shamt |
| 10 | %t2.s = shl int 1, ubyte 4 |
Chris Lattner | 8e4a914 | 2003-01-13 00:57:49 +0000 | [diff] [blame] | 11 | |
| 12 | %t1 = shl uint 1, ubyte %shamt |
| 13 | %t2 = shl uint 1, ubyte 5 |
| 14 | |
| 15 | ;%t1 = shl long 1, ubyte %shamt |
Reid Spencer | eacb702 | 2006-12-31 06:02:00 +0000 | [diff] [blame] | 16 | %t2.s = shl long 1, ubyte 4 |
Chris Lattner | 8e4a914 | 2003-01-13 00:57:49 +0000 | [diff] [blame] | 17 | |
| 18 | ;%t1 = shl ulong 1, ubyte %shamt |
| 19 | %t2 = shl ulong 1, ubyte 5 |
| 20 | |
| 21 | ; Right shifts... |
Reid Spencer | eacb702 | 2006-12-31 06:02:00 +0000 | [diff] [blame] | 22 | %tr1.s = shr int 1, ubyte %shamt |
| 23 | %tr2.s = shr int 1, ubyte 4 |
Chris Lattner | 8e4a914 | 2003-01-13 00:57:49 +0000 | [diff] [blame] | 24 | |
John Criswell | 1b4fb5a | 2003-11-26 14:45:37 +0000 | [diff] [blame] | 25 | %tr1 = shr uint 1, ubyte %shamt |
| 26 | %tr2 = shr uint 1, ubyte 5 |
Chris Lattner | 8e4a914 | 2003-01-13 00:57:49 +0000 | [diff] [blame] | 27 | |
John Criswell | 1b4fb5a | 2003-11-26 14:45:37 +0000 | [diff] [blame] | 28 | ;%tr1 = shr long 1, ubyte %shamt |
Reid Spencer | eacb702 | 2006-12-31 06:02:00 +0000 | [diff] [blame] | 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 |
Chris Lattner | 8e4a914 | 2003-01-13 00:57:49 +0000 | [diff] [blame] | 33 | |
| 34 | ;%t1 = shr ulong 1, ubyte %shamt |
Reid Spencer | eacb702 | 2006-12-31 06:02:00 +0000 | [diff] [blame] | 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 |
Misha Brukman | 297372c | 2002-12-13 05:44:21 +0000 | [diff] [blame] | 39 | ret int 0 |
Brian Gaeke | 8e0a6bf | 2002-10-31 23:05:22 +0000 | [diff] [blame] | 40 | } |