1 ; RUN: llc -mtriple=thumbv6m-apple-macho %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-T1
2 ; RUN: llc -mtriple=thumbv7m-apple-macho %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-T2
4 define i32 @test_add_i3(i1 %tst, i32 %a, i32 %b) {
5 ; CHECK-LABEL: test_add_i3:
6 ; CHECK: adds r0, {{r[0-9]+}}, #2
9 %int = select i1 %tst, i32 %tmp, i32 %tmp1
11 ; Call to force %int into a register that isn't r0 so using the i3 form is a
13 call void @foo(i32 %int)
18 define i32 @test_add_i8(i32 %a, i32 %b, i1 %tst) {
19 ; CHECK-LABEL: test_add_i8:
20 ; CHECK-T1: adds r0, #12
21 ; CHECK-T2: add.w r0, {{r[0-9]+}}, #12
23 %tmp = and i32 %a, -256
24 %tmp1 = and i32 %b, -512
25 %int = select i1 %tst, i32 %tmp, i32 %tmp1
26 %res = or i32 %int, 12
30 define i32 @test_add_i12(i32 %a, i32 %b, i1 %tst) {
31 ; CHECK-LABEL: test_add_i12:
32 ; CHECK-T2: addw r0, {{r[0-9]+}}, #854
34 %tmp = and i32 %a, -4096
35 %tmp1 = and i32 %b, -8192
36 %int = select i1 %tst, i32 %tmp, i32 %tmp1
37 %res = or i32 %int, 854
41 declare void @foo(i32)