5 static _Complex T_C_TYPE return_c(_Complex T_C_TYPE c1, float fl2, unsigned int in3, _Complex T_C_TYPE c4)
7 return c1 + fl2 + in3 + c4;
12 ffi_type *args[MAX_ARGS];
13 void *values[MAX_ARGS];
14 _Complex T_C_TYPE c1, c4, rc, rc2;
17 args[0] = &T_FFI_TYPE;
18 args[1] = &ffi_type_float;
19 args[2] = &ffi_type_uint;
20 args[3] = &T_FFI_TYPE;
26 /* Initialize the cif */
27 CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
28 &T_FFI_TYPE, args) == FFI_OK);
29 c1 = 127.0 + 255.0 * I;
32 c4 = 512.7 + 1024.1 * I;
34 ffi_call(&cif, FFI_FN(return_c), &rc, values);
35 rc2 = return_c(c1, fl2, in3, c4);
36 printf ("%f,%fi vs %f,%fi\n",
37 T_CONV creal (rc), T_CONV cimag (rc),
38 T_CONV creal (rc2), T_CONV cimag (rc2));