S12Z: GAS: Disallow immediate destination operands
authorJohn Darrington <john@darrington.wattle.id.au>
Fri, 1 Feb 2019 16:42:54 +0000 (17:42 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Fri, 1 Feb 2019 17:08:02 +0000 (18:08 +0100)
commit8b3a46f93c2b9ee839f806713afe7f88f0482214
tree7e0311d430b1f446d4577bf54f94d1e3753db396
parentc75eca848b682c20dcd3ef850f67491295c116b1
S12Z: GAS: Disallow immediate destination operands

The assembler permitted instructions which attempted to assign to an immediate
operand.  Bizarrely there is a valid machine code for such operations (although
the documentation says it's "inappropriate").  This change causes such attempts
to fail with  an error message.

gas/

* config/tc-s12z.c (lex_opr): Add a parameter to indicate whether
immediate mode operands should be permitted.
* testsuite/s12z/imm-dest.d: New file.
* testsuite/s12z/imm-dest.l: New file.
* testsuite/s12z/imm-dest.s: New file.
* testsuite/s12z/s12z.exp: Add them.
gas/ChangeLog
gas/config/tc-s12z.c
gas/testsuite/gas/s12z/imm-dest.d [new file with mode: 0644]
gas/testsuite/gas/s12z/imm-dest.l [new file with mode: 0644]
gas/testsuite/gas/s12z/imm-dest.s [new file with mode: 0644]
gas/testsuite/gas/s12z/s12z.exp