fix rdar://7986634 - match instruction opcodes case insensitively.
authorChris Lattner <sabre@nondot.org>
Wed, 19 May 2010 23:34:33 +0000 (23:34 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 19 May 2010 23:34:33 +0000 (23:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104183 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCParser/AsmParser.cpp
test/MC/AsmParser/X86/x86_instructions.s

index 1f045ac1711fe3841db19247971d4a3c1832235c..36075227b7101f53c023013f825a5b9b2c507f61 100644 (file)
@@ -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");
index 16a80460e809ac99696a4a799641dc66e130fc49..4bc8a4bb3a84858224d438f419ca3afaab1f862a 100644 (file)
@@ -146,3 +146,8 @@ fadd %st(7)
 
 // CHECK: leal 0, %eax
         leal 0, %eax
+
+// rdar://7986634 - Insensitivity on opcodes.
+// CHECK: int3
+INT3
+