diff options
author | Nirav Dave <niravd@google.com> | 2016-07-27 17:39:41 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2016-07-27 17:39:41 +0000 |
commit | 06a99a46e24ee08690ba57a0e5206e872a3d8bd6 (patch) | |
tree | f8a94c47bd35f8144100c8f7c44299821f4fc25f /llvm/test | |
parent | a033139cd4b77c0778c1c94d40db52c335653813 (diff) | |
download | bcm5719-llvm-06a99a46e24ee08690ba57a0e5206e872a3d8bd6.tar.gz bcm5719-llvm-06a99a46e24ee08690ba57a0e5206e872a3d8bd6.zip |
[MC][X86] Fix Intel Operand assembly parsing for .set ids
Fix intel syntax special case identifier operands that refer to a constant
(e.g. .set <ID> n) to be interpreted as immediate not memory in parsing.
Reviewers: rnk
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D22585
llvm-svn: 276895
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/MC/X86/intel-syntax-encoding.s | 5 | ||||
-rw-r--r-- | llvm/test/MC/X86/intel-syntax-error.s | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/MC/X86/intel-syntax-encoding.s b/llvm/test/MC/X86/intel-syntax-encoding.s index 9806ac3802e..9907cfe6f75 100644 --- a/llvm/test/MC/X86/intel-syntax-encoding.s +++ b/llvm/test/MC/X86/intel-syntax-encoding.s @@ -76,3 +76,8 @@ LBB0_3: // CHECK: encoding: [0xca,0x08,0x00] retf 8 + .set FOO, 2 + cmp eax, FOO +// CHECK: encoding: [0x83,0xf8,0x02] + cmp eax, FOO[eax] +// CHECK: encoding: [0x67,0x3b,0x40,0x02] diff --git a/llvm/test/MC/X86/intel-syntax-error.s b/llvm/test/MC/X86/intel-syntax-error.s index 7207c952aba..41b068eb3a1 100644 --- a/llvm/test/MC/X86/intel-syntax-error.s +++ b/llvm/test/MC/X86/intel-syntax-error.s @@ -11,3 +11,16 @@ _test2: .att_syntax noprefix // CHECK: error: '.att_syntax noprefix' is not supported: registers must have a '%' prefix in .att_syntax movl $257, -4(esp) + + +.intel_syntax noprefix + +.global arr +.global i +.set FOO, 2 +//CHECK-STDERR: error: cannot use base register with variable reference +mov eax, DWORD PTR arr[ebp + 1 + (2 * 5) - 3 + 1<<1] +//CHECK-STDERR: error: cannot use index register with variable reference +mov eax, DWORD PTR arr[esi*4] +//CHECK-STDERR: error: cannot use more than one symbol in memory operand +mov eax, DWORD PTR arr[i] |