2 Purpose: Check that negative integers are passed correctly.
5 Originator: From the original ffitest.c */
8 /* { dg-options -O2 } */
12 static int checking(int a, short b, signed char c)
15 return (a < 0 && b < 0 && c < 0);
21 ffi_type *args[MAX_ARGS];
22 void *values[MAX_ARGS];
29 args[0] = &ffi_type_sint;
31 args[1] = &ffi_type_sshort;
33 args[2] = &ffi_type_schar;
36 /* Initialize the cif */
37 CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
38 &ffi_type_sint, args) == FFI_OK);
44 checking (si, ss, sc);
46 ffi_call(&cif, FFI_FN(checking), &rint, values);
48 printf ("%d vs %d\n", (int)rint, checking (si, ss, sc));