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')
9cmp $0, 0(%eax)
10
11// 32: error: register %rax is only available in 64-bit mode
12addl $0, 0(%rax)
13
14// 32: test.s:8:2: error: invalid instruction mnemonic 'movi'
15
16# 8 "test.s"
17 movi $8,%eax
18
19movl 0(%rax), 0(%edx)  // error: invalid operand for instruction
20
21// 32: error: instruction requires: 64-bit mode
22sysexitq
23
24// rdar://10710167
25// 64: error: expected scale expression
26lea (%rsp, %rbp, $4), %rax
27
28// rdar://10423777
29// 64: error: base register is 64-bit, but index register is not
30movq (%rsi,%ecx),%xmm0
31
32// 64: error: invalid 16-bit base register
33movl %eax,(%bp,%si)
34
35// 32: error: scale factor in 16-bit address must be 1
36movl %eax,(%bp,%si,2)
37
38// 32: error: invalid 16-bit base register
39movl %eax,(%cx)
40
41// 32: error: invalid 16-bit base/index register combination
42movl %eax,(%bp,%bx)
43
44// 32: error: 16-bit memory operand may not include only index register
45movl %eax,(,%bx)
46
47// 32: error: invalid operand for instruction
48outb al, 4
49
50// 32: error: invalid segment register
51// 64: error: invalid segment register
52movl %eax:0x00, %ebx
53
54// 32: error: invalid operand for instruction
55// 64: error: invalid operand for instruction
56cmpps $-129, %xmm0, %xmm0
57
58// 32: error: invalid operand for instruction
59// 64: error: invalid operand for instruction
60cmppd $256, %xmm0, %xmm0
61
62// 32: error: instruction requires: 64-bit mode
63jrcxz 1
64
65// 64: error: instruction requires: Not 64-bit mode
66jcxz 1
67