1 @ RUN: not llvm-mc -triple=thumbv6-apple-darwin < %s 2> %t
2 @ RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s
3 @ RUN: not llvm-mc -triple=thumbv5-apple-darwin < %s 2> %t
4 @ RUN: FileCheck --check-prefix=CHECK-ERRORS-V5 < %t %s
5 @ RUN: not llvm-mc -triple=thumbv8 < %s 2> %t
6 @ RUN: FileCheck --check-prefix=CHECK-ERRORS-V8 < %t %s
8 @ Check for various assembly diagnostic messages on invalid input.
10 @ ADD instruction w/o 'S' suffix.
12 @ CHECK-ERRORS: error: invalid instruction
13 @ CHECK-ERRORS: add r1, r2, r3
16 @ Instructions which require v6+ for both registers to be low regs.
19 @ CHECK-ERRORS: error: instruction variant requires Thumb2
20 @ CHECK-ERRORS: add r2, r3
22 @ CHECK-ERRORS-V5: error: instruction variant requires ARMv6 or later
23 @ CHECK-ERRORS-V5: mov r2, r3
27 @ Out of range immediates for ASR instruction.
29 @ CHECK-ERRORS: error: invalid operand for instruction
30 @ CHECK-ERRORS: asrs r2, r3, #33
33 @ Out of range immediates for BKPT instruction.
36 error: invalid operand for instruction
39 error: invalid operand for instruction
43 @ Out of range immediates for v8 HLT instruction.
46 @CHECK-ERRORS: error: instruction requires: armv8 arm-mode
47 @CHECK-ERRORS: hlt #64
49 @CHECK-ERRORS-V8: error: instruction requires: arm-mode
50 @CHECK-ERRORS-V8: hlt #64
52 @CHECK-ERRORS: error: invalid operand for instruction
53 @CHECK-ERRORS: hlt #-1
56 @ Invalid writeback and register lists for LDM
60 ldm r2!, {r2, r3, r4, r10}
61 ldmdb r2!, {r2, r3, r4}
62 @ CHECK-ERRORS: error: registers must be in range r0-r7
63 @ CHECK-ERRORS: ldm r2!, {r5, r8}
65 @ CHECK-ERRORS: error: writeback operator '!' expected
66 @ CHECK-ERRORS: ldm r2, {r5, r7}
68 @ CHECK-ERRORS: error: writeback operator '!' not allowed when base register in register list
69 @ CHECK-ERRORS: ldm r2!, {r2, r3, r4}
71 @ CHECK-ERRORS-V8: error: writeback operator '!' not allowed when base register in register list
72 @ CHECK-ERRORS-V8: ldm r2!, {r2, r3, r4, r10}
74 @ CHECK-ERRORS-V8: error: writeback register not allowed in register list
75 @ CHECK-ERRORS-V8: ldmdb r2!, {r2, r3, r4}
78 @ Invalid writeback and register lists for PUSH/POP
81 @ CHECK-ERRORS: error: registers must be in range r0-r7 or pc
82 @ CHECK-ERRORS: pop {r1, r2, r10}
84 @ CHECK-ERRORS: error: registers must be in range r0-r7 or lr
85 @ CHECK-ERRORS: push {r8, r9}
89 @ Invalid writeback and register lists for STM
94 @ CHECK-ERRORS: error: instruction requires: thumb2
95 @ CHECK-ERRORS: stm r1, {r2, r6}
97 @ CHECK-ERRORS: error: registers must be in range r0-r7
98 @ CHECK-ERRORS: stm r1!, {r2, r9}
100 @ CHECK-ERRORS-V8: error: writeback operator '!' not allowed when base register in register list
101 @ CHECK-ERRORS-V8: stm r2!, {r2, r9}
103 @ CHECK-ERRORS-V8: error: writeback register not allowed in register list
104 @ CHECK-ERRORS-V8: stmdb r2!, {r0, r2}
107 @ Out of range immediates for LSL instruction.
110 @ CHECK-ERRORS: error: invalid operand for instruction
111 @ CHECK-ERRORS: lsls r4, r5, #-1
113 @ CHECK-ERRORS: error: invalid operand for instruction
114 @ CHECK-ERRORS: lsls r4, r5, #32
117 @ Mismatched source/destination operands for MUL instruction.
119 @ CHECK-ERRORS: error: destination register must match source register
120 @ CHECK-ERRORS: muls r1, r2, r3
124 @ Out of range immediates for STR instruction.
128 @ CHECK-ERRORS: error: instruction requires: thumb2
129 @ CHECK-ERRORS: str r2, [r7, #-1]
131 @ CHECK-ERRORS: error: instruction requires: thumb2
132 @ CHECK-ERRORS: str r5, [r1, #3]
134 @ CHECK-ERRORS: error: instruction requires: thumb2
135 @ CHECK-ERRORS: str r3, [r7, #128]
138 @ Out of range immediate for SVC instruction.
141 @ CHECK-ERRORS: error: invalid operand for instruction
142 @ CHECK-ERRORS: svc #-1
144 @ CHECK-ERRORS: error: instruction requires: arm-mode
145 @ CHECK-ERRORS: svc #256
149 @ Out of range immediate for ADD SP instructions
154 @ CHECK-ERRORS: error: instruction requires: thumb2
155 @ CHECK-ERRORS: add sp, #-1
157 @ CHECK-ERRORS: error: instruction requires: thumb2
158 @ CHECK-ERRORS: add sp, #3
160 @ CHECK-ERRORS: error: instruction requires: thumb2
161 @ CHECK-ERRORS: add sp, sp, #512
163 @ CHECK-ERRORS: error: instruction requires: arm-mode
164 @ CHECK-ERRORS: add r2, sp, #1024
168 @ CHECK-ERRORS: error: source register must be the same as destination
169 @ CHECK-ERRORS: add r2, sp, ip
173 @------------------------------------------------------------------------------
174 @ B/Bcc - out of range immediates for Thumb1 branches
175 @------------------------------------------------------------------------------
184 @ CHECK-ERRORS: error: branch target out of range
185 @ CHECK-ERRORS: error: branch target out of range
186 @ CHECK-ERRORS: error: branch target out of range
187 @ CHECK-ERRORS: error: branch target out of range
188 @ CHECK-ERRORS: error: branch target out of range
189 @ CHECK-ERRORS: error: branch target out of range
191 @------------------------------------------------------------------------------
192 @ WFE/WFI/YIELD - are not supported pre v6T2
193 @------------------------------------------------------------------------------
198 @ CHECK-ERRORS: error: instruction requires: armv6m or armv6t2
201 @ CHECK-ERRORS: error: instruction requires: armv6m or armv6t2
204 @ CHECK-ERRORS: error: instruction requires: armv6m or armv6t2
205 @ CHECK-ERRORS: yield
208 @------------------------------------------------------------------------------
209 @ PLDW required mp-extensions
210 @------------------------------------------------------------------------------
212 @ CHECK-ERRORS: error: instruction requires: mp-extensions
214 @------------------------------------------------------------------------------
215 @ LDR(lit) - invalid offsets
216 @------------------------------------------------------------------------------
219 @ CHECK-ERRORS: error: instruction requires: thumb2