mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
ARM: improve caret diagnostics for invalid FPU name
In the case of an invalid FPU name, place the caret at the name rather than FPU directive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227595 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
728d12e435
commit
9492802a37
@ -9229,6 +9229,7 @@ static const struct {
|
||||
/// parseDirectiveFPU
|
||||
/// ::= .fpu str
|
||||
bool ARMAsmParser::parseDirectiveFPU(SMLoc L) {
|
||||
SMLoc FPUNameLoc = getTok().getLoc();
|
||||
StringRef FPU = getParser().parseStringToEndOfStatement().trim();
|
||||
|
||||
unsigned ID = StringSwitch<unsigned>(FPU)
|
||||
@ -9237,7 +9238,7 @@ bool ARMAsmParser::parseDirectiveFPU(SMLoc L) {
|
||||
.Default(ARM::INVALID_FPU);
|
||||
|
||||
if (ID == ARM::INVALID_FPU) {
|
||||
Error(L, "Unknown FPU name");
|
||||
Error(FPUNameLoc, "Unknown FPU name");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
10
test/MC/ARM/directive-fpu-diagnostics.s
Normal file
10
test/MC/ARM/directive-fpu-diagnostics.s
Normal file
@ -0,0 +1,10 @@
|
||||
@ RUN: not llvm-mc -triple armv7 -filetype asm -o /dev/null %s 2>&1 \
|
||||
@ RUN: | FileCheck %s -strict-whitespace
|
||||
|
||||
.text
|
||||
.thumb
|
||||
|
||||
.fpu invalid
|
||||
@ CHECK: error: Unknown FPU name
|
||||
@ CHECK: .fpu invalid
|
||||
@ CHECK: ^
|
Loading…
x
Reference in New Issue
Block a user