blob: e67608ef4d05483b197917947011fc1ee886d589 [file] [log] [blame]
Brian Gaeke8e0a6bf2002-10-31 23:05:22 +00001; test shifts
Misha Brukman297372c2002-12-13 05:44:21 +00002int %main() {
Chris Lattner8e4a9142003-01-13 00:57:49 +00003 %shamt = add ubyte 0, 1
4
5 ; Left shifts...
6 %t1 = shl int 1, ubyte %shamt
7 %t2 = shl int 1, ubyte 4
8
9 %t1 = shl uint 1, ubyte %shamt
10 %t2 = shl uint 1, ubyte 5
11
12 ;%t1 = shl long 1, ubyte %shamt
13 %t2 = shl long 1, ubyte 4
14
15 ;%t1 = shl ulong 1, ubyte %shamt
16 %t2 = shl ulong 1, ubyte 5
17
18 ; Right shifts...
John Criswell1b4fb5a2003-11-26 14:45:37 +000019 %tr1 = shr int 1, ubyte %shamt
20 %tr2 = shr int 1, ubyte 4
Chris Lattner8e4a9142003-01-13 00:57:49 +000021
John Criswell1b4fb5a2003-11-26 14:45:37 +000022 %tr1 = shr uint 1, ubyte %shamt
23 %tr2 = shr uint 1, ubyte 5
Chris Lattner8e4a9142003-01-13 00:57:49 +000024
John Criswell1b4fb5a2003-11-26 14:45:37 +000025 ;%tr1 = shr long 1, ubyte %shamt
26 %tr1 = shr long 1, ubyte 4
27 %tr2 = shr long 1, ubyte %shamt
28 %tr3 = shl long 1, ubyte 4
29 %tr4 = shl long 1, ubyte %shamt
Chris Lattner8e4a9142003-01-13 00:57:49 +000030
31 ;%t1 = shr ulong 1, ubyte %shamt
John Criswell1b4fb5a2003-11-26 14:45:37 +000032 %tr1 = shr ulong 1, ubyte 5
33 %tr2 = shr ulong 1, ubyte %shamt
34 %tr3 = shl ulong 1, ubyte 5
35 %tr4 = shl ulong 1, ubyte %shamt
Misha Brukman297372c2002-12-13 05:44:21 +000036 ret int 0
Brian Gaeke8e0a6bf2002-10-31 23:05:22 +000037}