2011-08-17 05:11:21 +08:00
|
|
|
@ RUN: not llvm-mc -triple=thumbv6-apple-darwin < %s 2> %t
|
|
|
|
@ RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s
|
2011-08-20 04:46:54 +08:00
|
|
|
@ RUN: not llvm-mc -triple=thumbv5-apple-darwin < %s 2> %t
|
|
|
|
@ RUN: FileCheck --check-prefix=CHECK-ERRORS-V5 < %t %s
|
2011-08-17 05:11:21 +08:00
|
|
|
|
|
|
|
@ Check for various assembly diagnostic messages on invalid input.
|
|
|
|
|
|
|
|
@ ADD instruction w/o 'S' suffix.
|
|
|
|
add r1, r2, r3
|
|
|
|
@ CHECK-ERRORS: error: invalid instruction
|
|
|
|
@ CHECK-ERRORS: add r1, r2, r3
|
|
|
|
@ CHECK-ERRORS: ^
|
2011-08-17 06:20:01 +08:00
|
|
|
|
|
|
|
@ Instructions which require v6+ for both registers to be low regs.
|
|
|
|
add r2, r3
|
|
|
|
mov r2, r3
|
|
|
|
@ CHECK-ERRORS: error: instruction variant requires Thumb2
|
|
|
|
@ CHECK-ERRORS: add r2, r3
|
|
|
|
@ CHECK-ERRORS: ^
|
2011-08-20 04:46:54 +08:00
|
|
|
@ CHECK-ERRORS-V5: error: instruction variant requires ARMv6 or later
|
|
|
|
@ CHECK-ERRORS-V5: mov r2, r3
|
|
|
|
@ CHECK-ERRORS-V5: ^
|
2011-08-18 06:49:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
@ Out of range immediates for ASR instruction.
|
|
|
|
asrs r2, r3, #33
|
|
|
|
asrs r2, r3, #0
|
|
|
|
@ CHECK-ERRORS: error: invalid operand for instruction
|
|
|
|
@ CHECK-ERRORS: asrs r2, r3, #33
|
|
|
|
@ CHECK-ERRORS: ^
|
|
|
|
@ CHECK-ERRORS: error: invalid operand for instruction
|
|
|
|
@ CHECK-ERRORS: asrs r2, r3, #0
|
|
|
|
@ CHECK-ERRORS: ^
|
2011-08-18 07:11:13 +08:00
|
|
|
|
|
|
|
@ Out of range immediates for BKPT instruction.
|
|
|
|
bkpt #256
|
|
|
|
bkpt #-1
|
|
|
|
error: invalid operand for instruction
|
|
|
|
bkpt #256
|
|
|
|
^
|
|
|
|
error: invalid operand for instruction
|
|
|
|
bkpt #-1
|
|
|
|
^
|
2011-08-19 05:50:53 +08:00
|
|
|
|
|
|
|
@ Invalid writeback and register lists for LDM
|
|
|
|
ldm r2!, {r5, r8}
|
|
|
|
ldm r2, {r5, r7}
|
|
|
|
@ CHECK-ERRORS: error: registers must be in range r0-r7
|
|
|
|
@ CHECK-ERRORS: ldm r2!, {r5, r8}
|
|
|
|
@ CHECK-ERRORS: ^
|
|
|
|
@ CHECK-ERRORS: error: writeback operator '!' expected
|
|
|
|
@ CHECK-ERRORS: ldm r2, {r5, r7}
|
|
|
|
@ CHECK-ERRORS: ^
|
2011-08-20 03:29:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
@ Out of range immediates for LSL instruction.
|
|
|
|
lsls r4, r5, #-1
|
|
|
|
lsls r4, r5, #32
|
|
|
|
@ CHECK-ERRORS: error: invalid operand for instruction
|
|
|
|
@ CHECK-ERRORS: lsls r4, r5, #-1
|
|
|
|
@ CHECK-ERRORS: ^
|
|
|
|
@ CHECK-ERRORS: error: invalid operand for instruction
|
|
|
|
@ CHECK-ERRORS: lsls r4, r5, #32
|
|
|
|
@ CHECK-ERRORS: ^
|
2011-08-20 06:07:46 +08:00
|
|
|
|
|
|
|
@ Mismatched source/destination operands for MUL instruction.
|
|
|
|
muls r1, r2, r3
|
2011-08-20 06:30:46 +08:00
|
|
|
@ CHECK-ERRORS: error: destination register must match source register
|
2011-08-20 06:07:46 +08:00
|
|
|
@ CHECK-ERRORS: muls r1, r2, r3
|
|
|
|
@ CHECK-ERRORS: ^
|