mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-29 07:53:33 +00:00
[mips] Attempting to use register $32 should be an error instead of an assertion.
Reviewers: matheusalmeida Reviewed By: matheusalmeida Differential Revision: http://llvm-reviews.chandlerc.com/D3201 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204932 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aebc63ab2e
commit
16dc6ed33f
@ -1217,7 +1217,7 @@ unsigned MipsAsmParser::getGPR(int RegNo) {
|
||||
|
||||
int MipsAsmParser::matchRegisterByNumber(unsigned RegNum, unsigned RegClass) {
|
||||
if (RegNum >
|
||||
getContext().getRegisterInfo()->getRegClass(RegClass).getNumRegs())
|
||||
getContext().getRegisterInfo()->getRegClass(RegClass).getNumRegs() - 1)
|
||||
return -1;
|
||||
|
||||
if (RegClass == Mips::GPR32RegClassID || RegClass == Mips::GPR64RegClassID)
|
||||
|
8
test/MC/Mips/mips-register-names-invalid.s
Normal file
8
test/MC/Mips/mips-register-names-invalid.s
Normal file
@ -0,0 +1,8 @@
|
||||
# RUN: not llvm-mc %s -triple=mips-unknown-freebsd -show-encoding 2>%t0
|
||||
# RUN: FileCheck %s < %t0
|
||||
|
||||
# $32 used to trigger an assertion instead of the usual error message due to
|
||||
# an off-by-one bug.
|
||||
|
||||
# CHECK: :[[@LINE+1]]:18: error: invalid operand for instruction
|
||||
add $32, $0, $0
|
Loading…
Reference in New Issue
Block a user