]> gitweb.factorcode.org Git - factor.git/commitdiff
Add some more tests for complex numbers in FFI
authorsheeple <sheeple@oberon.local>
Fri, 6 Feb 2009 18:21:53 +0000 (12:21 -0600)
committersheeple <sheeple@oberon.local>
Fri, 6 Feb 2009 18:21:53 +0000 (12:21 -0600)
basis/compiler/tests/alien.factor
vm/ffi_test.c
vm/ffi_test.h

index b9c62f1429708f65dd769188ad5ba73de2cf1ba9..8830c59b316e0fb518c3e0b6a7796e86efa30569 100644 (file)
@@ -559,9 +559,17 @@ FUNCTION: test_struct_14 ffi_test_44 ( ) ; inline
 
 [ ] [ stack-frame-bustage 2drop ] unit-test
 
-FUNCTION: complex-float ffi_test_45 ( complex-float x, complex-double y ) ;
+FUNCTION: complex-float ffi_test_45 ( int x ) ;
+
+[ C{ 0.0 3.0 } ] [ 3 ffi_test_45 ] unit-test
+
+FUNCTION: complex-double ffi_test_46 ( int x ) ;
+
+[ C{ 0.0 3.0 } ] [ 3 ffi_test_46 ] unit-test
+
+FUNCTION: complex-float ffi_test_47 ( complex-float x, complex-double y ) ;
 
 [ C{ 4.0 4.0 } ] [
     C{ 1.0 2.0 }
-    C{ 1.5 1.0 } ffi_test_45
-] unit-test
\ No newline at end of file
+    C{ 1.5 1.0 } ffi_test_47
+] unit-test
index c7a9f7d8905e45e49867be41d3104177f74a2601..a5a43cf2ae7a6f7b6db82d10beb25ac2f6f09805 100755 (executable)
@@ -303,7 +303,17 @@ struct test_struct_14 ffi_test_44(void)
        return retval;
 }
 
-_Complex float ffi_test_45(_Complex float x, _Complex double y)
+_Complex float ffi_test_45(int x)
+{
+       return x;
+}
+
+_Complex double ffi_test_46(int x)
+{
+       return x;
+}
+
+_Complex float ffi_test_47(_Complex float x, _Complex double y)
 {
        return x + 2 * y;
 }
index 42ab8d71d10aaadfc88ebb4ce531094a06ef2282..f8634b304eff0c22cea7e21fbb87fc2e10edc6a2 100755 (executable)
@@ -89,4 +89,8 @@ DLLEXPORT struct test_struct_16 ffi_test_43(float x, int a);
 
 DLLEXPORT struct test_struct_14 ffi_test_44();
 
-DLLEXPORT _Complex float ffi_test_45(_Complex float x, _Complex double y);
+DLLEXPORT _Complex float ffi_test_45(int x);
+
+DLLEXPORT _Complex double ffi_test_46(int x);
+
+DLLEXPORT _Complex float ffi_test_47(_Complex float x, _Complex double y);