compiler.tests.alien: Add structs with uint and ulonglong pairs and return them from an FFI call. macosx32 seems to be working, hopefully this will break it or confirm that it's working. Linux32 is broken, hopefully this will show how.

db4
Doug Coleman 2014-11-08 13:39:47 -08:00
parent 56f1b87a6f
commit 1b5711cc42
3 changed files with 50 additions and 3 deletions

View File

@ -889,8 +889,27 @@ STRUCT: bool-and-ptr
{ ptr void* } ;
FUNCTION: bool-and-ptr ffi_test_61 ( ) ;
{
S{ bool-and-ptr { b t } { ptr f } }
} [
ffi_test_61
] unit-test
} [ ffi_test_61 ] unit-test
STRUCT: uint-pair
{ a uint }
{ b uint } ;
FUNCTION: uint-pair ffi_test_62 ( ) ;
{
S{ uint-pair { a 0xabcdefab } { b 0x12345678 } }
} [ ffi_test_62 ] unit-test
STRUCT: ulonglong-pair
{ a ulonglong }
{ b ulonglong } ;
FUNCTION: ulonglong-pair ffi_test_63 ( ) ;
{
S{ ulonglong-pair { a 0xabcdefabcdefabcd } { b 0x1234567891234567 } }
} [ ffi_test_63 ] unit-test

View File

@ -313,3 +313,17 @@ struct bool_and_ptr ffi_test_61() {
bap.ptr = NULL;
return bap;
}
struct uint_pair ffi_test_62() {
struct uint_pair uip;
uip.a = 0xabcdefab;
uip.b = 0x12345678;
return uip;
}
struct ulonglong_pair ffi_test_63() {
struct ulonglong_pair ullp;
ullp.a = 0xabcdefabcdefabcd;
ullp.b = 0x1234567891234567;
return ullp;
}

View File

@ -209,3 +209,17 @@ struct bool_and_ptr {
};
FACTOR_EXPORT struct bool_and_ptr ffi_test_61();
struct uint_pair {
unsigned int a;
unsigned int b;
};
FACTOR_EXPORT struct uint_pair ffi_test_62();
struct ulonglong_pair {
unsigned long long a;
unsigned long long b;
};
FACTOR_EXPORT struct ulonglong_pair ffi_test_63();