2022-05-17 11:34:31 +02:00
|
|
|
--TEST--
|
|
|
|
001: Argument Passing
|
2022-05-25 16:38:22 +02:00
|
|
|
--TARGET--
|
|
|
|
x86_64
|
2022-05-17 11:34:31 +02:00
|
|
|
--ARGS--
|
|
|
|
-S --run
|
|
|
|
--CODE--
|
|
|
|
{
|
|
|
|
int8_t c_1 = 1;
|
|
|
|
int16_t c_2 = 2;
|
|
|
|
int32_t c_3 = 3;
|
|
|
|
int64_t c_4 = 4;
|
|
|
|
int64_t c_5 = 0x100000000;
|
|
|
|
uint8_t c_6 = 6;
|
|
|
|
uint16_t c_7 = 7;
|
|
|
|
uint32_t c_8 = 8;
|
|
|
|
int64_t c_9 = 9;
|
|
|
|
int64_t c_10 = 0x100000000;
|
2023-09-27 09:23:34 +02:00
|
|
|
uintptr_t f = func(printf, 4);
|
2022-05-17 11:34:31 +02:00
|
|
|
uintptr_t fmt = "%d %d %d %lld 0x%llx %d %d %d %lld 0x%llx\n";
|
|
|
|
l_1 = START(l_3);
|
|
|
|
int32_t d_2, l_2 = CALL/11(l_1, f, fmt, c_1, c_2, c_3, c_4, c_5, c_6, c_7, c_8, c_9, c_10);
|
|
|
|
l_3 = RETURN(l_2, d_2);
|
|
|
|
}
|
|
|
|
--EXPECT--
|
2023-10-11 21:55:25 +02:00
|
|
|
main:
|
2022-05-17 22:01:37 +02:00
|
|
|
subq $0x28, %rsp
|
2022-05-26 00:17:02 +02:00
|
|
|
leaq .L1(%rip), %rdi
|
2023-02-17 16:11:13 +01:00
|
|
|
movl $1, %esi
|
2023-03-02 11:27:01 +01:00
|
|
|
movl $2, %edx
|
2022-05-17 11:34:31 +02:00
|
|
|
movl $3, %ecx
|
2023-02-17 16:11:13 +01:00
|
|
|
movl $4, %r8d
|
2022-05-17 11:34:31 +02:00
|
|
|
movabsq $0x100000000, %r9
|
2022-12-26 16:27:53 +01:00
|
|
|
movl $6, (%rsp)
|
|
|
|
movl $7, 8(%rsp)
|
|
|
|
movl $8, 0x10(%rsp)
|
|
|
|
movq $9, 0x18(%rsp)
|
|
|
|
movabsq $0x100000000, %rax
|
|
|
|
movq %rax, 0x20(%rsp)
|
2023-09-27 09:23:34 +02:00
|
|
|
movl $0, %eax
|
|
|
|
movabsq $printf, %r11
|
|
|
|
callq *%r11
|
2022-05-17 22:01:37 +02:00
|
|
|
addq $0x28, %rsp
|
2022-05-17 11:34:31 +02:00
|
|
|
retq
|
2022-05-26 00:17:02 +02:00
|
|
|
.rodata
|
|
|
|
.L1:
|
|
|
|
.db 0x25, 0x64, 0x20, 0x25, 0x64, 0x20, 0x25, 0x64, 0x20, 0x25, 0x6c, 0x6c, 0x64, 0x20, 0x30, 0x78
|
|
|
|
.db 0x25, 0x6c, 0x6c, 0x78, 0x20, 0x25, 0x64, 0x20, 0x25, 0x64, 0x20, 0x25, 0x64, 0x20, 0x25, 0x6c
|
|
|
|
.db 0x6c, 0x64, 0x20, 0x30, 0x78, 0x25, 0x6c, 0x6c, 0x78, 0x0a, 0x00
|
2022-05-17 11:34:31 +02:00
|
|
|
|
|
|
|
1 2 3 4 0x100000000 6 7 8 9 0x100000000
|
|
|
|
|
|
|
|
exit code = 40
|