llvm.org GIT mirror llvm / 7ed2299
[ARM] Fixup tests to take into account mov translation. NFC. Alter instances in the test-suite that use immediates that can be represented in the immediate field of a MOV. The reason for doing this is that when the LDR rt,=imm transformation to MOV rt, imm the existing tests do not need to be modified. Required by the patch that fixes PR25722. Patch by Peter Smith. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269353 91177308-0d34-0410-b5e6-96231b3b80d8 Renato Golin 4 years ago
6 changed file(s) with 56 addition(s) and 56 deletion(s). Raw diff Collapse all Expand all
88 ; CHECK: 0: 00 00 9f e5 ldr r0, [pc]
99 ; CHECK: 4: 0e f0 a0 e1 mov pc, lr
1010 ; Make sure the constant pool entry comes after the return
11 ; CHECK: 8: 01 00 00 00
11 ; CHECK: 8: 78 56 34 12
1212 define i32 @foo() nounwind {
1313 entry:
14 %0 = tail call i32 asm sideeffect "ldr $0,=1", "=r"() nounwind
14 %0 = tail call i32 asm sideeffect "ldr $0,=0x12345678", "=r"() nounwind
1515 ret i32 %0
1616 }
1414 .section __TEXT,b,regular,pure_instructions
1515 @ CHECK-LABEL: f3:
1616 f3:
17 ldr r0, =0x10001
17 ldr r0, =0x10002
1818 @ CHECK: ldr r0, Ltmp0
1919
2020 @ loading multiple constants
2121 .section __TEXT,c,regular,pure_instructions
2222 @ CHECK-LABEL: f4:
2323 f4:
24 ldr r0, =0x10002
24 ldr r0, =0x10003
2525 @ CHECK: ldr r0, Ltmp1
2626 adds r0, r0, #1
2727 adds r0, r0, #1
2828 adds r0, r0, #1
2929 adds r0, r0, #1
30 ldr r0, =0x10003
30 ldr r0, =0x10004
3131 @ CHECK: ldr r0, Ltmp2
3232 adds r0, r0, #1
3333 adds r0, r0, #1
3636 .section __TEXT,d,regular,pure_instructions
3737 @ CHECK-LABEL: f5:
3838 f5:
39 ldr r0, =0x10004
39 ldr r0, =0x10005
4040 @ CHECK: ldr r0, Ltmp3
4141 adds r0, r0, #1
4242 adds r0, r0, #1
4545 adds r0, r0, #1
4646 adds r0, r0, #1
4747 adds r0, r0, #1
48 ldr r0, =0x10004
48 ldr r0, =0x10005
4949 @ CHECK: ldr r0, Ltmp4
5050 adds r0, r0, #1
5151 adds r0, r0, #1
116116 f13:
117117 adds r0, r0, #1
118118 adds r0, r0, #1
119 ldr r0, =0x101
119 ldr r0, =0x10008
120120 @ CHECK: ldr r0, Ltmp10
121121 adds r0, r0, #1
122122 adds r0, r0, #1
130130
131131 @ usage in macro
132132 .macro useit_in_a_macro
133 ldr r0, =0x10008
133 ldr r0, =0x10009
134134 ldr r0, =baz
135135 .endm
136136 .section __TEXT,k,regular,pure_instructions
144144 .section __TEXT,l,regular,pure_instructions
145145 @ CHECK-LABEL: f15:
146146 f15:
147 ldr r0, =0x10001+8
147 ldr r0, =0x10001+9
148148 @ CHECK: ldr r0, Ltmp14
149149 adds r0, r0, #1
150150 ldr r0, =bar+4
158158 @ CHECK: .data_region
159159 @ CHECK: .p2align 2
160160 @ CHECK-LABEL: Ltmp0:
161 @ CHECK: .long 65537
161 @ CHECK: .long 65538
162162 @ CHECK: .end_data_region
163163
164164 @ CHECK: .section __TEXT,c,regular,pure_instructions
165165 @ CHECK: .data_region
166166 @ CHECK: .p2align 2
167167 @ CHECK-LABEL: Ltmp1:
168 @ CHECK: .long 65538
168 @ CHECK: .long 65539
169169 @ CHECK: .p2align 2
170170 @ CHECK-LABEL: Ltmp2:
171 @ CHECK: .long 65539
171 @ CHECK: .long 65540
172172 @ CHECK: .end_data_region
173173
174174 @ CHECK: .section __TEXT,d,regular,pure_instructions
175175 @ CHECK: .data_region
176176 @ CHECK: .p2align 2
177177 @ CHECK-LABEL: Ltmp3:
178 @ CHECK: .long 65540
178 @ CHECK: .long 65541
179179 @ CHECK: .p2align 2
180180 @ CHECK-LABEL: Ltmp4:
181 @ CHECK: .long 65540
181 @ CHECK: .long 65541
182182 @ CHECK: .end_data_region
183183
184184 @ CHECK: .section __TEXT,e,regular,pure_instructions
219219 @ CHECK: .data_region
220220 @ CHECK: .p2align 2
221221 @ CHECK-LABEL: Ltmp10:
222 @ CHECK: .long 257
222 @ CHECK: .long 65544
223223 @ CHECK: .p2align 2
224224 @ CHECK-LABEL: Ltmp11:
225225 @ CHECK: .long bar
229229 @ CHECK: .data_region
230230 @ CHECK: .p2align 2
231231 @ CHECK-LABEL: Ltmp12:
232 @ CHECK: .long 65544
232 @ CHECK: .long 65545
233233 @ CHECK: .p2align 2
234234 @ CHECK-LABEL: Ltmp13:
235235 @ CHECK: .long baz
239239 @ CHECK: .data_region
240240 @ CHECK: .p2align 2
241241 @ CHECK-LABEL: Ltmp14:
242 @ CHECK: .long 65545
242 @ CHECK: .long 65546
243243 @ CHECK: .p2align 2
244244 @ CHECK-LABEL: Ltmp15:
245245 @ CHECK: .long bar+4
99
1010 .text
1111 foo:
12 ldr r0, =0x101
12 ldr r0, =0x12345678
1313 .space 8000
1414 @ CHECK: error: out of range pc-relative fixup value
15 @ CHECK: ldr r0, =0x101
15 @ CHECK: ldr r0, =0x12345678
1616 @ CHECK: ^
1414 .section b,"ax",%progbits
1515 @ CHECK-LABEL: f3:
1616 f3:
17 ldr r0, =0x10001
17 ldr r0, =0x10002
1818 @ CHECK: ldr r0, .Ltmp[[TMP0:[0-9]+]]
1919
2020 @ loading multiple constants
2121 .section c,"ax",%progbits
2222 @ CHECK-LABEL: f4:
2323 f4:
24 ldr r0, =0x10002
24 ldr r0, =0x10003
2525 @ CHECK: ldr r0, .Ltmp[[TMP1:[0-9]+]]
2626 adds r0, r0, #1
2727 adds r0, r0, #1
2828 adds r0, r0, #1
2929 adds r0, r0, #1
30 ldr r0, =0x10003
30 ldr r0, =0x10004
3131 @ CHECK: ldr r0, .Ltmp[[TMP2:[0-9]+]]
3232 adds r0, r0, #1
3333 adds r0, r0, #1
3636 .section d,"ax",%progbits
3737 @ CHECK-LABEL: f5:
3838 f5:
39 ldr r0, =0x10004
39 ldr r0, =0x10005
4040 @ CHECK: ldr r0, .Ltmp[[TMP3:[0-9]+]]
4141 adds r0, r0, #1
4242 adds r0, r0, #1
4545 adds r0, r0, #1
4646 adds r0, r0, #1
4747 adds r0, r0, #1
48 ldr r0, =0x10004
48 ldr r0, =0x10005
4949 @ CHECK: ldr r0, .Ltmp[[TMP4:[0-9]+]]
5050 adds r0, r0, #1
5151 adds r0, r0, #1
116116 f13:
117117 adds r0, r0, #1
118118 adds r0, r0, #1
119 ldr r0, =0x101
119 ldr r0, =0x10008
120120 @ CHECK: ldr r0, .Ltmp[[TMP10:[0-9]+]]
121121 adds r0, r0, #1
122122 adds r0, r0, #1
130130
131131 @ usage in macro
132132 .macro useit_in_a_macro
133 ldr r0, =0x10008
133 ldr r0, =0x10009
134134 ldr r0, =baz
135135 .endm
136136 .section k,"ax",%progbits
144144 .section l, "ax", %progbits
145145 @ CHECK-LABEL: f15:
146146 f15:
147 ldr r0, =0x10001+8
147 ldr r0, =0x10001+9
148148 @ CHECK: ldr r0, .Ltmp[[TMP14:[0-9]+]]
149149 adds r0, r0, #1
150150 ldr r0, =bar+4
157157 @ CHECK: .section b,"ax",%progbits
158158 @ CHECK: .p2align 2
159159 @ CHECK: .Ltmp[[TMP0]]
160 @ CHECK: .long 65537
160 @ CHECK: .long 65538
161161
162162 @ CHECK: .section c,"ax",%progbits
163163 @ CHECK: .p2align 2
164164 @ CHECK: .Ltmp[[TMP1]]
165 @ CHECK: .long 65538
165 @ CHECK: .long 65539
166166 @ CHECK: .Ltmp[[TMP2]]
167 @ CHECK: .long 65539
167 @ CHECK: .long 65540
168168
169169 @ CHECK: .section d,"ax",%progbits
170170 @ CHECK: .p2align 2
171171 @ CHECK: .Ltmp[[TMP3]]
172 @ CHECK: .long 65540
172 @ CHECK: .long 65541
173173 @ CHECK: .Ltmp[[TMP4]]
174 @ CHECK: .long 65540
174 @ CHECK: .long 65541
175175
176176 @ CHECK: .section e,"ax",%progbits
177177 @ CHECK: .p2align 2
201201 @ CHECK: .section j,"ax",%progbits
202202 @ CHECK: .p2align 2
203203 @ CHECK: .Ltmp[[TMP10]]
204 @ CHECK: .long 257
204 @ CHECK: .long 65544
205205 @ CHECK: .Ltmp[[TMP11]]
206206 @ CHECK: .long bar
207207
208208 @ CHECK: .section k,"ax",%progbits
209209 @ CHECK: .p2align 2
210210 @ CHECK: .Ltmp[[TMP12]]
211 @ CHECK: .long 65544
211 @ CHECK: .long 65545
212212 @ CHECK: .Ltmp[[TMP13]]
213213 @ CHECK: .long baz
214214
215215 @ CHECK: .section l,"ax",%progbits
216216 @ CHECK: .p2align 2
217217 @ CHECK: .Ltmp[[TMP14]]
218 @ CHECK: .long 65545
218 @ CHECK: .long 65546
219219 @ CHECK: .Ltmp[[TMP15]]
220220 @ CHECK: .long bar+4
1111 .section __TEXT,a,regular,pure_instructions
1212 @ CHECK-LABEL: f2:
1313 f2:
14 ldr r0, =0x10001
14 ldr r0, =0x10002
1515 @ CHECK: ldr r0, Ltmp0
1616 adds r0, r0, #1
1717 adds r0, r0, #1
2121 @ CHECK: .data_region
2222 @ CHECK: .p2align 2
2323 @ CHECK-LABEL: Ltmp0:
24 @ CHECK: .long 65537
24 @ CHECK: .long 65538
2525 @ CHECK: .end_data_region
2626
2727 @ CHECK-LABEL: f3:
3333 .section __TEXT,b,regular,pure_instructions
3434 @ CHECK-LABEL: f4:
3535 f4:
36 ldr r0, =0x10002
36 ldr r0, =0x10003
3737 @ CHECK: ldr r0, Ltmp1
3838 adds r0, r0, #1
3939 adds r0, r0, #1
4343 @ CHECK: .data_region
4444 @ CHECK: .p2align 2
4545 @ CHECK-LABEL: Ltmp1:
46 @ CHECK: .long 65538
46 @ CHECK: .long 65539
4747 @ CHECK: .end_data_region
4848
4949 @ CHECK-LABEL: f5:
5050 f5:
5151 adds r0, r0, #1
5252 adds r0, r0, #1
53 ldr r0, =0x10003
53 ldr r0, =0x10004
5454 @ CHECK: ldr r0, Ltmp2
5555 adds r0, r0, #1
5656 b f6
5959 @ CHECK: .data_region
6060 @ CHECK: .p2align 2
6161 @ CHECK-LABEL: Ltmp2:
62 @ CHECK: .long 65539
62 @ CHECK: .long 65540
6363 @ CHECK: .end_data_region
6464
6565 @ CHECK-LABEL: f6:
108108 f11:
109109 adds r0, r0, #1
110110 adds r0, r0, #1
111 ldr r0, =0x10004
111 ldr r0, =0x10005
112112 @ CHECK: ldr r0, Ltmp4
113113 b f12
114114 .ltorg
116116 @ CHECK: .data_region
117117 @ CHECK: .p2align 2
118118 @ CHECK-LABEL: Ltmp4:
119 @ CHECK: .long 65540
119 @ CHECK: .long 65541
120120 @ CHECK: .end_data_region
121121
122122 @ CHECK-LABEL: f12:
123123 f12:
124124 adds r0, r0, #1
125 ldr r0, =0x10005
125 ldr r0, =0x10006
126126 @ CHECK: ldr r0, Ltmp5
127127
128128 .section __TEXT,f,regular,pure_instructions
143143 @ CHECK: .data_region
144144 @ CHECK: .p2align 2
145145 @ CHECK-LABEL: Ltmp5:
146 @ CHECK: .long 65541
146 @ CHECK: .long 65542
147147 @ CHECK: .end_data_region
148148
149149 @ should not have a constant pool at end of section with empty constant pools
1111 .section a,"ax",%progbits
1212 @ CHECK-LABEL: f2:
1313 f2:
14 ldr r0, =0x10001
14 ldr r0, =0x10002
1515 @ CHECK: ldr r0, .Ltmp[[TMP0:[0-9+]]]
1616 adds r0, r0, #1
1717 adds r0, r0, #1
2020 @ constant pool
2121 @ CHECK: .p2align 2
2222 @ CHECK: .Ltmp[[TMP0]]
23 @ CHECK: .long 65537
23 @ CHECK: .long 65538
2424
2525 @ CHECK-LABEL: f3:
2626 f3:
3131 .section b,"ax",%progbits
3232 @ CHECK-LABEL: f4:
3333 f4:
34 ldr r0, =0x10002
34 ldr r0, =0x10003
3535 @ CHECK: ldr r0, .Ltmp[[TMP1:[0-9+]]]
3636 adds r0, r0, #1
3737 adds r0, r0, #1
4040 @ constant pool
4141 @ CHECK: .p2align 2
4242 @ CHECK: .Ltmp[[TMP1]]
43 @ CHECK: .long 65538
43 @ CHECK: .long 65539
4444
4545 @ CHECK-LABEL: f5:
4646 f5:
4747 adds r0, r0, #1
4848 adds r0, r0, #1
49 ldr r0, =0x10003
49 ldr r0, =0x10004
5050 @ CHECK: ldr r0, .Ltmp[[TMP2:[0-9+]]]
5151 adds r0, r0, #1
5252 b f6
5454 @ constant pool
5555 @ CHECK: .p2align 2
5656 @ CHECK: .Ltmp[[TMP2]]
57 @ CHECK: .long 65539
57 @ CHECK: .long 65540
5858
5959 @ CHECK-LABEL: f6:
6060 f6:
100100 f11:
101101 adds r0, r0, #1
102102 adds r0, r0, #1
103 ldr r0, =0x10004
103 ldr r0, =0x10005
104104 @ CHECK: ldr r0, .Ltmp[[TMP4:[0-9+]]]
105105 b f12
106106 .ltorg
107107 @ constant pool
108108 @ CHECK: .p2align 2
109109 @ CHECK: .Ltmp[[TMP4]]
110 @ CHECK: .long 65540
110 @ CHECK: .long 65541
111111 @ CHECK-LABEL: f12:
112112 f12:
113113 adds r0, r0, #1
114 ldr r0, =0x10005
114 ldr r0, =0x10006
115115 @ CHECK: ldr r0, .Ltmp[[TMP5:[0-9+]]]
116116
117117 .section f,"ax",%progbits
131131 @ constant pool
132132 @ CHECK: .p2align 2
133133 @ CHECK: .Ltmp[[TMP5]]
134 @ CHECK: .long 65541
134 @ CHECK: .long 65542
135135
136136 @ should not have a constant pool at end of section with empty constant pools
137137 @ CHECK-NOT: .section f,"ax",%progbits