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
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
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;
+}
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);
+