2 Purpose: Check fastcall f call on X86_WIN32 systems.
5 Originator: From the original ffitest.c */
7 /* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
11 static size_t __FASTCALL__
my_fastcall_f(float a
, char *s
, int i
)
13 return (size_t) ((int) strlen(s
) + (int) a
+ i
);
19 ffi_type
*args
[MAX_ARGS
];
20 void *values
[MAX_ARGS
];
25 args
[2] = &ffi_type_sint
;
26 args
[1] = &ffi_type_pointer
;
27 args
[0] = &ffi_type_float
;
28 values
[2] = (void*) &v1
;
29 values
[1] = (void*) &s
;
30 values
[0] = (void*) &v2
;
32 /* Initialize the cif */
33 CHECK(ffi_prep_cif(&cif
, FFI_FASTCALL
, 3,
34 &ffi_type_sint
, args
) == FFI_OK
);
39 ffi_call(&cif
, FFI_FN(my_fastcall_f
), &rint
, values
);
45 ffi_call(&cif
, FFI_FN(my_fastcall_f
), &rint
, values
);
48 s
= "1234567890123456789012345";
51 ffi_call(&cif
, FFI_FN(my_fastcall_f
), &rint
, values
);
54 printf("fastcall fct3 tests passed\n");