Home | History | Annotate | Download | only in X86
      1 // RUN: not llvm-mc -triple i686-unknown-unknown -x86-asm-syntax=att %s -o /dev/null 2>&1 | FileCheck %s
      2 
      3 // This tests weird forms of Intel and AT&T syntax that gas accepts that we
      4 // don't.  The [no]prefix operand of the syntax directive indicates whether
      5 // registers need a '%' prefix.
      6 
      7 .intel_syntax prefix
      8 // CHECK: error: '.intel_syntax prefix' is not supported: registers must not have a '%' prefix in .intel_syntax
      9 _test2:
     10 	mov	DWORD PTR [%esp - 4], 257
     11 .att_syntax noprefix
     12 // CHECK: error: '.att_syntax noprefix' is not supported: registers must have a '%' prefix in .att_syntax
     13 	movl	$257, -4(esp)
     14 
     15 
     16 .intel_syntax noprefix
     17 
     18 .global arr
     19 .global i
     20 .set FOO, 2
     21 
     22 //CHECK: error: cannot use more than one symbol in memory operand
     23 mov eax, DWORD PTR arr[i]
     24 //CHECK: error: rip can only be used as a base register
     25 .code64
     26 mov rax, rip
     27 //CHECK: error: invalid base+index expression
     28 mov rbx, [rax+rip]
     29 //CHECK: error: scale factor in address must be 1, 2, 4 or 8
     30 lea RDX, [unknown_number * RAX + RBX + _foo]
     31 //CHECK: error: BaseReg/IndexReg already set!
     32 lea RDX, [4 * RAX + 27 * RBX + _pat]
     33 //CHECK: error: unexpected bracket encountered
     34 lea RDX, [[arr]
     35 //CHECK: error: unexpected bracket encountered
     36 lea RDX, [arr[]
     37 
     38 .intel_syntax
     39 
     40 // CHECK: error: invalid operand for instruction
     41 punpcklbw mm0, qword ptr [rsp]
     42 // CHECK: error: invalid operand for instruction
     43 punpcklwd mm0, word ptr [rsp]
     44 // CHECK: error: invalid operand for instruction
     45 punpckldq mm0, qword ptr [rsp]
     46 
     47 // CHECK: error: invalid 16-bit base register
     48 lea bx, [ax]
     49 
     50 // CHECK: invalid base+index expression
     51 lea eax, [eax+esp*1]
     52 
     53 // CHECK: 16-bit addresses cannot have a scale
     54 lea ax, [bx+si*1]
     55