summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/X86/intel-syntax-binary.s
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
commitf72d06a9197124a37bcf5d27b80b7f9f64f0a549 (patch)
treec71af34307ccc5832ec59aaaaab78cf228249cba /llvm/test/MC/X86/intel-syntax-binary.s
parent1c3e3c143306669905fb7ca7afaf5231d7285711 (diff)
downloadbcm5719-llvm-f72d06a9197124a37bcf5d27b80b7f9f64f0a549.tar.gz
bcm5719-llvm-f72d06a9197124a37bcf5d27b80b7f9f64f0a549.zip
[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 llvm-svn: 174983
Diffstat (limited to 'llvm/test/MC/X86/intel-syntax-binary.s')
-rw-r--r--llvm/test/MC/X86/intel-syntax-binary.s14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/MC/X86/intel-syntax-binary.s b/llvm/test/MC/X86/intel-syntax-binary.s
new file mode 100644
index 00000000000..1c4a4cc25b0
--- /dev/null
+++ b/llvm/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
OpenPOWER on IntegriCloud