blob: 475574996a12d242dd0f65590ea3f27b71d67896 [file] [log] [blame]
Brian Gaeke8e0a6bf2002-10-31 23:05:22 +00001; test shifts
Misha Brukman297372c2002-12-13 05:44:21 +00002int %main() {
Brian Gaeke8e0a6bf2002-10-31 23:05:22 +00003 %i = add int 10, 0
4 %u = add uint 20, 0
5 %shamt = add ubyte 0, 0
6 %shamt2 = add ubyte 1, 0
7 %shamt3 = add ubyte 2, 0
8 %shamt4 = add ubyte 3, 0
9 ; constantShiftAmount isRightShift isOperandUnsigned
10 ; 0 0 0
11 %temp01 = shl int %i, ubyte %shamt
12 ; 0 0 1
13 %temp02 = shl uint %u, ubyte %shamt2
14 ; 0 1 0
15 %temp03 = shr int %i, ubyte %shamt3
16 ; 0 1 1
17 %temp04 = shr uint %u, ubyte %shamt4
18 ; 1 0 0
19 %temp05 = shl int %i, ubyte 4
20 ; 1 0 1
21 %temp06 = shl uint %u, ubyte 5
22 ; 1 1 0
23 %temp07 = shr int %i, ubyte 6
24 ; 1 1 1
25 %temp08 = shr uint %u, ubyte 7
Misha Brukman297372c2002-12-13 05:44:21 +000026 ret int 0
Brian Gaeke8e0a6bf2002-10-31 23:05:22 +000027}