2023-03-02 15:57:26 +01:00
|
|
|
--TEST--
|
|
|
|
003: Parameter Loading and argument passing
|
|
|
|
--TARGET--
|
|
|
|
Windows-x86_64
|
|
|
|
--ARGS--
|
|
|
|
-S
|
|
|
|
--CODE--
|
|
|
|
{
|
|
|
|
uintptr_t f = func(printf, 4);
|
|
|
|
uintptr_t fmt = "%d %d %d %d %d %d %d %d %d %d\n";
|
|
|
|
l_1 = START(l_3);
|
|
|
|
int32_t p_1 = PARAM(l_1, "p_1", 1);
|
|
|
|
int32_t p_2 = PARAM(l_1, "p_2", 2);
|
|
|
|
int32_t p_3 = PARAM(l_1, "p_3", 3);
|
|
|
|
int32_t p_4 = PARAM(l_1, "p_4", 4);
|
|
|
|
int32_t p_5 = PARAM(l_1, "p_5", 5);
|
|
|
|
int32_t p_6 = PARAM(l_1, "p_6", 6);
|
|
|
|
int32_t p_7 = PARAM(l_1, "p_7", 7);
|
|
|
|
int32_t p_8 = PARAM(l_1, "p_8", 8);
|
|
|
|
int32_t p_9 = PARAM(l_1, "p_9", 9);
|
|
|
|
int32_t p_10 = PARAM(l_1, "p_10", 10);
|
|
|
|
int32_t ret, l_2 = CALL/11(l_1, f, fmt, p_1, p_2, p_3, p_4, p_5, p_6, p_7, p_8, p_9, p_10);
|
|
|
|
l_3 = RETURN(l_2, ret);
|
|
|
|
}
|
|
|
|
--EXPECT--
|
|
|
|
test:
|
|
|
|
subq $0x58, %rsp
|
|
|
|
movl %r9d, %eax
|
|
|
|
movl %eax, 0x20(%rsp)
|
|
|
|
movl %r8d, %r9d
|
|
|
|
movl %edx, %r8d
|
|
|
|
movl %ecx, %edx
|
|
|
|
leaq .L1(%rip), %rcx
|
2023-04-26 13:24:43 +02:00
|
|
|
movl 0x60(%rsp), %eax
|
|
|
|
movl %eax, 0x28(%rsp)
|
|
|
|
movl 0x68(%rsp), %eax
|
|
|
|
movl %eax, 0x30(%rsp)
|
|
|
|
movl 0x70(%rsp), %eax
|
|
|
|
movl %eax, 0x38(%rsp)
|
|
|
|
movl 0x78(%rsp), %eax
|
|
|
|
movl %eax, 0x40(%rsp)
|
|
|
|
movl 0x80(%rsp), %eax
|
|
|
|
movl %eax, 0x48(%rsp)
|
|
|
|
movl 0x88(%rsp), %eax
|
|
|
|
movl %eax, 0x50(%rsp)
|
2023-03-02 15:57:26 +01:00
|
|
|
movabsq $printf, %rax
|
|
|
|
callq *%rax
|
|
|
|
addq $0x58, %rsp
|
|
|
|
retq
|
|
|
|
.rodata
|
2023-04-26 13:24:43 +02:00
|
|
|
.db 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90
|
2023-03-02 15:57:26 +01:00
|
|
|
.L1:
|
|
|
|
.db 0x25, 0x64, 0x20, 0x25, 0x64, 0x20, 0x25, 0x64, 0x20, 0x25, 0x64, 0x20, 0x25, 0x64, 0x20, 0x25
|
|
|
|
.db 0x64, 0x20, 0x25, 0x64, 0x20, 0x25, 0x64, 0x20, 0x25, 0x64, 0x20, 0x25, 0x64, 0x0a, 0x00
|