1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM 2 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM 3 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB 4 ; rdar://10412592 5 6 ; Note: The Thumb code is being generated by the target-independent selector. 7 8 define void @t1() nounwind { 9 entry: 10 ; ARM: t1 11 ; THUMB: t1 12 ; ARM: mvn r0, #0 13 ; THUMB: movw r0, #65535 14 ; THUMB: movt r0, #65535 15 call void @foo(i32 -1) 16 ret void 17 } 18 19 declare void @foo(i32) 20 21 define void @t2() nounwind { 22 entry: 23 ; ARM: t2 24 ; THUMB: t2 25 ; ARM: mvn r0, #233 26 ; THUMB: movw r0, #65302 27 ; THUMB: movt r0, #65535 28 call void @foo(i32 -234) 29 ret void 30 } 31 32 define void @t3() nounwind { 33 entry: 34 ; ARM: t3 35 ; THUMB: t3 36 ; ARM: mvn r0, #256 37 ; THUMB: movw r0, #65279 38 ; THUMB: movt r0, #65535 39 call void @foo(i32 -257) 40 ret void 41 } 42 43 ; Load from constant pool 44 define void @t4() nounwind { 45 entry: 46 ; ARM: t4 47 ; THUMB: t4 48 ; ARM: ldr r0 49 ; THUMB: movw r0, #65278 50 ; THUMB: movt r0, #65535 51 call void @foo(i32 -258) 52 ret void 53 } 54 55 define void @t5() nounwind { 56 entry: 57 ; ARM: t5 58 ; THUMB: t5 59 ; ARM: mvn r0, #65280 60 ; THUMB: movs r0, #255 61 ; THUMB: movt r0, #65535 62 call void @foo(i32 -65281) 63 ret void 64 } 65 66 define void @t6() nounwind { 67 entry: 68 ; ARM: t6 69 ; THUMB: t6 70 ; ARM: mvn r0, #978944 71 ; THUMB: movw r0, #4095 72 ; THUMB: movt r0, #65521 73 call void @foo(i32 -978945) 74 ret void 75 } 76 77 define void @t7() nounwind { 78 entry: 79 ; ARM: t7 80 ; THUMB: t7 81 ; ARM: mvn r0, #267386880 82 ; THUMB: movw r0, #65535 83 ; THUMB: movt r0, #61455 84 call void @foo(i32 -267386881) 85 ret void 86 } 87 88 define void @t8() nounwind { 89 entry: 90 ; ARM: t8 91 ; THUMB: t8 92 ; ARM: mvn r0, #65280 93 ; THUMB: movs r0, #255 94 ; THUMB: movt r0, #65535 95 call void @foo(i32 -65281) 96 ret void 97 } 98 99 define void @t9() nounwind { 100 entry: 101 ; ARM: t9 102 ; THUMB: t9 103 ; ARM: mvn r0, #2130706432 104 ; THUMB: movw r0, #65535 105 ; THUMB: movt r0, #33023 106 call void @foo(i32 -2130706433) 107 ret void 108 } 109