This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libffi and older compilers


Hi,

I tried to get a newer than a 3.3.x compiler running on openbsd sparc, but 
that did not worked out. As the 2.95.3 and the 3.3.5 gcc versions are the 
system compilers that are installed as default, I thought it would be best if 
libffi and the testsuite would work with these. As the libffi itself compiled 
well with those compilers, only running the testsuite produced errors. 
Therefore I took a closer look, why so many tests fail with the old gcc 
2.95.3, and 3.3.5. 
The summary before:
                === libffi Summary ===

# of expected passes            583
# of unexpected failures        285
# of unsupported tests          15
*** Error code 1

The summary now:
                === libffi Summary ===

# of expected passes            1365
# of unexpected failures        8
# of unsupported tests          15
*** Error code 1

Most of the changes have been reshuffling variable declarations.
one problem was a comparison between signed and unsigned, and another one 
problem was that on the sparc, this is defined in float.h:
float.h:#define LDBL_EPSILON    DBL_EPSILON
which on one printf format string produced a warning.

After the changes I tested the patch on sparc64 and i386 too.
The libffi summary now is the same on all three architectures.
I had OpenBSD 4.4 running on all three hosts, patches are against 
libffi-3.0.8.

Any idea what to change to get rid of the remaining 8 compilation errors?
They all have the same problem.

regards
Sebastian
$OpenBSD$
--- testsuite/libffi.call/cls_12byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_12byte.c	Thu Dec 25 21:03:08 2008
@@ -51,6 +51,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_12byte h_dbl = { 7, 4, 9 };
+  struct cls_struct_12byte j_dbl = { 1, 5, 3 };
+  struct cls_struct_12byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -61,10 +65,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_12byte h_dbl = { 7, 4, 9 };
-  struct cls_struct_12byte j_dbl = { 1, 5, 3 };
-  struct cls_struct_12byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_sint;
   cls_struct_fields[1] = &ffi_type_sint;
$OpenBSD$
--- testsuite/libffi.call/cls_16byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_16byte.c	Thu Dec 25 21:03:08 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_16byte h_dbl = { 7, 8.0, 9 };
+  struct cls_struct_16byte j_dbl = { 1, 9.0, 3 };
+  struct cls_struct_16byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_16byte h_dbl = { 7, 8.0, 9 };
-  struct cls_struct_16byte j_dbl = { 1, 9.0, 3 };
-  struct cls_struct_16byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_sint;
   cls_struct_fields[1] = &ffi_type_double;
$OpenBSD$
--- testsuite/libffi.call/cls_18byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_18byte.c	Thu Dec 25 21:03:09 2008
@@ -56,6 +56,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[3];
 
+  struct cls_struct_18byte g_dbl = { 1.0, 127, 126, 3.0 };
+  struct cls_struct_18byte f_dbl = { 4.0, 125, 124, 5.0 };
+  struct cls_struct_18byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -66,10 +70,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_18byte g_dbl = { 1.0, 127, 126, 3.0 };
-  struct cls_struct_18byte f_dbl = { 4.0, 125, 124, 5.0 };
-  struct cls_struct_18byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_double;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/cls_19byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_19byte.c	Thu Dec 25 21:03:07 2008
@@ -59,6 +59,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[3];
 
+  struct cls_struct_19byte g_dbl = { 1.0, 127, 126, 3.0, 120 };
+  struct cls_struct_19byte f_dbl = { 4.0, 125, 124, 5.0, 119 };
+  struct cls_struct_19byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -69,10 +73,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_19byte g_dbl = { 1.0, 127, 126, 3.0, 120 };
-  struct cls_struct_19byte f_dbl = { 4.0, 125, 124, 5.0, 119 };
-  struct cls_struct_19byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_double;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/cls_1_1byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_1_1byte.c	Thu Dec 25 21:03:09 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_1_1byte g_dbl = { 12 };
+  struct cls_struct_1_1byte f_dbl = { 178 };
+  struct cls_struct_1_1byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_1_1byte g_dbl = { 12 };
-  struct cls_struct_1_1byte f_dbl = { 178 };
-  struct cls_struct_1_1byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = NULL;
$OpenBSD$
--- testsuite/libffi.call/cls_20byte1.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_20byte1.c	Thu Dec 25 21:03:10 2008
@@ -54,6 +54,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[3];
 
+  struct cls_struct_20byte g_dbl = { 1, 2.0, 3.0 };
+  struct cls_struct_20byte f_dbl = { 4, 5.0, 7.0 };
+  struct cls_struct_20byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -64,10 +68,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_20byte g_dbl = { 1, 2.0, 3.0 };
-  struct cls_struct_20byte f_dbl = { 4, 5.0, 7.0 };
-  struct cls_struct_20byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_sint;
   cls_struct_fields[1] = &ffi_type_double;
$OpenBSD$
--- testsuite/libffi.call/cls_20byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_20byte.c	Thu Dec 25 21:03:09 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_20byte g_dbl = { 1.0, 2.0, 3 };
+  struct cls_struct_20byte f_dbl = { 4.0, 5.0, 7 };
+  struct cls_struct_20byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_20byte g_dbl = { 1.0, 2.0, 3 };
-  struct cls_struct_20byte f_dbl = { 4.0, 5.0, 7 };
-  struct cls_struct_20byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_double;
   cls_struct_fields[1] = &ffi_type_double;
