Home | History | Annotate | Download | only in X86
      1 // RUN: not llvm-mc -triple i686-unknown-unknown %s -o /dev/null 2>&1 | FileCheck %s
      2 
      3 .intel_syntax
      4 
      5 // Basic case of ambiguity for inc.
      6 
      7 inc [eax]
      8 // CHECK: error: ambiguous operand size for instruction 'inc'
      9 inc dword ptr [eax]
     10 inc word ptr [eax]
     11 inc byte ptr [eax]
     12 // CHECK-NOT: error:
     13 
     14 // Other ambiguous instructions.  Anything that doesn't take a register,
     15 // basically.
     16 
     17 dec [eax]
     18 // CHECK: error: ambiguous operand size for instruction 'dec'
     19 mov [eax], 1
     20 // CHECK: error: ambiguous operand size for instruction 'mov'
     21 and [eax], 0
     22 // CHECK: error: ambiguous operand size for instruction 'and'
     23 or [eax], 1
     24 // CHECK: error: ambiguous operand size for instruction 'or'
     25 add [eax], 1
     26 // CHECK: error: ambiguous operand size for instruction 'add'
     27 sub [eax], 1
     28 // CHECK: error: ambiguous operand size for instruction 'sub'
     29 
     30 // gas assumes these instructions are pointer-sized by default, and we follow
     31 // suit.
     32 push [eax]
     33 call [eax]
     34 jmp [eax]
     35 // CHECK-NOT: error:
     36 
     37 add byte ptr [eax], eax
     38 // CHECK: error: invalid operand for instruction
     39 
     40 add byte ptr [eax], eax
     41 // CHECK: error: invalid operand for instruction
     42 
     43 add rax, 3
     44 // CHECK: error: register %rax is only available in 64-bit mode
     45 
     46 fadd   "?half@?0??bar@@YAXXZ@4NA"
     47 // CHECK: error: ambiguous operand size for instruction 'fadd'
     48 
     49 // Instruction line with PTR inside check that they don't accept register as memory.
     50 
     51 // CHECK:  error: expected memory operand after 'ptr', found register operand instead
     52 // CHECK: andps xmm1, xmmword ptr xmm1
     53 andps xmm1, xmmword ptr xmm1
     54 // CHECK:  error: expected memory operand after 'ptr', found register operand instead
     55 // CHECK: andps xmmword ptr xmm1, xmm1
     56 andps xmmword ptr xmm1, xmm1
     57 // CHECK:  error: expected memory operand after 'ptr', found register operand instead
     58 // CHECK: mov dword ptr eax, ebx
     59 mov dword ptr eax, ebx
     60