]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.tests.alien: Check in a failing unit test. Structure is getting returned...
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 7 Nov 2014 23:34:10 +0000 (15:34 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 7 Nov 2014 23:34:10 +0000 (15:34 -0800)
basis/compiler/tests/alien.factor
vm/ffi_test.c
vm/ffi_test.h

index 17603184329865df18d852029e0bfbecc818e7ce..bf640477aae3257ab3dd79124846e00d577bacad 100755 (executable)
@@ -883,3 +883,14 @@ TUPLE: some-tuple x ;
     f (free) f (free) ;
 
 [ ] [ anton's-regression ] unit-test
+
+STRUCT: bool-and-ptr
+    { b bool }
+    { ptr void* } ;
+
+FUNCTION: bool-and-ptr ffi_test_61 ( ) ;
+{
+    S{ bool-and-ptr { b t } { ptr f } }
+} [
+    ffi_test_61
+] unit-test
index 3026d51ae9d7c2b99db379d7e19fd1c708ab2a3d..340abaf4944db73ad553f96ec870d34a03bfd702 100644 (file)
@@ -306,3 +306,10 @@ signed long long ffi_test_59(signed long long x) {
 unsigned long long ffi_test_60(unsigned long long x) {
   return x;
 }
+
+struct bool_and_ptr ffi_test_61(unsigned long long x) {
+  struct bool_and_ptr bap;
+  bap.b = true;
+  bap.ptr = NULL;
+  return bap;
+}
index 1ccb322129804618ac47a798eaadad244f215d21..21d86ab0576002d5f0a2d0697cccf794497faafd 100644 (file)
@@ -203,3 +203,9 @@ FACTOR_EXPORT FACTOR_FASTCALL(struct test_struct_11)
 FACTOR_EXPORT signed long long ffi_test_59(signed long long x);
 FACTOR_EXPORT unsigned long long ffi_test_60(unsigned long long x);
 
+struct bool_and_ptr {
+    bool b;
+    void* ptr;
+};
+
+FACTOR_EXPORT struct bool_and_ptr ffi_test_61(unsigned long long x);