summaryrefslogtreecommitdiff
path: root/test/MC/X86
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-02-12 18:29:02 +0000
committerChad Rosier <mcrosier@apple.com>2013-02-12 18:29:02 +0000
commit8915e27704b2afd362a69c6be1111fb06bbcc727 (patch)
tree068e87c713405ef644808ce4b7e7bb49eea6c289 /test/MC/X86
parent1cb058f77c7b15045c677ef30586fe45c2929010 (diff)
downloadllvm-8915e27704b2afd362a69c6be1111fb06bbcc727.tar.gz
llvm-8915e27704b2afd362a69c6be1111fb06bbcc727.tar.bz2
llvm-8915e27704b2afd362a69c6be1111fb06bbcc727.tar.xz
[ms-inline asm] Add support for lexing binary integers with a [bB] suffix.
This is complicated by backward labels (e.g., 0b can be both a backward label and a binary zero). The current implementation assumes [0-9]b is always a label and thus it's possible for 0b and 1b to not be interpreted correctly for ms-style inline assembly. However, this is relatively simple to fix in the inline assembly (i.e., drop the [bB]). This patch also limits backward labels to [0-9]b, so that only 0b and 1b are ambiguous. Part of rdar://12470373 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174983 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/X86')
-rw-r--r--test/MC/X86/intel-syntax-binary.s14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/MC/X86/intel-syntax-binary.s b/test/MC/X86/intel-syntax-binary.s
new file mode 100644
index 0000000000..1c4a4cc25b
--- /dev/null
+++ b/test/MC/X86/intel-syntax-binary.s
@@ -0,0 +1,14 @@
+// RUN: llvm-mc -triple x86_64-unknown-unknown -x86-asm-syntax=intel %s | FileCheck %s
+// rdar://12470373
+
+// Checks to make sure we parse the binary suffix properly.
+// CHECK: movl $1, %eax
+ mov eax, 01b
+// CHECK: movl $2, %eax
+ mov eax, 10b
+// CHECK: movl $3, %eax
+ mov eax, 11b
+// CHECK: movl $3, %eax
+ mov eax, 11B
+// CHECK: movl $2711, %eax
+ mov eax, 101010010111B