[PATCH] D104194: Fix misspelled instruction in X86 assembly parser

Eric Astor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 13 15:19:56 PDT 2021


epastor updated this revision to Diff 351745.
epastor added a comment.

Add test case


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104194/new/

https://reviews.llvm.org/D104194

Files:
  llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
  llvm/test/MC/X86/intel-syntax.s


Index: llvm/test/MC/X86/intel-syntax.s
===================================================================
--- llvm/test/MC/X86/intel-syntax.s
+++ llvm/test/MC/X86/intel-syntax.s
@@ -66,6 +66,12 @@
   ljmp [rax]
 // CHECK: jmp _foo
   jmp short _foo
+// CHECK: jb _foo
+  jc short _foo
+// CHECK: jae _foo
+  jnc short _foo
+// CHECK: jecxz _foo
+  jecxz short _foo
 // CHECK: jp _foo
   jpe short _foo
 
Index: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -3101,7 +3101,7 @@
   // Hack to skip "short" following Jcc.
   if (isParsingIntelSyntax() &&
       (PatchedName == "jmp" || PatchedName == "jc" || PatchedName == "jnc" ||
-       PatchedName == "jcxz" || PatchedName == "jexcz" ||
+       PatchedName == "jcxz" || PatchedName == "jecxz" ||
        (PatchedName.startswith("j") &&
         ParseConditionCode(PatchedName.substr(1)) != X86::COND_INVALID))) {
     StringRef NextTok = Parser.getTok().getString();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104194.351745.patch
Type: text/x-patch
Size: 1094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210613/a3dce8aa/attachment.bin>


More information about the llvm-commits mailing list