summaryrefslogtreecommitdiff
path: root/test/ExecutionEngine/test-shift.ll
blob: 22e467887977a69d7ef51053137fd3da11be249a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
; RUN: llvm-upgrade %s | llvm-as -f -o %t.bc
; RUN: lli %t.bc > /dev/null

; test shifts
int %main() {
    %shamt = add ubyte 0, 1

    ; Left shifts...
    %t1 = shl int 1, ubyte %shamt
    %t2 = shl int 1, ubyte 4

    %t1 = shl uint 1, ubyte %shamt
    %t2 = shl uint 1, ubyte 5

    ;%t1 = shl long 1, ubyte %shamt
    %t2 = shl long 1, ubyte 4

    ;%t1 = shl ulong 1, ubyte %shamt
    %t2 = shl ulong 1, ubyte 5

    ; Right shifts...
    %tr1 = shr int 1, ubyte %shamt
    %tr2 = shr int 1, ubyte 4

    %tr1 = shr uint 1, ubyte %shamt
    %tr2 = shr uint 1, ubyte 5

    ;%tr1 = shr long 1, ubyte %shamt
    %tr1 = shr long 1, ubyte 4
    %tr2 = shr long 1, ubyte %shamt
    %tr3 = shl long 1, ubyte 4
    %tr4 = shl long 1, ubyte %shamt

    ;%t1 = shr ulong 1, ubyte %shamt
    %tr1 = shr ulong 1, ubyte 5
    %tr2 = shr ulong 1, ubyte %shamt
    %tr3 = shl ulong 1, ubyte 5
    %tr4 = shl ulong 1, ubyte %shamt
    ret int 0
}