$OpenBSD$
--- testsuite/libffi.call/cls_24byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_24byte.c	Thu Dec 25 21:03:06 2008
@@ -63,6 +63,12 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_24byte e_dbl = { 9.0, 2.0, 6, 5.0 };
+  struct cls_struct_24byte f_dbl = { 1.0, 2.0, 3, 7.0 };
+  struct cls_struct_24byte g_dbl = { 4.0, 5.0, 7, 9.0 };
+  struct cls_struct_24byte h_dbl = { 8.0, 6.0, 1, 4.0 };
+  struct cls_struct_24byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -73,12 +79,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_24byte e_dbl = { 9.0, 2.0, 6, 5.0 };
-  struct cls_struct_24byte f_dbl = { 1.0, 2.0, 3, 7.0 };
-  struct cls_struct_24byte g_dbl = { 4.0, 5.0, 7, 9.0 };
-  struct cls_struct_24byte h_dbl = { 8.0, 6.0, 1, 4.0 };
-  struct cls_struct_24byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_double;
   cls_struct_fields[1] = &ffi_type_double;
$OpenBSD$
--- testsuite/libffi.call/cls_2byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_2byte.c	Thu Dec 25 21:03:06 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_2byte g_dbl = { 12, 127 };
+  struct cls_struct_2byte f_dbl = { 1, 13 };
+  struct cls_struct_2byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_2byte g_dbl = { 12, 127 };
-  struct cls_struct_2byte f_dbl = { 1, 13 };
-  struct cls_struct_2byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/cls_3_1byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_3_1byte.c	Thu Dec 25 21:03:06 2008
@@ -56,6 +56,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_3_1byte g_dbl = { 12, 13, 14 };
+  struct cls_struct_3_1byte f_dbl = { 178, 179, 180 };
+  struct cls_struct_3_1byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -66,10 +70,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_3_1byte g_dbl = { 12, 13, 14 };
-  struct cls_struct_3_1byte f_dbl = { 178, 179, 180 };
-  struct cls_struct_3_1byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/cls_3byte1.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_3byte1.c	Thu Dec 25 21:03:08 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_3byte g_dbl = { 12, 119 };
+  struct cls_struct_3byte f_dbl = { 1, 15 };
+  struct cls_struct_3byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_3byte g_dbl = { 12, 119 };
-  struct cls_struct_3byte f_dbl = { 1, 15 };
-  struct cls_struct_3byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_ushort;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/cls_3byte2.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_3byte2.c	Thu Dec 25 21:03:07 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_3byte_1 g_dbl = { 15, 125 };
+  struct cls_struct_3byte_1 f_dbl = { 9, 19 };
+  struct cls_struct_3byte_1 res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_3byte_1 g_dbl = { 15, 125 };
-  struct cls_struct_3byte_1 f_dbl = { 9, 19 };
-  struct cls_struct_3byte_1 res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_ushort;
$OpenBSD$
--- testsuite/libffi.call/cls_4_1byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_4_1byte.c	Thu Dec 25 21:03:07 2008
@@ -58,6 +58,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_4_1byte g_dbl = { 12, 13, 14, 15 };
+  struct cls_struct_4_1byte f_dbl = { 178, 179, 180, 181 };
+  struct cls_struct_4_1byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -68,10 +72,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_4_1byte g_dbl = { 12, 13, 14, 15 };
-  struct cls_struct_4_1byte f_dbl = { 178, 179, 180, 181 };
-  struct cls_struct_4_1byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/cls_4byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_4byte.c	Thu Dec 25 21:03:08 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_4byte g_dbl = { 127, 120 };
+  struct cls_struct_4byte f_dbl = { 12, 128 };
+  struct cls_struct_4byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_4byte g_dbl = { 127, 120 };
-  struct cls_struct_4byte f_dbl = { 12, 128 };
-  struct cls_struct_4byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_ushort;
   cls_struct_fields[1] = &ffi_type_ushort;
$OpenBSD$
--- testsuite/libffi.call/cls_5_1_byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_5_1_byte.c	Thu Dec 25 21:03:09 2008
@@ -60,6 +60,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_5byte g_dbl = { 127, 120, 1, 3, 4 };
+  struct cls_struct_5byte f_dbl = { 12, 128, 9, 3, 4 };
+  struct cls_struct_5byte res_dbl = { 0, 0, 0, 0, 0 };
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -70,10 +74,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_5byte g_dbl = { 127, 120, 1, 3, 4 };
-  struct cls_struct_5byte f_dbl = { 12, 128, 9, 3, 4 };
-  struct cls_struct_5byte res_dbl = { 0, 0, 0, 0, 0 };
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/cls_5byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_5byte.c	Thu Dec 25 21:03:08 2008
@@ -55,6 +55,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_5byte g_dbl = { 127, 120, 1 };
+  struct cls_struct_5byte f_dbl = { 12, 128, 9 };
+  struct cls_struct_5byte res_dbl = { 0, 0, 0 };
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -65,10 +69,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_5byte g_dbl = { 127, 120, 1 };
-  struct cls_struct_5byte f_dbl = { 12, 128, 9 };
-  struct cls_struct_5byte res_dbl = { 0, 0, 0 };
 
   cls_struct_fields[0] = &ffi_type_ushort;
   cls_struct_fields[1] = &ffi_type_ushort;
