llvm.org GIT mirror llvm / df1530a
Tests to make sure that ComputeMaskedBits discards bits for shifts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28766 91177308-0d34-0410-b5e6-96231b3b80d8 Jim Laskey 13 years ago
1 changed file(s) with 50 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | llc -fast
1
2 uint %test1(uint %tmp1) {
3 %tmp2 = or uint %tmp1, 2147483648
4 %tmp3 = shr uint %tmp2, ubyte 31
5 %tmp4 = and uint %tmp3, 2147483648
6 %tmp5 = seteq uint %tmp4, 0
7 br bool %tmp5, label %cond_true, label %cond_false
8
9 cond_true:
10 ret uint %tmp1
11
12 cond_false:
13
14 ret uint %tmp2
15 }
16
17
18 uint %test2(uint %tmp1) {
19 %tmp2 = or uint %tmp1, 2147483648
20 %tmp3 = cast uint %tmp2 to int
21 %tmp4 = shr int %tmp3, ubyte 31
22 %tmp5 = cast int %tmp4 to uint
23 %tmp6 = and uint %tmp5, 2147483648
24 %tmp7 = seteq uint %tmp6, 0
25 br bool %tmp7, label %cond_true, label %cond_false
26
27 cond_true:
28 ret uint %tmp1
29
30 cond_false:
31
32 ret uint %tmp2
33 }
34
35
36 uint %test3(uint %tmp1) {
37 %tmp2 = or uint %tmp1, 1
38 %tmp3 = shl uint %tmp2, ubyte 31
39 %tmp4 = and uint %tmp3, 1
40 %tmp5 = seteq uint %tmp4, 0
41 br bool %tmp5, label %cond_true, label %cond_false
42
43 cond_true:
44 ret uint %tmp1
45
46 cond_false:
47
48 ret uint %tmp2
49 }