2010-08-12 08:55:42 +08:00
|
|
|
// RUN: not llvm-mc -triple x86_64-unknown-unknown %s 2> %t.err
|
2011-07-28 07:22:03 +08:00
|
|
|
// RUN: FileCheck --check-prefix=64 < %t.err %s
|
2010-08-12 08:55:42 +08:00
|
|
|
|
2011-07-28 07:22:03 +08:00
|
|
|
// RUN: not llvm-mc -triple i386-unknown-unknown %s 2> %t.err
|
|
|
|
// RUN: FileCheck --check-prefix=32 < %t.err %s
|
|
|
|
// rdar://8204588
|
|
|
|
|
|
|
|
// 64: error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')
|
2010-08-12 08:55:42 +08:00
|
|
|
cmp $0, 0(%eax)
|
2011-07-28 07:22:03 +08:00
|
|
|
|
|
|
|
// 32: error: register %rax is only available in 64-bit mode
|
|
|
|
addl $0, 0(%rax)
|
2011-10-13 05:38:39 +08:00
|
|
|
|
|
|
|
// 32: test.s:8:2: error: invalid instruction mnemonic 'movi'
|
|
|
|
|
|
|
|
# 8 "test.s"
|
|
|
|
movi $8,%eax
|
2011-10-16 12:47:35 +08:00
|
|
|
|
|
|
|
movl 0(%rax), 0(%edx) // error: invalid operand for instruction
|
|
|
|
|
2012-11-15 02:04:47 +08:00
|
|
|
// 32: error: instruction requires: 64-bit mode
|
2011-10-28 01:40:41 +08:00
|
|
|
sysexitq
|
2012-03-10 06:24:10 +08:00
|
|
|
|
|
|
|
// rdar://10710167
|
|
|
|
// 64: error: expected scale expression
|
|
|
|
lea (%rsp, %rbp, $4), %rax
|
2012-03-13 05:32:09 +08:00
|
|
|
|
|
|
|
// rdar://10423777
|
2014-01-08 20:58:28 +08:00
|
|
|
// 64: error: base register is 64-bit, but index register is not
|
2012-03-13 05:32:09 +08:00
|
|
|
movq (%rsi,%ecx),%xmm0
|
2013-05-11 02:24:17 +08:00
|
|
|
|
2014-01-08 20:58:28 +08:00
|
|
|
// 64: error: invalid 16-bit base register
|
|
|
|
movl %eax,(%bp,%si)
|
|
|
|
|
|
|
|
// 32: error: scale factor in 16-bit address must be 1
|
|
|
|
movl %eax,(%bp,%si,2)
|
|
|
|
|
|
|
|
// 32: error: invalid 16-bit base register
|
|
|
|
movl %eax,(%cx)
|
|
|
|
|
|
|
|
// 32: error: invalid 16-bit base/index register combination
|
|
|
|
movl %eax,(%bp,%bx)
|
|
|
|
|
|
|
|
// 32: error: 16-bit memory operand may not include only index register
|
|
|
|
movl %eax,(,%bx)
|
|
|
|
|
2013-05-11 02:24:17 +08:00
|
|
|
// 32: error: invalid operand for instruction
|
|
|
|
outb al, 4
|
2014-08-01 07:03:22 +08:00
|
|
|
|
|
|
|
// 32: error: invalid segment register
|
|
|
|
// 64: error: invalid segment register
|
|
|
|
movl %eax:0x00, %ebx
|
2015-01-21 14:07:53 +08:00
|
|
|
|
|
|
|
// 32: error: invalid operand for instruction
|
|
|
|
// 64: error: invalid operand for instruction
|
|
|
|
cmpps $-129, %xmm0, %xmm0
|
|
|
|
|
|
|
|
// 32: error: invalid operand for instruction
|
|
|
|
// 64: error: invalid operand for instruction
|
|
|
|
cmppd $256, %xmm0, %xmm0
|
2015-07-04 08:01:07 +08:00
|
|
|
|
|
|
|
// 32: error: instruction requires: 64-bit mode
|
|
|
|
jrcxz 1
|
|
|
|
|
|
|
|
// 64: error: instruction requires: Not 64-bit mode
|
|
|
|
jcxz 1
|
2016-08-28 01:13:34 +08:00
|
|
|
|
|
|
|
// 32: error: register %cr8 is only available in 64-bit mode
|
|
|
|
movl %edx, %cr8
|
|
|
|
|
|
|
|
// 32: error: register %dr8 is only available in 64-bit mode
|
|
|
|
movl %edx, %dr8
|
2016-10-05 23:23:35 +08:00
|
|
|
|
|
|
|
// 32: error: register %rip is only available in 64-bit mode
|
|
|
|
// 64: error: %rip can only be used as a base register
|
|
|
|
mov %rip, %rax
|
|
|
|
|
|
|
|
// 32: error: register %rax is only available in 64-bit mode
|
|
|
|
// 64: error: %rip is not allowed as an index register
|
|
|
|
mov (%rax,%rip), %rbx
|
2018-04-30 14:21:24 +08:00
|
|
|
|
|
|
|
// 32: error: instruction requires: 64-bit mode
|
|
|
|
ljmpq *(%eax)
|
2018-06-23 01:15:58 +08:00
|
|
|
|
|
|
|
// 32: error: register %rax is only available in 64-bit mode
|
|
|
|
// 64: error: invalid base+index expression
|
|
|
|
leaq (%rax,%rsp), %rax
|
|
|
|
|
|
|
|
// 32: error: invalid base+index expression
|
|
|
|
// 64: error: invalid base+index expression
|
|
|
|
leaq (%eax,%esp), %eax
|
2018-06-23 04:20:38 +08:00
|
|
|
|
|
|
|
// 32: error: invalid 16-bit base/index register combination
|
|
|
|
// 64: error: invalid 16-bit base register
|
|
|
|
lea (%si,%bp), %ax
|
|
|
|
// 32: error: invalid 16-bit base/index register combination
|
|
|
|
// 64: error: invalid 16-bit base register
|
|
|
|
lea (%di,%bp), %ax
|
|
|
|
// 32: error: invalid 16-bit base/index register combination
|
|
|
|
// 64: error: invalid 16-bit base register
|
|
|
|
lea (%si,%bx), %ax
|
|
|
|
// 32: error: invalid 16-bit base/index register combination
|
|
|
|
// 64: error: invalid 16-bit base register
|
|
|
|
lea (%di,%bx), %ax
|
2018-06-23 13:53:00 +08:00
|
|
|
|
2018-09-06 10:03:14 +08:00
|
|
|
// 32: error: invalid base+index expression
|
2018-06-23 13:53:00 +08:00
|
|
|
// 64: error: invalid base+index expression
|
|
|
|
mov (,%eip), %rbx
|
|
|
|
|
2018-09-06 10:03:14 +08:00
|
|
|
// 32: error: invalid base+index expression
|
2018-06-23 13:53:00 +08:00
|
|
|
// 64: error: invalid base+index expression
|
|
|
|
mov (%eip,%eax), %rbx
|
|
|
|
|
|
|
|
// 32: error: register %rax is only available in 64-bit mode
|
|
|
|
// 64: error: base register is 64-bit, but index register is not
|
|
|
|
mov (%rax,%eiz), %ebx
|
|
|
|
|
|
|
|
// 32: error: register %riz is only available in 64-bit mode
|
|
|
|
// 64: error: base register is 32-bit, but index register is not
|
|
|
|
mov (%eax,%riz), %ebx
|
2019-01-12 04:17:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
// Parse errors from assembler parsing.
|
|
|
|
|
|
|
|
v_ecx = %ecx
|
|
|
|
v_eax = %eax
|
|
|
|
v_gs = %gs
|
|
|
|
v_imm = 4
|
|
|
|
$test = %ebx
|
|
|
|
|
|
|
|
// 32: 7: error: expected register here
|
|
|
|
// 64: 7: error: expected register here
|
|
|
|
mov 4(4), %eax
|
|
|
|
|
|
|
|
// 32: 7: error: expected register here
|
|
|
|
// 64: 7: error: expected register here
|
|
|
|
mov 5(v_imm), %eax
|
|
|
|
|
|
|
|
// 32: 7: error: invalid register name
|
|
|
|
// 64: 7: error: invalid register name
|
|
|
|
mov 6(%v_imm), %eax
|
|
|
|
|
|
|
|
// 32: 8: warning: scale factor without index register is ignored
|
|
|
|
// 64: 8: warning: scale factor without index register is ignored
|
|
|
|
mov 7(,v_imm), %eax
|
|
|
|
|
|
|
|
// 64: 6: error: expected immediate expression
|
|
|
|
mov $%eax, %ecx
|
|
|
|
|
|
|
|
// 32: 6: error: expected immediate expression
|
|
|
|
// 64: 6: error: expected immediate expression
|
|
|
|
mov $v_eax, %ecx
|
|
|
|
|
|
|
|
// 32: error: unexpected token in argument list
|
|
|
|
// 64: error: unexpected token in argument list
|
|
|
|
mov v_ecx(%eax), %ecx
|
2019-01-15 02:44:32 +08:00
|
|
|
|
|
|
|
// 32: 7: error: invalid operand for instruction
|
|
|
|
// 64: 7: error: invalid operand for instruction
|
|
|
|
addb (%dx), %al
|
2019-03-19 06:06:14 +08:00
|
|
|
|
|
|
|
// 32: error: instruction requires: 64-bit mode
|
|
|
|
cqto
|
|
|
|
|
|
|
|
// 32: error: instruction requires: 64-bit mode
|
|
|
|
cltq
|
2019-03-20 07:57:16 +08:00
|
|
|
|
|
|
|
// 32: error: instruction requires: 64-bit mode
|
|
|
|
cmpxchg16b (%eax)
|
2019-04-10 02:45:15 +08:00
|
|
|
|
2020-05-09 02:49:30 +08:00
|
|
|
// 32: error: unsupported instruction
|
|
|
|
// 64: error: unsupported instruction
|
|
|
|
{vex} vmovdqu32 %xmm0, %xmm0
|
|
|
|
|
2019-04-10 02:45:15 +08:00
|
|
|
// 32: error: unsupported instruction
|
|
|
|
// 64: error: unsupported instruction
|
|
|
|
{vex2} vmovdqu32 %xmm0, %xmm0
|
|
|
|
|
|
|
|
// 32: error: unsupported instruction
|
|
|
|
// 64: error: unsupported instruction
|
|
|
|
{vex3} vmovdqu32 %xmm0, %xmm0
|
|
|
|
|
|
|
|
// 32: error: unsupported instruction
|
|
|
|
// 64: error: unsupported instruction
|
|
|
|
{evex} vmovdqu %xmm0, %xmm0
|
2019-08-07 13:34:27 +08:00
|
|
|
|
2019-08-10 12:28:52 +08:00
|
|
|
// 32: 12: error: immediate must be an integer in range [0, 15]
|
|
|
|
// 64: 12: error: immediate must be an integer in range [0, 15]
|
2019-08-07 13:34:27 +08:00
|
|
|
vpermil2pd $16, %xmm3, %xmm5, %xmm1, %xmm2
|