Add unit test for float alignment
parent
7bc7f469c7
commit
e7722c02b7
|
@ -270,6 +270,16 @@ FUNCTION: double ffi_test_35 test-struct-11 x int y ;
|
||||||
3 ffi_test_35
|
3 ffi_test_35
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
C-STRUCT: test-struct-12 { "int" "a" } { "double" "x" } ;
|
||||||
|
|
||||||
|
: make-struct-12
|
||||||
|
"test-struct-12" <c-object>
|
||||||
|
[ set-test-struct-12-x ] keep ;
|
||||||
|
|
||||||
|
FUNCTION: double ffi_test_36 ( test-struct-12 x ) ;
|
||||||
|
|
||||||
|
[ 1.23456 ] [ 1.23456 make-struct-12 ffi_test_36 ] unit-test
|
||||||
|
|
||||||
! Test callbacks
|
! Test callbacks
|
||||||
|
|
||||||
: callback-1 "void" { } "cdecl" [ ] alien-callback ;
|
: callback-1 "void" { } "cdecl" [ ] alien-callback ;
|
||||||
|
|
|
@ -245,3 +245,8 @@ double ffi_test_35(struct test_struct_11 x, int y)
|
||||||
{
|
{
|
||||||
return (x.x + x.y) * y;
|
return (x.x + x.y) * y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double ffi_test_36(struct test_struct_12 x)
|
||||||
|
{
|
||||||
|
return x.x;
|
||||||
|
}
|
||||||
|
|
|
@ -57,3 +57,7 @@ struct test_struct_10 { float x; int y; };
|
||||||
DLLEXPORT double ffi_test_34(struct test_struct_10 x, int y);
|
DLLEXPORT double ffi_test_34(struct test_struct_10 x, int y);
|
||||||
struct test_struct_11 { int x; int y; };
|
struct test_struct_11 { int x; int y; };
|
||||||
DLLEXPORT double ffi_test_35(struct test_struct_11 x, int y);
|
DLLEXPORT double ffi_test_35(struct test_struct_11 x, int y);
|
||||||
|
|
||||||
|
struct test_struct_12 { int a; double x; };
|
||||||
|
|
||||||
|
DLLEXPORT double ffi_test_36(struct test_struct_12 x);
|
||||||
|
|
Loading…
Reference in New Issue