diff options
author | Chris Lattner <sabre@nondot.org> | 2010-05-19 23:34:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-05-19 23:34:33 +0000 |
commit | a7f1354eb5289b340220c9138befff89822119b2 (patch) | |
tree | ff2ce939030b2b9328f32587eb7ab9a120134459 | |
parent | a008750aa9c3327a353c2345935b35d9e9f1161a (diff) |
fix rdar://7986634 - match instruction opcodes case insensitively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104183 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/MC/MCParser/AsmParser.cpp | 7 | ||||
-rw-r--r-- | test/MC/AsmParser/X86/x86_instructions.s | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index 1f045ac171..36075227b7 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -783,8 +783,13 @@ bool AsmParser::ParseStatement() { return false; } + // Canonicalize the opcode to lower case. + SmallString<128> Opcode; + for (unsigned i = 0, e = IDVal.size(); i != e; ++i) + Opcode.push_back(tolower(IDVal[i])); + SmallVector<MCParsedAsmOperand*, 8> ParsedOperands; - bool HadError = getTargetParser().ParseInstruction(IDVal, IDLoc, + bool HadError = getTargetParser().ParseInstruction(Opcode.str(), IDLoc, ParsedOperands); if (!HadError && Lexer.isNot(AsmToken::EndOfStatement)) HadError = TokError("unexpected token in argument list"); diff --git a/test/MC/AsmParser/X86/x86_instructions.s b/test/MC/AsmParser/X86/x86_instructions.s index 16a80460e8..4bc8a4bb3a 100644 --- a/test/MC/AsmParser/X86/x86_instructions.s +++ b/test/MC/AsmParser/X86/x86_instructions.s @@ -146,3 +146,8 @@ fadd %st(7) // CHECK: leal 0, %eax leal 0, %eax + +// rdar://7986634 - Insensitivity on opcodes. +// CHECK: int3 +INT3 + |