OSDN Git Service

[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)
commit1b72e9850b845378b9332be24b95f0d75ff236af
treeabbd8af372be57c7a9072703196bdd8e06c24189
parent1dcbea8cd57df1d632b3ec73fc99880bdf5c2d05
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356329 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
test/MC/RISCV/cfi-regs-invalid.s [new file with mode: 0644]
test/MC/RISCV/cfi-regs-valid.s [new file with mode: 0644]