1 ; RUN: llc -mtriple=arm64-apple-darwin < %s | FileCheck %s
3 @board = common global [400 x i8] zeroinitializer, align 1
4 @next_string = common global i32 0, align 4
5 @string_number = common global [400 x i32] zeroinitializer, align 4
7 ; Function Attrs: nounwind ssp
8 define void @new_position(i32 %pos) {
10 %idxprom = sext i32 %pos to i64
11 %arrayidx = getelementptr inbounds [400 x i8], [400 x i8]* @board, i64 0, i64 %idxprom
12 %tmp = load i8, i8* %arrayidx, align 1
13 %.off = add i8 %tmp, -1
14 %switch = icmp ult i8 %.off, 2
15 br i1 %switch, label %if.then, label %if.end
17 if.then: ; preds = %entry
18 %tmp1 = load i32, i32* @next_string, align 4
19 %arrayidx8 = getelementptr inbounds [400 x i32], [400 x i32]* @string_number, i64 0, i64 %idxprom
20 store i32 %tmp1, i32* %arrayidx8, align 4
23 if.end: ; preds = %if.then, %entry
25 ; CHECK-LABEL: new_position
30 define zeroext i1 @test8_0(i8 zeroext %x) align 2 {
33 %1 = icmp ult i8 %0, -20
34 br i1 %1, label %ret_true, label %ret_false
39 ; CHECK-LABEL: test8_0
44 define zeroext i1 @test8_1(i8 zeroext %x) align 2 {
47 %1 = icmp uge i8 %0, 90
48 br i1 %1, label %ret_true, label %ret_false
53 ; CHECK-LABEL: test8_1
58 define zeroext i1 @test8_2(i8 zeroext %x) align 2 {
61 %1 = icmp ne i8 %0, 179
62 br i1 %1, label %ret_true, label %ret_false
67 ; CHECK-LABEL: test8_2
72 define zeroext i1 @test8_3(i8 zeroext %x) align 2 {
75 %1 = icmp eq i8 %0, 154
76 br i1 %1, label %ret_true, label %ret_false
81 ; CHECK-LABEL: test8_3
86 define zeroext i1 @test8_4(i8 zeroext %x) align 2 {
89 %1 = icmp ne i8 %0, -40
90 br i1 %1, label %ret_true, label %ret_false
95 ; CHECK-LABEL: test8_4
100 define zeroext i1 @test8_5(i8 zeroext %x) align 2 {
103 %1 = icmp uge i8 %0, -105
104 br i1 %1, label %ret_true, label %ret_false
109 ; CHECK-LABEL: test8_5
114 define zeroext i1 @test8_6(i8 zeroext %x) align 2 {
117 %1 = icmp uge i8 %0, 155
118 br i1 %1, label %ret_true, label %ret_false
123 ; CHECK-LABEL: test8_6
128 define zeroext i1 @test8_7(i8 zeroext %x) align 2 {
131 %1 = icmp ult i8 %0, 124
132 br i1 %1, label %ret_true, label %ret_false
137 ; CHECK-LABEL: test8_7
144 define zeroext i1 @test8_8(i8 zeroext %x) align 2 {
147 %1 = icmp uge i8 %0, 1
148 br i1 %1, label %ret_true, label %ret_false
153 ; CHECK-LABEL: test8_8
158 define zeroext i1 @test16_0(i16 zeroext %x) align 2 {
160 %0 = add i16 %x, -46989
161 %1 = icmp ne i16 %0, -41903
162 br i1 %1, label %ret_true, label %ret_false
167 ; CHECK-LABEL: test16_0
172 define zeroext i1 @test16_2(i16 zeroext %x) align 2 {
174 %0 = add i16 %x, 16882
175 %1 = icmp ule i16 %0, -24837
176 br i1 %1, label %ret_true, label %ret_false
181 ; CHECK-LABEL: test16_2
182 ; CHECK: mov [[CST:w[0-9]+]], #16882
183 ; CHECK: add [[ADD:w[0-9]+]], w0, [[CST]]
184 ; CHECK: cmp {{.*}}, [[ADD]], uxth
188 define zeroext i1 @test16_3(i16 zeroext %x) align 2 {
190 %0 = add i16 %x, 29283
191 %1 = icmp ne i16 %0, 16947
192 br i1 %1, label %ret_true, label %ret_false
197 ; CHECK-LABEL: test16_3
202 define zeroext i1 @test16_4(i16 zeroext %x) align 2 {
204 %0 = add i16 %x, -35551
205 %1 = icmp uge i16 %0, 15677
206 br i1 %1, label %ret_true, label %ret_false
211 ; CHECK-LABEL: test16_4
212 ; CHECK: mov [[CST:w[0-9]+]], #29985
213 ; CHECK: add [[ADD:w[0-9]+]], w0, [[CST]]
214 ; CHECK: cmp {{.*}}, [[ADD]], uxth
218 define zeroext i1 @test16_5(i16 zeroext %x) align 2 {
220 %0 = add i16 %x, -25214
221 %1 = icmp ne i16 %0, -1932
222 br i1 %1, label %ret_true, label %ret_false
227 ; CHECK-LABEL: test16_5
232 define zeroext i1 @test16_6(i16 zeroext %x) align 2 {
234 %0 = add i16 %x, -32194
235 %1 = icmp uge i16 %0, -41215
236 br i1 %1, label %ret_true, label %ret_false
241 ; CHECK-LABEL: test16_6
246 define zeroext i1 @test16_7(i16 zeroext %x) align 2 {
248 %0 = add i16 %x, 9272
249 %1 = icmp uge i16 %0, -42916
250 br i1 %1, label %ret_true, label %ret_false
255 ; CHECK-LABEL: test16_7
256 ; CHECK: mov [[CST:w[0-9]+]], #9272
257 ; CHECK: add [[ADD:w[0-9]+]], w0, [[CST]]
258 ; CHECK: cmp {{.*}}, [[ADD]], uxth
262 define zeroext i1 @test16_8(i16 zeroext %x) align 2 {
264 %0 = add i16 %x, -63749
265 %1 = icmp ne i16 %0, 6706
266 br i1 %1, label %ret_true, label %ret_false
271 ; CHECK-LABEL: test16_8