fix rdar://8407548, I missed the commuted form of xchg/test without a suffix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113427 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 9a43913..7e9dacf 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -850,7 +850,8 @@
   // The assembler accepts "xchgX <reg>, <mem>" and "xchgX <mem>, <reg>" as
   // synonyms.  Our tables only have the "<reg>, <mem>" form, so if we see the
   // other operand order, swap them.
-  if (Name == "xchgb" || Name == "xchgw" || Name == "xchgl" || Name == "xchgq")
+  if (Name == "xchgb" || Name == "xchgw" || Name == "xchgl" || Name == "xchgq"||
+      Name == "xchg")
     if (Operands.size() == 3 &&
         static_cast<X86Operand*>(Operands[1])->isMem() &&
         static_cast<X86Operand*>(Operands[2])->isReg()) {
@@ -860,7 +861,8 @@
   // The assembler accepts "testX <reg>, <mem>" and "testX <mem>, <reg>" as
   // synonyms.  Our tables only have the "<mem>, <reg>" form, so if we see the
   // other operand order, swap them.
-  if (Name == "testb" || Name == "testw" || Name == "testl" || Name == "testq")
+  if (Name == "testb" || Name == "testw" || Name == "testl" || Name == "testq"||
+      Name == "test")
     if (Operands.size() == 3 &&
         static_cast<X86Operand*>(Operands[1])->isReg() &&
         static_cast<X86Operand*>(Operands[2])->isMem()) {