]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/ffi_test.c
io.streams.256color: faster by caching styles
[factor.git] / vm / ffi_test.c
index 4bf5e70f3ec30e30a0384bd38a942d7f9cadde36..7e927b9d27261029647f016d728b987dbffe2430 100644 (file)
@@ -84,7 +84,10 @@ FACTOR_STDCALL(struct bar) ffi_test_19(long x, long y, long z) {
 }
 
 void ffi_test_20(double x1, double x2, double x3, double y1, double y2,
-                 double y3, double z1, double z2, double z3) {}
+                 double y3, double z1, double z2, double z3) {
+  (void) x1, (void) x2, (void) x3, (void) y1, (void) y2,
+  (void) y3, (void) z1, (void) z2, (void) z3;
+}
 
 long long ffi_test_21(long x, long y) { return (long long) x * (long long) y; }
 
@@ -309,7 +312,7 @@ unsigned long long ffi_test_60(unsigned long long x) {
 /* C99 features */
 #ifndef _MSC_VER
 
-struct bool_and_ptr ffi_test_61() {
+struct bool_and_ptr ffi_test_61(void) {
   struct bool_and_ptr bap;
   bap.b = true;
   bap.ptr = NULL;
@@ -318,14 +321,14 @@ struct bool_and_ptr ffi_test_61() {
 
 #endif
 
-struct uint_pair ffi_test_62() {
+struct uint_pair ffi_test_62(void) {
   struct uint_pair uip;
   uip.a = 0xabcdefab;
   uip.b = 0x12345678;
   return uip;
 }
 
-struct ulonglong_pair ffi_test_63() {
+struct ulonglong_pair ffi_test_63(void) {
   struct ulonglong_pair ullp;
   ullp.a = 0xabcdefabcdefabcd;
   ullp.b = 0x1234567891234567;
@@ -354,12 +357,49 @@ double ffi_test_65(int n, ...) {
     return sum;
 }
 
+unsigned long ffi_test_66(unsigned long a, unsigned long b, unsigned long c,
+                          struct test_struct_66 d, struct test_struct_66 e) {
+    unsigned long x;
+    x = a + b + c + d.mem1 + d.mem2 + e.mem1 + e.mem2;
+    return x;
+}
+
+unsigned long ffi_test_67(unsigned long a, unsigned long b, unsigned long c,
+                          struct test_struct_66 d, struct test_struct_66 e,
+                          unsigned long f) {
+    unsigned long x;
+    x = a + b + c + d.mem1 + d.mem2 + e.mem1 + e.mem2 + f*2;
+    return x;
+}
+
+unsigned long ffi_test_68(unsigned long a, unsigned long b, unsigned long c,
+                          struct test_struct_66 d, struct test_struct_68 e, struct test_struct_66 f) {
+    unsigned long x;
+    x = a + b + c + d.mem1 + d.mem2 + e.mem1 + e.mem2 + e.mem3 + f.mem1 + f.mem2;
+    return x;
+}
+
+unsigned long ffi_test_69(unsigned long a, unsigned long b, unsigned long c,
+                          struct test_struct_66 d, struct test_struct_69 e, struct test_struct_66 f) {
+    unsigned long x;
+    x = a + b + c + d.mem1 + d.mem2 + (long)e.mem1 + e.mem2 + e.mem3 + f.mem1 + f.mem2;
+    return x;
+}
+
+unsigned long ffi_test_70(struct test_struct_68 a, struct test_struct_68 b, struct test_struct_66 c) { 
+    unsigned long x;
+    x = a.mem1 + a.mem2 + a.mem3 + b.mem1 + b.mem2 + b.mem3 + c.mem1 + c.mem2;
+    return x;
+}
+
 
 void* bug1021_test_1(void* x, int y) {
   return (void*)(y * y + (size_t)x);
 }
 
 int bug1021_test_2(int x, char *y, void *z) {
+  (void) x;
+  (void) z;
   return y[0];
 }