aboutsummaryrefslogtreecommitdiff
path: root/libffi
diff options
context:
space:
mode:
authorAndreas Tobler <a.tobler@schweiz.ch>2003-11-09 18:05:10 +0100
committerAndreas Tobler <andreast@gcc.gnu.org>2003-11-09 18:05:10 +0100
commit647af4a91c4035fe99c8db7ab9d726c091e7e153 (patch)
tree0c4b92bc5f48dd4adf2289af9cadb8f314a91fa1 /libffi
parentce4191eed16e15397cc09bba95d8ef603ba05359 (diff)
downloadgcc-647af4a91c4035fe99c8db7ab9d726c091e7e153.zip
gcc-647af4a91c4035fe99c8db7ab9d726c091e7e153.tar.gz
gcc-647af4a91c4035fe99c8db7ab9d726c091e7e153.tar.bz2
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
Diffstat (limited to 'libffi')
-rw-r--r--libffi/ChangeLog44
-rw-r--r--libffi/testsuite/libffi.call/closure_fn0.c9
-rw-r--r--libffi/testsuite/libffi.call/closure_fn1.c9
-rw-r--r--libffi/testsuite/libffi.call/closure_fn2.c9
-rw-r--r--libffi/testsuite/libffi.call/closure_fn3.c9
-rw-r--r--libffi/testsuite/libffi.call/closure_fn4.c17
-rw-r--r--libffi/testsuite/libffi.call/closure_fn5.c14
-rw-r--r--libffi/testsuite/libffi.call/cls_12byte.c10
-rw-r--r--libffi/testsuite/libffi.call/cls_16byte.c10
-rw-r--r--libffi/testsuite/libffi.call/cls_18byte.c12
-rw-r--r--libffi/testsuite/libffi.call/cls_19byte.c16
-rw-r--r--libffi/testsuite/libffi.call/cls_1_1byte.c6
-rw-r--r--libffi/testsuite/libffi.call/cls_20byte.c10
-rw-r--r--libffi/testsuite/libffi.call/cls_20byte1.c10
-rw-r--r--libffi/testsuite/libffi.call/cls_24byte.c19
-rw-r--r--libffi/testsuite/libffi.call/cls_2byte.c8
-rw-r--r--libffi/testsuite/libffi.call/cls_3_1byte.c12
-rw-r--r--libffi/testsuite/libffi.call/cls_3byte1.c8
-rw-r--r--libffi/testsuite/libffi.call/cls_3byte2.c8
-rw-r--r--libffi/testsuite/libffi.call/cls_4_1byte.c12
-rw-r--r--libffi/testsuite/libffi.call/cls_4byte.c8
-rw-r--r--libffi/testsuite/libffi.call/cls_5byte.c10
-rw-r--r--libffi/testsuite/libffi.call/cls_64byte.c28
-rw-r--r--libffi/testsuite/libffi.call/cls_6byte.c13
-rw-r--r--libffi/testsuite/libffi.call/cls_7byte.c12
-rw-r--r--libffi/testsuite/libffi.call/cls_8byte.c9
-rw-r--r--libffi/testsuite/libffi.call/cls_9byte1.c8
-rw-r--r--libffi/testsuite/libffi.call/cls_9byte2.c9
-rw-r--r--libffi/testsuite/libffi.call/cls_double.c4
-rw-r--r--libffi/testsuite/libffi.call/cls_float.c8
-rw-r--r--libffi/testsuite/libffi.call/cls_schar.c3
-rw-r--r--libffi/testsuite/libffi.call/cls_sint.c3
-rw-r--r--libffi/testsuite/libffi.call/cls_sshort.c3
-rw-r--r--libffi/testsuite/libffi.call/cls_uchar.c4
-rw-r--r--libffi/testsuite/libffi.call/cls_uint.c4
-rw-r--r--libffi/testsuite/libffi.call/cls_ulonglong.c8
-rw-r--r--libffi/testsuite/libffi.call/cls_ushort.c4
-rw-r--r--libffi/testsuite/libffi.call/problem1.c12
-rw-r--r--libffi/testsuite/libffi.special/unwindtest.cc12
39 files changed, 221 insertions, 193 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 004625d..11406c3 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 fd6593c..f418f01 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 8373478..f98a017 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 8ca5ad7..5b06ec8 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 27b964c..6af54c7 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 2085020..87ca0db 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 c99dc81..f7918c1 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 d44a334..a917a70 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 2481196..ae0e7c7 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 3e4ae5a..0b1d07f 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 fafaad0..2bb0b67 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 11defc8..f7682fe 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 d81df4d..f3cc0eb 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 1f70313..089f02e 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 6c86115..f3adb9d 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 2198ee8..672437d 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 e4bda2f..26f6501 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 b03fa86..9f51f55 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 d750869..815debf 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 195d8cc..000506e 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 8eb9ad9..fdf9b9b 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 821d653..877ea4c 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 69281af..28d5590 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 c1cb278..5eb17d2 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 253534d..9c1765a 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 3746a69..d9050d4 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 8369a06..06acca4 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 2fc234e..21d7b49 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 2bfc643..51ec26a 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 dd0a48b..bd1601e 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 a704c9d..ecdbfb6 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 839045f..caae0d4 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 9cfe767..3b1e4c6 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 dfa4d97..e5027b2 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 6840022..08f2912 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 8d1a74d..80dc2db 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 401ff77..3599f67 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 6cbdb2c..f3bd3b5 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 ee6806e..d393a50 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" } */