$OpenBSD$
--- testsuite/libffi.call/cls_64byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_64byte.c	Thu Dec 25 21:03:07 2008
@@ -68,6 +68,12 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_64byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0 };
+  struct cls_struct_64byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0 };
+  struct cls_struct_64byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0 };
+  struct cls_struct_64byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0 };
+  struct cls_struct_64byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -78,12 +84,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_64byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0 };
-  struct cls_struct_64byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0 };
-  struct cls_struct_64byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0 };
-  struct cls_struct_64byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0 };
-  struct cls_struct_64byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_double;
   cls_struct_fields[1] = &ffi_type_double;
$OpenBSD$
--- testsuite/libffi.call/cls_6_1_byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_6_1_byte.c	Thu Dec 25 21:03:07 2008
@@ -62,6 +62,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_6byte g_dbl = { 127, 120, 1, 3, 4, 5 };
+  struct cls_struct_6byte f_dbl = { 12, 128, 9, 3, 4, 5 };
+  struct cls_struct_6byte res_dbl = { 0, 0, 0, 0, 0, 0 };
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -72,10 +76,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_6byte g_dbl = { 127, 120, 1, 3, 4, 5 };
-  struct cls_struct_6byte f_dbl = { 12, 128, 9, 3, 4, 5 };
-  struct cls_struct_6byte res_dbl = { 0, 0, 0, 0, 0, 0 };
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/cls_6byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_6byte.c	Thu Dec 25 21:03:07 2008
@@ -58,6 +58,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_6byte g_dbl = { 127, 120, 1, 128 };
+  struct cls_struct_6byte f_dbl = { 12, 128, 9, 127 };
+  struct cls_struct_6byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -68,10 +72,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_6byte g_dbl = { 127, 120, 1, 128 };
-  struct cls_struct_6byte f_dbl = { 12, 128, 9, 127 };
-  struct cls_struct_6byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_ushort;
   cls_struct_fields[1] = &ffi_type_ushort;
$OpenBSD$
--- testsuite/libffi.call/cls_7_1_byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_7_1_byte.c	Thu Dec 25 21:03:07 2008
@@ -64,6 +64,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_7byte g_dbl = { 127, 120, 1, 3, 4, 5, 6 };
+  struct cls_struct_7byte f_dbl = { 12, 128, 9, 3, 4, 5, 6 };
+  struct cls_struct_7byte res_dbl = { 0, 0, 0, 0, 0, 0, 0 };
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -74,10 +78,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_7byte g_dbl = { 127, 120, 1, 3, 4, 5, 6 };
-  struct cls_struct_7byte f_dbl = { 12, 128, 9, 3, 4, 5, 6 };
-  struct cls_struct_7byte res_dbl = { 0, 0, 0, 0, 0, 0, 0 };
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/cls_7byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_7byte.c	Thu Dec 25 21:03:09 2008
@@ -57,6 +57,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_7byte g_dbl = { 127, 120, 1, 254 };
+  struct cls_struct_7byte f_dbl = { 12, 128, 9, 255 };
+  struct cls_struct_7byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -67,10 +71,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_7byte g_dbl = { 127, 120, 1, 254 };
-  struct cls_struct_7byte f_dbl = { 12, 128, 9, 255 };
-  struct cls_struct_7byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_ushort;
   cls_struct_fields[1] = &ffi_type_ushort;
$OpenBSD$
--- testsuite/libffi.call/cls_8byte.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_8byte.c	Thu Dec 25 21:03:08 2008
@@ -51,6 +51,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_8byte g_dbl = { 1, 2.0 };
+  struct cls_struct_8byte f_dbl = { 4, 5.0 };
+  struct cls_struct_8byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -61,10 +65,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_8byte g_dbl = { 1, 2.0 };
-  struct cls_struct_8byte f_dbl = { 4, 5.0 };
-  struct cls_struct_8byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_sint;
   cls_struct_fields[1] = &ffi_type_float;
$OpenBSD$
--- testsuite/libffi.call/cls_9byte1.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_9byte1.c	Thu Dec 25 21:03:07 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[3];
 
+  struct cls_struct_9byte h_dbl = { 7, 8.0};
+  struct cls_struct_9byte j_dbl = { 1, 9.0};
+  struct cls_struct_9byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_9byte h_dbl = { 7, 8.0};
-  struct cls_struct_9byte j_dbl = { 1, 9.0};
-  struct cls_struct_9byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_sint;
   cls_struct_fields[1] = &ffi_type_double;
$OpenBSD$
--- testsuite/libffi.call/cls_9byte2.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_9byte2.c	Thu Dec 25 21:03:09 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[3];
 
+  struct cls_struct_9byte h_dbl = { 7.0, 8};
+  struct cls_struct_9byte j_dbl = { 1.0, 9};
+  struct cls_struct_9byte res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_9byte h_dbl = { 7.0, 8};
-  struct cls_struct_9byte j_dbl = { 1.0, 9};
-  struct cls_struct_9byte res_dbl;
 
   cls_struct_fields[0] = &ffi_type_double;
   cls_struct_fields[1] = &ffi_type_sint;
