From 647af4a91c4035fe99c8db7ab9d726c091e7e153 Mon Sep 17 00:00:00 2001
From: Andreas Tobler <a.tobler@schweiz.ch>
Date: Sun, 9 Nov 2003 18:05:10 +0100
Subject: [PATCH] closure_fn0.c: Print result and check with dg-output to make
 debugging easier.

2003-11-09  Andreas Tobler  <a.tobler@schweiz.ch>

	* testsuite/libffi.call/closure_fn0.c: Print result and check
	with dg-output to make debugging easier.
	* testsuite/libffi.call/closure_fn1.c: Likewise.
	* testsuite/libffi.call/closure_fn2.c: Likewise.
	* testsuite/libffi.call/closure_fn3.c: Likewise.
	* testsuite/libffi.call/closure_fn4.c: Likewise.
	* testsuite/libffi.call/closure_fn5.c: Likewise.
	* testsuite/libffi.call/cls_12byte.c: Likewise.
	* testsuite/libffi.call/cls_16byte.c: Likewise.
	* testsuite/libffi.call/cls_18byte.c: Likewise.
	* testsuite/libffi.call/cls_19byte.c: Likewise.
	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
	* testsuite/libffi.call/cls_20byte.c: Likewise.
	* testsuite/libffi.call/cls_20byte1.c: Likewise.
	* testsuite/libffi.call/cls_24byte.c: Likewise.
	* testsuite/libffi.call/cls_2byte.c: Likewise.
	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
	* testsuite/libffi.call/cls_3byte1.c: Likewise.
	* testsuite/libffi.call/cls_3byte2.c: Likewise.
	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
	* testsuite/libffi.call/cls_4byte.c: Likewise.
	* testsuite/libffi.call/cls_5byte.c: Likewise.
	* testsuite/libffi.call/cls_64byte.c: Likewise.
	* testsuite/libffi.call/cls_6byte.c: Likewise.
	* testsuite/libffi.call/cls_7byte.c: Likewise.
	* testsuite/libffi.call/cls_8byte.c: Likewise.
	* testsuite/libffi.call/cls_9byte1.c: Likewise.
	* testsuite/libffi.call/cls_9byte2.c: Likewise.
	* testsuite/libffi.call/cls_double.c: Likewise.
	* testsuite/libffi.call/cls_float.c: Likewise.
	* testsuite/libffi.call/cls_schar.c: Likewise.
	* testsuite/libffi.call/cls_sint.c: Likewise.
	* testsuite/libffi.call/cls_sshort.c: Likewise.
	* testsuite/libffi.call/cls_uchar.c: Likewise.
	* testsuite/libffi.call/cls_uint.c: Likewise.
	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
	* testsuite/libffi.call/cls_ushort.c: Likewise.
	* testsuite/libffi.call/problem1.c: Likewise.

	* testsuite/libffi.special/unwindtest.cc: Make ffi_closure
	static.

From-SVN: r73393
---
 libffi/ChangeLog                              | 44 +++++++++++++++++++
 libffi/testsuite/libffi.call/closure_fn0.c    |  9 ++--
 libffi/testsuite/libffi.call/closure_fn1.c    |  9 ++--
 libffi/testsuite/libffi.call/closure_fn2.c    |  9 ++--
 libffi/testsuite/libffi.call/closure_fn3.c    |  9 ++--
 libffi/testsuite/libffi.call/closure_fn4.c    | 17 +++----
 libffi/testsuite/libffi.call/closure_fn5.c    | 14 +++---
 libffi/testsuite/libffi.call/cls_12byte.c     | 10 ++---
 libffi/testsuite/libffi.call/cls_16byte.c     | 10 ++---
 libffi/testsuite/libffi.call/cls_18byte.c     | 12 ++---
 libffi/testsuite/libffi.call/cls_19byte.c     | 16 +++----
 libffi/testsuite/libffi.call/cls_1_1byte.c    |  6 ++-
 libffi/testsuite/libffi.call/cls_20byte.c     | 10 ++---
 libffi/testsuite/libffi.call/cls_20byte1.c    | 10 ++---
 libffi/testsuite/libffi.call/cls_24byte.c     | 19 ++++----
 libffi/testsuite/libffi.call/cls_2byte.c      |  8 ++--
 libffi/testsuite/libffi.call/cls_3_1byte.c    | 12 ++---
 libffi/testsuite/libffi.call/cls_3byte1.c     |  8 ++--
 libffi/testsuite/libffi.call/cls_3byte2.c     |  8 ++--
 libffi/testsuite/libffi.call/cls_4_1byte.c    | 12 ++---
 libffi/testsuite/libffi.call/cls_4byte.c      |  8 ++--
 libffi/testsuite/libffi.call/cls_5byte.c      | 10 ++---
 libffi/testsuite/libffi.call/cls_64byte.c     | 28 ++++--------
 libffi/testsuite/libffi.call/cls_6byte.c      | 13 +++---
 libffi/testsuite/libffi.call/cls_7byte.c      | 12 ++---
 libffi/testsuite/libffi.call/cls_8byte.c      |  9 ++--
 libffi/testsuite/libffi.call/cls_9byte1.c     |  8 ++--
 libffi/testsuite/libffi.call/cls_9byte2.c     |  9 ++--
 libffi/testsuite/libffi.call/cls_double.c     |  4 +-
 libffi/testsuite/libffi.call/cls_float.c      |  8 ++--
 libffi/testsuite/libffi.call/cls_schar.c      |  3 +-
 libffi/testsuite/libffi.call/cls_sint.c       |  3 +-
 libffi/testsuite/libffi.call/cls_sshort.c     |  3 +-
 libffi/testsuite/libffi.call/cls_uchar.c      |  4 +-
 libffi/testsuite/libffi.call/cls_uint.c       |  4 +-
 libffi/testsuite/libffi.call/cls_ulonglong.c  |  8 +++-
 libffi/testsuite/libffi.call/cls_ushort.c     |  4 +-
 libffi/testsuite/libffi.call/problem1.c       | 12 ++---
 libffi/testsuite/libffi.special/unwindtest.cc | 12 ++---
 39 files changed, 221 insertions(+), 193 deletions(-)

diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 004625db9b93..11406c341162 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,47 @@
+2003-11-09  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/closure_fn0.c: Print result and check
+	with dg-output to make debugging easier.
+	* testsuite/libffi.call/closure_fn1.c: Likewise.
+	* testsuite/libffi.call/closure_fn2.c: Likewise.
+	* testsuite/libffi.call/closure_fn3.c: Likewise.
+	* testsuite/libffi.call/closure_fn4.c: Likewise.
+	* testsuite/libffi.call/closure_fn5.c: Likewise.
+	* testsuite/libffi.call/cls_12byte.c: Likewise.
+	* testsuite/libffi.call/cls_16byte.c: Likewise.
+	* testsuite/libffi.call/cls_18byte.c: Likewise.
+	* testsuite/libffi.call/cls_19byte.c: Likewise.
+	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte1.c: Likewise.
+	* testsuite/libffi.call/cls_24byte.c: Likewise.
+	* testsuite/libffi.call/cls_2byte.c: Likewise.
+	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_3byte1.c: Likewise.
+	* testsuite/libffi.call/cls_3byte2.c: Likewise.
+	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_4byte.c: Likewise.
+	* testsuite/libffi.call/cls_5byte.c: Likewise.
+	* testsuite/libffi.call/cls_64byte.c: Likewise.
+	* testsuite/libffi.call/cls_6byte.c: Likewise.
+	* testsuite/libffi.call/cls_7byte.c: Likewise.
+	* testsuite/libffi.call/cls_8byte.c: Likewise.
+	* testsuite/libffi.call/cls_9byte1.c: Likewise.
+	* testsuite/libffi.call/cls_9byte2.c: Likewise.
+	* testsuite/libffi.call/cls_double.c: Likewise.
+	* testsuite/libffi.call/cls_float.c: Likewise.
+	* testsuite/libffi.call/cls_schar.c: Likewise.
+	* testsuite/libffi.call/cls_sint.c: Likewise.
+	* testsuite/libffi.call/cls_sshort.c: Likewise.
+	* testsuite/libffi.call/cls_uchar.c: Likewise.
+	* testsuite/libffi.call/cls_uint.c: Likewise.
+	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
+	* testsuite/libffi.call/cls_ushort.c: Likewise.
+	* testsuite/libffi.call/problem1.c: Likewise.
+
+	* testsuite/libffi.special/unwindtest.cc: Make ffi_closure
+	static.
+
 2003-11-08  Andreas Tobler  <a.tobler@schweiz.ch>
 
 	* testsuite/libffi.call/cls_9byte2.c: New test case.
diff --git a/libffi/testsuite/libffi.call/closure_fn0.c b/libffi/testsuite/libffi.call/closure_fn0.c
index fd6593c64491..f418f01b38ce 100644
--- a/libffi/testsuite/libffi.call/closure_fn0.c
+++ b/libffi/testsuite/libffi.call/closure_fn0.c
@@ -48,6 +48,7 @@ int main (void)
   static ffi_closure cl;
   ffi_closure *pcl = &cl;
   ffi_type * cl_arg_types[17];
+  int res;
 
   cl_arg_types[0] = &ffi_type_uint64;
   cl_arg_types[1] = &ffi_type_uint;
@@ -74,9 +75,11 @@ int main (void)
   CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn0,
 			 (void *) 3 /* userdata */) == FFI_OK);
 
-  (*((closure_test_type0)pcl))
-	(1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
-	 19, 21, 1);
+  res = (*((closure_test_type0)pcl))
+    (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
+     19, 21, 1);
   /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 680" } */
      exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/closure_fn1.c b/libffi/testsuite/libffi.call/closure_fn1.c
index 83734783ee16..f98a01796cdd 100644
--- a/libffi/testsuite/libffi.call/closure_fn1.c
+++ b/libffi/testsuite/libffi.call/closure_fn1.c
@@ -43,6 +43,7 @@ int main (void)
   static ffi_closure cl;
   ffi_closure *pcl = &cl;
   ffi_type * cl_arg_types[17];
+  int res;
 
   cl_arg_types[0] = &ffi_type_float;
   cl_arg_types[1] = &ffi_type_float;
@@ -69,9 +70,11 @@ int main (void)
   CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn1,
 			 (void *) 3 /* userdata */)  == FFI_OK);
 
