1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -run-pass=arm-pseudo -verify-machineinstrs %s -o - | FileCheck %s
4 target triple = "armv7---gnueabi"
6 define i32 @test1(i32 %x) {
10 define i32 @test2(i32 %x) {
14 define i32 @test3(i32 %x) {
18 define i32 @test4(i32 %x) {
23 define i32 @test5(i32 %x) {
31 tracksRegLiveness: true
33 - { reg: '$r0', virtual-reg: '' }
38 ; CHECK-LABEL: name: test1
41 ; CHECK-NEXT: $r1 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
42 ; CHECK-NEXT: CMPri killed $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
43 ; CHECK-NEXT: $r1 = MOVi16 500, 0 /* CC::eq */, killed $cpsr, implicit killed $r1
44 ; CHECK-NEXT: $r0 = MOVr killed $r1, 14 /* CC::al */, $noreg, $noreg
45 ; CHECK-NEXT: BX_RET 14 /* CC::al */, $noreg, implicit $r0
46 $r1 = MOVi 2, 14, $noreg, $noreg
47 CMPri killed $r0, 0, 14, $noreg, implicit-def $cpsr
48 $r1 = MOVCCi16 killed $r1, 500, 0, killed $cpsr
49 $r0 = MOVr killed $r1, 14, $noreg, $noreg
50 BX_RET 14, $noreg, implicit $r0
56 tracksRegLiveness: true
58 - { reg: '$r0', virtual-reg: '' }
63 ; CHECK-LABEL: name: test2
66 ; CHECK-NEXT: $r1 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
67 ; CHECK-NEXT: CMPri killed $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
68 ; CHECK-NEXT: $r1 = MOVi16 2068, 0 /* CC::eq */, $cpsr, implicit killed $r1
69 ; CHECK-NEXT: $r1 = MOVTi16 $r1, 7637, 0 /* CC::eq */, $cpsr
70 ; CHECK-NEXT: $r0 = MOVr killed $r1, 14 /* CC::al */, $noreg, $noreg
71 ; CHECK-NEXT: BX_RET 14 /* CC::al */, $noreg, implicit $r0
72 $r1 = MOVi 2, 14, $noreg, $noreg
73 CMPri killed $r0, 0, 14, $noreg, implicit-def $cpsr
74 $r1 = MOVCCi32imm killed $r1, 500500500, 0, killed $cpsr
75 $r0 = MOVr killed $r1, 14, $noreg, $noreg
76 BX_RET 14, $noreg, implicit $r0
82 tracksRegLiveness: true
84 - { reg: '$r0', virtual-reg: '' }
85 - { reg: '$r1', virtual-reg: '' }
90 ; CHECK-LABEL: name: test3
91 ; CHECK: liveins: $r0, $r1
93 ; CHECK-NEXT: CMPri $r1, 500, 14 /* CC::al */, $noreg, implicit-def $cpsr
94 ; CHECK-NEXT: $r0 = MOVr killed $r1, 12 /* CC::gt */, killed $cpsr, $noreg, implicit killed $r0
95 ; CHECK-NEXT: BX_RET 14 /* CC::al */, $noreg, implicit $r0
96 CMPri $r1, 500, 14, $noreg, implicit-def $cpsr
97 $r0 = MOVCCr killed $r0, killed $r1, 12, killed $cpsr
98 BX_RET 14, $noreg, implicit $r0
104 tracksRegLiveness: true
106 - { reg: '$r0', virtual-reg: '' }
107 - { reg: '$r0_r1', virtual-reg: '' }
112 ; CHECK-LABEL: name: test4
113 ; CHECK: liveins: $r0, $r0_r1
115 ; CHECK-NEXT: $r0 = MOVi16 51712, 14 /* CC::al */, $noreg, implicit-def $r0_r1
116 ; CHECK-NEXT: $r0 = MOVTi16 $r0, 15258, 14 /* CC::al */, $noreg, implicit-def $r0_r1
117 ; CHECK-NEXT: BX_RET 14 /* CC::al */, $noreg, implicit $r0
118 $r0 = MOVi32imm 1000000000, implicit-def $r0_r1
119 BX_RET 14, $noreg, implicit $r0
125 tracksRegLiveness: true
127 - { reg: '$r0', virtual-reg: '' }
128 - { reg: '$r0_r1', virtual-reg: '' }
133 ; CHECK-LABEL: name: test5
134 ; CHECK: liveins: $r0, $r0_r1
136 ; CHECK-NEXT: $r0 = MOVi16_ga_pcrel target-flags(arm-lo16) @var, 0, implicit-def $r0_r1
137 ; CHECK-NEXT: $r0 = MOVTi16_ga_pcrel $r0, target-flags(arm-hi16) @var, 0, implicit-def $r0_r1
138 ; CHECK-NEXT: $r0 = PICLDR $r0, 0, 14 /* CC::al */, $noreg, implicit-def $r0_r1
139 ; CHECK-NEXT: BX_RET 14 /* CC::al */, $noreg, implicit $r0
140 $r0 = MOV_ga_pcrel_ldr @var, implicit-def $r0_r1
141 BX_RET 14, $noreg, implicit $r0