2011-08-30 06:24:09 +08:00
|
|
|
@ RUN: not llvm-mc -triple=thumbv7-apple-darwin < %s 2> %t
|
2015-10-28 21:58:36 +08:00
|
|
|
@ RUN: FileCheck --check-prefix=CHECK-ERRORS --check-prefix=CHECK-ERRORS-V7 < %t %s
|
|
|
|
|
|
|
|
@ RUN: not llvm-mc -triple=thumbv8-apple-darwin < %s 2> %t
|
|
|
|
@ RUN: FileCheck --check-prefix=CHECK-ERRORS --check-prefix=CHECK-ERRORS-V8 < %t %s
|
2011-08-30 06:24:09 +08:00
|
|
|
|
|
|
|
@ Ill-formed IT block instructions.
|
|
|
|
itet eq
|
|
|
|
addle r0, r1, r2
|
|
|
|
nop
|
|
|
|
it le
|
|
|
|
iteeee gt
|
|
|
|
ittfe le
|
|
|
|
nopeq
|
|
|
|
|
|
|
|
@ CHECK-ERRORS: error: incorrect condition in IT block; got 'le', but expected 'eq'
|
|
|
|
@ CHECK-ERRORS: addle r0, r1, r2
|
|
|
|
@ CHECK-ERRORS: ^
|
|
|
|
@ CHECK-ERRORS: error: incorrect condition in IT block; got 'al', but expected 'ne'
|
|
|
|
@ CHECK-ERRORS: nop
|
|
|
|
@ CHECK-ERRORS: ^
|
|
|
|
@ CHECK-ERRORS: error: instructions in IT block must be predicable
|
|
|
|
@ CHECK-ERRORS: it le
|
|
|
|
@ CHECK-ERRORS: ^
|
|
|
|
@ CHECK-ERRORS: error: too many conditions on IT instruction
|
|
|
|
@ CHECK-ERRORS: iteeee gt
|
|
|
|
@ CHECK-ERRORS: ^
|
|
|
|
@ CHECK-ERRORS: error: illegal IT block condition mask 'tfe'
|
|
|
|
@ CHECK-ERRORS: ittfe le
|
|
|
|
@ CHECK-ERRORS: ^
|
|
|
|
@ CHECK-ERRORS: error: predicated instructions must be in IT block
|
|
|
|
@ CHECK-ERRORS: nopeq
|
|
|
|
@ CHECK-ERRORS: ^
|
2011-09-15 03:28:49 +08:00
|
|
|
|
|
|
|
@ Out of range immediates for MRC/MRC2/MRRC/MRRC2
|
|
|
|
mrc p14, #8, r1, c1, c2, #4
|
|
|
|
mrc p14, #1, r1, c1, c2, #8
|
|
|
|
mrc2 p14, #8, r1, c1, c2, #4
|
|
|
|
mrc2 p14, #0, r1, c1, c2, #9
|
|
|
|
mrrc p7, #16, r5, r4, c1
|
|
|
|
mrrc2 p7, #17, r5, r4, c1
|
2017-10-04 17:18:07 +08:00
|
|
|
@ CHECK-ERRORS: operand must be an immediate in the range [0,7]
|
|
|
|
@ CHECK-ERRORS: operand must be an immediate in the range [0,7]
|
|
|
|
@ CHECK-ERRORS-V7: operand must be an immediate in the range [0,7]
|
|
|
|
@ CHECK-ERRORS-V7: operand must be an immediate in the range [0,7]
|
2017-12-04 21:42:22 +08:00
|
|
|
@ CHECK-ERRORS-V8: invalid instruction
|
2017-10-03 18:26:11 +08:00
|
|
|
@ CHECK-ERRORS-V8: too many operands for instruction
|
2017-10-04 17:18:07 +08:00
|
|
|
@ CHECK-ERRORS: operand must be an immediate in the range [0,15]
|
|
|
|
@ CHECK-ERRORS-V7: operand must be an immediate in the range [0,15]
|
2017-10-03 18:26:11 +08:00
|
|
|
@ CHECK-ERRORS-V8: invalid instruction
|
2013-06-10 22:17:08 +08:00
|
|
|
|
|
|
|
isb #-1
|
|
|
|
isb #16
|
|
|
|
@ CHECK-ERRORS: error: immediate value out of range
|
|
|
|
@ CHECK-ERRORS: error: immediate value out of range
|
2013-06-27 00:52:40 +08:00
|
|
|
|
|
|
|
itt eq
|
|
|
|
bkpteq #1
|
|
|
|
@ CHECK-ERRORS: error: instruction 'bkpt' is not predicable, but condition code specified
|
2013-08-09 18:38:32 +08:00
|
|
|
|
|
|
|
nopeq
|
|
|
|
nopeq
|
|
|
|
|
|
|
|
@ out of range operands for Thumb2 targets
|
|
|
|
|
|
|
|
beq.w #-1048578
|
|
|
|
bne.w #1048576
|
|
|
|
blt.w #1013411
|
|
|
|
b.w #-16777218
|
|
|
|
b.w #16777216
|
|
|
|
b.w #1592313
|
|
|
|
|
2013-10-01 02:50:51 +08:00
|
|
|
@ CHECK-ERRORS: error: branch target out of range
|
|
|
|
@ CHECK-ERRORS: error: branch target out of range
|
|
|
|
@ CHECK-ERRORS: error: branch target out of range
|
|
|
|
@ CHECK-ERRORS: error: branch target out of range
|
|
|
|
@ CHECK-ERRORS: error: branch target out of range
|
|
|
|
@ CHECK-ERRORS: error: branch target out of range
|
2014-04-19 07:06:39 +08:00
|
|
|
|
|
|
|
foo2:
|
|
|
|
movw r0, foo2
|
|
|
|
movt r0, foo2
|
2017-10-04 17:24:54 +08:00
|
|
|
movt r0, #0x10000
|
|
|
|
movt r0, #0x10000
|
2014-04-19 07:06:39 +08:00
|
|
|
@ CHECK-ERRORS: error: immediate expression for mov requires :lower16: or :upper16
|
|
|
|
@ CHECK-ERRORS: ^
|
2017-10-03 18:26:11 +08:00
|
|
|
@ CHECK-ERRORS: immediate expression for mov requires :lower16: or :upper16
|
2014-04-19 07:06:39 +08:00
|
|
|
@ CHECK-ERRORS: ^
|
2017-10-04 17:24:54 +08:00
|
|
|
@ CHECK-ERRORS: error: operand must be an immediate in the range [0,0xffff] or a relocatable expression
|
|
|
|
@ CHECK-ERRORS: error: operand must be an immediate in the range [0,0xffff] or a relocatable expression
|
2014-05-01 19:37:44 +08:00
|
|
|
|
|
|
|
and sp, r1, #80008000
|
|
|
|
and pc, r1, #80008000
|
2017-12-04 21:42:22 +08:00
|
|
|
@ CHECK-ERRORS: error: invalid instruction
|
|
|
|
@ CHECK-ERRORS: error: invalid instruction
|
2014-05-01 19:37:44 +08:00
|
|
|
|
2015-10-28 21:58:36 +08:00
|
|
|
ssat r0, #1, r0, asr #32
|
|
|
|
usat r0, #1, r0, asr #32
|
2015-01-20 00:37:17 +08:00
|
|
|
@ CHECK-ERRORS: error: 'asr #32' shift amount not allowed in Thumb mode
|
|
|
|
@ CHECK-ERRORS: error: 'asr #32' shift amount not allowed in Thumb mode
|
2015-10-28 21:58:36 +08:00
|
|
|
|
|
|
|
@ PC is not valid as shifted-rGPR
|
|
|
|
sbc.w r2, r7, pc, lsr #16
|
|
|
|
and.w r2, r7, pc, lsr #16
|
2017-10-03 18:26:11 +08:00
|
|
|
@ CHECK-ERRORS: error: invalid instruction, any one of the following would fix this:
|
|
|
|
@ CHECK-ERRORS: note: invalid operand for instruction
|
2017-10-10 20:31:53 +08:00
|
|
|
@ CHECK-ERRORS-V7: note: operand must be a register in range [r0, r12] or r14
|
|
|
|
@ CHECK-ERRORS-V8: note: operand must be a register in range [r0, r14]
|
2017-10-03 18:26:11 +08:00
|
|
|
@ CHECK-ERRORS: error: invalid instruction, any one of the following would fix this:
|
|
|
|
@ CHECK-ERRORS: note: invalid operand for instruction
|
2017-10-10 20:31:53 +08:00
|
|
|
@ CHECK-ERRORS-V7: note: operand must be a register in range [r0, r12] or r14
|
|
|
|
@ CHECK-ERRORS-V8: note: operand must be a register in range [r0, r14]
|
2015-10-28 21:58:36 +08:00
|
|
|
|
2016-02-26 00:54:52 +08:00
|
|
|
|
|
|
|
@ PC is not valid as base of load
|
|
|
|
ldr r0, [pc, r0]
|
|
|
|
ldrb r1, [pc, r2]
|
|
|
|
ldrh r3, [pc, r3]
|
|
|
|
pld r4, [pc, r5]
|
|
|
|
str r6, [pc, r7]
|
|
|
|
strb r7 [pc, r8]
|
|
|
|
strh r9, [pc, r10]
|
2017-10-03 18:26:11 +08:00
|
|
|
@ CHECK-ERRORS: error: invalid instruction, any one of the following would fix this:
|
|
|
|
@ CHECK-ERRORS: note: invalid operand for instruction
|
|
|
|
@ CHECK-ERRORS: note: instruction requires: arm-mode
|
|
|
|
@ CHECK-ERRORS: error: invalid instruction, any one of the following would fix this:
|
|
|
|
@ CHECK-ERRORS: note: invalid operand for instruction
|
|
|
|
@ CHECK-ERRORS: note: instruction requires: arm-mode
|
|
|
|
@ CHECK-ERRORS: error: invalid instruction, any one of the following would fix this:
|
|
|
|
@ CHECK-ERRORS: note: instruction requires: arm-mode
|
|
|
|
@ CHECK-ERRORS: note: invalid operand for instruction
|
2017-12-04 21:42:22 +08:00
|
|
|
@ CHECK-ERRORS: error: invalid instruction
|
2017-10-03 18:26:11 +08:00
|
|
|
@ CHECK-ERRORS: error: invalid instruction, any one of the following would fix this:
|
|
|
|
@ CHECK-ERRORS: note: invalid operand for instruction
|
|
|
|
@ CHECK-ERRORS: note: instruction requires: arm-mode
|
2016-02-26 00:54:52 +08:00
|
|
|
@ CHECK-ERRORS: error: immediate value expected for vector index
|
2017-10-03 18:26:11 +08:00
|
|
|
@ CHECK-ERRORS: error: invalid instruction, any one of the following would fix this:
|
|
|
|
@ CHECK-ERRORS: note: instruction requires: arm-mode
|
|
|
|
@ CHECK-ERRORS: note: invalid operand for instruction
|
2017-01-31 22:35:01 +08:00
|
|
|
|
|
|
|
@ SWP(B) is an ARM-only instruction
|
|
|
|
swp r0, r1, [r2]
|
|
|
|
swpb r3, r4, [r5]
|
2017-10-03 18:26:11 +08:00
|
|
|
@ CHECK-ERRORS-V7: error: instruction requires: arm-mode
|
|
|
|
@ CHECK-ERRORS-V7: error: instruction requires: arm-mode
|
|
|
|
@ CHECK-ERRORS-V8: error: invalid instruction
|
|
|
|
@ CHECK-ERRORS-V8: error: invalid instruction
|
2017-11-21 23:16:50 +08:00
|
|
|
|
|
|
|
@ Generic error for too few operands
|
|
|
|
adds
|
|
|
|
adds r0
|
|
|
|
@ CHECK-ERRORS: error: too few operands for instruction
|
|
|
|
@ CHECK-ERRORS: error: too few operands for instruction
|