$OpenBSD$
--- testsuite/libffi.call/cls_align_double.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_align_double.c	Thu Dec 25 21:03:07 2008
@@ -54,6 +54,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_align g_dbl = { 12, 4951, 127 };
+  struct cls_struct_align f_dbl = { 1, 9320, 13 };
+  struct cls_struct_align res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -64,10 +68,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_align g_dbl = { 12, 4951, 127 };
-  struct cls_struct_align f_dbl = { 1, 9320, 13 };
-  struct cls_struct_align res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_double;
$OpenBSD$
--- testsuite/libffi.call/cls_align_float.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_align_float.c	Thu Dec 25 21:03:08 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_align g_dbl = { 12, 4951, 127 };
+  struct cls_struct_align f_dbl = { 1, 9320, 13 };
+  struct cls_struct_align res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_align g_dbl = { 12, 4951, 127 };
-  struct cls_struct_align f_dbl = { 1, 9320, 13 };
-  struct cls_struct_align res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_float;
$OpenBSD$
--- testsuite/libffi.call/cls_align_longdouble.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_align_longdouble.c	Thu Dec 25 21:03:08 2008
@@ -53,6 +53,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_align g_dbl = { 12, 4951, 127 };
+  struct cls_struct_align f_dbl = { 1, 9320, 13 };
+  struct cls_struct_align res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -63,10 +67,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_align g_dbl = { 12, 4951, 127 };
-  struct cls_struct_align f_dbl = { 1, 9320, 13 };
-  struct cls_struct_align res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_longdouble;
$OpenBSD$
--- testsuite/libffi.call/cls_align_pointer.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_align_pointer.c	Thu Dec 25 21:03:09 2008
@@ -54,6 +54,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_align g_dbl = { 12, (void *)4951, 127 };
+  struct cls_struct_align f_dbl = { 1, (void *)9320, 13 };
+  struct cls_struct_align res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -64,10 +68,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_align g_dbl = { 12, (void *)4951, 127 };
-  struct cls_struct_align f_dbl = { 1, (void *)9320, 13 };
-  struct cls_struct_align res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_pointer;
$OpenBSD$
--- testsuite/libffi.call/cls_align_sint16.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_align_sint16.c	Thu Dec 25 21:03:08 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_align g_dbl = { 12, 4951, 127 };
+  struct cls_struct_align f_dbl = { 1, 9320, 13 };
+  struct cls_struct_align res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_align g_dbl = { 12, 4951, 127 };
-  struct cls_struct_align f_dbl = { 1, 9320, 13 };
-  struct cls_struct_align res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_sshort;
$OpenBSD$
--- testsuite/libffi.call/cls_align_sint32.c.orig	Thu Dec 25 21:03:10 2008
+++ testsuite/libffi.call/cls_align_sint32.c	Thu Dec 25 21:03:07 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_align g_dbl = { 12, 4951, 127 };
+  struct cls_struct_align f_dbl = { 1, 9320, 13 };
+  struct cls_struct_align res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_align g_dbl = { 12, 4951, 127 };
-  struct cls_struct_align f_dbl = { 1, 9320, 13 };
-  struct cls_struct_align res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_sint;
$OpenBSD$
--- testsuite/libffi.call/cls_align_sint64.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/cls_align_sint64.c	Thu Dec 25 21:03:07 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_align g_dbl = { 12, 4951, 127 };
+  struct cls_struct_align f_dbl = { 1, 9320, 13 };
+  struct cls_struct_align res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_align g_dbl = { 12, 4951, 127 };
-  struct cls_struct_align f_dbl = { 1, 9320, 13 };
-  struct cls_struct_align res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_sint64;
$OpenBSD$
--- testsuite/libffi.call/cls_align_uint16.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/cls_align_uint16.c	Thu Dec 25 21:03:09 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_align g_dbl = { 12, 4951, 127 };
+  struct cls_struct_align f_dbl = { 1, 9320, 13 };
+  struct cls_struct_align res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_align g_dbl = { 12, 4951, 127 };
-  struct cls_struct_align f_dbl = { 1, 9320, 13 };
-  struct cls_struct_align res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_ushort;
$OpenBSD$
--- testsuite/libffi.call/cls_align_uint32.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/cls_align_uint32.c	Thu Dec 25 21:03:09 2008
@@ -52,6 +52,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_align g_dbl = { 12, 4951, 127 };
+  struct cls_struct_align f_dbl = { 1, 9320, 13 };
+  struct cls_struct_align res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -62,10 +66,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_align g_dbl = { 12, 4951, 127 };
-  struct cls_struct_align f_dbl = { 1, 9320, 13 };
-  struct cls_struct_align res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_uint;
$OpenBSD$
--- testsuite/libffi.call/cls_align_uint64.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/cls_align_uint64.c	Thu Dec 25 21:03:06 2008
@@ -53,6 +53,10 @@ int main (void)
   ffi_type cls_struct_type;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_align g_dbl = { 12, 4951, 127 };
+  struct cls_struct_align f_dbl = { 1, 9320, 13 };
+  struct cls_struct_align res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -63,10 +67,6 @@ int main (void)
   cls_struct_type.alignment = 0;
   cls_struct_type.type = FFI_TYPE_STRUCT;
   cls_struct_type.elements = cls_struct_fields;
-
-  struct cls_struct_align g_dbl = { 12, 4951, 127 };
-  struct cls_struct_align f_dbl = { 1, 9320, 13 };
-  struct cls_struct_align res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_uint64;
$OpenBSD$
--- testsuite/libffi.call/float2.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/float2.c	Thu Dec 25 23:09:36 2008
@@ -6,6 +6,7 @@
 
 /* { dg-do run } */
 
