2 Purpose: Check return value double.
5 Originator: <andreast@gcc.gnu.org> 20050212 */
10 static double return_dbl(double dbl1
, double dbl2
, unsigned int in3
, double dbl4
)
12 return dbl1
+ dbl2
+ in3
+ dbl4
;
17 ffi_type
*args
[MAX_ARGS
];
18 void *values
[MAX_ARGS
];
19 double dbl1
, dbl2
, dbl4
, rdbl
;
21 args
[0] = &ffi_type_double
;
22 args
[1] = &ffi_type_double
;
23 args
[2] = &ffi_type_uint
;
24 args
[3] = &ffi_type_double
;
30 /* Initialize the cif */
31 CHECK(ffi_prep_cif(&cif
, FFI_DEFAULT_ABI
, 4,
32 &ffi_type_double
, args
) == FFI_OK
);
38 ffi_call(&cif
, FFI_FN(return_dbl
), &rdbl
, values
);
39 printf ("%f vs %f\n", rdbl
, return_dbl(dbl1
, dbl2
, in3
, dbl4
));
40 CHECK(rdbl
== dbl1
+ dbl2
+ in3
+ dbl4
);