ffi: Add some tests to ensure that 64bit integers are handled properly.
parent
608c23ad8f
commit
beb2d1df3a
|
@ -6,7 +6,8 @@ math memory namespaces namespaces.private parser
|
|||
quotations sequences specialized-arrays stack-checker
|
||||
stack-checker.errors system threads tools.test words
|
||||
alien.complex concurrency.promises alien.data
|
||||
byte-arrays classes compiler.test libc ;
|
||||
byte-arrays classes compiler.test libc layouts
|
||||
math.bitwise ;
|
||||
FROM: alien.c-types => float short ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
SPECIALIZED-ARRAY: char
|
||||
|
@ -662,6 +663,18 @@ FUNCTION: short ffi_test_48 ( bool-field-test x ) ;
|
|||
test-struct-11 "f-fastcall" "ffi_test_58" { int int int }
|
||||
alien-invoke gc ;
|
||||
|
||||
! Make sure that large longlong/ulonglong are correctly dealt with
|
||||
FUNCTION: longlong ffi_test_59 ( longlong x ) ;
|
||||
FUNCTION: ulonglong ffi_test_60 ( ulonglong x ) ;
|
||||
|
||||
[ t ] [ most-positive-fixnum 1 + [ ffi_test_59 ] keep = ] unit-test
|
||||
[ t ] [ most-positive-fixnum 1 + [ ffi_test_60 ] keep = ] unit-test
|
||||
|
||||
[ -1 ] [ -1 ffi_test_59 ] unit-test
|
||||
[ -1 ] [ 0xffffffffffffffff ffi_test_59 ] unit-test
|
||||
[ 0xffffffffffffffff ] [ -1 ffi_test_60 ] unit-test
|
||||
[ 0xffffffffffffffff ] [ 0xffffffffffffffff ffi_test_60 ] unit-test
|
||||
|
||||
! GCC bugs
|
||||
mingw? [
|
||||
[ 13 ] [ 3 4.0 5 ffi_test_52 ] unit-test
|
||||
|
|
|
@ -298,3 +298,11 @@ FACTOR_FASTCALL(struct test_struct_11) ffi_test_58(int x, int y, int z) {
|
|||
struct test_struct_11 r = { x + y, y - z };
|
||||
return r;
|
||||
}
|
||||
|
||||
signed long long ffi_test_59(signed long long x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
unsigned long long ffi_test_60(unsigned long long x) {
|
||||
return x;
|
||||
}
|
||||
|
|
|
@ -199,3 +199,7 @@ FACTOR_EXPORT FACTOR_FASTCALL(int)
|
|||
FACTOR_EXPORT FACTOR_FASTCALL(struct test_struct_11) ffi_test_57(int x, int y);
|
||||
FACTOR_EXPORT FACTOR_FASTCALL(struct test_struct_11)
|
||||
ffi_test_58(int x, int y, int z);
|
||||
|
||||
signed long long ffi_test_59(signed long long x);
|
||||
unsigned long long ffi_test_60(unsigned long long x);
|
||||
|
||||
|
|
Loading…
Reference in New Issue