diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-02-12 18:29:02 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-02-12 18:29:02 +0000 |
commit | 8915e27704b2afd362a69c6be1111fb06bbcc727 (patch) | |
tree | 068e87c713405ef644808ce4b7e7bb49eea6c289 /test/MC | |
parent | 1cb058f77c7b15045c677ef30586fe45c2929010 (diff) |
[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')
-rw-r--r-- | test/MC/MachO/direction_labels.s | 12 | ||||
-rw-r--r-- | test/MC/X86/intel-syntax-binary.s | 14 |
2 files changed, 20 insertions, 6 deletions
diff --git a/test/MC/MachO/direction_labels.s b/test/MC/MachO/direction_labels.s index e224ed3a14..35f5d44f72 100644 --- a/test/MC/MachO/direction_labels.s +++ b/test/MC/MachO/direction_labels.s @@ -1,15 +1,15 @@ // RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s direction_labels: -10: nop - jmp 10b - nop +8: nop + jmp 8b + nop jne 0f 0: nop jne 0b - jmp 11f -11: nop - ret + jmp 9f +9: nop + ret // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) 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 |