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
23mov eax, DWORD PTR arr[i]
24//CHECK: error: rip can only be used as a base register
25.code64
26mov rax, rip
27//CHECK: error: invalid base+index expression
28mov rbx, [rax+rip]
29//CHECK: error: scale factor in address must be 1, 2, 4 or 8
30lea RDX, [unknown_number * RAX + RBX + _foo]
31//CHECK: error: BaseReg/IndexReg already set!
32lea RDX, [4 * RAX + 27 * RBX + _pat]
33//CHECK: error: unexpected bracket encountered
34lea RDX, [[arr]
35//CHECK: error: unexpected bracket encountered
36lea RDX, [arr[]
37
38.intel_syntax
39
40// CHECK: error: invalid operand for instruction
41punpcklbw mm0, qword ptr [rsp]
42// CHECK: error: invalid operand for instruction
43punpcklwd mm0, word ptr [rsp]
44// CHECK: error: invalid operand for instruction
45punpckldq mm0, qword ptr [rsp]
46
47// CHECK: error: invalid 16-bit base register
48lea bx, [ax]
49
50// CHECK: invalid base+index expression
51lea eax, [eax+esp*1]
52
53// CHECK: 16-bit addresses cannot have a scale
54lea ax, [bx+si*1]
55