1 # RUN: llvm-mc -triple=armv7-apple-darwin -disassemble < %s | FileCheck %s
3 #------------------------------------------------------------------------------
5 #------------------------------------------------------------------------------
7 # CHECK: ldr r6, [r3, #63]
8 # CHECK: ldr r2, [r4, #4095]!
9 # CHECK: ldr r1, [r2], #30
10 # CHECK: ldr r3, [r1], #-30
18 #------------------------------------------------------------------------------
19 # FIXME: LDR (literal)
20 #------------------------------------------------------------------------------
21 # label operands currently assert the show-encoding asm comment helper due
22 # to the use of non-contiguous bit ranges for fixups in ARM. Once that's
23 # cleaned up, we can write useful assembly testcases for these sorts of
26 #------------------------------------------------------------------------------
28 #------------------------------------------------------------------------------
29 # CHECK: ldr r3, [r8, r1]
30 # CHECK: ldr r2, [r5, -r3]
31 # CHECK: ldr r1, [r5, r9]!
32 # CHECK: ldr r6, [r7, -r8]!
33 # CHECK: ldr r1, [r0, r2, lsr #3]!
34 # CHECK: ldr r5, [r9], r2
35 # CHECK: ldr r4, [r3], -r6
36 # CHECK: ldr r3, [r8, -r2, lsl #15
37 # CHECK: ldr r1, [r5], r3, asr #15
50 #------------------------------------------------------------------------------
52 #------------------------------------------------------------------------------
53 # CHECK: ldrb r3, [r8]
54 # CHECK: ldrb r1, [sp, #63]
55 # CHECK: ldrb r9, [r3, #4095]!
56 # CHECK: ldrb r8, [r1], #22
57 # CHECK: ldrb r2, [r7], #-19
66 #------------------------------------------------------------------------------
68 #------------------------------------------------------------------------------
69 # CHECK: ldrb r9, [r8, r5]
70 # CHECK: ldrb r1, [r5, -r1]
71 # CHECK: ldrb r3, [r5, r2]!
72 # CHECK: ldrb r6, [r9, -r3]!
73 # CHECK: ldrb r2, [r1], r4
74 # CHECK: ldrb r8, [r4], -r5
75 # CHECK: ldrb r7, [r12, -r1, lsl #15
76 # CHECK: ldrb r5, [r2], r9, asr #15
88 #------------------------------------------------------------------------------
90 #------------------------------------------------------------------------------
91 # FIXME: Optional offset operand.
92 # CHECK: ldrbt r3, [r1], #4
93 # CHECK: ldrbt r2, [r8], #-8
94 # CHECK: ldrbt r8, [r7], r6
95 # CHECK: ldrbt r1, [r2], -r6, lsl #12
104 #------------------------------------------------------------------------------
106 #------------------------------------------------------------------------------
107 # CHECK: ldrd r0, r1, [r5]
108 # CHECK: ldrd r8, r9, [r2, #15]
109 # CHECK: ldrd r2, r3, [r9, #32]!
110 # CHECK: ldrd r6, r7, [r1], #8
111 # CHECK: ldrd r2, r3, [r8], #0
112 # CHECK: ldrd r2, r3, [r8], #0
113 # CHECK: ldrd r2, r3, [r8], #-0
124 #------------------------------------------------------------------------------
125 # FIXME: LDRD (label)
126 #------------------------------------------------------------------------------
128 #------------------------------------------------------------------------------
130 #------------------------------------------------------------------------------
131 # CHECK: ldrd r4, r5, [r1, r3]
132 # CHECK: ldrd r4, r5, [r7, r2]!
133 # CHECK: ldrd r0, r1, [r8], r12
134 # CHECK: ldrd r0, r1, [r8], -r12
142 #------------------------------------------------------------------------------
144 #------------------------------------------------------------------------------
145 # CHECK: ldrh r3, [r4
146 # CHECK: ldrh r2, [r7, #4
147 # CHECK: ldrh r1, [r8, #64]!
148 # CHECK: ldrh r12, [sp], #4
156 #------------------------------------------------------------------------------
157 # FIXME: LDRH (label)
158 #------------------------------------------------------------------------------
161 #------------------------------------------------------------------------------
163 #------------------------------------------------------------------------------
164 # CHECK: ldrh r6, [r5, r4
165 # CHECK: ldrh r3, [r8, r11]!
166 # CHECK: ldrh r1, [r2, -r1]!
167 # CHECK: ldrh r9, [r7], r2
168 # CHECK: ldrh r4, [r3], -r2
177 #------------------------------------------------------------------------------
179 #------------------------------------------------------------------------------
180 # CHECK: ldrht r9, [r7], #128
181 # CHECK: ldrht r4, [r3], #-75
182 # CHECK: ldrht r9, [r7], r2
183 # CHECK: ldrht r4, [r3], -r2
191 #------------------------------------------------------------------------------
193 #------------------------------------------------------------------------------
194 # CHECK: ldrsb r3, [r4
195 # CHECK: ldrsb r2, [r7, #17
196 # CHECK: ldrsb r1, [r8, #255]!
197 # CHECK: ldrsb r12, [sp], #9
205 #------------------------------------------------------------------------------
206 # FIXME: LDRSB (label)
207 #------------------------------------------------------------------------------
210 #------------------------------------------------------------------------------
212 #------------------------------------------------------------------------------
213 # CHECK: ldrsb r6, [r5, r4
214 # CHECK: ldrsb r3, [r8, r11]!
215 # CHECK: ldrsb r1, [r2, -r1]!
216 # CHECK: ldrsb r9, [r7], r2
217 # CHECK: ldrsb r4, [r3], -r2
227 #------------------------------------------------------------------------------
229 #------------------------------------------------------------------------------
230 # CHECK: ldrsbt r5, [r6], #1
231 # CHECK: ldrsbt r3, [r8], #-12
232 # CHECK: ldrsbt r8, [r9], r5
233 # CHECK: ldrsbt r2, [r1], -r4
241 #------------------------------------------------------------------------------
243 #------------------------------------------------------------------------------
244 # CHECK: ldrsh r5, [r9
245 # CHECK: ldrsh r4, [r5, #7
246 # CHECK: ldrsh r3, [r6, #55]!
247 # CHECK: ldrsh r2, [r7], #-9
255 #------------------------------------------------------------------------------
256 # FIXME: LDRSH (label)
257 #------------------------------------------------------------------------------
260 #------------------------------------------------------------------------------
262 #------------------------------------------------------------------------------
263 # CHECK: ldrsh r3, [r1, r5
264 # CHECK: ldrsh r4, [r6, r1]!
265 # CHECK: ldrsh r5, [r3, -r6]!
266 # CHECK: ldrsh r6, [r9], r8
267 # CHECK: ldrsh r7, [r8], -r3
276 #------------------------------------------------------------------------------
278 #------------------------------------------------------------------------------
279 # CHECK: ldrsht r5, [r6], #1
280 # CHECK: ldrsht r3, [r8], #-12
281 # CHECK: ldrsht r8, [r9], r5
282 # CHECK: ldrsht r2, [r1], -r4
290 #------------------------------------------------------------------------------
292 #------------------------------------------------------------------------------
293 # CHECK: str r8, [r12
294 # CHECK: str r7, [r1, #12
295 # CHECK: str r3, [r5, #40]!
296 # CHECK: str r9, [sp], #4095
297 # CHECK: str r1, [r7], #-128
306 #------------------------------------------------------------------------------
307 # FIXME: STR (literal)
308 #------------------------------------------------------------------------------
310 #------------------------------------------------------------------------------
312 #------------------------------------------------------------------------------
313 # CHECK: str r9, [r6, r3
314 # CHECK: str r8, [r0, -r2
315 # CHECK: str r7, [r1, r6]!
316 # CHECK: str r6, [sp, -r1]!
317 # CHECK: str r5, [r3], r9
318 # CHECK: str r4, [r2], -r5
319 # CHECK: str r3, [r4, -r2, lsl #2
320 # CHECK: str r2, [r7], r3, asr #24
332 #------------------------------------------------------------------------------
334 #------------------------------------------------------------------------------
335 # CHECK: strb r9, [r2
336 # CHECK: strb r7, [r1, #3
337 # CHECK: strb r6, [r4, #405]!
338 # CHECK: strb r5, [r7], #72
339 # CHECK: strb r1, [sp], #-1
347 #------------------------------------------------------------------------------
348 # FIXME: STRB (literal)
349 #------------------------------------------------------------------------------
351 #------------------------------------------------------------------------------
353 #------------------------------------------------------------------------------
354 # CHECK: strb r1, [r2, r9
355 # CHECK: strb r2, [r3, -r8
356 # CHECK: strb r3, [r4, r7]!
357 # CHECK: strb r4, [r5, -r6]!
358 # CHECK: strb r5, [r6], r5
359 # CHECK: strb r6, [r2], -r4
360 # CHECK: strb r7, [r12, -r3, lsl #5
361 # CHECK: strb sp, [r7], r2, asr #12
373 #------------------------------------------------------------------------------
375 #------------------------------------------------------------------------------
376 # FIXME: Optional offset operand.
377 # CHECK: strbt r6, [r2], #12
378 # CHECK: strbt r5, [r6], #-13
379 # CHECK: strbt r4, [r9], r5
380 # CHECK: strbt r3, [r8], -r2, lsl #3
388 #------------------------------------------------------------------------------
390 #------------------------------------------------------------------------------
391 # CHECK: strd r0, r1, [r4]
392 # CHECK: strd r2, r3, [r6, #1]
393 # CHECK: strd r2, r3, [r7, #22]!
394 # CHECK: strd r4, r5, [r8], #7
395 # CHECK: strd r4, r5, [sp], #0
396 # CHECK: strd r6, r7, [lr], #0
397 # CHECK: strd r6, r7, [r9], #-0
408 #------------------------------------------------------------------------------
409 # FIXME: STRD (label)
410 #------------------------------------------------------------------------------
412 #------------------------------------------------------------------------------
414 #------------------------------------------------------------------------------
415 # CHECK: strd r8, r9, [r4, r1]
416 # CHECK: strd r6, r7, [r3, r9]!
417 # CHECK: strd r6, r7, [r5], r8
418 # CHECK: strd r4, r5, [r12], -r10
425 #------------------------------------------------------------------------------
427 #------------------------------------------------------------------------------
428 # CHECK: strh r3, [r4
429 # CHECK: strh r2, [r7, #4
430 # CHECK: strh r1, [r8, #64]!
431 # CHECK: strh r12, [sp], #4
439 #------------------------------------------------------------------------------
440 # FIXME: STRH (label)
441 #------------------------------------------------------------------------------
444 #------------------------------------------------------------------------------
446 #------------------------------------------------------------------------------
447 # CHECK: strh r6, [r5, r4
448 # CHECK: strh r3, [r8, r11]!
449 # CHECK: strh r1, [r2, -r1]!
450 # CHECK: strh r9, [r7], r2
451 # CHECK: strh r4, [r3], -r2
459 #------------------------------------------------------------------------------
461 #------------------------------------------------------------------------------
462 # CHECK: strht r2, [r5], #76
463 # CHECK: strht r8, [r1], #-25
464 # CHECK: strht r5, [r3], r4
465 # CHECK: strht r6, [r8], -r0