2 Purpose: Check stdcall 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__((stdcall)) my_stdcall_strlen(char *s
)
19 ffi_type
*args
[MAX_ARGS
];
20 void *values
[MAX_ARGS
];
23 args
[0] = &ffi_type_pointer
;
24 values
[0] = (void*) &s
;
26 /* Initialize the cif */
27 CHECK(ffi_prep_cif(&cif
, FFI_STDCALL
, 1,
28 &ffi_type_sint
, args
) == FFI_OK
);
31 ffi_call(&cif
, FFI_FN(my_stdcall_strlen
), &rint
, values
);
35 ffi_call(&cif
, FFI_FN(my_stdcall_strlen
), &rint
, values
);
38 s
= "1234567890123456789012345";
39 ffi_call(&cif
, FFI_FN(my_stdcall_strlen
), &rint
, values
);
42 printf("stdcall strlen tests passed\n");