16 printf(
"%d %d: %d\n", a1, a2, result);
23 void *data __UNUSED__)
27 a1 = *(
signed char *)avals[0];
28 a2 = *(
signed char *)avals[1];
34 typedef signed char (*
test_type)(
signed char,
signed char);
40 ffi_closure *pcl = ffi_closure_alloc(
sizeof(ffi_closure), &code);
42 ffi_type * cl_arg_types[3];
44 signed char a, b, res_closure;
55 cl_arg_types[2] =
NULL;
63 printf(
"res: %d\n", (
signed char)res_call);
68 res_closure = (*((
test_type)code))(2, 125);
70 printf(
"res: %d\n", res_closure);
signed char(* test_type)(signed char, signed char)
signed char test_func_fn(signed char a1, signed char a2)
ffi_status ffi_prep_closure_loc(ffi_closure *closure, ffi_cif *cif, void(*fun)(ffi_cif *, void *, void **, void *), void *user_data, void *codeloc)
void ffi_call(ffi_cif *cif, void(*fn)(void), void *rvalue, void **avalue)
static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals, void *data __UNUSED__)
ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, ffi_type *rtype, ffi_type **atypes)