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
6 @ Check for various assembly diagnostic messages on invalid input.
8 @ ADD instruction w/o 'S' suffix.
10 @ CHECK-ERRORS: error: invalid instruction
11 @ CHECK-ERRORS: add r1, r2, r3
14 @ Instructions which require v6+ for both registers to be low regs.
17 @ CHECK-ERRORS: error: instruction variant requires Thumb2
18 @ CHECK-ERRORS: add r2, r3
20 @ CHECK-ERRORS-V5: error: instruction variant requires ARMv6 or later
21 @ CHECK-ERRORS-V5: mov r2, r3
25 @ Out of range immediates for ASR instruction.
27 @ CHECK-ERRORS: error: invalid operand for instruction
28 @ CHECK-ERRORS: asrs r2, r3, #33
31 @ Out of range immediates for BKPT instruction.
34 error: invalid operand for instruction
37 error: invalid operand for instruction
41 @ Invalid writeback and register lists for LDM
45 @ CHECK-ERRORS: error: registers must be in range r0-r7
46 @ CHECK-ERRORS: ldm r2!, {r5, r8}
48 @ CHECK-ERRORS: error: writeback operator '!' expected
49 @ CHECK-ERRORS: ldm r2, {r5, r7}
51 @ CHECK-ERRORS: error: writeback operator '!' not allowed when base register in register list
52 @ CHECK-ERRORS: ldm r2!, {r2, r3, r4}
55 @ Invalid writeback and register lists for PUSH/POP
58 @ CHECK-ERRORS: error: registers must be in range r0-r7 or pc
59 @ CHECK-ERRORS: pop {r1, r2, r10}
61 @ CHECK-ERRORS: error: registers must be in range r0-r7 or lr
62 @ CHECK-ERRORS: push {r8, r9}
66 @ Invalid writeback and register lists for STM
69 @ CHECK-ERRORS: error: instruction requires: thumb2
70 @ CHECK-ERRORS: stm r1, {r2, r6}
72 @ CHECK-ERRORS: error: registers must be in range r0-r7
73 @ CHECK-ERRORS: stm r1!, {r2, r9}
76 @ Out of range immediates for LSL instruction.
79 @ CHECK-ERRORS: error: invalid operand for instruction
80 @ CHECK-ERRORS: lsls r4, r5, #-1
82 @ CHECK-ERRORS: error: invalid operand for instruction
83 @ CHECK-ERRORS: lsls r4, r5, #32
86 @ Mismatched source/destination operands for MUL instruction.
88 @ CHECK-ERRORS: error: destination register must match source register
89 @ CHECK-ERRORS: muls r1, r2, r3
93 @ Out of range immediates for STR instruction.
97 @ CHECK-ERRORS: error: instruction requires: thumb2
98 @ CHECK-ERRORS: str r2, [r7, #-1]
100 @ CHECK-ERRORS: error: instruction requires: thumb2
101 @ CHECK-ERRORS: str r5, [r1, #3]
103 @ CHECK-ERRORS: error: instruction requires: thumb2
104 @ CHECK-ERRORS: str r3, [r7, #128]
107 @ Out of range immediate for SVC instruction.
110 @ CHECK-ERRORS: error: invalid operand for instruction
111 @ CHECK-ERRORS: svc #-1
113 @ CHECK-ERRORS: error: instruction requires: arm-mode
114 @ CHECK-ERRORS: svc #256
118 @ Out of range immediate for ADD SP instructions
123 @ CHECK-ERRORS: error: instruction requires: thumb2
124 @ CHECK-ERRORS: add sp, #-1
126 @ CHECK-ERRORS: error: instruction requires: thumb2
127 @ CHECK-ERRORS: add sp, #3
129 @ CHECK-ERRORS: error: instruction requires: thumb2
130 @ CHECK-ERRORS: add sp, sp, #512
132 @ CHECK-ERRORS: error: instruction requires: arm-mode
133 @ CHECK-ERRORS: add r2, sp, #1024
137 @ CHECK-ERRORS: error: source register must be the same as destination
138 @ CHECK-ERRORS: add r2, sp, ip
142 @------------------------------------------------------------------------------
143 @ B/Bcc - out of range immediates for Thumb1 branches
144 @------------------------------------------------------------------------------
153 @ CHECK-ERRORS: error: Branch target out of range
154 @ CHECK-ERRORS: error: Branch target out of range
155 @ CHECK-ERRORS: error: Branch target out of range
156 @ CHECK-ERRORS: error: Branch target out of range
157 @ CHECK-ERRORS: error: Branch target out of range
158 @ CHECK-ERRORS: error: Branch target out of range
160 @------------------------------------------------------------------------------
161 @ WFE/WFI/YIELD - are not supported pre v6T2
162 @------------------------------------------------------------------------------
167 @ CHECK-ERRORS: error: instruction requires: thumb2
170 @ CHECK-ERRORS: error: instruction requires: thumb2
173 @ CHECK-ERRORS: error: instruction requires: thumb2
174 @ CHECK-ERRORS: yield
177 @------------------------------------------------------------------------------
178 @ PLDW required mp-extensions
179 @------------------------------------------------------------------------------
181 @ CHECK-ERRORS: error: instruction requires: mp-extensions
183 @------------------------------------------------------------------------------
184 @ LDR(lit) - invalid offsets
185 @------------------------------------------------------------------------------
188 @ CHECK-ERRORS: error: instruction requires: thumb2