mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-21 18:22:53 +01:00
[ms] [llvm-ml] When parsing MASM, "jmp short" instructions are case insensitive
Handle "short" in a case-insensitive fashion in MASM. Required to correctly parse z_Windows_NT-586_asm.asm from the OpenMP runtime. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D104195
This commit is contained in:
parent
679dc9bc3b
commit
d15098fdc8
@ -3105,7 +3105,8 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
||||
(PatchedName.startswith("j") &&
|
||||
ParseConditionCode(PatchedName.substr(1)) != X86::COND_INVALID))) {
|
||||
StringRef NextTok = Parser.getTok().getString();
|
||||
if (NextTok == "short") {
|
||||
if (Parser.isParsingMasm() ? NextTok.equals_lower("short")
|
||||
: NextTok == "short") {
|
||||
SMLoc NameEndLoc =
|
||||
NameLoc.getFromPointer(NameLoc.getPointer() + Name.size());
|
||||
// Eat the short keyword.
|
||||
|
21
test/tools/llvm-ml/jmp_short.asm
Normal file
21
test/tools/llvm-ml/jmp_short.asm
Normal file
@ -0,0 +1,21 @@
|
||||
; RUN: llvm-ml -filetype=s %s /Fo - | FileCheck %s
|
||||
|
||||
.code
|
||||
|
||||
t1:
|
||||
jmp short t1_label
|
||||
jmp SHORT t1_label
|
||||
JmP Short t1_label
|
||||
JMP SHORT t1_label
|
||||
mov eax, eax
|
||||
t1_label:
|
||||
ret
|
||||
|
||||
; CHECK-LABEL: t1:
|
||||
; CHECK-NEXT: jmp t1_label
|
||||
; CHECK-NEXT: jmp t1_label
|
||||
; CHECK-NEXT: jmp t1_label
|
||||
; CHECK-NEXT: jmp t1_label
|
||||
; CHECK-NEXT: mov eax, eax
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user