Home | History | Annotate | Download | only in X86
      1 // RUN: not llvm-mc -triple x86_64-unknown-unknown %s 2> %t.err
      2 // RUN: FileCheck --check-prefix=64 < %t.err %s
      3 
      4 // RUN: not llvm-mc -triple i386-unknown-unknown %s 2> %t.err
      5 // RUN: FileCheck --check-prefix=32 < %t.err %s
      6 // rdar://8204588
      7 
      8 // 64: error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')
      9 cmp $0, 0(%eax)
     10 
     11 // 32: error: register %rax is only available in 64-bit mode
     12 addl $0, 0(%rax)
     13 
     14 // 32: error: register %xmm16 is only available in 64-bit mode
     15 // 64: error: register %xmm16 is only available with AVX512
     16 vaddps %xmm16, %xmm0, %xmm0
     17 
     18 // 32: test.s:8:2: error: invalid instruction mnemonic 'movi'
     19 
     20 # 8 "test.s"
     21  movi $8,%eax
     22 
     23 movl 0(%rax), 0(%edx)  // error: invalid operand for instruction
     24 
     25 // 32: error: instruction requires: 64-bit mode
     26 sysexitq
     27 
     28 // rdar://10710167
     29 // 64: error: expected scale expression
     30 lea (%rsp, %rbp, $4), %rax
     31 
     32 // rdar://10423777
     33 // 64: error: base register is 64-bit, but index register is not
     34 movq (%rsi,%ecx),%xmm0
     35 
     36 // 64: error: invalid 16-bit base register
     37 movl %eax,(%bp,%si)
     38 
     39 // 32: error: scale factor in 16-bit address must be 1
     40 movl %eax,(%bp,%si,2)
     41 
     42 // 32: error: invalid 16-bit base register
     43 movl %eax,(%cx)
     44 
     45 // 32: error: invalid 16-bit base/index register combination
     46 movl %eax,(%bp,%bx)
     47 
     48 // 32: error: 16-bit memory operand may not include only index register
     49 movl %eax,(,%bx)
     50 
     51 // 32: error: invalid operand for instruction
     52 outb al, 4
     53 
     54 // 32: error: invalid segment register
     55 // 64: error: invalid segment register
     56 movl %eax:0x00, %ebx
     57 
     58 // 32: error: invalid operand for instruction
     59 // 64: error: invalid operand for instruction
     60 cmpps $-129, %xmm0, %xmm0
     61 
     62 // 32: error: invalid operand for instruction
     63 // 64: error: invalid operand for instruction
     64 cmppd $256, %xmm0, %xmm0
     65 
     66 // 32: error: instruction requires: 64-bit mode
     67 jrcxz 1
     68 
     69 // 64: error: instruction requires: Not 64-bit mode
     70 jcxz 1
     71