9 static int promotion(
signed char sc,
signed short ss,
10 unsigned char uc,
unsigned short us)
12 int r = (int) sc + (
int) ss + (int) uc + (
int) us;
30 args[1] = &ffi_type_sshort;
32 args[3] = &ffi_type_ushort;
40 &ffi_type_sint, args) == FFI_OK);
45 for (sc = (
signed char) -127;
46 sc <= (
signed char) 120; sc += 1)
47 for (ss = -30000; ss <= 30000; ss += 10000)
48 for (uc = (
unsigned char) 0;
49 uc <= (
unsigned char) 200; uc += 20)
50 for (us = 0; us <= 60000; us += 10000)
54 CHECK((
int)rint == (
signed char) sc + (
signed short) ss +
55 (
unsigned char) uc + (
unsigned short) us);
57 printf(
"%lu promotion tests run\n", ul);
void ffi_call(ffi_cif *cif, void(*fn)(void), void *rvalue, void **avalue)
ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, ffi_type *rtype, ffi_type **atypes)