1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
2 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
3 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
4 ; RUN: llc < %s -O0 -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=thumbv8-apple-ios | FileCheck %s --check-prefix=THUMB
6 define i32 @t1(i1 %c) nounwind readnone {
18 ; THUMB: moveq r0, #20
19 %0 = select i1 %c, i32 10, i32 20
23 define i32 @t2(i1 %c, i32 %a) nounwind readnone {
26 ; ARM: tst {{r[0-9]+}}, #1
27 ; ARM: moveq {{r[0-9]+}}, #20
29 ; THUMB: tst.w {{r[0-9]+}}, #1
31 ; THUMB: moveq {{r[0-9]+}}, #20
32 %0 = select i1 %c, i32 %a, i32 20
36 define i32 @t3(i1 %c, i32 %a, i32 %b) nounwind readnone {
46 ; THUMB: adds r0, r2, r1
47 %0 = select i1 %c, i32 %a, i32 %b
52 define i32 @t4(i1 %c) nounwind readnone {
65 %0 = select i1 %c, i32 -10, i32 -1
69 define i32 @t5(i1 %c, i32 %a) nounwind readnone {
72 ; ARM: tst {{r[0-9]+}}, #1
73 ; ARM: mvneq {{r[0-9]+}}, #1
75 ; THUMB: tst.w {{r[0-9]+}}, #1
77 ; THUMB: mvneq {{r[0-9]+}}, #1
78 %0 = select i1 %c, i32 %a, i32 -2
82 ; Check one large negative immediates.
83 define i32 @t6(i1 %c, i32 %a) nounwind readnone {
86 ; ARM: tst {{r[0-9]+}}, #1
87 ; ARM: mvneq {{r[0-9]+}}, #978944
89 ; THUMB: tst.w {{r[0-9]+}}, #1
91 ; THUMB: mvneq {{r[0-9]+}}, #978944
92 %0 = select i1 %c, i32 %a, i32 -978945