2010-08-24 21:13:38 +02:00
|
|
|
// RUN: llvm-mc -triple x86_64-unknown-unknown %s > %t 2> %t.err
|
|
|
|
// RUN: FileCheck < %t %s
|
|
|
|
// RUN: FileCheck --check-prefix=CHECK-STDERR < %t.err %s
|
2009-07-31 05:11:49 +02:00
|
|
|
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: subb %al, %al
|
2009-07-31 22:53:16 +02:00
|
|
|
subb %al, %al
|
|
|
|
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: addl $24, %eax
|
2009-07-31 22:53:16 +02:00
|
|
|
addl $24, %eax
|
|
|
|
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: movl %eax, 10(%ebp)
|
2009-07-31 22:53:16 +02:00
|
|
|
movl %eax, 10(%ebp)
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: movl %eax, 10(%ebp,%ebx)
|
2009-07-31 22:53:16 +02:00
|
|
|
movl %eax, 10(%ebp, %ebx)
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: movl %eax, 10(%ebp,%ebx,4)
|
2009-07-31 22:53:16 +02:00
|
|
|
movl %eax, 10(%ebp, %ebx, 4)
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: movl %eax, 10(,%ebx,4)
|
2009-07-31 22:53:16 +02:00
|
|
|
movl %eax, 10(, %ebx, 4)
|
2010-01-30 02:02:48 +01:00
|
|
|
|
|
|
|
// CHECK: movl 0, %eax
|
|
|
|
movl 0, %eax
|
|
|
|
// CHECK: movl $0, %eax
|
|
|
|
movl $0, %eax
|
|
|
|
|
2010-01-22 21:16:37 +01:00
|
|
|
// CHECK: ret
|
|
|
|
ret
|
|
|
|
|
2009-08-09 09:20:21 +02:00
|
|
|
// FIXME: Check that this matches SUB32ri8
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: subl $1, %eax
|
2009-08-09 09:20:21 +02:00
|
|
|
subl $1, %eax
|
|
|
|
|
|
|
|
// FIXME: Check that this matches SUB32ri8
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: subl $-1, %eax
|
2009-08-09 09:20:21 +02:00
|
|
|
subl $-1, %eax
|
|
|
|
|
|
|
|
// FIXME: Check that this matches SUB32ri
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: subl $256, %eax
|
2009-08-09 09:20:21 +02:00
|
|
|
subl $256, %eax
|
|
|
|
|
2009-08-10 23:06:41 +02:00
|
|
|
// FIXME: Check that this matches XOR64ri8
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: xorq $1, %rax
|
2009-08-11 04:59:53 +02:00
|
|
|
xorq $1, %rax
|
2009-08-09 09:20:21 +02:00
|
|
|
|
2009-08-10 23:06:41 +02:00
|
|
|
// FIXME: Check that this matches XOR64ri32
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: xorq $256, %rax
|
2009-08-11 04:59:53 +02:00
|
|
|
xorq $256, %rax
|
|
|
|
|
|
|
|
// FIXME: Check that this matches SUB8rr
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: subb %al, %bl
|
2009-08-11 04:59:53 +02:00
|
|
|
subb %al, %bl
|
|
|
|
|
|
|
|
// FIXME: Check that this matches SUB16rr
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: subw %ax, %bx
|
2009-08-11 04:59:53 +02:00
|
|
|
subw %ax, %bx
|
|
|
|
|
|
|
|
// FIXME: Check that this matches SUB32rr
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: subl %eax, %ebx
|
2009-08-11 04:59:53 +02:00
|
|
|
subl %eax, %ebx
|
|
|
|
|
2009-08-11 07:00:25 +02:00
|
|
|
// FIXME: Check that this matches the correct instruction.
|
2010-07-19 09:21:07 +02:00
|
|
|
// CHECK: callq *%rax
|
2009-08-11 07:00:25 +02:00
|
|
|
call *%rax
|
2009-08-12 01:23:44 +02:00
|
|
|
|
|
|
|
// FIXME: Check that this matches the correct instruction.
|
2009-08-14 05:48:55 +02:00
|
|
|
// CHECK: shldl %cl, %eax, %ebx
|
2009-08-12 01:23:44 +02:00
|
|
|
shldl %cl, %eax, %ebx
|
2010-02-03 00:46:47 +01:00
|
|
|
|
|
|
|
// CHECK: shll $2, %eax
|
|
|
|
shll $2, %eax
|
|
|
|
|
|
|
|
// CHECK: shll $2, %eax
|
|
|
|
sall $2, %eax
|
2010-02-03 22:04:42 +01:00
|
|
|
|
|
|
|
// CHECK: rep
|
|
|
|
// CHECK: insb
|
|
|
|
rep;insb
|
|
|
|
|
|
|
|
// CHECK: rep
|
|
|
|
// CHECK: outsb
|
|
|
|
rep;outsb
|
|
|
|
|
|
|
|
// CHECK: rep
|
|
|
|
// CHECK: movsb
|
|
|
|
rep;movsb
|
|
|
|
|
|
|
|
// CHECK: rep
|
|
|
|
// CHECK: lodsb
|
|
|
|
rep;lodsb
|
|
|
|
|
|
|
|
// CHECK: rep
|
|
|
|
// CHECK: stosb
|
|
|
|
rep;stosb
|
|
|
|
|
|
|
|
// NOTE: repz and repe have the same opcode as rep
|
|
|
|
// CHECK: rep
|
|
|
|
// CHECK: cmpsb
|
|
|
|
repz;cmpsb
|
|
|
|
|
|
|
|
// NOTE: repnz has the same opcode as repne
|
|
|
|
// CHECK: repne
|
|
|
|
// CHECK: cmpsb
|
|
|
|
repnz;cmpsb
|
|
|
|
|
|
|
|
// NOTE: repe and repz have the same opcode as rep
|
|
|
|
// CHECK: rep
|
|
|
|
// CHECK: scasb
|
|
|
|
repe;scasb
|
|
|
|
|
|
|
|
// CHECK: repne
|
|
|
|
// CHECK: scasb
|
|
|
|
repne;scasb
|
|
|
|
|
|
|
|
// CHECK: lock
|
2010-02-13 01:17:21 +01:00
|
|
|
// CHECK: cmpxchgb %al, (%ebx)
|
2010-02-03 22:04:42 +01:00
|
|
|
lock;cmpxchgb %al, 0(%ebx)
|
|
|
|
|
|
|
|
// CHECK: cs
|
2010-02-13 01:17:21 +01:00
|
|
|
// CHECK: movb (%eax), %al
|
2010-02-03 22:04:42 +01:00
|
|
|
cs;movb 0(%eax), %al
|
|
|
|
|
|
|
|
// CHECK: ss
|
2010-02-13 01:17:21 +01:00
|
|
|
// CHECK: movb (%eax), %al
|
2010-02-03 22:04:42 +01:00
|
|
|
ss;movb 0(%eax), %al
|
|
|
|
|
|
|
|
// CHECK: ds
|
2010-02-13 01:17:21 +01:00
|
|
|
// CHECK: movb (%eax), %al
|
2010-02-03 22:04:42 +01:00
|
|
|
ds;movb 0(%eax), %al
|
|
|
|
|
|
|
|
// CHECK: es
|
2010-02-13 01:17:21 +01:00
|
|
|
// CHECK: movb (%eax), %al
|
2010-02-03 22:04:42 +01:00
|
|
|
es;movb 0(%eax), %al
|
|
|
|
|
|
|
|
// CHECK: fs
|
2010-02-13 01:17:21 +01:00
|
|
|
// CHECK: movb (%eax), %al
|
2010-02-03 22:04:42 +01:00
|
|
|
fs;movb 0(%eax), %al
|
|
|
|
|
|
|
|
// CHECK: gs
|
2010-02-13 01:17:21 +01:00
|
|
|
// CHECK: movb (%eax), %al
|
2010-02-03 22:04:42 +01:00
|
|
|
gs;movb 0(%eax), %al
|
|
|
|
|
2010-02-09 01:49:22 +01:00
|
|
|
// CHECK: fadd %st(0)
|
|
|
|
// CHECK: fadd %st(1)
|
|
|
|
// CHECK: fadd %st(7)
|
|
|
|
|
|
|
|
fadd %st(0)
|
|
|
|
fadd %st(1)
|
|
|
|
fadd %st(7)
|
2010-05-07 00:39:14 +02:00
|
|
|
|
|
|
|
// CHECK: leal 0, %eax
|
|
|
|
leal 0, %eax
|
2010-05-20 01:34:33 +02:00
|
|
|
|
|
|
|
// rdar://7986634 - Insensitivity on opcodes.
|
|
|
|
// CHECK: int3
|
|
|
|
INT3
|
|
|
|
|
2010-08-24 21:13:38 +02:00
|
|
|
|
|
|
|
// Allow scale factor without index register.
|
|
|
|
// CHECK: movaps %xmm3, (%esi)
|
|
|
|
// CHECK-STDERR: warning: scale factor without index register is ignored
|
|
|
|
movaps %xmm3, (%esi, 2)
|
2010-08-24 21:24:18 +02:00
|
|
|
|
|
|
|
// CHECK: imull $12, %eax, %eax
|
|
|
|
imul $12, %eax
|
2010-08-24 21:37:56 +02:00
|
|
|
|
|
|
|
// CHECK: imull %ecx, %eax
|
|
|
|
imull %ecx, %eax
|
2010-09-07 01:29:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
// rdar://8208481
|
|
|
|
// CHECK: outb %al, $161
|
|
|
|
outb %al, $161
|
|
|
|
// CHECK: outw %ax, $128
|
|
|
|
outw %ax, $128
|
|
|
|
// CHECK: inb $161, %al
|
|
|
|
inb $161, %al
|