-  (*((closure_test_type1)pcl))
-	(1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
-	 19, 21, 1);
+  res = (*((closure_test_type1)pcl))
+    (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
+     19, 21, 1);
   /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 255" } */
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/closure_fn2.c b/libffi/testsuite/libffi.call/closure_fn2.c
index 8ca5ad7bd63d..5b06ec8406de 100644
--- a/libffi/testsuite/libffi.call/closure_fn2.c
+++ b/libffi/testsuite/libffi.call/closure_fn2.c
@@ -44,6 +44,7 @@ int main (void)
   static ffi_closure cl;
   ffi_closure *pcl = &cl;
   ffi_type * cl_arg_types[17];
+  int res;
 
   cl_arg_types[0] = &ffi_type_double;
   cl_arg_types[1] = &ffi_type_double;
@@ -70,9 +71,11 @@ int main (void)
   CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn2,
 			 (void *) 3 /* userdata */) == FFI_OK);
 
-  (*((closure_test_type2)pcl))
-	(1, 2, 3, 4, 127, 5, 6, 8, 9, 10, 11, 12.0, 13,
-	 19.0, 21, 1);
+  res = (*((closure_test_type2)pcl))
+    (1, 2, 3, 4, 127, 5, 6, 8, 9, 10, 11, 12.0, 13,
+     19.0, 21, 1);
   /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 255" } */
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/closure_fn3.c b/libffi/testsuite/libffi.call/closure_fn3.c
index 27b964cd6917..6af54c76ac0f 100644
--- a/libffi/testsuite/libffi.call/closure_fn3.c
+++ b/libffi/testsuite/libffi.call/closure_fn3.c
@@ -45,6 +45,7 @@ int main (void)
   static ffi_closure cl;
   ffi_closure *pcl = &cl;
   ffi_type * cl_arg_types[17];
+  int res;
 
 
   cl_arg_types[0] = &ffi_type_float;
@@ -72,9 +73,11 @@ int main (void)
   CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn3,
 			 (void *) 3 /* userdata */)  == FFI_OK);
 
-  (*((closure_test_type3)pcl))
-	(1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13,
-	 19.19, 21.21, 1);
+  res = (*((closure_test_type3)pcl))
+    (1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13,
+     19.19, 21.21, 1);
   /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 19 21 1 3: 135" } */
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 135" } */
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/closure_fn4.c b/libffi/testsuite/libffi.call/closure_fn4.c
index 2085020b4577..87ca0db9185e 100644
--- a/libffi/testsuite/libffi.call/closure_fn4.c
+++ b/libffi/testsuite/libffi.call/closure_fn4.c
@@ -25,7 +25,7 @@ closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata)
     (int)*(unsigned long long *)args[13] +
     (int)*(unsigned long long *)args[14] +
     *(int *)args[15] + (int)(long)userdata;
-  
+
   printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
 	 (int)*(unsigned long long *)args[0],
 	 (int)*(unsigned long long *)args[1],
@@ -44,7 +44,7 @@ closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata)
 	 (int)*(unsigned long long *)args[14],
 	 *(int *)args[15],
 	 (int)(long)userdata, (int)*(ffi_arg *)resp);
-  
+
 }
 
 typedef int (*closure_test_type0)(unsigned long long, unsigned long long,
@@ -63,25 +63,26 @@ int main (void)
   ffi_closure *pcl = &cl;
   ffi_type * cl_arg_types[17];
   int i, res;
-  
+
   for (i = 0; i < 15; i++) {
     cl_arg_types[i] = &ffi_type_uint64;
   }
   cl_arg_types[15] = &ffi_type_uint;
   cl_arg_types[16] = NULL;
-  
+
   /* Initialize the cif */
   CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
 		     &ffi_type_sint, cl_arg_types) == FFI_OK);
-  
+
   CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn0,
 			 (void *) 3 /* userdata */) == FFI_OK);
-  
+
   res = (*((closure_test_type0)pcl))
     (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11LL, 12LL,
      13LL, 19LL, 21LL, 1);
   /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
-  CHECK(res == 680);
-  
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 680" } */
+
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/closure_fn5.c b/libffi/testsuite/libffi.call/closure_fn5.c
index c99dc81c17eb..f7918c16868d 100644
--- a/libffi/testsuite/libffi.call/closure_fn5.c
+++ b/libffi/testsuite/libffi.call/closure_fn5.c
@@ -25,7 +25,7 @@ closure_test_fn5(ffi_cif* cif,void* resp,void** args, void* userdata)
     (int)*(unsigned long long *)args[13] +
     (int)*(unsigned long long *)args[14] +
     *(int *)args[15] + (int)(long)userdata;
-  
+
   printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
 	 (int)*(unsigned long long *)args[0],
 	 (int)*(unsigned long long *)args[1],
@@ -44,7 +44,7 @@ closure_test_fn5(ffi_cif* cif,void* resp,void** args, void* userdata)
 	 (int)*(unsigned long long *)args[14],
 	 *(int *)args[15],
 	 (int)(long)userdata, (int)*(ffi_arg *)resp);
-  
+
 }
 
 typedef int (*closure_test_type0)(unsigned long long, unsigned long long,
@@ -73,18 +73,20 @@ int main (void)
   }
   cl_arg_types[15] = &ffi_type_uint;
   cl_arg_types[16] = NULL;
-  
+
   /* Initialize the cif */
   CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
 		     &ffi_type_sint, cl_arg_types) == FFI_OK);
-  
+
   CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn5,
 			 (void *) 3 /* userdata */) == FFI_OK);
