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 @ CHECK-ERRORS: error: registers must be in range r0-r7
61 @ CHECK-ERRORS: ldm r2!, {r5, r8}
63 @ CHECK-ERRORS: error: writeback operator '!' expected
64 @ CHECK-ERRORS: ldm r2, {r5, r7}
66 @ CHECK-ERRORS: error: writeback operator '!' not allowed when base register in register list
67 @ CHECK-ERRORS: ldm r2!, {r2, r3, r4}
70 @ Invalid writeback and register lists for PUSH/POP
73 @ CHECK-ERRORS: error: registers must be in range r0-r7 or pc
74 @ CHECK-ERRORS: pop {r1, r2, r10}
76 @ CHECK-ERRORS: error: registers must be in range r0-r7 or lr
77 @ CHECK-ERRORS: push {r8, r9}
81 @ Invalid writeback and register lists for STM
84 @ CHECK-ERRORS: error: instruction requires: thumb2
85 @ CHECK-ERRORS: stm r1, {r2, r6}
87 @ CHECK-ERRORS: error: registers must be in range r0-r7
88 @ CHECK-ERRORS: stm r1!, {r2, r9}
91 @ Out of range immediates for LSL instruction.
94 @ CHECK-ERRORS: error: invalid operand for instruction
95 @ CHECK-ERRORS: lsls r4, r5, #-1
97 @ CHECK-ERRORS: error: invalid operand for instruction
98 @ CHECK-ERRORS: lsls r4, r5, #32
101 @ Mismatched source/destination operands for MUL instruction.
103 @ CHECK-ERRORS: error: destination register must match source register
104 @ CHECK-ERRORS: muls r1, r2, r3
108 @ Out of range immediates for STR instruction.
112 @ CHECK-ERRORS: error: instruction requires: thumb2
113 @ CHECK-ERRORS: str r2, [r7, #-1]
115 @ CHECK-ERRORS: error: instruction requires: thumb2
116 @ CHECK-ERRORS: str r5, [r1, #3]
118 @ CHECK-ERRORS: error: instruction requires: thumb2
119 @ CHECK-ERRORS: str r3, [r7, #128]
122 @ Out of range immediate for SVC instruction.
125 @ CHECK-ERRORS: error: invalid operand for instruction
126 @ CHECK-ERRORS: svc #-1
128 @ CHECK-ERRORS: error: instruction requires: arm-mode
129 @ CHECK-ERRORS: svc #256
133 @ Out of range immediate for ADD SP instructions
138 @ CHECK-ERRORS: error: instruction requires: thumb2
139 @ CHECK-ERRORS: add sp, #-1
141 @ CHECK-ERRORS: error: instruction requires: thumb2
142 @ CHECK-ERRORS: add sp, #3
144 @ CHECK-ERRORS: error: instruction requires: thumb2
145 @ CHECK-ERRORS: add sp, sp, #512
147 @ CHECK-ERRORS: error: instruction requires: arm-mode
148 @ CHECK-ERRORS: add r2, sp, #1024
152 @ CHECK-ERRORS: error: source register must be the same as destination
153 @ CHECK-ERRORS: add r2, sp, ip
157 @------------------------------------------------------------------------------
158 @ B/Bcc - out of range immediates for Thumb1 branches
159 @------------------------------------------------------------------------------
168 @ CHECK-ERRORS: error: branch target out of range
169 @ CHECK-ERRORS: error: branch target out of range
170 @ CHECK-ERRORS: error: branch target out of range
171 @ CHECK-ERRORS: error: branch target out of range
172 @ CHECK-ERRORS: error: branch target out of range
173 @ CHECK-ERRORS: error: branch target out of range
175 @------------------------------------------------------------------------------
176 @ WFE/WFI/YIELD - are not supported pre v6T2
177 @------------------------------------------------------------------------------
182 @ CHECK-ERRORS: error: instruction requires: thumb2
185 @ CHECK-ERRORS: error: instruction requires: thumb2
188 @ CHECK-ERRORS: error: instruction requires: thumb2
189 @ CHECK-ERRORS: yield
192 @------------------------------------------------------------------------------
193 @ PLDW required mp-extensions
194 @------------------------------------------------------------------------------
196 @ CHECK-ERRORS: error: instruction requires: mp-extensions
198 @------------------------------------------------------------------------------
199 @ LDR(lit) - invalid offsets
200 @------------------------------------------------------------------------------
203 @ CHECK-ERRORS: error: instruction requires: thumb2