From ae9e103995c1d809be7b8717905593e7dbbf9d17 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 13 Jul 2024 20:56:26 +0300 Subject: bytecode tests pass --- tests/sti_i.c | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 tests/sti_i.c (limited to 'tests/sti_i.c') diff --git a/tests/sti_i.c b/tests/sti_i.c deleted file mode 100644 index 1f014fd..0000000 --- a/tests/sti_i.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "test.h" - -static uint32_t data[] = { 0x12121212, 0x00000000, 0x34343434 }; - -static void -run_test(jit_state_t *j, uint8_t *arena_base, size_t arena_size) -{ - jit_begin(j, arena_base, arena_size); - size_t align = jit_enter_jit_abi(j, 0, 0, 0); - jit_load_args_1(j, jit_operand_gpr (JIT_OPERAND_ABI_INT32, JIT_R1)); - - jit_sti_i(j, &data[1], JIT_R1); - jit_leave_jit_abi(j, 0, 0, align); - jit_ret(j); - - void (*f)(int32_t) = jit_end(j, NULL); - - ASSERT(data[0] == 0x12121212); - ASSERT(data[1] == 0x00); - ASSERT(data[2] == 0x34343434); - f(-1); - ASSERT(data[0] == 0x12121212); - ASSERT(data[1] == 0xffffffff); - ASSERT(data[2] == 0x34343434); -} - -int -main (int argc, char *argv[]) -{ - return main_helper(argc, argv, run_test); -} -- cgit v1.2.3