-  
+
   res = (*((closure_test_type0)pcl))
     (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11, 12LL,
      13LL, 19LL, 21LL, 1);
   /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
-  CHECK(res == 680);
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 680" } */
+
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_12byte.c b/libffi/testsuite/libffi.call/cls_12byte.c
index d44a3344e08e..a917a709d61a 100644
--- a/libffi/testsuite/libffi.call/cls_12byte.c
+++ b/libffi/testsuite/libffi.call/cls_12byte.c
@@ -75,17 +75,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_12byte_fn), &res_dbl, args_dbl);
   /* { dg-output "7 4 9 1 5 3: 8 9 12" } */
-  CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
-  CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
-  CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
+  printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 8 9 12" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_12byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_12byte(*)(cls_struct_12byte, cls_struct_12byte))(pcl))(h_dbl, j_dbl);
   /* { dg-output "\n7 4 9 1 5 3: 8 9 12" } */
-  CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
-  CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
-  CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
+  printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 8 9 12" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_16byte.c b/libffi/testsuite/libffi.call/cls_16byte.c
index 2481196402a5..ae0e7c754ee3 100644
--- a/libffi/testsuite/libffi.call/cls_16byte.c
+++ b/libffi/testsuite/libffi.call/cls_16byte.c
@@ -76,17 +76,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_16byte_fn), &res_dbl, args_dbl);
   /* { dg-output "7 8 9 1 9 3: 8 17 12" } */
-  CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
-  CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
-  CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
+  printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 8 17 12" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_16byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_16byte(*)(cls_struct_16byte, cls_struct_16byte))(pcl))(h_dbl, j_dbl);
   /* { dg-output "\n7 8 9 1 9 3: 8 17 12" } */
