]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libffi/testsuite/libffi.call/strlen3.c
2 Purpose: Check strlen function call with additional arguments.
5 Originator: From the original ffitest.c */
11 static size_t ABI_ATTR
my_f(float a
, char *s
)
13 return (size_t) ((int) strlen(s
) + (int) a
);
19 ffi_type
*args
[MAX_ARGS
];
20 void *values
[MAX_ARGS
];
24 args
[1] = &ffi_type_pointer
;
25 args
[0] = &ffi_type_float
;
26 values
[1] = (void*) &s
;
27 values
[0] = (void*) &v2
;
29 /* Initialize the cif */
30 CHECK(ffi_prep_cif(&cif
, ABI_NUM
, 2,
31 &ffi_type_sint
, args
) == FFI_OK
);
35 ffi_call(&cif
, FFI_FN(my_f
), &rint
, values
);
40 ffi_call(&cif
, FFI_FN(my_f
), &rint
, values
);
43 s
= "1234567890123456789012345";
45 ffi_call(&cif
, FFI_FN(my_f
), &rint
, values
);