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