1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-18 02:00:20 +02:00

Add some nop and jmp tests, and fix a hazard with jmpi/calli

This commit is contained in:
Andy Wingo 2019-03-26 16:28:38 +01:00
parent 8a8273c45c
commit 281cca514f
4 changed files with 92 additions and 10 deletions

21
tests/jmpi.c Normal file
View file

@ -0,0 +1,21 @@
#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);
jit_jmpi(j, tail);
int (*f)(void) = jit_end(j, NULL);
ASSERT(f() == 42);
}
int
main (int argc, char *argv[])
{
return main_helper(argc, argv, run_test);
}