macaw/x86/tests/x64/test-imul.s
Tristan Ravitch d6060e51be x86: Fix a bug affecting imul (and add a test case)
We were hitting a translation error for imul in another application - this test
case is a reduced example demonstrating the problem.

The root cause was that there were a few missing cases for the new signed
immediate values from flexdis; this caused a fallthrough that mis-identified
signed immediates as non-immediates, triggering an error.
2018-10-24 10:23:51 -07:00

46 lines
672 B
ArmAsm

.file "test-imul.c"
.text
.globl g
.data
.align 4
.type g, @object
.size g, 4
g:
.long -11
.text
.globl _start
.type _start, @function
_start:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
#APP
# 6 "test-imul.c" 1
mov %edx,0xc(%rsp)
lea (%r12,%rax,1),%ecx
xor %eax,%eax
imul $0xffffffe8,%ebx,%ebx
add %edi,%ebx
mov %edx,%edi
# 0 "" 2
# 14 "test-imul.c" 1
movq $60,%rax
movq $0,%rdi
syscall
# 0 "" 2
#NO_APP
nop
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size _start, .-_start
.ident "GCC: (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0"
.section .note.GNU-stack,"",@progbits