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/ler_f.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'tests/ler_f.c') diff --git a/tests/ler_f.c b/tests/ler_f.c index ecb4b3f..fa08b24 100644 --- a/tests/ler_f.c +++ b/tests/ler_f.c @@ -9,22 +9,16 @@ int main() EJIT_OPERAND_FPR(1, EJIT_TYPE(double)) }; - struct ejit_func *f = ejit_create_func(EJIT_TYPE(double), 2, operands); + struct ejit_func *f = ejit_create_func(EJIT_TYPE(long), 2, operands); ejit_ler_f(f, EJIT_GPR(0), EJIT_FPR(0), EJIT_FPR(1)); ejit_retr(f, EJIT_GPR(0)); - ejit_select_compile_func(f, 1, 2, EJIT_USE64(long), do_jit); + ejit_select_compile_func(f, 1, 2, EJIT_USE64(double), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); - - assert(ejit_run_func_2(f, - EJIT_ARG(0x0fffffffffffffff, long), - EJIT_ARG(0x0ffffffffffffff0, long)) == 1); - - assert(ejit_run_func_2(f, - EJIT_ARG(0x7fffffffffffffff, long), - EJIT_ARG(0x6fffffffffffffff, long)) == 0); + assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 1); + assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 0); + assert(erf2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 1); + assert(erf2(f, EJIT_ARG(-1, double), EJIT_ARG(-1, double)) == 1); ejit_destroy_func(f); } -- cgit v1.2.3