#include #include #include "do_jit.h" int main(int argc, char *argv[]) { (void)argv; bool do_jit = argc > 1; struct ejit_operand operands[1] = { EJIT_OPERAND_GPR(1, EJIT_TYPE(long)) }; struct ejit_func *f = ejit_create_func(EJIT_TYPE(long), 1, operands); ejit_extr_u16(f, EJIT_GPR(0), EJIT_GPR(1)); ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); assert(erfi1(f, EJIT_ARG(0, long)) == 0); assert(erfi1(f, EJIT_ARG(1, long)) == 1); assert(erfi1(f, EJIT_ARG(0xffff, long)) == 0xffff); assert(erfi1(f, EJIT_ARG(0xfffff, long)) == 0xffff); assert(erfi1(f, EJIT_ARG(0xf0000, long)) == 0); ejit_destroy_func(f); }