2 Purpose: Check that negative integers are passed correctly.
5 Originator: From the original ffitest.c */
11 static int checking(int a
, short b
, signed char c
)
14 return (a
< 0 && b
< 0 && c
< 0);
20 ffi_type
*args
[MAX_ARGS
];
21 void *values
[MAX_ARGS
];
28 args
[0] = &ffi_type_sint
;
30 args
[1] = &ffi_type_sshort
;
32 args
[2] = &ffi_type_schar
;
35 /* Initialize the cif */
36 CHECK(ffi_prep_cif(&cif
, FFI_DEFAULT_ABI
, 3,
37 &ffi_type_sint
, args
) == FFI_OK
);
43 checking (si
, ss
, sc
);
45 ffi_call(&cif
, FFI_FN(checking
), &rint
, values
);
47 printf ("%d vs %d\n", (int)rint
, checking (si
, ss
, sc
));