[llvm-readobj] - Simplify stack-sizes.test test case.
[llvm-complete.git] / test / MC / X86 / x86_errors.s
blobf9cdc150b667f0bf2f88efdfb26f5e0fe17c6b6b
1 // RUN: not llvm-mc -triple x86_64-unknown-unknown %s 2> %t.err
2 // RUN: FileCheck --check-prefix=64 < %t.err %s
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
8 // 64: error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')
9 cmp $0, 0(%eax)
11 // 32: error: register %rax is only available in 64-bit mode
12 addl $0, 0(%rax)
14 // 32: test.s:8:2: error: invalid instruction mnemonic 'movi'
16 # 8 "test.s"
17 movi $8,%eax
19 movl 0(%rax), 0(%edx) // error: invalid operand for instruction
21 // 32: error: instruction requires: 64-bit mode
22 sysexitq
24 // rdar://10710167
25 // 64: error: expected scale expression
26 lea (%rsp, %rbp, $4), %rax
28 // rdar://10423777
29 // 64: error: base register is 64-bit, but index register is not
30 movq (%rsi,%ecx),%xmm0
32 // 64: error: invalid 16-bit base register
33 movl %eax,(%bp,%si)
35 // 32: error: scale factor in 16-bit address must be 1
36 movl %eax,(%bp,%si,2)
38 // 32: error: invalid 16-bit base register
39 movl %eax,(%cx)
41 // 32: error: invalid 16-bit base/index register combination
42 movl %eax,(%bp,%bx)
44 // 32: error: 16-bit memory operand may not include only index register
45 movl %eax,(,%bx)
47 // 32: error: invalid operand for instruction
48 outb al, 4
50 // 32: error: invalid segment register
51 // 64: error: invalid segment register
52 movl %eax:0x00, %ebx
54 // 32: error: invalid operand for instruction
55 // 64: error: invalid operand for instruction
56 cmpps $-129, %xmm0, %xmm0
58 // 32: error: invalid operand for instruction
59 // 64: error: invalid operand for instruction
60 cmppd $256, %xmm0, %xmm0
62 // 32: error: instruction requires: 64-bit mode
63 jrcxz 1
65 // 64: error: instruction requires: Not 64-bit mode
66 jcxz 1
68 // 32: error: register %cr8 is only available in 64-bit mode
69 movl %edx, %cr8
71 // 32: error: register %dr8 is only available in 64-bit mode
72 movl %edx, %dr8
74 // 32: error: register %rip is only available in 64-bit mode
75 // 64: error: %rip can only be used as a base register
76 mov %rip, %rax
78 // 32: error: register %rax is only available in 64-bit mode
79 // 64: error: %rip is not allowed as an index register
80 mov (%rax,%rip), %rbx
82 // 32: error: instruction requires: 64-bit mode
83 ljmpq *(%eax)
85 // 32: error: register %rax is only available in 64-bit mode
86 // 64: error: invalid base+index expression
87 leaq (%rax,%rsp), %rax
89 // 32: error: invalid base+index expression
90 // 64: error: invalid base+index expression
91 leaq (%eax,%esp), %eax
93 // 32: error: invalid 16-bit base/index register combination
94 // 64: error: invalid 16-bit base register
95 lea (%si,%bp), %ax
96 // 32: error: invalid 16-bit base/index register combination
97 // 64: error: invalid 16-bit base register
98 lea (%di,%bp), %ax
99 // 32: error: invalid 16-bit base/index register combination
100 // 64: error: invalid 16-bit base register
101 lea (%si,%bx), %ax
102 // 32: error: invalid 16-bit base/index register combination
103 // 64: error: invalid 16-bit base register
104 lea (%di,%bx), %ax
106 // 32: error: invalid base+index expression
107 // 64: error: invalid base+index expression
108 mov (,%eip), %rbx
110 // 32: error: invalid base+index expression
111 // 64: error: invalid base+index expression
112 mov (%eip,%eax), %rbx
114 // 32: error: register %rax is only available in 64-bit mode
115 // 64: error: base register is 64-bit, but index register is not
116 mov (%rax,%eiz), %ebx
118 // 32: error: register %riz is only available in 64-bit mode
119 // 64: error: base register is 32-bit, but index register is not
120 mov (%eax,%riz), %ebx
123 // Parse errors from assembler parsing.
125 v_ecx = %ecx
126 v_eax = %eax
127 v_gs = %gs
128 v_imm = 4
129 $test = %ebx
131 // 32: 7: error: expected register here
132 // 64: 7: error: expected register here
133 mov 4(4), %eax
135 // 32: 7: error: expected register here
136 // 64: 7: error: expected register here
137 mov 5(v_imm), %eax
139 // 32: 7: error: invalid register name
140 // 64: 7: error: invalid register name
141 mov 6(%v_imm), %eax
143 // 32: 8: warning: scale factor without index register is ignored
144 // 64: 8: warning: scale factor without index register is ignored
145 mov 7(,v_imm), %eax
147 // 64: 6: error: expected immediate expression
148 mov $%eax, %ecx
150 // 32: 6: error: expected immediate expression
151 // 64: 6: error: expected immediate expression
152 mov $v_eax, %ecx
154 // 32: error: unexpected token in argument list
155 // 64: error: unexpected token in argument list
156 mov v_ecx(%eax), %ecx
158 // 32: 7: error: invalid operand for instruction
159 // 64: 7: error: invalid operand for instruction
160 addb (%dx), %al
162 // 32: error: instruction requires: 64-bit mode
163 cqto
165 // 32: error: instruction requires: 64-bit mode
166 cltq
168 // 32: error: instruction requires: 64-bit mode
169 cmpxchg16b (%eax)
171 // 32: error: unsupported instruction
172 // 64: error: unsupported instruction
173 {vex2} vmovdqu32 %xmm0, %xmm0
175 // 32: error: unsupported instruction
176 // 64: error: unsupported instruction
177 {vex3} vmovdqu32 %xmm0, %xmm0
179 // 32: error: unsupported instruction
180 // 64: error: unsupported instruction
181 {evex} vmovdqu %xmm0, %xmm0
183 // 32: 12: error: immediate must be an integer in range [0, 15]
184 // 64: 12: error: immediate must be an integer in range [0, 15]
185 vpermil2pd $16, %xmm3, %xmm5, %xmm1, %xmm2