-  CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
-  CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
-  CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
+  printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 8 17 12" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_18byte.c b/libffi/testsuite/libffi.call/cls_18byte.c
index 3e4ae5a86c92..0b1d07f25db3 100644
--- a/libffi/testsuite/libffi.call/cls_18byte.c
+++ b/libffi/testsuite/libffi.call/cls_18byte.c
@@ -81,19 +81,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_18byte_fn), &res_dbl, args_dbl);
   /* { dg-output "1 127 126 3 4 125 124 5: 5 252 250 8" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-  CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+  printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+  /* { dg-output "\nres: 5 252 250 8" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_18byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_18byte(*)(cls_struct_18byte, cls_struct_18byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n1 127 126 3 4 125 124 5: 5 252 250 8" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-  CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+  printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+  /* { dg-output "\nres: 5 252 250 8" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_19byte.c b/libffi/testsuite/libffi.call/cls_19byte.c
index fafaad031e18..2bb0b6780eea 100644
--- a/libffi/testsuite/libffi.call/cls_19byte.c
+++ b/libffi/testsuite/libffi.call/cls_19byte.c
@@ -85,21 +85,17 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_19byte_fn), &res_dbl, args_dbl);
   /* { dg-output "1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-  CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
-  CHECK( res_dbl.e == (g_dbl.e + f_dbl.e));
+  printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c, 
+	 res_dbl.d, res_dbl.e);
+  /* { dg-output "\nres: 5 252 250 8 239" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_19byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_19byte(*)(cls_struct_19byte, cls_struct_19byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-  CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
-  CHECK( res_dbl.e == (g_dbl.e + f_dbl.e));
+  printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
+	 res_dbl.d, res_dbl.e);
+  /* { dg-output "\nres: 5 252 250 8 239" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_1_1byte.c b/libffi/testsuite/libffi.call/cls_1_1byte.c
index 11defc80e97c..f7682fef550a 100644
--- a/libffi/testsuite/libffi.call/cls_1_1byte.c
+++ b/libffi/testsuite/libffi.call/cls_1_1byte.c
@@ -72,13 +72,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_1_1byte_fn), &res_dbl, args_dbl);
   /* { dg-output "12 178: 190" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
+  printf("res: %d\n", res_dbl.a);
+  /* { dg-output "\nres: 190" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_1_1byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_1_1byte(*)(cls_struct_1_1byte, cls_struct_1_1byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n12 178: 190" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
+  printf("res: %d\n", res_dbl.a);
+  /* { dg-output "\nres: 190" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_20byte.c b/libffi/testsuite/libffi.call/cls_20byte.c
index d81df4d5c383..f3cc0ebbd13a 100644
--- a/libffi/testsuite/libffi.call/cls_20byte.c
+++ b/libffi/testsuite/libffi.call/cls_20byte.c
@@ -76,17 +76,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl);
   /* { dg-output "1 2 3 4 5 7: 5 7 10" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
+  printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 5 7 10" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_20byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
+  printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 5 7 10" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_20byte1.c b/libffi/testsuite/libffi.call/cls_20byte1.c
index 1f70313c8c54..089f02e327ef 100644
--- a/libffi/testsuite/libffi.call/cls_20byte1.c
+++ b/libffi/testsuite/libffi.call/cls_20byte1.c
@@ -76,17 +76,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl);
   /* { dg-output "1 2 3 4 5 7: 5 7 10" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
+  printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 5 7 10" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_20byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
+  printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 5 7 10" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_24byte.c b/libffi/testsuite/libffi.call/cls_24byte.c
index 6c86115e41c9..f3adb9da3524 100644
--- a/libffi/testsuite/libffi.call/cls_24byte.c
+++ b/libffi/testsuite/libffi.call/cls_24byte.c
@@ -94,22 +94,19 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_24byte_fn), &res_dbl, args_dbl);
   /* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
-  CHECK( res_dbl.a == (e_dbl.a + f_dbl.a + g_dbl.a + h_dbl.a));
-  CHECK( res_dbl.b == (e_dbl.b + f_dbl.b + g_dbl.b + h_dbl.b));
-  CHECK( res_dbl.c == (e_dbl.c + f_dbl.c + g_dbl.c + h_dbl.c));
-  CHECK( res_dbl.d == (e_dbl.d + f_dbl.d + g_dbl.d + h_dbl.d));
+  printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+  /* { dg-output "\nres: 22 15 17 25" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_24byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_24byte(*)(cls_struct_24byte,
-				     cls_struct_24byte,
-				     cls_struct_24byte,
-				     cls_struct_24byte))
+				   cls_struct_24byte,
+				   cls_struct_24byte,
+				   cls_struct_24byte))
 	     (pcl))(e_dbl, f_dbl, g_dbl, h_dbl);
   /* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
-  CHECK( res_dbl.a == (e_dbl.a + f_dbl.a + g_dbl.a + h_dbl.a));
-  CHECK( res_dbl.b == (e_dbl.b + f_dbl.b + g_dbl.b + h_dbl.b));
-  CHECK( res_dbl.c == (e_dbl.c + f_dbl.c + g_dbl.c + h_dbl.c));
-  CHECK( res_dbl.d == (e_dbl.d + f_dbl.d + g_dbl.d + h_dbl.d));
+  printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+  /* { dg-output "\nres: 22 15 17 25" } */
+
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_2byte.c b/libffi/testsuite/libffi.call/cls_2byte.c
index 2198ee821cbb..672437d05c9d 100644
--- a/libffi/testsuite/libffi.call/cls_2byte.c
+++ b/libffi/testsuite/libffi.call/cls_2byte.c
@@ -75,15 +75,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_2byte_fn), &res_dbl, args_dbl);
   /* { dg-output "12 127 1 13: 13 140" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+  printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 13 140" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_2byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_2byte(*)(cls_struct_2byte, cls_struct_2byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n12 127 1 13: 13 140" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+  printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 13 140" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_3_1byte.c b/libffi/testsuite/libffi.call/cls_3_1byte.c
index e4bda2fa026e..26f6501d365f 100644
--- a/libffi/testsuite/libffi.call/cls_3_1byte.c
+++ b/libffi/testsuite/libffi.call/cls_3_1byte.c
@@ -80,19 +80,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_3_1byte_fn), &res_dbl, args_dbl);
   /* { dg-output "12 13 14 178 179 180: 190 192 194" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-
+  printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 190 192 194" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3_1byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_3_1byte(*)(cls_struct_3_1byte, cls_struct_3_1byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n12 13 14 178 179 180: 190 192 194" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-
+  printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 190 192 194" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_3byte1.c b/libffi/testsuite/libffi.call/cls_3byte1.c
index b03fa86cd70b..9f51f55f6fcc 100644
--- a/libffi/testsuite/libffi.call/cls_3byte1.c
+++ b/libffi/testsuite/libffi.call/cls_3byte1.c
@@ -75,15 +75,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_3byte_fn), &res_dbl, args_dbl);
   /* { dg-output "12 119 1 15: 13 134" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+  printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 13 134" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_3byte(*)(cls_struct_3byte, cls_struct_3byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n12 119 1 15: 13 134" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+  printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 13 134" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_3byte2.c b/libffi/testsuite/libffi.call/cls_3byte2.c
index d750869bc4fc..815debf59174 100644
--- a/libffi/testsuite/libffi.call/cls_3byte2.c
+++ b/libffi/testsuite/libffi.call/cls_3byte2.c
@@ -75,15 +75,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_3byte_fn1), &res_dbl, args_dbl);
   /* { dg-output "15 125 9 19: 24 144" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+  printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 24 144" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3byte_gn1, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_3byte_1(*)(cls_struct_3byte_1, cls_struct_3byte_1))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n15 125 9 19: 24 144" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+  printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 24 144" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_4_1byte.c b/libffi/testsuite/libffi.call/cls_4_1byte.c
index 195d8cc6cdda..000506eabed1 100644
--- a/libffi/testsuite/libffi.call/cls_4_1byte.c
+++ b/libffi/testsuite/libffi.call/cls_4_1byte.c
@@ -83,19 +83,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_4_1byte_fn), &res_dbl, args_dbl);
   /* { dg-output "12 13 14 15 178 179 180 181: 190 192 194 196" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-  CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+  printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+  /* { dg-output "\nres: 190 192 194 196" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_4_1byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_4_1byte(*)(cls_struct_4_1byte, cls_struct_4_1byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n12 13 14 15 178 179 180 181: 190 192 194 196" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-  CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+  printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+  /* { dg-output "\nres: 190 192 194 196" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_4byte.c b/libffi/testsuite/libffi.call/cls_4byte.c
index 8eb9ad958007..fdf9b9bf600c 100644
--- a/libffi/testsuite/libffi.call/cls_4byte.c
+++ b/libffi/testsuite/libffi.call/cls_4byte.c
@@ -75,15 +75,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_4byte_fn), &res_dbl, args_dbl);
   /* { dg-output "127 120 12 128: 139 248" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+  printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 139 248" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_4byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_4byte(*)(cls_struct_4byte, cls_struct_4byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n127 120 12 128: 139 248" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+  printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 139 248" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_5byte.c b/libffi/testsuite/libffi.call/cls_5byte.c
index 821d653fd292..877ea4cbff23 100644
--- a/libffi/testsuite/libffi.call/cls_5byte.c
+++ b/libffi/testsuite/libffi.call/cls_5byte.c
@@ -79,17 +79,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl);
   /* { dg-output "127 120 1 12 128 9: 139 248 10" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
+  printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 139 248 10" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_5byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n127 120 1 12 128 9: 139 248 10" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
+  printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+  /* { dg-output "\nres: 139 248 10" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_64byte.c b/libffi/testsuite/libffi.call/cls_64byte.c
index 69281af1e190..28d5590735ff 100644
--- a/libffi/testsuite/libffi.call/cls_64byte.c
+++ b/libffi/testsuite/libffi.call/cls_64byte.c
@@ -103,31 +103,21 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_64byte_fn), &res_dbl, args_dbl);
   /* { dg-output "22 15 17 25 6 13 19 18" } */
