1// RUN: not llvm-mc -triple x86_64-unknown-unknown %s 2> %t.err 2// RUN: FileCheck --check-prefix=X64 < %t.err %s 3 4// RUN: not llvm-mc -triple i386-unknown-unknown %s 2> %t.err 5// RUN: FileCheck --check-prefix=X86 < %t.err %s 6// rdar://8204588 7 8// X64: error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', 'cmpl', or 'cmpq') 9cmp $0, 0(%eax) 10 11// X86: error: register %rax is only available in 64-bit mode 12addl $0, 0(%rax) 13 14// X86: 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// X86: error: instruction requires: 64-bit mode 22sysexitq 23 24// rdar://10710167 25// X64: error: expected scale expression 26lea (%rsp, %rbp, $4), %rax 27 28// rdar://10423777 29// X64: error: base register is 64-bit, but index register is not 30movq (%rsi,%ecx),%xmm0 31 32// X64: error: invalid 16-bit base register 33movl %eax,(%bp,%si) 34 35// X86: error: scale factor in 16-bit address must be 1 36movl %eax,(%bp,%si,2) 37 38// X86: error: invalid 16-bit base register 39movl %eax,(%cx) 40 41// X86: error: invalid 16-bit base/index register combination 42movl %eax,(%bp,%bx) 43 44// X86: error: 16-bit memory operand may not include only index register 45movl %eax,(,%bx) 46 47// X86: error: invalid operand for instruction 48outb al, 4 49 50// X86: error: invalid segment register 51// X64: error: invalid segment register 52movl %eax:0x00, %ebx 53 54// X86: error: invalid operand for instruction 55// X64: error: invalid operand for instruction 56cmpps $-129, %xmm0, %xmm0 57 58// X86: error: invalid operand for instruction 59// X64: error: invalid operand for instruction 60cmppd $256, %xmm0, %xmm0 61 62// X86: error: instruction requires: 64-bit mode 63jrcxz 1 64 65// X64: error: instruction requires: Not 64-bit mode 66jcxz 1 67 68// X86: error: register %cr8 is only available in 64-bit mode 69movl %edx, %cr8 70 71// X86: error: register %dr8 is only available in 64-bit mode 72movl %edx, %dr8 73 74// X86: error: register %rip is only available in 64-bit mode 75// X64: error: %rip can only be used as a base register 76mov %rip, %rax 77 78// X86: error: register %rax is only available in 64-bit mode 79// X64: error: %rip is not allowed as an index register 80mov (%rax,%rip), %rbx 81 82// X86: error: instruction requires: 64-bit mode 83ljmpq *(%eax) 84 85// X86: error: register %rax is only available in 64-bit mode 86// X64: error: invalid base+index expression 87leaq (%rax,%rsp), %rax 88 89// X86: error: invalid base+index expression 90// X64: error: invalid base+index expression 91leaq (%eax,%esp), %eax 92 93// X86: error: invalid 16-bit base/index register combination 94// X64: error: invalid 16-bit base register 95lea (%si,%bp), %ax 96// X86: error: invalid 16-bit base/index register combination 97// X64: error: invalid 16-bit base register 98lea (%di,%bp), %ax 99// X86: error: invalid 16-bit base/index register combination 100// X64: error: invalid 16-bit base register 101lea (%si,%bx), %ax 102// X86: error: invalid 16-bit base/index register combination 103// X64: error: invalid 16-bit base register 104lea (%di,%bx), %ax 105 106// X86: error: invalid base+index expression 107// X64: error: invalid base+index expression 108mov (,%eip), %rbx 109 110// X86: error: invalid base+index expression 111// X64: error: invalid base+index expression 112mov (%eip,%eax), %rbx 113 114// X86: error: register %rax is only available in 64-bit mode 115// X64: error: base register is 64-bit, but index register is not 116mov (%rax,%eiz), %ebx 117 118// X86: error: register %riz is only available in 64-bit mode 119// X64: error: base register is 32-bit, but index register is not 120mov (%eax,%riz), %ebx 121 122 123// Parse errors from assembler parsing. 124 125v_ecx = %ecx 126v_eax = %eax 127v_gs = %gs 128v_imm = 4 129$test = %ebx 130 131// X86: 7: error: expected register here 132// X64: 7: error: expected register here 133mov 4(4), %eax 134 135// X86: 7: error: expected register here 136// X64: 7: error: expected register here 137mov 5(v_imm), %eax 138 139// X86: 7: error: invalid register name 140// X64: 7: error: invalid register name 141mov 6(%v_imm), %eax 142 143// X86: 8: warning: scale factor without index register is ignored 144// X64: 8: warning: scale factor without index register is ignored 145mov 7(,v_imm), %eax 146 147// X64: 6: error: expected immediate expression 148mov $%eax, %ecx 149 150// X86: 6: error: expected immediate expression 151// X64: 6: error: expected immediate expression 152mov $v_eax, %ecx 153 154// X86: error: unexpected token in argument list 155// X64: error: unexpected token in argument list 156mov v_ecx(%eax), %ecx 157 158// X86: 7: error: invalid operand for instruction 159// X64: 7: error: invalid operand for instruction 160addb (%dx), %al 161 162// X86: error: instruction requires: 64-bit mode 163cqto 164 165// X86: error: instruction requires: 64-bit mode 166cltq 167 168// X86: error: instruction requires: 64-bit mode 169cmpxchg16b (%eax) 170 171// X86: error: unsupported instruction 172// X64: error: unsupported instruction 173{rex} vmovdqu32 %xmm0, %xmm0 174 175// X86: error: unsupported instruction 176// X64: error: unsupported instruction 177{rex2} vmovdqu32 %xmm0, %xmm0 178 179// X86: error: unsupported instruction 180// X64: error: unsupported instruction 181{vex} vmovdqu32 %xmm0, %xmm0 182 183// X86: error: unsupported instruction 184// X64: error: unsupported instruction 185{vex2} vmovdqu32 %xmm0, %xmm0 186 187// X86: error: unsupported instruction 188// X64: error: unsupported instruction 189{vex3} vmovdqu32 %xmm0, %xmm0 190 191// X86: error: unsupported instruction 192// X64: error: unsupported instruction 193{evex} vmovdqu %xmm0, %xmm0 194 195// X86: 12: error: immediate must be an integer in range [0, 15] 196// X64: 12: error: immediate must be an integer in range [0, 15] 197vpermil2pd $16, %xmm3, %xmm5, %xmm1, %xmm2 198 199// X86: error: instruction requires: 64-bit mode 200pbndkb 201 202// X86: error: register %r16d is only available in 64-bit mode 203movl %eax, %r16d 204