ir/tests/debug.Windows-x86_64/args_001.irt
2023-03-02 17:57:26 +03:00

55 lines
1.2 KiB
Plaintext
Executable File

--TEST--
001: Argument Passing
--TARGET--
Windows-x86_64
--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;
uintptr_t f = func(printf, 4);
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--
test:
subq $0x58, %rsp
leaq .L1(%rip), %rcx
movl $1, %edx
movl $2, %r8d
movl $3, %r9d
movq $4, 0x20(%rsp)
movabsq $0x100000000, %rax
movq %rax, 0x28(%rsp)
movl $6, 0x30(%rsp)
movl $7, 0x38(%rsp)
movl $8, 0x40(%rsp)
movq $9, 0x48(%rsp)
movabsq $0x100000000, %rax
movq %rax, 0x50(%rsp)
movabsq $printf, %rax
callq *%rax
addq $0x58, %rsp
retq
.rodata
.db 0x90, 0x90, 0x90
.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
1 2 3 4 0x100000000 6 7 8 9 0x100000000
exit code = 40