-  CHECK( res_dbl.a == (e_dbl.a + f_dbl.a + g_dbl.a + h_dbl.a));
-  CHECK( res_dbl.b == (e_dbl.b + f_dbl.b + g_dbl.b + h_dbl.b));
-  CHECK( res_dbl.c == (e_dbl.c + f_dbl.c + g_dbl.c + h_dbl.c));
-  CHECK( res_dbl.d == (e_dbl.d + f_dbl.d + g_dbl.d + h_dbl.d));
-  CHECK( res_dbl.e == (e_dbl.e + f_dbl.e + g_dbl.e + h_dbl.e));
-  CHECK( res_dbl.f == (e_dbl.f + f_dbl.f + g_dbl.f + h_dbl.f));
-  CHECK( res_dbl.g == (e_dbl.g + f_dbl.g + g_dbl.g + h_dbl.g));
-  CHECK( res_dbl.h == (e_dbl.h + f_dbl.h + g_dbl.h + h_dbl.h));
+  printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
+	 res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
+  /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_64byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_64byte(*)(cls_struct_64byte,
-				     cls_struct_64byte,
-				     cls_struct_64byte,
-				     cls_struct_64byte))
+				   cls_struct_64byte,
+				   cls_struct_64byte,
+				   cls_struct_64byte))
 	     (pcl))(e_dbl, f_dbl, g_dbl, h_dbl);
   /* { dg-output "\n22 15 17 25 6 13 19 18" } */
-  CHECK( res_dbl.a == (e_dbl.a + f_dbl.a + g_dbl.a + h_dbl.a));
-  CHECK( res_dbl.b == (e_dbl.b + f_dbl.b + g_dbl.b + h_dbl.b));
-  CHECK( res_dbl.c == (e_dbl.c + f_dbl.c + g_dbl.c + h_dbl.c));
-  CHECK( res_dbl.d == (e_dbl.d + f_dbl.d + g_dbl.d + h_dbl.d));
-  CHECK( res_dbl.e == (e_dbl.e + f_dbl.e + g_dbl.e + h_dbl.e));
-  CHECK( res_dbl.f == (e_dbl.f + f_dbl.f + g_dbl.f + h_dbl.f));
-  CHECK( res_dbl.g == (e_dbl.g + f_dbl.g + g_dbl.g + h_dbl.g));
-  CHECK( res_dbl.h == (e_dbl.h + f_dbl.h + g_dbl.h + h_dbl.h));
+  printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
+	 res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
+  /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_6byte.c b/libffi/testsuite/libffi.call/cls_6byte.c
index c1cb278f749a..5eb17d2430f7 100644
--- a/libffi/testsuite/libffi.call/cls_6byte.c
+++ b/libffi/testsuite/libffi.call/cls_6byte.c
@@ -82,19 +82,16 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl);
   /* { dg-output "127 120 1 128 12 128 9 127: 139 248 10 255" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-  CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+  printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+  /* { dg-output "\nres: 139 248 10 255" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_6byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n127 120 1 128 12 128 9 127: 139 248 10 255" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-  CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+  printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+  /* { dg-output "\nres: 139 248 10 255" } */
+
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_7byte.c b/libffi/testsuite/libffi.call/cls_7byte.c
index 253534dfbeea..9c1765af835a 100644
--- a/libffi/testsuite/libffi.call/cls_7byte.c
+++ b/libffi/testsuite/libffi.call/cls_7byte.c
@@ -82,19 +82,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl);
   /* { dg-output "127 120 1 254 12 128 9 255: 139 248 10 509" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-  CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+  printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+  /* { dg-output "\nres: 139 248 10 509" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_7byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n127 120 1 254 12 128 9 255: 139 248 10 509" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-  CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-  CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+  printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+  /* { dg-output "\nres: 139 248 10 509" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_8byte.c b/libffi/testsuite/libffi.call/cls_8byte.c
index 3746a696c125..d9050d494c80 100644
--- a/libffi/testsuite/libffi.call/cls_8byte.c
+++ b/libffi/testsuite/libffi.call/cls_8byte.c
@@ -74,15 +74,14 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_8byte_fn), &res_dbl, args_dbl);
   /* { dg-output "1 2 4 5: 5 7" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-
+  printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 5 7" } */
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_8byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_8byte(*)(cls_struct_8byte, cls_struct_8byte))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n1 2 4 5: 5 7" } */
-  CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
-  CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+  printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 5 7" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_9byte1.c b/libffi/testsuite/libffi.call/cls_9byte1.c
index 8369a06f8f34..06acca48b71a 100644
--- a/libffi/testsuite/libffi.call/cls_9byte1.c
+++ b/libffi/testsuite/libffi.call/cls_9byte1.c
@@ -76,15 +76,15 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl);
   /* { dg-output "7 8 1 9: 8 17" } */
