1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/test/MC/Mips/mips64r5
Simon Atanasyan 7ef9328e08 [mips] Show an error if register number is out of range
Current code does not check that a register number is in the 0-31 range.
Sometimes the parser checks that later for some kinds of instructions,
but that leads to unclear / incorrect error messages like that:

  % cat test.s
  .text
  lb $4, 8($32)

  % llvm-mc test.s -triple=mips64-unknown-linux
  test.s:2:10: error: expected memory with 16-bit signed offset
    lb $4, 8($32)
           ^

Sometimes the parser just crashes:

  % cat test.s
  .text
  lw  $4, 8($32)

  % llvm-mc test.s -triple=mips64-unknown-linux

This patch resolves the problem by checking that register number after
'$' sign is in the 0-31 range. If the number is out of the range the
parser shows the `invalid register number` error, but treats invalid
register number as a normal one to continue parsing and catch other
possible errors.

Differential Revision: https://reviews.llvm.org/D45919

llvm-svn: 330732
2018-04-24 16:14:00 +00:00
..
abi-bad.s [mips] Don't derive the default ABI from the CPU in the backend. 2016-06-23 12:42:53 +00:00
abiflags.s [mips] Don't derive the default ABI from the CPU in the backend. 2016-06-23 12:42:53 +00:00
invalid-mips64.s
invalid-mips64r2.s
invalid-mips64r3.s
invalid.s [mips] Show an error if register number is out of range 2018-04-24 16:14:00 +00:00
valid-xfail.s [mips] Correct c.cond.fmt instruction definition. 2017-01-16 13:55:58 +00:00
valid.s [mips] Correct the predicates for special nops, tlb ctrl instrs, software breakpoint and prefx. 2018-04-12 12:37:02 +00:00