2 Purpose: Check fastcall strlen 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 __attribute__((fastcall
)) my_fastcall_strlen(char *s
)
20 ffi_type
*args
[MAX_ARGS
];
21 void *values
[MAX_ARGS
];
24 args
[0] = &ffi_type_pointer
;
25 values
[0] = (void*) &s
;
27 /* Initialize the cif */
28 CHECK(ffi_prep_cif(&cif
, FFI_FASTCALL
, 1,
29 &ffi_type_sint
, args
) == FFI_OK
);
32 ffi_call(&cif
, FFI_FN(my_fastcall_strlen
), &rint
, values
);
36 ffi_call(&cif
, FFI_FN(my_fastcall_strlen
), &rint
, values
);
39 s
= "1234567890123456789012345";
40 ffi_call(&cif
, FFI_FN(my_fastcall_strlen
), &rint
, values
);
43 printf("fastcall strlen tests passed\n");