-  CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
-  CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
+  printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 8 17" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_9byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(pcl))(h_dbl, j_dbl);
   /* { dg-output "\n7 8 1 9: 8 17" } */
-  CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
-  CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
+  printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 8 17" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_9byte2.c b/libffi/testsuite/libffi.call/cls_9byte2.c
index 2fc234e00251..21d7b49ab5c6 100644
--- a/libffi/testsuite/libffi.call/cls_9byte2.c
+++ b/libffi/testsuite/libffi.call/cls_9byte2.c
@@ -76,15 +76,16 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl);
   /* { dg-output "7 8 1 9: 8 17" } */
-  CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
-  CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
+  printf("res: %g %d\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 8 17" } */
+
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_9byte_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(pcl))(h_dbl, j_dbl);
   /* { dg-output "\n7 8 1 9: 8 17" } */
-  CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
-  CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
+  printf("res: %g %d\n", res_dbl.a, res_dbl.b);
+  /* { dg-output "\nres: 8 17" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_double.c b/libffi/testsuite/libffi.call/cls_double.c
index 2bfc6432f2f6..51ec26a3a05e 100644
--- a/libffi/testsuite/libffi.call/cls_double.c
+++ b/libffi/testsuite/libffi.call/cls_double.c
@@ -36,6 +36,8 @@ int main (void)
 
   res = (*((cls_ret_double)pcl))(21474.789);
   /* { dg-output "21474.789000: 21474.789000" } */
-  CHECK(res == 21474.789000);
+  printf("res: %.6f\n", res);
+  /* { dg-output "\nres: 21474.789000" } */
+
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_float.c b/libffi/testsuite/libffi.call/cls_float.c
index dd0a48bd2cc4..bd1601ebc78c 100644
--- a/libffi/testsuite/libffi.call/cls_float.c
+++ b/libffi/testsuite/libffi.call/cls_float.c
@@ -24,6 +24,7 @@ int main (void)
   static ffi_closure cl;
   ffi_closure *pcl = &cl;
   ffi_type * cl_arg_types[2];
+  float res;
 
 
   cl_arg_types[0] = &ffi_type_float;
@@ -34,10 +35,9 @@ int main (void)
 		     &ffi_type_float, cl_arg_types) == FFI_OK);
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_ret_float_fn, NULL)  == FFI_OK);
-  ((((cls_ret_float)pcl)(-2122.12)));
-  /* { dg-output "\\-2122.12: \\-2122.12\n" } */
-  printf("%f \n",(((cls_ret_float)pcl)(-2122.12)));
+  res = ((((cls_ret_float)pcl)(-2122.12)));
   /* { dg-output "\\-2122.12: \\-2122.12" } */
-  /* { dg-output "\n\-2122.120117" } */
+  printf("res: %.6f\n", res);
+  /* { dg-output "\nres: \-2122.120117" } */
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_schar.c b/libffi/testsuite/libffi.call/cls_schar.c
index a704c9d18acf..ecdbfb695754 100644
--- a/libffi/testsuite/libffi.call/cls_schar.c
+++ b/libffi/testsuite/libffi.call/cls_schar.c
@@ -35,7 +35,8 @@ int main (void)
 
   res = (*((cls_ret_schar)pcl))(127);
   /* { dg-output "127: 127" } */
-  CHECK(res == 127);
+  printf("res: %d\n", res);
+  /* { dg-output "\nres: 127" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_sint.c b/libffi/testsuite/libffi.call/cls_sint.c
index 839045f673dc..caae0d456912 100644
--- a/libffi/testsuite/libffi.call/cls_sint.c
+++ b/libffi/testsuite/libffi.call/cls_sint.c
@@ -35,7 +35,8 @@ int main (void)
 
   res = (*((cls_ret_sint)pcl))(65534);
   /* { dg-output "65534: 65534" } */
-  CHECK(res == 65534);
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 65534" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_sshort.c b/libffi/testsuite/libffi.call/cls_sshort.c
index 9cfe76787173..3b1e4c60d482 100644
--- a/libffi/testsuite/libffi.call/cls_sshort.c
+++ b/libffi/testsuite/libffi.call/cls_sshort.c
@@ -35,7 +35,8 @@ int main (void)
 
   res = (*((cls_ret_sshort)pcl))(255);
   /* { dg-output "255: 255" } */
-  CHECK(res == 255);
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 255" } */
 
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_uchar.c b/libffi/testsuite/libffi.call/cls_uchar.c
index dfa4d97a9b95..e5027b2e45c6 100644
--- a/libffi/testsuite/libffi.call/cls_uchar.c
+++ b/libffi/testsuite/libffi.call/cls_uchar.c
@@ -35,6 +35,8 @@ int main (void)
 
   res = (*((cls_ret_uchar)pcl))(127);
   /* { dg-output "127: 127" } */
