• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1@ RUN: not llvm-mc -triple=armv7-apple-darwin < %s 2> %t
2@ RUN: FileCheck --check-prefix=CHECK-ERRORS --check-prefix=CHECK-ERRORS-V7 < %t %s
3@ RUN: not llvm-mc -triple=armv8 < %s 2> %t
4@ RUN: FileCheck --check-prefix=CHECK-ERRORS --check-prefix=CHECK-ERRORS-V8 < %t %s
5
6@ Check for various assembly diagnostic messages on invalid input.
7
8@ 's' bit on an instruction that can't accept it.
9        mlss r1, r2, r3, r4
10@ CHECK-ERRORS: error: instruction 'mls' can not set flags,
11@ CHECK-ERRORS: but 's' suffix specified
12
13
14        @ Out of range shift immediate values.
15        adc r1, r2, r3, lsl #invalid
16        adc r4, r5, r6, lsl #-1
17        adc r4, r5, r6, lsl #32
18        adc r4, r5, r6, lsr #-1
19        adc r4, r5, r6, lsr #33
20        adc r4, r5, r6, asr #-1
21        adc r4, r5, r6, asr #33
22        adc r4, r5, r6, ror #-1
23        adc r4, r5, r6, ror #32
24
25@ CHECK-ERRORS: error: invalid immediate shift value
26@ CHECK-ERRORS:         adc r1, r2, r3, lsl #invalid
27@ CHECK-ERRORS:                              ^
28@ CHECK-ERRORS: error: immediate shift value out of range
29@ CHECK-ERRORS:         adc r4, r5, r6, lsl #-1
30@ CHECK-ERRORS:                              ^
31@ CHECK-ERRORS: error: immediate shift value out of range
32@ CHECK-ERRORS:         adc r4, r5, r6, lsl #32
33@ CHECK-ERRORS:                              ^
34@ CHECK-ERRORS: error: immediate shift value out of range
35@ CHECK-ERRORS:         adc r4, r5, r6, lsr #-1
36@ CHECK-ERRORS:                              ^
37@ CHECK-ERRORS: error: immediate shift value out of range
38@ CHECK-ERRORS:         adc r4, r5, r6, lsr #33
39@ CHECK-ERRORS:                              ^
40@ CHECK-ERRORS: error: immediate shift value out of range
41@ CHECK-ERRORS:         adc r4, r5, r6, asr #-1
42@ CHECK-ERRORS:                              ^
43@ CHECK-ERRORS: error: immediate shift value out of range
44@ CHECK-ERRORS:         adc r4, r5, r6, asr #33
45@ CHECK-ERRORS:                              ^
46@ CHECK-ERRORS: error: immediate shift value out of range
47@ CHECK-ERRORS:         adc r4, r5, r6, ror #-1
48@ CHECK-ERRORS:                              ^
49@ CHECK-ERRORS: error: immediate shift value out of range
50@ CHECK-ERRORS:         adc r4, r5, r6, ror #32
51
52        @ Out of range shift immediate values for load/store.
53        str r1, [r2, r3, lsl #invalid]
54        ldr r4, [r5], r6, lsl #-1
55        pld r4, [r5, r6, lsl #32]
56        str r4, [r5], r6, lsr #-1
57        ldr r4, [r5, r6, lsr #33]
58        pld r4, [r5, r6, asr #-1]
59        str r4, [r5, r6, asr #33]
60        ldr r4, [r5, r6, ror #-1]
61        pld r4, [r5, r6, ror #32]
62        pld r4, [r5, r6, rrx #0]
63
64@ CHECK-ERRORS: error: shift amount must be an immediate
65@ CHECK-ERRORS:         str r1, [r2, r3, lsl #invalid]
66@ CHECK-ERRORS:                              ^
67@ CHECK-ERRORS: error: immediate shift value out of range
68@ CHECK-ERRORS:         ldr r4, [r5], r6, lsl #-1
69@ CHECK-ERRORS:                              ^
70@ CHECK-ERRORS: error: immediate shift value out of range
71@ CHECK-ERRORS:         pld r4, [r5, r6, lsl #32]
72@ CHECK-ERRORS:                              ^
73@ CHECK-ERRORS: error: immediate shift value out of range
74@ CHECK-ERRORS:         str r4, [r5], r6, lsr #-1
75@ CHECK-ERRORS:                              ^
76@ CHECK-ERRORS: error: immediate shift value out of range
77@ CHECK-ERRORS:         ldr r4, [r5, r6, lsr #33]
78@ CHECK-ERRORS:                              ^
79@ CHECK-ERRORS: error: immediate shift value out of range
80@ CHECK-ERRORS:         pld r4, [r5, r6, asr #-1]
81@ CHECK-ERRORS:                              ^
82@ CHECK-ERRORS: error: immediate shift value out of range
83@ CHECK-ERRORS:         str r4, [r5, r6, asr #33]
84@ CHECK-ERRORS:                              ^
85@ CHECK-ERRORS: error: immediate shift value out of range
86@ CHECK-ERRORS:         ldr r4, [r5, r6, ror #-1]
87@ CHECK-ERRORS:                              ^
88@ CHECK-ERRORS: error: immediate shift value out of range
89@ CHECK-ERRORS:         pld r4, [r5, r6, ror #32]
90@ CHECK-ERRORS: error: ']' expected
91@ CHECK-ERRORS:         pld r4, [r5, r6, rrx #0]
92
93        @ Out of range 16-bit immediate on BKPT
94        bkpt #65536
95
96@ CHECK-ERRORS: error: invalid operand for instruction
97
98        @ Out of range immediates for v8 HLT instruction.
99        hlt #65536
100        hlt #-1
101@CHECK-ERRORS: error: invalid operand for instruction
102@CHECK-ERRORS:         hlt #65536
103@CHECK-ERRORS:              ^
104@CHECK-ERRORS: error: invalid operand for instruction
105@CHECK-ERRORS:         hlt #-1
106@CHECK-ERRORS:              ^
107
108        @ Illegal condition code for v8 HLT instruction.
109        hlteq #2
110        hltlt #23
111@CHECK-ERRORS: error: instruction 'hlt' is not predicable, but condition code specified
112@CHECK-ERRORS:        hlteq #2
113@CHECK-ERRORS:        ^
114@CHECK-ERRORS: error: instruction 'hlt' is not predicable, but condition code specified
115@CHECK-ERRORS:        hltlt #23
116@CHECK-ERRORS:        ^
117
118        @ Out of range 4 and 3 bit immediates on CDP[2]
119
120        @ Out of range immediates for CDP/CDP2
121        cdp  p7, #2, c1, c1, c1, #8
122        cdp  p7, #1, c1, c1, c1, #8
123        cdp2  p7, #2, c1, c1, c1, #8
124        cdp2  p7, #1, c1, c1, c1, #8
125
126@ CHECK-ERRORS: error: invalid operand for instruction
127@ CHECK-ERRORS: error: invalid operand for instruction
128@ CHECK-ERRORS: error: invalid operand for instruction
129@ CHECK-ERRORS: error: invalid operand for instruction
130
131        @ Out of range immediates for DBG
132        dbg #-1
133        dbg #16
134
135@ CHECK-ERRORS: error: immediate operand must be in the range [0,15]
136@ CHECK-ERRORS: error: immediate operand must be in the range [0,15]
137@  Double-check that we're synced up with the right diagnostics.
138@ CHECK-ERRORS: dbg #16
139
140        @ Out of range immediate for MCR/MCR2/MCRR/MCRR2
141        mcr  p7, #8, r5, c1, c1, #4
142        mcr  p7, #2, r5, c1, c1, #8
143        mcr2  p7, #8, r5, c1, c1, #4
144        mcr2  p7, #1, r5, c1, c1, #8
145        mcrr  p7, #16, r5, r4, c1
146        mcrr2  p7, #16, r5, r4, c1
147@ CHECK-ERRORS: error: invalid operand for instruction
148@ CHECK-ERRORS: error: invalid operand for instruction
149@ CHECK-ERRORS: error: invalid operand for instruction
150@ CHECK-ERRORS: error: invalid operand for instruction
151@ CHECK-ERRORS: error: immediate operand must be in the range [0,15]
152@ CHECK-ERRORS-V7: error: immediate operand must be in the range [0,15]
153@ CHECK-ERRORS-V8: error: invalid operand for instruction
154
155        @ p10 and p11 are reserved for NEON
156        mcr p10, #2, r5, c1, c1, #4
157        mcrr p11, #8, r5, r4, c1
158@ CHECK-ERRORS: error: invalid operand for instruction
159@ CHECK-ERRORS: error: invalid operand for instruction
160
161        @ Out of range immediate for MOV
162        movw r9, 0x10000
163@ CHECK-ERRORS: error: invalid operand for instruction
164
165        @ Invalid 's' bit usage for MOVW
166        movs r6, #0xffff
167        movwseq r9, #0xffff
168@ CHECK-ERRORS: error: invalid operand for instruction
169@ CHECK-ERRORS: error: instruction 'movw' can not set flags, but 's' suffix specified
170
171        @ Out of range immediate for MOVT
172        movt r9, 0x10000
173@ CHECK-ERRORS: error: invalid operand for instruction
174
175        @ Out of range immediates for MRC/MRC2/MRRC/MRRC2
176        mrc  p14, #8, r1, c1, c2, #4
177        mrc  p14, #1, r1, c1, c2, #8
178        mrc2  p14, #8, r1, c1, c2, #4
179        mrc2  p14, #0, r1, c1, c2, #9
180        mrrc  p7, #16, r5, r4, c1
181        mrrc2  p7, #17, r5, r4, c1
182@ CHECK-ERRORS: error: invalid operand for instruction
183@ CHECK-ERRORS: error: invalid operand for instruction
184@ CHECK-ERRORS: error: invalid operand for instruction
185@ CHECK-ERRORS: error: invalid operand for instruction
186@ CHECK-ERRORS: error: immediate operand must be in the range [0,15]
187@ CHECK-ERRORS-V7: error: immediate operand must be in the range [0,15]
188@ CHECK-ERRORS-V8: error: invalid operand for instruction
189
190        @ Shifter operand validation for PKH instructions.
191        pkhbt r2, r2, r3, lsl #-1
192        pkhbt r2, r2, r3, lsl #32
193        pkhtb r2, r2, r3, asr #0
194        pkhtb r2, r2, r3, asr #33
195        pkhbt r2, r2, r3, asr #3
196        pkhtb r2, r2, r3, lsl #3
197
198@ CHECK-ERRORS: error: immediate value out of range
199@ CHECK-ERRORS:         pkhbt r2, r2, r3, lsl #-1
200@ CHECK-ERRORS:                                ^
201@ CHECK-ERRORS: error: immediate value out of range
202@ CHECK-ERRORS:         pkhbt r2, r2, r3, lsl #32
203@ CHECK-ERRORS:                                ^
204@ CHECK-ERRORS: error: immediate value out of range
205@ CHECK-ERRORS:         pkhtb r2, r2, r3, asr #0
206@ CHECK-ERRORS:                                ^
207@ CHECK-ERRORS: error: immediate value out of range
208@ CHECK-ERRORS:         pkhtb r2, r2, r3, asr #33
209@ CHECK-ERRORS:                                ^
210@ CHECK-ERRORS: error: lsl operand expected.
211@ CHECK-ERRORS:         pkhbt r2, r2, r3, asr #3
212@ CHECK-ERRORS:                           ^
213@ CHECK-ERRORS: error: asr operand expected.
214@ CHECK-ERRORS:         pkhtb r2, r2, r3, lsl #3
215@ CHECK-ERRORS:                           ^
216
217
218        @ bad values for SETEND
219        setendne be
220        setend me
221        setend 1
222
223@ CHECK-ERRORS: error: instruction 'setend' is not predicable, but condition code specified
224@ CHECK-ERRORS:         setendne be
225@ CHECK-ERRORS:         ^
226@ CHECK-ERRORS: error: 'be' or 'le' operand expected
227@ CHECK-ERRORS:         setend me
228@ CHECK-ERRORS:                  ^
229@ CHECK-ERRORS: error: 'be' or 'le' operand expected
230@ CHECK-ERRORS:         setend 1
231@ CHECK-ERRORS:                ^
232
233
234        @ Out of range immediates and bad shift types for SSAT
235	ssat	r8, #0, r10, lsl #8
236	ssat	r8, #33, r10, lsl #8
237	ssat	r8, #1, r10, lsl #-1
238	ssat	r8, #1, r10, lsl #32
239	ssat	r8, #1, r10, asr #0
240	ssat	r8, #1, r10, asr #33
241        ssat    r8, #1, r10, lsr #5
242        ssat    r8, #1, r10, lsl fred
243        ssat    r8, #1, r10, lsl #fred
244
245@ CHECK-ERRORS: error: invalid operand for instruction
246@ CHECK-ERRORS: 	ssat	r8, #0, r10, lsl #8
247@ CHECK-ERRORS: 	    	    ^
248@ CHECK-ERRORS: error: invalid operand for instruction
249@ CHECK-ERRORS: 	ssat	r8, #33, r10, lsl #8
250@ CHECK-ERRORS: 	    	    ^
251@ CHECK-ERRORS: error: 'lsr' shift amount must be in range [0,31]
252@ CHECK-ERRORS: 	ssat	r8, #1, r10, lsl #-1
253@ CHECK-ERRORS: 	    	                  ^
254@ CHECK-ERRORS: error: 'lsr' shift amount must be in range [0,31]
255@ CHECK-ERRORS: 	ssat	r8, #1, r10, lsl #32
256@ CHECK-ERRORS: 	    	                  ^
257@ CHECK-ERRORS: error: 'asr' shift amount must be in range [1,32]
258@ CHECK-ERRORS: 	ssat	r8, #1, r10, asr #0
259@ CHECK-ERRORS: 	    	                  ^
260@ CHECK-ERRORS: error: 'asr' shift amount must be in range [1,32]
261@ CHECK-ERRORS: 	ssat	r8, #1, r10, asr #33
262@ CHECK-ERRORS: 	    	                  ^
263@ CHECK-ERRORS: error: shift operator 'asr' or 'lsl' expected
264@ CHECK-ERRORS:         ssat    r8, #1, r10, lsr #5
265@ CHECK-ERRORS:                              ^
266@ CHECK-ERRORS: error: '#' expected
267@ CHECK-ERRORS:         ssat    r8, #1, r10, lsl fred
268@ CHECK-ERRORS:                                  ^
269@ CHECK-ERRORS: error: shift amount must be an immediate
270@ CHECK-ERRORS:         ssat    r8, #1, r10, lsl #fred
271@ CHECK-ERRORS:                                   ^
272
273        @ Out of range immediates for SSAT16
274	ssat16	r2, #0, r7
275	ssat16	r3, #17, r5
276
277@ CHECK-ERRORS: error: invalid operand for instruction
278@ CHECK-ERRORS: 	ssat16	r2, #0, r7
279@ CHECK-ERRORS: 	      	    ^
280@ CHECK-ERRORS: error: invalid operand for instruction
281@ CHECK-ERRORS: 	ssat16	r3, #17, r5
282@ CHECK-ERRORS: 	      	    ^
283
284
285        @ Out of order STM registers
286        stmda sp!, {r5, r2}
287
288@ CHECK-ERRORS: warning: register list not in ascending order
289@ CHECK-ERRORS:         stmda     sp!, {r5, r2}
290@ CHECK-ERRORS:                            ^
291
292
293        @ Out of range immediate on SVC
294        svc #0x1000000
295@ CHECK-ERRORS: error: invalid operand for instruction
296@ CHECK-ERRORS:   svc #0x1000000
297@ CHECK-ERRORS:       ^
298
299
300        @ Out of order Rt/Rt2 operands for ldrexd/strexd
301        ldrexd  r4, r3, [r8]
302        strexd  r6, r5, r3, [r8]
303
304@ CHECK-ERRORS: error: destination operands must be sequential
305@ CHECK-ERRORS:         ldrexd  r4, r3, [r8]
306@ CHECK-ERRORS:                     ^
307@ CHECK-ERRORS: error: source operands must be sequential
308@ CHECK-ERRORS:         strexd  r6, r5, r3, [r8]
309@ CHECK-ERRORS:                         ^
310
311        @ Illegal rotate operators for extend instructions
312        sxtb r8, r3, #8
313        sxtb r8, r3, ror 24
314        sxtb r8, r3, ror #8 -
315        sxtab r3, r8, r3, ror #(fred - wilma)
316        sxtab r7, r8, r3, ror #25
317        sxtah r9, r3, r3, ror #-8
318        sxtb16ge r2, r3, lsr #24
319
320@ CHECK-ERRORS: error: invalid operand for instruction
321@ CHECK-ERRORS:         sxtb r8, r3, #8
322@ CHECK-ERRORS:                      ^
323@ CHECK-ERRORS: error: '#' expected
324@ CHECK-ERRORS:         sxtb r8, r3, ror 24
325@ CHECK-ERRORS:                          ^
326@ CHECK-ERRORS: error: unknown token in expression
327@ CHECK-ERRORS:         sxtb r8, r3, ror #8 -
328@ CHECK-ERRORS:                              ^
329@ CHECK-ERRORS: error: malformed rotate expression
330@ CHECK-ERRORS:         sxtb r8, r3, ror #8 -
331@ CHECK-ERRORS:                           ^
332@ CHECK-ERRORS: error: rotate amount must be an immediate
333@ CHECK-ERRORS:         sxtab r3, r8, r3, ror #(fred - wilma)
334@ CHECK-ERRORS:                                ^
335@ CHECK-ERRORS: error: 'ror' rotate amount must be 8, 16, or 24
336@ CHECK-ERRORS:         sxtab r7, r8, r3, ror #25
337@ CHECK-ERRORS:                                ^
338@ CHECK-ERRORS: error: 'ror' rotate amount must be 8, 16, or 24
339@ CHECK-ERRORS:         sxtah r9, r3, r3, ror #-8
340@ CHECK-ERRORS:                                ^
341@ CHECK-ERRORS: error: invalid operand for instruction
342@ CHECK-ERRORS:         sxtb16ge r2, r3, lsr #24
343@ CHECK-ERRORS:                          ^
344
345        @ Out of range width for SBFX/UBFX
346        sbfx r4, r5, #31, #2
347        ubfxgt r4, r5, #16, #17
348
349@ CHECK-ERRORS: error: bitfield width must be in range [1,32-lsb]
350@ CHECK-ERRORS:         sbfx r4, r5, #31, #2
351@ CHECK-ERRORS:                           ^
352@ CHECK-ERRORS: error: bitfield width must be in range [1,32-lsb]
353@ CHECK-ERRORS:         ubfxgt r4, r5, #16, #17
354@ CHECK-ERRORS:                             ^
355
356        @ Using pc for SBFX/UBFX
357        sbfx pc, r2, #1, #3
358        sbfx sp, pc, #4, #5
359        ubfx pc, r0, #0, #31
360        ubfx r14, pc, #1, #2
361@ CHECK-ERRORS: error: invalid operand for instruction
362@ CHECK-ERRORS:         sbfx pc, r2, #1, #3
363@ CHECK-ERRORS:              ^
364@ CHECK-ERRORS: error: invalid operand for instruction
365@ CHECK-ERRORS:         sbfx sp, pc, #4, #5
366@ CHECK-ERRORS:                  ^
367@ CHECK-ERRORS: error: invalid operand for instruction
368@ CHECK-ERRORS:         ubfx pc, r0, #0, #31
369@ CHECK-ERRORS:              ^
370@ CHECK-ERRORS: error: invalid operand for instruction
371@ CHECK-ERRORS:         ubfx r14, pc, #1, #2
372@ CHECK-ERRORS:                   ^
373
374        @ Out of order Rt/Rt2 operands for ldrd
375        ldrd  r4, r3, [r8]
376        ldrd  r4, r3, [r8, #8]!
377        ldrd  r4, r3, [r8], #8
378@ CHECK-ERRORS: error: destination operands must be sequential
379@ CHECK-ERRORS:         ldrd  r4, r3, [r8]
380@ CHECK-ERRORS:                   ^
381@ CHECK-ERRORS: error: destination operands must be sequential
382@ CHECK-ERRORS:         ldrd  r4, r3, [r8, #8]!
383@ CHECK-ERRORS:                   ^
384@ CHECK-ERRORS: error: destination operands must be sequential
385@ CHECK-ERRORS:         ldrd  r4, r3, [r8], #8
386@ CHECK-ERRORS:                   ^
387
388
389        @ Bad register lists for VFP.
390        vpush {s0, s3}
391@ CHECK-ERRORS: error: non-contiguous register range
392@ CHECK-ERRORS:         vpush {s0, s3}
393@ CHECK-ERRORS:                    ^
394
395        @ Out of range coprocessor option immediate.
396        ldc2 p2, c8, [r1], { 256 }
397        ldc2 p2, c8, [r1], { -1 }
398
399@ CHECK-ERRORS-V7: error: coprocessor option must be an immediate in range [0, 255]
400@ CHECK-ERRORS-V7:         ldc2 p2, c8, [r1], { 256 }
401@ CHECK-ERRORS-V7:                              ^
402@ CHECK-ERRORS-V8: error: register expected
403@ CHECK-ERRORS-V7: error: coprocessor option must be an immediate in range [0, 255]
404@ CHECK-ERRORS-V7:         ldc2 p2, c8, [r1], { -1 }
405@ CHECK-ERRORS-V7:                              ^
406@ CHECK-ERRORS-V8: error: register expected
407
408        @ Bad CPS instruction format.
409        cps f,#1
410@ CHECK-ERRORS: error: invalid operand for instruction
411@ CHECK-ERRORS:         cps f,#1
412@ CHECK-ERRORS:               ^
413
414        @ Bad operands for msr
415        msr #0, #0
416        msr foo, #0
417@ CHECK-ERRORS: error: invalid operand for instruction
418@ CHECK-ERRORS:         msr #0, #0
419@ CHECK-ERRORS:             ^
420@ CHECK-ERRORS: error: invalid operand for instruction
421@ CHECK-ERRORS:         msr foo, #0
422@ CHECK-ERRORS:             ^
423
424        isb #-1
425        isb #16
426@ CHECK-ERRORS: error: immediate value out of range
427@ CHECK-ERRORS: error: immediate value out of range
428
429        nop.n
430@ CHECK-ERRORS: error: instruction with .n (narrow) qualifier not allowed in arm mode
431
432	dmbeq #5
433	dsble #15
434	isblo #7
435@ CHECK-ERRORS: error: instruction 'dmb' is not predicable, but condition code specified
436@ CHECK-ERRORS: error: instruction 'dsb' is not predicable, but condition code specified
437@ CHECK-ERRORS: error: instruction 'isb' is not predicable, but condition code specified
438
439	dmblt
440	dsbne
441	isbeq
442@ CHECK-ERRORS: error: instruction 'dmb' is not predicable, but condition code specified
443@ CHECK-ERRORS: error: instruction 'dsb' is not predicable, but condition code specified
444@ CHECK-ERRORS: error: instruction 'isb' is not predicable, but condition code specified
445
446        mcr2le  p7, #1, r5, c1, c1, #4
447        mcrr2ne p7, #15, r5, r4, c1
448        mrc2lo  p14, #0, r1, c1, c2, #4
449        mrrc2lo  p7, #1, r5, r4, c1
450        cdp2hi   p10, #0, c6, c12, c0, #7
451@ CHECK-ERRORS: error: instruction 'mcr2' is not predicable, but condition code specified
452@ CHECK-ERRORS: error: instruction 'mcrr2' is not predicable, but condition code specified
453@ CHECK-ERRORS: error: instruction 'mrc2' is not predicable, but condition code specified
454@ CHECK-ERRORS: error: instruction 'mrrc2' is not predicable, but condition code specified
455@ CHECK-ERRORS: error: instruction 'cdp2' is not predicable, but condition code specified
456
457        bkpteq #7
458@ CHECK-ERRORS: error: instruction 'bkpt' is not predicable, but condition code specified
459
460        ldm r2!, {r2, r3}
461        ldmdb r2!, {r2, r3}
462        ldmda r2!, {r2, r3}
463        popeq {sp}
464@ CHECK-ERRORS: error: writeback register not allowed in register list
465@ CHECK-ERRORS: error: writeback register not allowed in register list
466@ CHECK-ERRORS: error: writeback register not allowed in register list
467@ CHECK-ERRORS: error: writeback register not allowed in register list
468
469        vrintz.f32.f32 s0, s1
470        vrintr.f32 s0, s1
471        vrintx.f64.f64 d2, d5
472        vrintz.f64 d10, d9
473        vrinta.f32.f32 s6, s7
474        vrintn.f32 s8, s9
475        vrintp.f64.f64 d10, d11
476        vrintm.f64 d12, d13
477@ CHECK-ERRORS-V7: error: instruction requires: FPARMv8
478@ CHECK-ERRORS-V7: error: instruction requires: FPARMv8
479@ CHECK-ERRORS-V7: error: instruction requires: FPARMv8
480@ CHECK-ERRORS-V7: error: instruction requires: FPARMv8
481@ CHECK-ERRORS-V7: error: instruction requires: FPARMv8
482@ CHECK-ERRORS-V7: error: instruction requires: FPARMv8
483@ CHECK-ERRORS-V7: error: instruction requires: FPARMv8
484@ CHECK-ERRORS-V7: error: instruction requires: FPARMv8
485
486        stm sp!, {r0, pc}^
487        ldm sp!, {r0}^
488@ CHECK-ERRORS: error: system STM cannot have writeback register
489@ CHECK-ERRORS: error: writeback register only allowed on system LDM if PC in register-list
490
491foo2:
492        mov r0, foo2
493        movw r0, foo2
494@ CHECK-ERRORS: error: immediate expression for mov requires :lower16: or :upper16
495@ CHECK-ERRORS:                 ^
496@ CHECK-ERRORS: error: immediate expression for mov requires :lower16: or :upper16
497@ CHECK-ERRORS:                  ^
498
499        str r0, [r0, #4]!
500        str r0, [r0, r1]!
501        str r0, [r0], #4
502        str r0, [r0], r1
503        strh r0, [r0, #2]!
504        strh r0, [r0, r1]!
505        strh r0, [r0], #2
506        strh r0, [r0], r1
507        strb r0, [r0, #1]!
508        strb r0, [r0, r1]!
509        strb r0, [r0], #1
510        strb r0, [r0], r1
511@ CHECK-ERRORS: error: source register and base register can't be identical
512@ CHECK-ERRORS: str r0, [r0, #4]!
513@ CHECK-ERRORS:         ^
514@ CHECK-ERRORS: error: source register and base register can't be identical
515@ CHECK-ERRORS: str r0, [r0, r1]!
516@ CHECK-ERRORS:         ^
517@ CHECK-ERRORS: error: source register and base register can't be identical
518@ CHECK-ERRORS: str r0, [r0], #4
519@ CHECK-ERRORS:         ^
520@ CHECK-ERRORS: error: source register and base register can't be identical
521@ CHECK-ERRORS: str r0, [r0], r1
522@ CHECK-ERRORS:         ^
523@ CHECK-ERRORS: error: source register and base register can't be identical
524@ CHECK-ERRORS: strh r0, [r0, #2]!
525@ CHECK-ERRORS:          ^
526@ CHECK-ERRORS: error: source register and base register can't be identical
527@ CHECK-ERRORS: strh r0, [r0, r1]!
528@ CHECK-ERRORS:          ^
529@ CHECK-ERRORS: error: source register and base register can't be identical
530@ CHECK-ERRORS: strh r0, [r0], #2
531@ CHECK-ERRORS:          ^
532@ CHECK-ERRORS: error: source register and base register can't be identical
533@ CHECK-ERRORS: strh r0, [r0], r1
534@ CHECK-ERRORS:          ^
535@ CHECK-ERRORS: error: source register and base register can't be identical
536@ CHECK-ERRORS: strb r0, [r0, #1]!
537@ CHECK-ERRORS:          ^
538@ CHECK-ERRORS: error: source register and base register can't be identical
539@ CHECK-ERRORS: strb r0, [r0, r1]!
540@ CHECK-ERRORS:          ^
541@ CHECK-ERRORS: error: source register and base register can't be identical
542@ CHECK-ERRORS: strb r0, [r0], #1
543@ CHECK-ERRORS:          ^
544@ CHECK-ERRORS: error: source register and base register can't be identical
545@ CHECK-ERRORS: strb r0, [r0], r1
546@ CHECK-ERRORS:          ^
547
548        ldr r0, [r0, #4]!
549        ldr r0, [r0, r1]!
550        ldr r0, [r0], #4
551        ldr r0, [r0], r1
552        ldrh r0, [r0, #2]!
553        ldrh r0, [r0, r1]!
554        ldrh r0, [r0], #2
555        ldrh r0, [r0], r1
556        ldrsh r0, [r0, #2]!
557        ldrsh r0, [r0, r1]!
558        ldrsh r0, [r0], #2
559        ldrsh r0, [r0], r1
560        ldrb r0, [r0, #1]!
561        ldrb r0, [r0, r1]!
562        ldrb r0, [r0], #1
563        ldrb r0, [r0], r1
564        ldrsb r0, [r0, #1]!
565        ldrsb r0, [r0, r1]!
566        ldrsb r0, [r0], #1
567        ldrsb r0, [r0], r1
568@ CHECK-ERRORS: error: destination register and base register can't be identical
569@ CHECK-ERRORS: ldr r0, [r0, #4]!
570@ CHECK-ERRORS:         ^
571@ CHECK-ERRORS: error: destination register and base register can't be identical
572@ CHECK-ERRORS: ldr r0, [r0, r1]!
573@ CHECK-ERRORS:         ^
574@ CHECK-ERRORS: error: destination register and base register can't be identical
575@ CHECK-ERRORS: ldr r0, [r0], #4
576@ CHECK-ERRORS:         ^
577@ CHECK-ERRORS: error: destination register and base register can't be identical
578@ CHECK-ERRORS: ldr r0, [r0], r1
579@ CHECK-ERRORS:         ^
580@ CHECK-ERRORS: error: destination register and base register can't be identical
581@ CHECK-ERRORS: ldrh r0, [r0, #2]!
582@ CHECK-ERRORS:          ^
583@ CHECK-ERRORS: error: destination register and base register can't be identical
584@ CHECK-ERRORS: ldrh r0, [r0, r1]!
585@ CHECK-ERRORS:          ^
586@ CHECK-ERRORS: error: destination register and base register can't be identical
587@ CHECK-ERRORS: ldrh r0, [r0], #2
588@ CHECK-ERRORS:          ^
589@ CHECK-ERRORS: error: destination register and base register can't be identical
590@ CHECK-ERRORS: ldrh r0, [r0], r1
591@ CHECK-ERRORS:          ^
592@ CHECK-ERRORS: error: destination register and base register can't be identical
593@ CHECK-ERRORS: ldrsh r0, [r0, #2]!
594@ CHECK-ERRORS:           ^
595@ CHECK-ERRORS: error: destination register and base register can't be identical
596@ CHECK-ERRORS: ldrsh r0, [r0, r1]!
597@ CHECK-ERRORS:           ^
598@ CHECK-ERRORS: error: destination register and base register can't be identical
599@ CHECK-ERRORS: ldrsh r0, [r0], #2
600@ CHECK-ERRORS:           ^
601@ CHECK-ERRORS: error: destination register and base register can't be identical
602@ CHECK-ERRORS: ldrsh r0, [r0], r1
603@ CHECK-ERRORS:           ^
604@ CHECK-ERRORS: error: destination register and base register can't be identical
605@ CHECK-ERRORS: ldrb r0, [r0, #1]!
606@ CHECK-ERRORS:          ^
607@ CHECK-ERRORS: error: destination register and base register can't be identical
608@ CHECK-ERRORS: ldrb r0, [r0, r1]!
609@ CHECK-ERRORS:          ^
610@ CHECK-ERRORS: error: destination register and base register can't be identical
611@ CHECK-ERRORS: ldrb r0, [r0], #1
612@ CHECK-ERRORS:          ^
613@ CHECK-ERRORS: error: destination register and base register can't be identical
614@ CHECK-ERRORS: ldrb r0, [r0], r1
615@ CHECK-ERRORS:          ^
616@ CHECK-ERRORS: error: destination register and base register can't be identical
617@ CHECK-ERRORS: ldrsb r0, [r0, #1]!
618@ CHECK-ERRORS:           ^
619@ CHECK-ERRORS: error: destination register and base register can't be identical
620@ CHECK-ERRORS: ldrsb r0, [r0, r1]!
621@ CHECK-ERRORS:           ^
622@ CHECK-ERRORS: error: destination register and base register can't be identical
623@ CHECK-ERRORS: ldrsb r0, [r0], #1
624@ CHECK-ERRORS:           ^
625@ CHECK-ERRORS: error: destination register and base register can't be identical
626@ CHECK-ERRORS: ldrsb r0, [r0], r1
627@ CHECK-ERRORS:           ^
628
629        @ Out of range modified immediate values
630        mov  r5, #-256, #6
631        mov  r6, #42, #7
632        mvn  r5, #256, #6
633        mvn  r6, #42, #298
634        cmp  r5, #65535, #6
635        cmp  r6, #42, #31
636        cmn  r5, #-1, #6
637        cmn  r6, #42, #32
638	msr  APSR_nzcvq, #-128, #2
639	msr  apsr_nzcvqg, #0, #1
640        adc  r7, r8, #-256, #2
641        adc  r7, r8, #128, #1
642        sbc  r7, r8, #-256, #2
643        sbc  r7, r8, #128, #1
644        add  r7, r8, #-2149, #0
645        add  r7, r8, #100, #1
646        sub  r7, r8, #-2149, #0
647        sub  r7, r8, #100, #1
648        and  r7, r8, #-2149, #0
649        and  r7, r8, #100, #1
650        orr  r7, r8, #-2149, #0
651        orr  r7, r8, #100, #1
652        eor  r7, r8, #-2149, #0
653        eor  r7, r8, #100, #1
654        bic  r7, r8, #-2149, #0
655        bic  r7, r8, #100, #1
656        rsb  r7, r8, #-2149, #0
657        rsb  r7, r8, #100, #1
658        adds r7, r8, #-2149, #0
659        adds r7, r8, #100, #1
660        subs r7, r8, #-2149, #0
661        subs r7, r8, #100, #1
662        rsbs r7, r8, #-2149, #0
663        rsbs r7, r8, #100, #1
664        rsc r7, r8, #-2149, #0
665        rsc r7, r8, #100, #1
666        TST r7, #-2149, #0
667        TST r7, #100, #1
668        TEQ r7, #-2149, #0
669        TEQ r7, #100, #1
670@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
671@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
672@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
673@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
674@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
675@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
676@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
677@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
678@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
679@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
680@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
681@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
682@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
683@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
684@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
685@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
686@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
687@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
688@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
689@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
690@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
691@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
692@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
693@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
694@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
695@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
696@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
697@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
698@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
699@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
700@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
701@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
702@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
703@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
704@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
705@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
706@ CHECK-ERRORS: error: immediate operand must a number in the range [0, 255]
707@ CHECK-ERRORS: error: immediate operand must an even number in the range [0, 30]
708