summaryrefslogtreecommitdiff
path: root/test/CodeGen/Generic/2006-06-13-ComputeMaskedBitsCrash.ll
blob: 4b69386d887019cdad494a8e3e5d9a1dfbfc2bab (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
41
42
43
44
45
46
47
48
49
50
; RUN: llvm-as < %s | llc -fast

uint %test1(uint %tmp1) {
  %tmp2 = or uint %tmp1, 2147483648
  %tmp3 = shr uint %tmp2, ubyte 31
  %tmp4 = and uint %tmp3, 2147483648
  %tmp5 = seteq uint %tmp4, 0
  br bool %tmp5, label %cond_true, label %cond_false
  
cond_true:
  ret uint %tmp1
  
cond_false:

  ret uint %tmp2
}


uint %test2(uint %tmp1) {
  %tmp2 = or uint %tmp1, 2147483648
  %tmp3 = cast uint %tmp2 to int
  %tmp4 = shr int %tmp3, ubyte 31
  %tmp5 = cast int %tmp4 to uint
  %tmp6 = and uint %tmp5, 2147483648
  %tmp7 = seteq uint %tmp6, 0
  br bool %tmp7, label %cond_true, label %cond_false
  
cond_true:
  ret uint %tmp1
  
cond_false:

  ret uint %tmp2
}


uint %test3(uint %tmp1) {
  %tmp2 = or uint %tmp1, 1
  %tmp3 = shl uint %tmp2, ubyte 31
  %tmp4 = and uint %tmp3, 1
  %tmp5 = seteq uint %tmp4, 0
  br bool %tmp5, label %cond_true, label %cond_false
  
cond_true:
  ret uint %tmp1
  
cond_false:

  ret uint %tmp2
}