-  CHECK(res == 127);
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 127" } */
+
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_uint.c b/libffi/testsuite/libffi.call/cls_uint.c
index 684002217ce8..08f29122bd4b 100644
--- a/libffi/testsuite/libffi.call/cls_uint.c
+++ b/libffi/testsuite/libffi.call/cls_uint.c
@@ -36,6 +36,8 @@ int main (void)
 
   res = (*((cls_ret_uint)pcl))(2147483647);
   /* { dg-output "2147483647: 2147483647" } */
-  CHECK(res == 2147483647);
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 2147483647" } */
+
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_ulonglong.c b/libffi/testsuite/libffi.call/cls_ulonglong.c
index 8d1a74d7705b..80dc2db7aaa7 100644
--- a/libffi/testsuite/libffi.call/cls_ulonglong.c
+++ b/libffi/testsuite/libffi.call/cls_ulonglong.c
@@ -34,9 +34,13 @@ int main (void)
   CHECK(ffi_prep_closure(pcl, &cif, cls_ret_ulonglong_fn, NULL)  == FFI_OK);
   res = (*((cls_ret_ulonglong)pcl))(214LL);
   /* { dg-output "214: 214" } */
-  CHECK(res == 214LL);
+  printf("res: %lld\n", res);
+  /* { dg-output "\nres: 214" } */
+
   res = (*((cls_ret_ulonglong)pcl))(9223372035854775808LL);
   /* { dg-output "\n9223372035854775808: 9223372035854775808" } */
-  CHECK(res == 9223372035854775808LL);
+  printf("res: %lld\n", res);
+  /* { dg-output "\nres: 9223372035854775808" } */
+
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/cls_ushort.c b/libffi/testsuite/libffi.call/cls_ushort.c
index 401ff77be720..3599f6776a5d 100644
--- a/libffi/testsuite/libffi.call/cls_ushort.c
+++ b/libffi/testsuite/libffi.call/cls_ushort.c
@@ -36,6 +36,8 @@ int main (void)
 
   res = (*((cls_ret_ushort)pcl))(65535);
   /* { dg-output "65535: 65535" } */
-  CHECK(res == 65535);
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 65535" } */
+
   exit(0);
 }
diff --git a/libffi/testsuite/libffi.call/problem1.c b/libffi/testsuite/libffi.call/problem1.c
index 6cbdb2c4c9ad..f3bd3b57739a 100644
--- a/libffi/testsuite/libffi.call/problem1.c
+++ b/libffi/testsuite/libffi.call/problem1.c
@@ -75,19 +75,15 @@ int main(void)
     args[2] = NULL;
     ffi_call(&cif, FFI_FN(callee), &res, args);
     /* { dg-output "1 2 3 1 2 3: 2 4 6" } */
-
-    CHECK(res.a == 2.0);
-    CHECK(res.b == 4.0);
-    CHECK(res.c == 6.0);
+    printf("res: %g %g %g\n", res.a, res.b, res.c);
+    /* { dg-output "\nres: 2 4 6" } */
 
     CHECK(ffi_prep_closure(pcl, &cif, stub, NULL) == FFI_OK);
 
     res = ((my_ffi_struct(*)(struct my_ffi_struct, struct my_ffi_struct))(pcl))(g, f);
     /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */
-
-    CHECK(res.a == 2.0);
-    CHECK(res.b == 4.0);
-    CHECK(res.c == 6.0);
+    printf("res: %g %g %g\n", res.a, res.b, res.c);
+    /* { dg-output "\nres: 2 4 6" } */
 
     exit(0);;
 }
diff --git a/libffi/testsuite/libffi.special/unwindtest.cc b/libffi/testsuite/libffi.special/unwindtest.cc
index ee6806effe11..d393a50f6a45 100644
--- a/libffi/testsuite/libffi.special/unwindtest.cc
+++ b/libffi/testsuite/libffi.special/unwindtest.cc
@@ -49,18 +49,20 @@ typedef int (*closure_test_type1)(float, float, float, float, signed short,
 int main (void)
 {
   ffi_cif cif;
-  ffi_closure cl;
+  static ffi_closure cl;
+  ffi_closure *pcl = &cl;
   ffi_type * cl_arg_types[17];
+  int res;
   {
     cl_arg_types[1] = NULL;
 
     CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0,
 		       &ffi_type_void, cl_arg_types) == FFI_OK);
-    CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn, NULL) == FFI_OK);
+    CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn, NULL) == FFI_OK);
 
     try
       {
-	(*((closure_test_type)(&cl)))();
+	(*((closure_test_type)(pcl)))();
       } catch (int exception_code)
       {
 	CHECK(exception_code == 9);
@@ -94,11 +96,11 @@ int main (void)
       CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
 			 &ffi_type_sint, cl_arg_types) == FFI_OK);
 
-      CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn1,
+      CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn1,
 			     (void *) 3 /* userdata */)  == FFI_OK);
       try
 	{
-	  (*((closure_test_type1)(&cl)))
+	  (*((closure_test_type1)pcl))
 	    (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
 	     19, 21, 1);
 	  /* { dg-output "\n1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */