mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
ARM IAS: fix diagnostics of improper qualification
An improper qualifier would result in a superfluous error due to the parser not consuming the remainder of the statement. Simply consume the remainder of the statement to avoid the error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199035 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fcb6800dd4
commit
3d83eb48ac
@ -5325,6 +5325,7 @@ bool ARMAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
||||
// For for ARM mode generate an error if the .n qualifier is used.
|
||||
if (ExtraToken == ".n" && !isThumb()) {
|
||||
SMLoc Loc = SMLoc::getFromPointer(NameLoc.getPointer() + Start);
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "instruction with .n (narrow) qualifier not allowed in "
|
||||
"arm mode");
|
||||
}
|
||||
|
15
test/MC/ARM/arm-qualifier-diagnostics.s
Normal file
15
test/MC/ARM/arm-qualifier-diagnostics.s
Normal file
@ -0,0 +1,15 @@
|
||||
@ RUN: not llvm-mc -triple armv7-eabi -filetype asm -o - %s 2>&1 | FileCheck %s
|
||||
|
||||
.syntax unified
|
||||
|
||||
.type function,%function
|
||||
function:
|
||||
ldr.n r0, [r0]
|
||||
|
||||
@ CHECK: error: instruction with .n (narrow) qualifier not allowed in arm mode
|
||||
@ CHECK: ldr.n r0, [r0]
|
||||
@ CHECK: ^
|
||||
@ CHECK-NOT: error: unexpected token in operand
|
||||
@ CHECK-NOT: ldr.n r0, [r0]
|
||||
@ CHECK-NOT: ^
|
||||
|
Loading…
Reference in New Issue
Block a user