+#include <math.h>
 #include "ffitest.h"
 #include "float.h"
 
@@ -44,7 +45,7 @@ int main (void)
   /* This is ifdef'd out for now. long double support under SunOS/gcc
      is pretty much non-existent.  You'll get the odd bus error in library
      routines like printf().  */
-  printf ("%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(f), ld - ldblit(f), LDBL_EPSILON);
+  printf ("%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(f), ld - ldblit(f), (long double)LDBL_EPSILON);
 #endif
 
   /* These are not always the same!! Check for a reasonable delta */
$OpenBSD$
--- testsuite/libffi.call/nested_struct10.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/nested_struct10.c	Thu Dec 25 21:03:08 2008
@@ -69,6 +69,12 @@ int main (void)
   ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
   ffi_type* dbl_arg_types[4];
 
+  struct A e_dbl = { 1LL, 7};
+  struct B f_dbl = { 99, {12LL , 127}, 255};
+  struct C g_dbl = { 2LL, 9};
+
+  struct B res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -89,12 +95,6 @@ int main (void)
   cls_struct_type2.alignment = 0;
   cls_struct_type2.type = FFI_TYPE_STRUCT;
   cls_struct_type2.elements = cls_struct_fields2;
-
-  struct A e_dbl = { 1LL, 7};
-  struct B f_dbl = { 99, {12LL , 127}, 255};
-  struct C g_dbl = { 2LL, 9};
-
-  struct B res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uint64;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/nested_struct1.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/nested_struct1.c	Thu Dec 25 21:03:08 2008
@@ -83,6 +83,13 @@ int main (void)
   ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
+  struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
+  struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
+				      {3, 1.0, 8.0}};
+  struct cls_struct_16byte1 h_dbl = { 3.0, 2.0, 4};
+  struct cls_struct_combined res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -103,13 +110,6 @@ int main (void)
   cls_struct_type2.alignment = 0;
   cls_struct_type2.type = FFI_TYPE_STRUCT;
   cls_struct_type2.elements = cls_struct_fields2;
-
-  struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
-  struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
-  struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
-				      {3, 1.0, 8.0}};
-  struct cls_struct_16byte1 h_dbl = { 3.0, 2.0, 4};
-  struct cls_struct_combined res_dbl;
 
   cls_struct_fields[0] = &ffi_type_double;
   cls_struct_fields[1] = &ffi_type_float;
$OpenBSD$
--- testsuite/libffi.call/nested_struct2.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/nested_struct2.c	Thu Dec 25 21:03:08 2008
@@ -59,6 +59,11 @@ int main (void)
   ffi_type cls_struct_type, cls_struct_type1;
   ffi_type* dbl_arg_types[3];
 
+  struct A e_dbl = { 1, 7};
+  struct B f_dbl = {{12 , 127}, 99};
+
+  struct B res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -74,11 +79,6 @@ int main (void)
   cls_struct_type1.alignment = 0;
   cls_struct_type1.type = FFI_TYPE_STRUCT;
   cls_struct_type1.elements = cls_struct_fields1;
-
-  struct A e_dbl = { 1, 7};
-  struct B f_dbl = {{12 , 127}, 99};
-
-  struct B res_dbl;
 
   cls_struct_fields[0] = &ffi_type_ulong;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/nested_struct3.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/nested_struct3.c	Thu Dec 25 21:03:08 2008
@@ -60,6 +60,11 @@ int main (void)
   ffi_type cls_struct_type, cls_struct_type1;
   ffi_type* dbl_arg_types[3];
 
+  struct A e_dbl = { 1LL, 7};
+  struct B f_dbl = {{12LL , 127}, 99};
+
+  struct B res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -75,11 +80,6 @@ int main (void)
   cls_struct_type1.alignment = 0;
   cls_struct_type1.type = FFI_TYPE_STRUCT;
   cls_struct_type1.elements = cls_struct_fields1;
-
-  struct A e_dbl = { 1LL, 7};
-  struct B f_dbl = {{12LL , 127}, 99};
-
-  struct B res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uint64;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/nested_struct4.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/nested_struct4.c	Thu Dec 25 21:03:09 2008
@@ -60,6 +60,11 @@ int main (void)
   ffi_type cls_struct_type, cls_struct_type1;
   ffi_type* dbl_arg_types[3];
 
+  struct A e_dbl = { 1.0, 7};
+  struct B f_dbl = {{12.0 , 127}, 99};
+
+  struct B res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -75,11 +80,6 @@ int main (void)
   cls_struct_type1.alignment = 0;
   cls_struct_type1.type = FFI_TYPE_STRUCT;
   cls_struct_type1.elements = cls_struct_fields1;
-
-  struct A e_dbl = { 1.0, 7};
-  struct B f_dbl = {{12.0 , 127}, 99};
-
-  struct B res_dbl;
 
   cls_struct_fields[0] = &ffi_type_double;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/nested_struct5.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/nested_struct5.c	Thu Dec 25 21:03:08 2008
@@ -60,6 +60,11 @@ int main (void)
   ffi_type cls_struct_type, cls_struct_type1;
   ffi_type* dbl_arg_types[3];
 
