[RISCV] Fix RISCVAsmParser::ParseRegister and add tests
authorAlex Bradbury <asb@lowrisc.org>
Sun, 17 Mar 2019 12:00:58 +0000 (12:00 +0000)
committerAlex Bradbury <asb@lowrisc.org>
Sun, 17 Mar 2019 12:00:58 +0000 (12:00 +0000)
commitb18e314a7cbdfb4b9f671170562041eebb04c20a
treebe1539ac67d5a171453dc4c558fac2ba92d76631
parent68b4673feaaf4c16653847db3259d706229178f4
[RISCV] Fix RISCVAsmParser::ParseRegister and add tests

RISCVAsmParser::ParseRegister is called from AsmParser::parseRegisterOrNumber,
which in turn is called when processing CFI directives. The RISC-V
implementation wasn't setting RegNo, and so was incorrect. This patch address
that and adds cfi directive tests that demonstrate the fix. A follow-up patch
will factor out the register parsing logic shared between ParseRegister and
parseRegister.

llvm-svn: 356329
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/test/MC/RISCV/cfi-regs-invalid.s [new file with mode: 0644]
llvm/test/MC/RISCV/cfi-regs-valid.s [new file with mode: 0644]