llvm/test/MC/SystemZ/tokens.s
Richard Sandiford bfe3212dd8 [SystemZ] Improve AsmParser handling of invalid instructions
Previously, an invalid instruction like:

	foo     %r1, %r0

would generate the rather odd error message:

....: error: unknown token in expression
	foo     %r1, %r0
		^

We now get the more informative:

....: error: invalid instruction
	foo     %r1, %r0
	^

The same would happen if an address were used where a register was expected.
We now get "invalid operand for instruction" instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182644 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 14:26:46 +00:00

71 lines
1.7 KiB
ArmAsm

# RUN: not llvm-mc -triple s390x-linux-gnu < %s 2> %t
# RUN: FileCheck < %t %s
#CHECK: error: invalid instruction
#CHECK: foo 100, 200
#CHECK: error: register expected
#CHECK: foo 100(, 200
#CHECK: error: register expected
#CHECK: foo 100(0), 200
#CHECK: error: invalid operand
#CHECK: foo 100(%a0), 200
#CHECK: error: %r0 used in an address
#CHECK: foo 100(%r0), 200
#CHECK: error: invalid operand
#CHECK: foo 100(%r1,%a0), 200
#CHECK: error: %r0 used in an address
#CHECK: foo 100(%r1,%r0), 200
#CHECK: error: unexpected token in address
#CHECK: foo 100(%r1,%r2, 200
#CHECK: error: invalid instruction
#CHECK: foo 100(%r1,%r2), 200
#CHECK: error: unexpected token in argument list
#CHECK: foo 100(%r1,%r2)(, 200
#CHECK: error: invalid instruction
#CHECK: foo %r0, 200
#CHECK: error: invalid instruction
#CHECK: foo %r15, 200
#CHECK: error: invalid register
#CHECK: foo %r16, 200
#CHECK: error: invalid instruction
#CHECK: foo %f0, 200
#CHECK: error: invalid instruction
#CHECK: foo %f15, 200
#CHECK: error: invalid register
#CHECK: foo %f16, 200
#CHECK: error: invalid instruction
#CHECK: foo %a0, 200
#CHECK: error: invalid instruction
#CHECK: foo %a15, 200
#CHECK: error: invalid register
#CHECK: foo %a16, 200
#CHECK: error: invalid register
#CHECK: foo %c, 200
#CHECK: error: invalid register
#CHECK: foo %, 200
#CHECK: error: unknown token in expression
#CHECK: foo {, 200
foo 100, 200
foo 100(, 200
foo 100(0), 200
foo 100(%a0), 200
foo 100(%r0), 200
foo 100(%r1,%a0), 200
foo 100(%r1,%r0), 200
foo 100(%r1,%r2, 200
foo 100(%r1,%r2), 200
foo 100(%r1,%r2)(, 200
foo %r0, 200
foo %r15, 200
foo %r16, 200
foo %f0, 200
foo %f15, 200
foo %f16, 200
foo %a0, 200
foo %a15, 200
foo %a16, 200
foo %c, 200
foo %, 200
foo {, 200