mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-06 04:00:26 +02:00
27 lines
550 B
C
27 lines
550 B
C
#include "test.h"
|
|
|
|
static int tail(void) { return 42; }
|
|
|
|
static void
|
|
run_test(jit_state_t *j, uint8_t *arena_base, size_t arena_size)
|
|
{
|
|
jit_begin(j, arena_base, arena_size);
|
|
|
|
const jit_arg_abi_t abi[] = { JIT_ARG_ABI_POINTER };
|
|
jit_arg_t args[1];
|
|
const jit_anyreg_t regs[] = { { .gpr=JIT_R0 } };
|
|
|
|
jit_receive(j, 1, abi, args);
|
|
jit_load_args(j, 1, abi, args, regs);
|
|
|
|
jit_jmpr(j, JIT_R0);
|
|
|
|
int (*f)(void*) = jit_end(j, NULL);
|
|
ASSERT(f(tail) == 42);
|
|
}
|
|
|
|
int
|
|
main (int argc, char *argv[])
|
|
{
|
|
return main_helper(argc, argv, run_test);
|
|
}
|