aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-05-04 16:12:42 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-05-04 16:12:42 +0000
commitc918d6043b823173b106c163038b14c1e2f92765 (patch)
treeb45b46b76644ac459a19f4ecbce52eaa6f62117b /test
parentd29f5282e06a395e696130d57aa3b1e0c73a60d4 (diff)
downloadexternal_llvm-c918d6043b823173b106c163038b14c1e2f92765.zip
external_llvm-c918d6043b823173b106c163038b14c1e2f92765.tar.gz
external_llvm-c918d6043b823173b106c163038b14c1e2f92765.tar.bz2
MC/X86: Add "support" for matching ATT style mnemonic prefixes.
- The idea is that when a match fails, we just try to match each of +'b', +'w', +'l'. If exactly one matches, we assume this is a mnemonic prefix and accept it. If all match, we assume it is width generic, and take the 'l' form. - This would be a horrible hack, if it weren't so simple. Therefore it is an elegant solution! Chris gets the credit for this particular elegant solution. :) - Next step to making this more robust is to have the X86 matcher generate the mnemonic prefix information. Ideally we would also compute up-front exactly which mnemonic to attempt to match, but this may require more custom code in the matcher than is really worth it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103012 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/MC/AsmParser/X86/x86_64-suffix-matching.s8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/MC/AsmParser/X86/x86_64-suffix-matching.s b/test/MC/AsmParser/X86/x86_64-suffix-matching.s
new file mode 100644
index 0000000..9a38e1b
--- /dev/null
+++ b/test/MC/AsmParser/X86/x86_64-suffix-matching.s
@@ -0,0 +1,8 @@
+// RUN: llvm-mc -triple x86_64 -o - %s | FileCheck %s
+
+// CHECK: addl $0, %eax
+ add $0, %eax
+// CHECK: addb $255, %al
+ add $0xFF, %al
+// CHECK: addl $0, (%rax)
+ add $0, 0(%rax)