diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 534771b0a21..97b9db92363 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -5466,9 +5466,8 @@ validateInstruction(MCInst &Inst, case ARM::t2STMIA_UPD: case ARM::t2STMDB_UPD: { if (listContainsReg(Inst, 3, Inst.getOperand(0).getReg())) - return Error(Operands[4]->getStartLoc(), - "writeback operator '!' not allowed when base register " - "in register list"); + return Error(Operands.back()->getStartLoc(), + "writeback register not allowed in register list"); break; } case ARM::tMUL: { diff --git a/test/MC/ARM/diagnostics.s b/test/MC/ARM/diagnostics.s index 5eae4d216e4..4942ba06cf8 100644 --- a/test/MC/ARM/diagnostics.s +++ b/test/MC/ARM/diagnostics.s @@ -433,6 +433,8 @@ ldm r2!, {r2, r3} ldmdb r2!, {r2, r3} ldmda r2!, {r2, r3} -@ CHECK-ERRORS: error: writeback operator '!' not allowed when base register in register list -@ CHECK-ERRORS: error: writeback operator '!' not allowed when base register in register list -@ CHECK-ERRORS: error: writeback operator '!' not allowed when base register in register list + popeq {sp} +@ CHECK-ERRORS: error: writeback register not allowed in register list +@ CHECK-ERRORS: error: writeback register not allowed in register list +@ CHECK-ERRORS: error: writeback register not allowed in register list +@ CHECK-ERRORS: error: writeback register not allowed in register list diff --git a/test/MC/ARM/thumb-diagnostics.s b/test/MC/ARM/thumb-diagnostics.s index 8b55e3740da..19d17c2deef 100644 --- a/test/MC/ARM/thumb-diagnostics.s +++ b/test/MC/ARM/thumb-diagnostics.s @@ -71,7 +71,7 @@ error: invalid operand for instruction @ CHECK-ERRORS-V8: error: writeback operator '!' not allowed when base register in register list @ CHECK-ERRORS-V8: ldm r2!, {r2, r3, r4, r10} @ CHECK-ERRORS-V8: ^ -@ CHECK-ERRORS-V8: error: writeback operator '!' not allowed when base register in register list +@ CHECK-ERRORS-V8: error: writeback register not allowed in register list @ CHECK-ERRORS-V8: ldmdb r2!, {r2, r3, r4} @ CHECK-ERRORS-V8: ^ @@ -100,7 +100,7 @@ error: invalid operand for instruction @ CHECK-ERRORS-V8: error: writeback operator '!' not allowed when base register in register list @ CHECK-ERRORS-V8: stm r2!, {r2, r9} @ CHECK-ERRORS-V8: ^ -@ CHECK-ERRORS-V8: error: writeback operator '!' not allowed when base register in register list +@ CHECK-ERRORS-V8: error: writeback register not allowed in register list @ CHECK-ERRORS-V8: stmdb r2!, {r0, r2} @ CHECK-ERRORS-V8: ^