+  struct A e_dbl = { 1.0, 7};
+  struct B f_dbl = {{12.0 , 127}, 99};
+
+  struct B res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -75,11 +80,6 @@ int main (void)
   cls_struct_type1.alignment = 0;
   cls_struct_type1.type = FFI_TYPE_STRUCT;
   cls_struct_type1.elements = cls_struct_fields1;
-
-  struct A e_dbl = { 1.0, 7};
-  struct B f_dbl = {{12.0 , 127}, 99};
-
-  struct B res_dbl;
 
   cls_struct_fields[0] = &ffi_type_longdouble;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/nested_struct6.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/nested_struct6.c	Thu Dec 25 21:03:08 2008
@@ -68,6 +68,12 @@ int main (void)
   ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
   ffi_type* dbl_arg_types[4];
 
+  struct A e_dbl = { 1.0, 7};
+  struct B f_dbl = {{12.0 , 127}, 99};
+  struct C g_dbl = { 2, 9};
+
+  struct B res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -88,12 +94,6 @@ int main (void)
   cls_struct_type2.alignment = 0;
   cls_struct_type2.type = FFI_TYPE_STRUCT;
   cls_struct_type2.elements = cls_struct_fields2;
-
-  struct A e_dbl = { 1.0, 7};
-  struct B f_dbl = {{12.0 , 127}, 99};
-  struct C g_dbl = { 2, 9};
-
-  struct B res_dbl;
 
   cls_struct_fields[0] = &ffi_type_double;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/nested_struct7.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/nested_struct7.c	Thu Dec 25 21:03:07 2008
@@ -60,6 +60,11 @@ int main (void)
   ffi_type cls_struct_type, cls_struct_type1;
   ffi_type* dbl_arg_types[3];
 
+  struct A e_dbl = { 1LL, 7};
+  struct B f_dbl = {{12.0 , 127}, 99};
+
+  struct B res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -75,11 +80,6 @@ int main (void)
   cls_struct_type1.alignment = 0;
   cls_struct_type1.type = FFI_TYPE_STRUCT;
   cls_struct_type1.elements = cls_struct_fields1;
-
-  struct A e_dbl = { 1LL, 7};
-  struct B f_dbl = {{12.0 , 127}, 99};
-
-  struct B res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uint64;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/nested_struct8.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/nested_struct8.c	Thu Dec 25 21:03:09 2008
@@ -68,6 +68,12 @@ int main (void)
   ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
   ffi_type* dbl_arg_types[4];
 
+  struct A e_dbl = { 1LL, 7};
+  struct B f_dbl = {{12LL , 127}, 99};
+  struct C g_dbl = { 2LL, 9};
+
+  struct B res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -88,12 +94,6 @@ int main (void)
   cls_struct_type2.alignment = 0;
   cls_struct_type2.type = FFI_TYPE_STRUCT;
   cls_struct_type2.elements = cls_struct_fields2;
-
-  struct A e_dbl = { 1LL, 7};
-  struct B f_dbl = {{12LL , 127}, 99};
-  struct C g_dbl = { 2LL, 9};
-
-  struct B res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uint64;
   cls_struct_fields[1] = &ffi_type_uchar;
$OpenBSD$
--- testsuite/libffi.call/nested_struct9.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/nested_struct9.c	Thu Dec 25 21:03:08 2008
@@ -68,6 +68,12 @@ int main (void)
   ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
   ffi_type* dbl_arg_types[4];
 
+  struct A e_dbl = { 1, 7LL};
+  struct B f_dbl = {{12.0 , 127}, 99};
+  struct C g_dbl = { 2, 9};
+
+  struct B res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -88,12 +94,6 @@ int main (void)
   cls_struct_type2.alignment = 0;
   cls_struct_type2.type = FFI_TYPE_STRUCT;
   cls_struct_type2.elements = cls_struct_fields2;
-
-  struct A e_dbl = { 1, 7LL};
-  struct B f_dbl = {{12.0 , 127}, 99};
-  struct C g_dbl = { 2, 9};
-
-  struct B res_dbl;
 
   cls_struct_fields[0] = &ffi_type_uchar;
   cls_struct_fields[1] = &ffi_type_uint64;
$OpenBSD$
--- testsuite/libffi.call/nested_struct.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/nested_struct.c	Thu Dec 25 21:03:08 2008
@@ -79,6 +79,12 @@ int main (void)
   ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
   ffi_type* dbl_arg_types[5];
 
+  struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
+  struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
+  struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
+				      {3, 1.0, 8.0}};
+  struct cls_struct_combined res_dbl;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
@@ -99,12 +105,6 @@ int main (void)
   cls_struct_type2.alignment = 0;
   cls_struct_type2.type = FFI_TYPE_STRUCT;
   cls_struct_type2.elements = cls_struct_fields2;
-
-  struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
-  struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
-  struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
-				      {3, 1.0, 8.0}};
-  struct cls_struct_combined res_dbl;
 
   cls_struct_fields[0] = &ffi_type_double;
   cls_struct_fields[1] = &ffi_type_float;
$OpenBSD$
--- testsuite/libffi.call/problem1.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/problem1.c	Thu Dec 25 21:03:07 2008
@@ -52,15 +52,15 @@ int main(void)
   void* args[4];
   ffi_type* arg_types[3];
 
