1 @ RUN
: not llvm-mc
-triple
=thumbv6-apple-darwin
-o
/dev
/null
< %s
2>&1 \
2 @ RUN
: | FileCheck
--check-prefix
=CHECK-ERRORS
%s
3 @ RUN
: not llvm-mc
-triple
=thumbv5-apple-darwin
-o
/dev
/null
< %s
2>&1 \
4 @ RUN
: | FileCheck
--check-prefix
=CHECK-ERRORS-V5
%s
5 @ RUN
: not llvm-mc
-triple
=thumbv7m
-o
/dev
/null
< %s
2>&1 \
6 @ RUN
: | FileCheck
--check-prefix
=CHECK-ERRORS-V7M
%s
7 @ RUN
: not llvm-mc
-triple
=thumbv8
-o
/dev
/null
< %s
2>&1 \
8 @ RUN
: | FileCheck
--check-prefix
=CHECK-ERRORS-V8
%s
10 @ Check for various assembly diagnostic messages on invalid input.
12 @
ADD instruction w
/o
'S' suffix.
14 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
15 @ CHECK-ERRORS
: add r1, r2, r3
17 @ CHECK-ERRORS
: note
: instruction requires
: arm-mode
18 @ CHECK-ERRORS
: note
: instruction requires
: thumb2
19 @ CHECK-ERRORS
: note
: invalid operand for instruction
20 @ CHECK-ERRORS
: note
: operand must
be an immediate in the range
[0,7]
21 @ CHECK-ERRORS
: note
: no flag-preserving variant of this instruction available
23 @ Instructions which require v6+ for both registers to
be low regs.
26 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
27 @ CHECK-ERRORS
: add r2, r3
29 @ CHECK-ERRORS
: note
: instruction variant requires Thumb2
30 @ CHECK-ERRORS
: note
: operand must
be a register sp
31 @ CHECK-ERRORS-V5
: error
: instruction variant requires ARMv6
or later
32 @ CHECK-ERRORS-V5
: mov
r2, r3
35 @ Immediates where registers were expected
38 @ CHECK-ERRORS
: error
: operand must
be a register in range
[r0, r7]
39 @ CHECK-ERRORS
: adds
#0, r1, r2
40 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
41 @ CHECK-ERRORS
: adds
r0, #1, r2
42 @ CHECK-ERRORS
: note
: operand must
be a register in range
[r0, r7]
43 @ CHECK-ERRORS
: note
: too many operands for instruction
45 @ Out of range immediates for ASR instruction.
47 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
48 @ CHECK-ERRORS
: asrs
r2, r3, #33
50 @ CHECK-ERRORS
: note
: operand must
be an immediate in the range
[1,32]
51 @ CHECK-ERRORS
: note
: too many operands for instruction
53 @ Out of range immediates for BKPT instruction.
56 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
57 @ CHECK-ERRORS
: bkpt
#256
59 @ CHECK-ERRORS
: note
: instruction requires
: arm-mode
60 @ CHECK-ERRORS
: note
: operand must
be an immediate in the range
[0,255]
61 @ CHECK-ERRORS
: note
: too many operands for instruction
63 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
64 @ CHECK-ERRORS
: bkpt
#-1
66 @ CHECK-ERRORS
: note
: operand must
be an immediate in the range
[0,255]
67 @ CHECK-ERRORS
: note
: too many operands for instruction
69 @ Out of range immediates for v8 HLT instruction.
72 @CHECK-ERRORS
: error
: invalid instruction
73 @CHECK-ERRORS
: hlt
#64
75 @CHECK-ERRORS-V8
: error
: invalid instruction
, any one of the following would fix this
:
76 @CHECK-ERRORS-V8
: hlt
#64
78 @CHECK-ERRORS-V8
: note
: instruction requires
: arm-mode
79 @CHECK-ERRORS-V8
: operand must
be an immediate in the range
[0,63]
80 @CHECK-ERRORS
: error
: invalid instruction
81 @CHECK-ERRORS
: hlt
#-1
83 @CHECK-ERRORS-V8
: error
: operand must
be an immediate in the range
[0,63]
84 @CHECK-ERRORS-V8
: hlt
#-1
87 @ Invalid writeback
and register lists for LDM
91 ldm
r2!, {r2, r3, r4, r10}
92 ldmdb
r2!, {r2, r3, r4}
95 ldmia
r0!, {r2-
r3, sp
}
96 ldmfd
r2, {r1, r3-
r6, sp
}
97 ldmfd
r2!, {r1, r3-
r6, sp
}
98 ldmdb
r1, {r2, r3, sp
}
99 ldmdb
r1!, {r2, r3, sp
}
100 @ CHECK-ERRORS
: error
: registers must
be in range r0-
r7
101 @ CHECK-ERRORS
: ldm
r2!, {r5, r8}
103 @ CHECK-ERRORS
: error
: writeback operator
'!' expected
104 @ CHECK-ERRORS
: ldm
r2, {r5, r7}
106 @ CHECK-ERRORS
: error
: writeback operator
'!' not allowed when base register in register list
107 @ CHECK-ERRORS
: ldm
r2!, {r2, r3, r4}
109 @ CHECK-ERRORS-V8
: error
: writeback operator
'!' not allowed when base register in register list
110 @ CHECK-ERRORS-V8
: ldm
r2!, {r2, r3, r4, r10}
112 @ CHECK-ERRORS-V8
: error
: writeback register
not allowed in register list
113 @ CHECK-ERRORS-V8
: ldmdb
r2!, {r2, r3, r4}
115 @ CHECK-ERRORS-V7M
: error
: SP may
not be in the register list
116 @ CHECK-ERRORS-V7M
: ldm
r0, {r2, sp
}
117 @ CHECK-ERRORS-V7M
: ^
118 @ CHECK-ERRORS-V7M
: error
: SP may
not be in the register list
119 @ CHECK-ERRORS-V7M
: ldmia
r0, {r2-
r3, sp
}
120 @ CHECK-ERRORS-V7M
: ^
121 @ CHECK-ERRORS-V7M
: error
: SP may
not be in the register list
122 @ CHECK-ERRORS-V7M
: ldmia
r0!, {r2-
r3, sp
}
123 @ CHECK-ERRORS-V7M
: ^
124 @ CHECK-ERRORS-V7M
: error
: SP may
not be in the register list
125 @ CHECK-ERRORS-V7M
: ldmfd
r2, {r1, r3-
r6, sp
}
126 @ CHECK-ERRORS-V7M
: ^
127 @ CHECK-ERRORS-V7M
: error
: SP may
not be in the register list
128 @ CHECK-ERRORS-V7M
: ldmfd
r2!, {r1, r3-
r6, sp
}
129 @ CHECK-ERRORS-V7M
: ^
130 @ CHECK-ERRORS-V7M
: error
: SP may
not be in the register list
131 @ CHECK-ERRORS-V7M
: ldmdb
r1, {r2, r3, sp
}
132 @ CHECK-ERRORS-V7M
: ^
133 @ CHECK-ERRORS-V7M
: error
: SP may
not be in the register list
134 @ CHECK-ERRORS-V7M
: ldmdb
r1!, {r2, r3, sp
}
135 @ CHECK-ERRORS-V7M
: ^
137 @ Invalid writeback
and register lists for PUSH
/POP
140 @ CHECK-ERRORS
: error
: registers must
be in range r0-
r7 or pc
141 @ CHECK-ERRORS
: pop
{r1, r2, r10}
143 @ CHECK-ERRORS
: error
: registers must
be in range r0-
r7 or lr
144 @ CHECK-ERRORS
: push
{r8, r9}
148 @ Invalid writeback
and register lists for
STM
154 stmia
r4!, {r0-
r3, sp
}
155 stmdb
r1, {r2, r3, sp
}
156 stmdb
r1!, {r2, r3, sp
}
157 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
158 @ CHECK-ERRORS
: stm r1, {r2, r6}
160 @ CHECK-ERRORS
: note
: instruction requires
: thumb2
161 @ CHECK-ERRORS
: note
: instruction requires
: arm-mode
162 @ CHECK-ERRORS
: error
: registers must
be in range r0-
r7
163 @ CHECK-ERRORS
: stm r1!, {r2, r9}
165 @ CHECK-ERRORS-V8
: error
: writeback operator
'!' not allowed when base register in register list
166 @ CHECK-ERRORS-V8
: stm r2!, {r2, r9}
168 @ CHECK-ERRORS-V8
: error
: writeback register
not allowed in register list
169 @ CHECK-ERRORS-V8
: stmdb
r2!, {r0, r2}
171 @ CHECK-ERRORS-V7M
: error
: SP may
not be in the register list
172 @ CHECK-ERRORS-V7M
: stm r1!, {r2, sp
}
173 @ CHECK-ERRORS-V7M
: ^
174 @ CHECK-ERRORS-V7M
: error
: SP may
not be in the register list
175 @ CHECK-ERRORS-V7M
: stmia
r4!, {r0-
r3, sp
}
176 @ CHECK-ERRORS-V7M
: ^
177 @ CHECK-ERRORS-V7M
: error
: SP may
not be in the register list
178 @ CHECK-ERRORS-V7M
: stmdb
r1, {r2, r3, sp
}
179 @ CHECK-ERRORS-V7M
: ^
180 @ CHECK-ERRORS-V7M
: error
: SP may
not be in the register list
181 @ CHECK-ERRORS-V7M
: stmdb
r1!, {r2, r3, sp
}
182 @ CHECK-ERRORS-V7M
: ^
184 @ Out of range immediates for LSL instruction.
187 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
188 @ CHECK-ERRORS
: lsls
r4, r5, #-1
190 @ CHECK-ERRORS
: note
: operand must
be an immediate in the range
[0,31]
191 @ CHECK-ERRORS
: note
: too many operands for instruction
192 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
193 @ CHECK-ERRORS
: lsls
r4, r5, #32
195 @ CHECK-ERRORS
: note
: operand must
be an immediate in the range
[0,31]
196 @ CHECK-ERRORS
: note
: too many operands for instruction
198 @ Mismatched source
/destination operands for
MUL instruction.
200 @ CHECK-ERRORS
: error
: destination register must match source register
201 @ CHECK-ERRORS
: muls r1, r2, r3
205 @ Out of range immediates for STR instruction.
209 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
210 @ CHECK-ERRORS
: str
r2, [r7, #-1]
212 @ CHECK-ERRORS
: note
: instruction requires
: thumb2
213 @ CHECK-ERRORS
: note
: instruction requires
: arm-mode
214 @ CHECK-ERRORS
: note
: invalid operand for instruction
215 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
216 @ CHECK-ERRORS
: str
r5, [r1, #3]
218 @ CHECK-ERRORS
: note
: instruction requires
: thumb2
219 @ CHECK-ERRORS
: note
: instruction requires
: arm-mode
220 @ CHECK-ERRORS
: note
: invalid operand for instruction
221 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
222 @ CHECK-ERRORS
: str
r3, [r7, #128]
224 @ CHECK-ERRORS
: note
: instruction requires
: thumb2
225 @ CHECK-ERRORS
: note
: instruction requires
: arm-mode
226 @ CHECK-ERRORS
: note
: invalid operand for instruction
228 @ Out of range immediate for
SVC instruction.
231 @ CHECK-ERRORS
: error
: operand must
be an immediate in the range
[0,255]
232 @ CHECK-ERRORS
: svc #-1
234 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
235 @ CHECK-ERRORS
: svc #256
237 @ CHECK-ERRORS
: note
: instruction requires
: arm-mode
238 @ CHECK-ERRORS
: note
: operand must
be an immediate in the range
[0,255]
241 @ Out of range immediate for
ADD SP instructions
246 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
247 @ CHECK-ERRORS
: add sp
, #-1
249 @ CHECK-ERRORS
: note
: operand must
be a register in range
[r0, r15]
250 @ CHECK-ERRORS
: note
: instruction requires
: thumb2
251 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
252 @ CHECK-ERRORS
: add sp
, #3
254 @ CHECK-ERRORS
: note
: operand must
be a register in range
[r0, r15]
255 @ CHECK-ERRORS
: note
: instruction requires
: thumb2
256 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
257 @ CHECK-ERRORS
: add sp
, sp
, #512
259 @ CHECK-ERRORS
: note
: operand must
be a register in range
[r0, r15]
260 @ CHECK-ERRORS
: note
: instruction requires
: thumb2
261 @ CHECK-ERRORS
: error
: instruction requires
: thumb2
262 @ CHECK-ERRORS
: add r2, sp
, #1024
266 @ CHECK-ERRORS
: error
: source register must
be the same as destination
267 @ CHECK-ERRORS
: add r2, sp
, ip
271 @
------------------------------------------------------------------------------
272 @
B/Bcc - out of range immediates for Thumb1 branches
273 @
------------------------------------------------------------------------------
282 @ CHECK-ERRORS
: error
: branch target out of range
283 @ CHECK-ERRORS
: error
: branch target out of range
284 @ CHECK-ERRORS
: error
: branch target out of range
285 @ CHECK-ERRORS
: error
: branch target out of range
286 @ CHECK-ERRORS
: error
: branch target out of range
287 @ CHECK-ERRORS
: error
: branch target out of range
289 @
------------------------------------------------------------------------------
290 @ CBZ
/CBNZ
- out of range immediates for branches
291 @
------------------------------------------------------------------------------
299 @ CHECK-ERRORS-V7M
: error
: branch target out of range
300 @ CHECK-ERRORS-V7M
: error
: invalid operand for instruction
301 @ CHECK-ERRORS-V7M
: error
: branch target out of range
302 @ CHECK-ERRORS-V8
: error
: branch target out of range
303 @ CHECK-ERRORS-V8
: error
: invalid operand for instruction
304 @ CHECK-ERRORS-V8
: error
: branch target out of range
306 @
------------------------------------------------------------------------------
307 @ SEV
/WFE
/WFI
/YIELD
- are
not supported pre v6M
or v6T2
308 @
------------------------------------------------------------------------------
314 @ CHECK-ERRORS
: error
: instruction requires
: armv6m
or armv6t2
317 @ CHECK-ERRORS
: error
: instruction requires
: armv6m
or armv6t2
320 @ CHECK-ERRORS
: error
: instruction requires
: armv6m
or armv6t2
323 @ CHECK-ERRORS
: error
: instruction requires
: armv6m
or armv6t2
324 @ CHECK-ERRORS
: yield
327 @
------------------------------------------------------------------------------
328 @ PLDW required mp-extensions
329 @
------------------------------------------------------------------------------
331 @ CHECK-ERRORS
: error
: instruction requires
: mp-extensions
333 @
------------------------------------------------------------------------------
334 @ LDR
(lit
) - invalid offsets
335 @
------------------------------------------------------------------------------
338 @ CHECK-ERRORS
: error
: invalid instruction
, any one of the following would fix this
:
339 @ CHECK-ERRORS
: note
: instruction requires
: thumb2
340 @ CHECK-ERRORS
: note
: instruction requires
: arm-mode
341 @ CHECK-ERRORS
: note
: invalid operand for instruction
343 @
------------------------------------------------------------------------------
344 @ STC2
{L}/LDC2
{L} - requires thumb2
345 @
------------------------------------------------------------------------------
346 stc2 p0
, c8
, [r1, #4]
347 stc2l p6
, c2
, [r7, #4]
348 ldc2 p0
, c8
, [r1, #4]
349 ldc2l p6
, c2
, [r7, #4]
350 @ CHECK-ERRORS
: error
: invalid instruction
351 @ CHECK-ERRORS
: error
: invalid instruction
352 @ CHECK-ERRORS
: error
: invalid instruction
353 @ CHECK-ERRORS
: error
: invalid instruction
355 @
------------------------------------------------------------------------------
356 @ Generic error for too few operands
357 @
------------------------------------------------------------------------------
361 @ CHECK-ERRORS
: error
: too few operands for instruction
362 @ CHECK-ERRORS
: error
: too few operands for instruction
364 @
------------------------------------------------------------------------------
365 @ Out of range width for SBFX
/UBFX
366 @
------------------------------------------------------------------------------
369 ubfx
r4, r5, #16, #17
371 @ CHECK-ERRORS-V8
: error
: bitfield width must
be in range
[1,32-lsb
]
372 @ CHECK-ERRORS-V8
: sbfx
r4, r5, #31, #2
374 @ CHECK-ERRORS-V8
: error
: bitfield width must
be in range
[1,32-lsb
]
375 @ CHECK-ERRORS-V8
: ubfx
r4, r5, #16, #17
378 @
------------------------------------------------------------------------------
379 @ Writeback store writing to same register as value
380 @
------------------------------------------------------------------------------
388 strd
r0, r1, [r0], #1
389 strd
r1, r0, [r0], #1
390 @ CHECK-ERRORS-V8
: error
: source register
and base register can
't be identical
391 @ CHECK-ERRORS-V8: str r0, [r0, #4]!
393 @ CHECK-ERRORS-V8: error: source register and base register can't be identical
394 @ CHECK-ERRORS-V8
: str
r0, [r0], #4
396 @ CHECK-ERRORS-V8
: error
: source register
and base register can
't be identical
397 @ CHECK-ERRORS-V8: strh r0, [r0, #2]!
399 @ CHECK-ERRORS-V8: error: source register and base register can't be identical
400 @ CHECK-ERRORS-V8
: strh
r0, [r0], #2
402 @ CHECK-ERRORS-V8
: error
: source register
and base register can
't be identical
403 @ CHECK-ERRORS-V8: strb r0, [r0, #1]!
405 @ CHECK-ERRORS-V8: error: source register and base register can't be identical
406 @ CHECK-ERRORS-V8
: strb
r0, [r0], #1
408 @ CHECK-ERRORS-V8
: error
: source register
and base register can
't be identical
409 @ CHECK-ERRORS-V8: strd r0, r1, [r0], #1
411 @ CHECK-ERRORS-V8: error: source register and base register can't be identical
412 @ CHECK-ERRORS-V8
: strd
r1, r0, [r0], #1