-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply input from @joshtriplett on more general stdcall handling
- Loading branch information
Showing
3 changed files
with
44 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* Area: ffi_call | ||
Purpose: Check for proper argument alignment. | ||
Limitations: none. | ||
PR: none. | ||
Originator: <twalljava@java.net> (from many_win32.c) */ | ||
|
||
/* { dg-do run } */ | ||
|
||
#include "ffitest.h" | ||
#include <float.h> | ||
|
||
static float ABI_ATTR align_arguments(int i1, | ||
double f2, | ||
int i3, | ||
double f4) | ||
{ | ||
return i1+f2+i3+f4; | ||
} | ||
|
||
int main (void) | ||
{ | ||
ffi_cif cif; | ||
ffi_type *args[4] = {&ffi_type_int, &ffi_type_double, &ffi_type_int, &ffi_type_double}; | ||
float fa[2] = {1,2}; | ||
int ia[2] = {1,2}; | ||
void *values[4] = {&ia[0], &fa[0], &ia[1], &fa[1]}; | ||
float f, ff; | ||
|
||
/* Initialize the cif */ | ||
CHECK(ffi_prep_cif(&cif, ABI_NUM, 4, | ||
&ffi_type_float, args) == FFI_OK); | ||
|
||
ff = align_arguments(ia[0], fa[0], ia[1], fa[1]); | ||
|
||
ffi_call(&cif, FFI_FN(align_arguments), &f, values); | ||
|
||
if (f - ff < FLT_EPSILON) | ||
printf("align arguments tests ok!\n"); | ||
else | ||
CHECK(0); | ||
exit(0); | ||
} |
This file was deleted.
Oops, something went wrong.