mirror of
https://github.com/danog/ir.git
synced 2024-12-11 16:59:46 +01:00
53 lines
1.2 KiB
Plaintext
53 lines
1.2 KiB
Plaintext
--TEST--
|
|
003: Parameter Loading and argument passing
|
|
--TARGET--
|
|
aarch64
|
|
--ARGS--
|
|
-S
|
|
--CODE--
|
|
{
|
|
uintptr_t f = func(printf);
|
|
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:
|
|
stp x29, x30, [sp, #-0x10]!
|
|
mov x29, sp
|
|
mov w8, w7
|
|
sub sp, sp, #0x20
|
|
str w8, [sp]
|
|
mov w7, w6
|
|
mov w6, w5
|
|
mov w5, w4
|
|
mov w4, w3
|
|
mov w3, w2
|
|
mov w2, w1
|
|
mov w1, w0
|
|
adr x0, .L1
|
|
ldr w9, [x29, #0x20]
|
|
str w9, [sp, #8]
|
|
ldr w9, [x29, #0x28]
|
|
str w9, [sp, #0x10]
|
|
bl _IO_printf
|
|
add sp, sp, #0x20
|
|
ldp x29, x30, [sp], #0x10
|
|
ret
|
|
.rodata
|
|
.db 0x1f, 0x20, 0x03, 0xd5
|
|
.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, 0x00
|