+  struct my_ffi_struct g = { 1.0, 2.0, 3.0 };
+  struct my_ffi_struct f = { 1.0, 2.0, 3.0 };
+  struct my_ffi_struct res;
+
 #ifdef USING_MMAP
   pcl = allocate_mmap (sizeof(ffi_closure));
 #else
   pcl = &cl;
 #endif
-
-  struct my_ffi_struct g = { 1.0, 2.0, 3.0 };
-  struct my_ffi_struct f = { 1.0, 2.0, 3.0 };
-  struct my_ffi_struct res;
 
   my_ffi_struct_type.size = 0;
   my_ffi_struct_type.alignment = 0;
$OpenBSD$
--- testsuite/libffi.call/return_uc.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/return_uc.c	Thu Dec 25 21:03:09 2008
@@ -32,7 +32,7 @@ int main (void)
        uc < (unsigned char) '\xff'; uc++)
     {
       ffi_call(&cif, FFI_FN(return_uc), &rint, values);
-      CHECK(rint == (signed int) uc);
+      CHECK(rint == (unsigned int) uc);
     }
   exit(0);
 }
$OpenBSD$
--- testsuite/libffi.call/struct1.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/struct1.c	Thu Dec 25 21:03:07 2008
@@ -30,6 +30,11 @@ int main (void)
   void *values[MAX_ARGS];
   ffi_type ts1_type;
   ffi_type *ts1_type_elements[4];
+  test_structure_1 ts1_arg;
+  /* This is a hack to get a properly aligned result buffer */
+  test_structure_1 *ts1_result = 
+    (test_structure_1 *) malloc (sizeof(test_structure_1));
+  
   ts1_type.size = 0;
   ts1_type.alignment = 0;
   ts1_type.type = FFI_TYPE_STRUCT;
@@ -38,11 +43,6 @@ int main (void)
   ts1_type_elements[1] = &ffi_type_double;
   ts1_type_elements[2] = &ffi_type_uint;
   ts1_type_elements[3] = NULL;
-  
-  test_structure_1 ts1_arg;
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_1 *ts1_result = 
-    (test_structure_1 *) malloc (sizeof(test_structure_1));
   
   args[0] = &ts1_type;
   values[0] = &ts1_arg;
$OpenBSD$
--- testsuite/libffi.call/struct2.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/struct2.c	Thu Dec 25 21:03:08 2008
@@ -27,6 +27,10 @@ int main (void)
   ffi_type *args[MAX_ARGS];
   void *values[MAX_ARGS];
   test_structure_2 ts2_arg;
+  /* This is a hack to get a properly aligned result buffer */
+  test_structure_2 *ts2_result = 
+    (test_structure_2 *) malloc (sizeof(test_structure_2));
+  
   ffi_type ts2_type;
   ffi_type *ts2_type_elements[3];
   ts2_type.size = 0;
@@ -37,10 +41,6 @@ int main (void)
   ts2_type_elements[1] = &ffi_type_double;
   ts2_type_elements[2] = NULL;
 
-  
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_2 *ts2_result = 
-    (test_structure_2 *) malloc (sizeof(test_structure_2));
   
   args[0] = &ts2_type;
   values[0] = &ts2_arg;
$OpenBSD$
--- testsuite/libffi.call/struct3.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/struct3.c	Thu Dec 25 21:03:08 2008
@@ -27,6 +27,10 @@ int main (void)
   int compare_value;
   ffi_type ts3_type;
   ffi_type *ts3_type_elements[2];
+  test_structure_3 ts3_arg;
+  test_structure_3 *ts3_result = 
+    (test_structure_3 *) malloc (sizeof(test_structure_3));
+  
   ts3_type.size = 0;
   ts3_type.alignment = 0;
   ts3_type.type = FFI_TYPE_STRUCT;
@@ -34,10 +38,6 @@ int main (void)
   ts3_type_elements[0] = &ffi_type_sint;
   ts3_type_elements[1] = NULL;
 
-  test_structure_3 ts3_arg;
-  test_structure_3 *ts3_result = 
-    (test_structure_3 *) malloc (sizeof(test_structure_3));
-  
   args[0] = &ts3_type;
   values[0] = &ts3_arg;
   
$OpenBSD$
--- testsuite/libffi.call/struct4.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/struct4.c	Thu Dec 25 21:03:09 2008
@@ -28,20 +28,20 @@ int main (void)
   void *values[MAX_ARGS];
   ffi_type ts4_type;
   ffi_type *ts4_type_elements[4];  
+  test_structure_4 ts4_arg;
+  /* This is a hack to get a properly aligned result buffer */
+  test_structure_4 *ts4_result = 
+    (test_structure_4 *) malloc (sizeof(test_structure_4));
   ts4_type.size = 0;
   ts4_type.alignment = 0;
   ts4_type.type = FFI_TYPE_STRUCT;
-  test_structure_4 ts4_arg;
+  
   ts4_type.elements = ts4_type_elements;
   ts4_type_elements[0] = &ffi_type_uint;
   ts4_type_elements[1] = &ffi_type_uint;
   ts4_type_elements[2] = &ffi_type_uint;
   ts4_type_elements[3] = NULL;
 
-  
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_4 *ts4_result = 
-    (test_structure_4 *) malloc (sizeof(test_structure_4));
   
   args[0] = &ts4_type;
   values[0] = &ts4_arg;
