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:
parent
8a8273c45c
commit
281cca514f
4 changed files with 92 additions and 10 deletions
21
tests/jmpi.c
Normal file
21
tests/jmpi.c
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue