1 ; RUN: llc -fast-isel-sink-local-values < %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 -fast-isel-sink-local-values < %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 -fast-isel-sink-local-values < %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 -fast-isel-sink-local-values < %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 {
16 ; THUMB: moveq r0, #20
17 %0 = select i1 %c, i32 10, i32 20
21 define i32 @t2(i1 %c, i32 %a) nounwind readnone {
25 ; ARM: moveq r{{[1-9]}}, #20
26 ; ARM: mov r0, r{{[1-9]}}
30 ; THUMB: moveq r{{[1-9]}}, #20
31 ; THUMB: mov r0, r{{[1-9]}}
32 %0 = select i1 %c, i32 %a, i32 20
36 define i32 @t3(i1 %c, i32 %a, i32 %b) nounwind readnone {
46 ; THUMB: add.w r0, r2, r1
47 %0 = select i1 %c, i32 %a, i32 %b
52 define i32 @t4(i1 %c) nounwind readnone {
63 %0 = select i1 %c, i32 -10, i32 -1
67 define i32 @t5(i1 %c, i32 %a) nounwind readnone {
71 ; ARM: mvneq r{{[1-9]}}, #1
72 ; ARM: mov r0, r{{[1-9]}}
76 ; THUMB: mvneq r{{[1-9]}}, #1
77 ; THUMB: mov r0, r{{[1-9]}}
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 {
87 ; ARM: mvneq r{{[1-9]}}, #978944
88 ; ARM: mov r0, r{{[1-9]}}
92 ; THUMB: mvneq r{{[1-9]}}, #978944
93 ; THUMB: mov r0, r{{[1-9]}}
94 %0 = select i1 %c, i32 %a, i32 -978945