1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-12 14:28:08 +03:00
juvix/tests/Asm/positive/test021.jva
2022-09-29 17:44:55 +02:00

29 lines
350 B
Plaintext

-- higher-order functions & recursion
function f(integer -> integer) : integer {
push 5;
push arg[0];
tcall $ 1;
}
function h(integer, integer) : integer {
push arg[1];
push arg[0];
add;
ret;
}
function u(integer) : integer {
push arg[0];
push 4;
calloc h 1;
call f;
add;
ret;
}
function main() {
push 2;
tcall u;
}