1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv6-eabi %s -o - | FileCheck %s
4 define void @test1(i32 %x, void ()* %f) {
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: .save {r7, lr}
8 ; CHECK-NEXT: push {r7, lr}
9 ; CHECK-NEXT: lsls r0, r0, #2
10 ; CHECK-NEXT: cmp r0, #68
11 ; CHECK-NEXT: beq .LBB0_2
12 ; CHECK-NEXT: @ %bb.1: @ %if.then
14 ; CHECK-NEXT: .LBB0_2: @ %if.end
15 ; CHECK-NEXT: pop {r7, pc}
17 %a = and i32 %x, 1073741823
18 %cmp = icmp eq i32 %a, 17
19 br i1 %cmp, label %if.end, label %if.then
29 define void @test2(i32 %x, void ()* %f) {
31 ; CHECK: @ %bb.0: @ %entry
32 ; CHECK-NEXT: .save {r7, lr}
33 ; CHECK-NEXT: push {r7, lr}
34 ; CHECK-NEXT: lsls r0, r0, #8
35 ; CHECK-NEXT: bhi .LBB1_2
36 ; CHECK-NEXT: @ %bb.1: @ %if.then
38 ; CHECK-NEXT: .LBB1_2: @ %if.end
39 ; CHECK-NEXT: pop {r7, pc}
42 %cmp = icmp ugt i32 %a, 2147483648
43 br i1 %cmp, label %if.end, label %if.then
53 define void @test3(i32 %x, void ()* %f) {
55 ; CHECK: @ %bb.0: @ %entry
56 ; CHECK-NEXT: .save {r7, lr}
57 ; CHECK-NEXT: push {r7, lr}
58 ; CHECK-NEXT: lsls r0, r0, #3
59 ; CHECK-NEXT: bhi .LBB2_2
60 ; CHECK-NEXT: @ %bb.1: @ %if.then
62 ; CHECK-NEXT: .LBB2_2: @ %if.end
63 ; CHECK-NEXT: pop {r7, pc}
65 %a = and i32 %x, 1073741823
66 %cmp = icmp ugt i32 %a, 536870912
67 br i1 %cmp, label %if.end, label %if.then
77 define void @test4(i32 %x, void ()* %f) {
79 ; CHECK: @ %bb.0: @ %entry
80 ; CHECK-NEXT: .save {r7, lr}
81 ; CHECK-NEXT: push {r7, lr}
82 ; CHECK-NEXT: uxtb r0, r0
83 ; CHECK-NEXT: cmp r0, #17
84 ; CHECK-NEXT: beq .LBB3_2
85 ; CHECK-NEXT: @ %bb.1: @ %if.then
87 ; CHECK-NEXT: .LBB3_2: @ %if.end
88 ; CHECK-NEXT: pop {r7, pc}
91 %cmp = icmp eq i32 %a, 17
92 br i1 %cmp, label %if.end, label %if.then
102 define void @test5(i32 %x, void ()* %f) {
103 ; CHECK-LABEL: test5:
104 ; CHECK: @ %bb.0: @ %entry
105 ; CHECK-NEXT: .save {r7, lr}
106 ; CHECK-NEXT: push {r7, lr}
107 ; CHECK-NEXT: uxth r0, r0
108 ; CHECK-NEXT: cmp r0, #17
109 ; CHECK-NEXT: beq .LBB4_2
110 ; CHECK-NEXT: @ %bb.1: @ %if.then
112 ; CHECK-NEXT: .LBB4_2: @ %if.end
113 ; CHECK-NEXT: pop {r7, pc}
115 %a = and i32 %x, 65535
116 %cmp = icmp eq i32 %a, 17
117 br i1 %cmp, label %if.end, label %if.then
127 define void @test6(i32 %x, void ()* %f) {
128 ; CHECK-LABEL: test6:
129 ; CHECK: @ %bb.0: @ %entry
130 ; CHECK-NEXT: .save {r7, lr}
131 ; CHECK-NEXT: push {r7, lr}
132 ; CHECK-NEXT: movs r2, #32
133 ; CHECK-NEXT: ands r2, r0
134 ; CHECK-NEXT: cmp r2, #17
135 ; CHECK-NEXT: beq .LBB5_2
136 ; CHECK-NEXT: @ %bb.1: @ %if.then
138 ; CHECK-NEXT: .LBB5_2: @ %if.end
139 ; CHECK-NEXT: pop {r7, pc}
142 %cmp = icmp eq i32 %a, 17
143 br i1 %cmp, label %if.end, label %if.then
153 define void @test7(i32 %x, void ()* %f) {
154 ; CHECK-LABEL: test7:
155 ; CHECK: @ %bb.0: @ %entry
156 ; CHECK-NEXT: .save {r7, lr}
157 ; CHECK-NEXT: push {r7, lr}
158 ; CHECK-NEXT: ldr r2, .LCPI6_0
159 ; CHECK-NEXT: ands r2, r0
160 ; CHECK-NEXT: cmp r2, #17
161 ; CHECK-NEXT: beq .LBB6_2
162 ; CHECK-NEXT: @ %bb.1: @ %if.then
164 ; CHECK-NEXT: .LBB6_2: @ %if.end
165 ; CHECK-NEXT: pop {r7, pc}
166 ; CHECK-NEXT: .p2align 2
167 ; CHECK-NEXT: @ %bb.3:
168 ; CHECK-NEXT: .LCPI6_0:
169 ; CHECK-NEXT: .long 1023 @ 0x3ff
171 %a = and i32 %x, 1023
172 %cmp = icmp eq i32 %a, 17
173 br i1 %cmp, label %if.end, label %if.then
183 define void @test8(i32 %x, void ()* %f) {
184 ; CHECK-LABEL: test8:
185 ; CHECK: @ %bb.0: @ %entry
186 ; CHECK-NEXT: .save {r7, lr}
187 ; CHECK-NEXT: push {r7, lr}
188 ; CHECK-NEXT: movs r2, #129
189 ; CHECK-NEXT: lsls r2, r2, #23
190 ; CHECK-NEXT: lsls r0, r0, #22
191 ; CHECK-NEXT: cmp r0, r2
192 ; CHECK-NEXT: beq .LBB7_2
193 ; CHECK-NEXT: @ %bb.1: @ %if.then
195 ; CHECK-NEXT: .LBB7_2: @ %if.end
196 ; CHECK-NEXT: pop {r7, pc}
198 %a = and i32 %x, 1023
199 %cmp = icmp eq i32 %a, 258
200 br i1 %cmp, label %if.end, label %if.then