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}
56 @ Invalid writeback and register lists for PUSH/POP
59 @ CHECK-ERRORS: error: registers must be in range r0-r7 or pc
60 @ CHECK-ERRORS: pop {r1, r2, r10}
62 @ CHECK-ERRORS: error: registers must be in range r0-r7 or lr
63 @ CHECK-ERRORS: push {r8, r9}
67 @ Invalid writeback and register lists for STM
70 @ CHECK-ERRORS: error: instruction requires: thumb2
71 @ CHECK-ERRORS: stm r1, {r2, r6}
73 @ CHECK-ERRORS: error: registers must be in range r0-r7
74 @ CHECK-ERRORS: stm r1!, {r2, r9}
77 @ Out of range immediates for LSL instruction.
80 @ CHECK-ERRORS: error: invalid operand for instruction
81 @ CHECK-ERRORS: lsls r4, r5, #-1
83 @ CHECK-ERRORS: error: invalid operand for instruction
84 @ CHECK-ERRORS: lsls r4, r5, #32
87 @ Mismatched source/destination operands for MUL instruction.
89 @ CHECK-ERRORS: error: destination register must match source register
90 @ CHECK-ERRORS: muls r1, r2, r3
94 @ Out of range immediates for STR instruction.
98 @ CHECK-ERRORS: error: instruction requires: thumb2
99 @ CHECK-ERRORS: str r2, [r7, #-1]
101 @ CHECK-ERRORS: error: instruction requires: thumb2
102 @ CHECK-ERRORS: str r5, [r1, #3]
104 @ CHECK-ERRORS: error: instruction requires: thumb2
105 @ CHECK-ERRORS: str r3, [r7, #128]
108 @ Out of range immediate for SVC instruction.
111 @ CHECK-ERRORS: error: invalid operand for instruction
112 @ CHECK-ERRORS: svc #-1
114 @ CHECK-ERRORS: error: instruction requires: arm-mode
115 @ CHECK-ERRORS: svc #256
119 @ Out of range immediate for ADD SP instructions
124 @ CHECK-ERRORS: error: instruction requires: thumb2
125 @ CHECK-ERRORS: add sp, #-1
127 @ CHECK-ERRORS: error: instruction requires: thumb2
128 @ CHECK-ERRORS: add sp, #3
130 @ CHECK-ERRORS: error: instruction requires: thumb2
131 @ CHECK-ERRORS: add sp, sp, #512
133 @ CHECK-ERRORS: error: instruction requires: arm-mode
134 @ CHECK-ERRORS: add r2, sp, #1024
138 @ CHECK-ERRORS: error: source register must be the same as destination
139 @ CHECK-ERRORS: add r2, sp, ip
142 @------------------------------------------------------------------------------
143 @ WFE/WFI/YIELD - are not supported pre v6T2
144 @------------------------------------------------------------------------------
149 @ CHECK-ERRORS: error: instruction requires: thumb2
152 @ CHECK-ERRORS: error: instruction requires: thumb2
155 @ CHECK-ERRORS: error: instruction requires: thumb2
156 @ CHECK-ERRORS: yield