$OpenBSD$
--- testsuite/libffi.call/struct5.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/struct5.c	Thu Dec 25 21:03:09 2008
@@ -27,6 +27,12 @@ int main (void)
   void *values[MAX_ARGS];
   ffi_type ts5_type;
   ffi_type *ts5_type_elements[3];
+  test_structure_5 ts5_arg1, ts5_arg2;
+  
+  /* This is a hack to get a properly aligned result buffer */
+  test_structure_5 *ts5_result = 
+    (test_structure_5 *) malloc (sizeof(test_structure_5));
+  
   ts5_type.size = 0;
   ts5_type.alignment = 0;
   ts5_type.type = FFI_TYPE_STRUCT;
@@ -35,12 +41,6 @@ int main (void)
   ts5_type_elements[1] = &ffi_type_schar;
   ts5_type_elements[2] = NULL;
 
-  test_structure_5 ts5_arg1, ts5_arg2;
-  
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_5 *ts5_result = 
-    (test_structure_5 *) malloc (sizeof(test_structure_5));
-  
   args[0] = &ts5_type;
   args[1] = &ts5_type;
   values[0] = &ts5_arg1;
$OpenBSD$
--- testsuite/libffi.call/struct6.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/struct6.c	Thu Dec 25 21:03:07 2008
@@ -27,6 +27,12 @@ int main (void)
   void *values[MAX_ARGS];
   ffi_type ts6_type;
   ffi_type *ts6_type_elements[3];
+  test_structure_6 ts6_arg;
+
+  /* This is a hack to get a properly aligned result buffer */
+  test_structure_6 *ts6_result = 
+    (test_structure_6 *) malloc (sizeof(test_structure_6));
+  
   ts6_type.size = 0;
   ts6_type.alignment = 0;
   ts6_type.type = FFI_TYPE_STRUCT;
@@ -36,12 +42,6 @@ int main (void)
   ts6_type_elements[2] = NULL;
 
 
-  test_structure_6 ts6_arg;
-
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_6 *ts6_result = 
-    (test_structure_6 *) malloc (sizeof(test_structure_6));
-  
   args[0] = &ts6_type;
   values[0] = &ts6_arg;
 
$OpenBSD$
--- testsuite/libffi.call/struct7.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/struct7.c	Thu Dec 25 21:03:08 2008
@@ -29,6 +29,12 @@ int main (void)
   void *values[MAX_ARGS];
   ffi_type ts7_type;
   ffi_type *ts7_type_elements[4];
+  test_structure_7 ts7_arg;
+  
+  /* This is a hack to get a properly aligned result buffer */
+  test_structure_7 *ts7_result = 
+    (test_structure_7 *) malloc (sizeof(test_structure_7));
+  
   ts7_type.size = 0;
   ts7_type.alignment = 0;
   ts7_type.type = FFI_TYPE_STRUCT;
@@ -39,12 +45,6 @@ int main (void)
   ts7_type_elements[3] = NULL;
 
 
-  test_structure_7 ts7_arg;
-  
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_7 *ts7_result = 
-    (test_structure_7 *) malloc (sizeof(test_structure_7));
-  
   args[0] = &ts7_type;
   values[0] = &ts7_arg;
   
$OpenBSD$
--- testsuite/libffi.call/struct8.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/struct8.c	Thu Dec 25 21:03:08 2008
@@ -31,6 +31,12 @@ int main (void)
   void *values[MAX_ARGS];
   ffi_type ts8_type;
   ffi_type *ts8_type_elements[5];
+  test_structure_8 ts8_arg;
+  
+  /* This is a hack to get a properly aligned result buffer */
+  test_structure_8 *ts8_result = 
+    (test_structure_8 *) malloc (sizeof(test_structure_8));
+  
   ts8_type.size = 0;
   ts8_type.alignment = 0;
   ts8_type.type = FFI_TYPE_STRUCT;
@@ -41,12 +47,6 @@ int main (void)
   ts8_type_elements[3] = &ffi_type_float;
   ts8_type_elements[4] = NULL;
 
-  test_structure_8 ts8_arg;
-  
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_8 *ts8_result = 
-    (test_structure_8 *) malloc (sizeof(test_structure_8));
-  
   args[0] = &ts8_type;
   values[0] = &ts8_arg;
   
$OpenBSD$
--- testsuite/libffi.call/struct9.c.orig	Thu Dec 25 21:03:11 2008
+++ testsuite/libffi.call/struct9.c	Thu Dec 25 21:03:09 2008
@@ -28,6 +28,12 @@ int main (void)
   void *values[MAX_ARGS];
   ffi_type ts9_type;
   ffi_type *ts9_type_elements[3];
+  test_structure_9 ts9_arg;
+  
+  /* This is a hack to get a properly aligned result buffer */
+  test_structure_9 *ts9_result = 
+    (test_structure_9 *) malloc (sizeof(test_structure_9));
+  
   ts9_type.size = 0;
   ts9_type.alignment = 0;
   ts9_type.type = FFI_TYPE_STRUCT;
@@ -36,12 +42,6 @@ int main (void)
   ts9_type_elements[1] = &ffi_type_sint;
   ts9_type_elements[2] = NULL;
 
-  test_structure_9 ts9_arg;
-  
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_9 *ts9_result = 
-    (test_structure_9 *) malloc (sizeof(test_structure_9));
-  
   args[0] = &ts9_type;
   values[0] = &ts9_arg;
   

Attachment: libffi.log.gz
Description: GNU Zip compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]