Skip to content

Commit

Permalink
Revert some redundant dg-output/printf statements
Browse files Browse the repository at this point in the history
Helps Node.
  • Loading branch information
kleisauke committed Jun 28, 2021
1 parent 254af96 commit 0e0d593
Show file tree
Hide file tree
Showing 34 changed files with 40 additions and 66 deletions.
3 changes: 2 additions & 1 deletion testsuite/libffi.closures/closure_fn0.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#include "ffitest.h"

static void
closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata)
closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata)
{
*(ffi_arg*)resp =
(int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) +
Expand Down
8 changes: 3 additions & 5 deletions testsuite/libffi.closures/closure_loc_fn0.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,17 @@ int main (void)
cl_arg_types[15] = &ffi_type_sint;
cl_arg_types[16] = NULL;

printf("prep_cif: %d\n",res);
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
&ffi_type_sint, cl_arg_types) == FFI_OK);

printf("prep_cif: %d\n",res);
pcl = ffi_closure_alloc(sizeof(ffi_closure), &codeloc);
CHECK(pcl != NULL);
CHECK(codeloc != NULL);

CHECK(ffi_prep_closure_loc(pcl, &cif, closure_loc_test_fn0,
(void *) 3 /* userdata */, codeloc) == FFI_OK);

#ifndef FFI_EXEC_STATIC_TRAMP
/* With static trampolines, the codeloc does not point to closure */
CHECK(memcmp(pcl, codeloc, sizeof(*pcl)) == 0);
Expand All @@ -94,8 +92,8 @@ int main (void)
(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" } */
CHECK(res == 680);
printf("res: %d\n",res);
/* { dg-output "\nres: 680" } */
exit(0);
CHECK(res == 680);
exit(0);
}
1 change: 0 additions & 1 deletion testsuite/libffi.closures/cls_16byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ cls_struct_16byte cls_struct_16byte_fn(struct cls_struct_16byte b1,

printf("%d %g %d %d %g %d: %d %g %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c,
result.a, result.b, result.c);
/* { dg-output "7 8 9 1 9 3: 8 17 12" } */

CHECK(b1.a == 7);
CHECK(b1.b == 8);
Expand Down
1 change: 0 additions & 1 deletion testsuite/libffi.closures/cls_18byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ cls_struct_18byte cls_struct_18byte_fn(struct cls_struct_18byte a1,
printf("%g %d %d %g %g %d %d %g: %g %d %d %g\n", a1.a, a1.b, a1.c, a1.d,
a2.a, a2.b, a2.c, a2.d,
result.a, result.b, result.c, result.d);
/* { dg-output "1 127 126 3 4 125 124 5: 5 252 250 8" } */

CHECK(a1.a == 1);
CHECK(a1.b == 127);
Expand Down
1 change: 0 additions & 1 deletion testsuite/libffi.closures/cls_19byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ cls_struct_19byte cls_struct_19byte_fn(struct cls_struct_19byte a1,
a1.a, a1.b, a1.c, a1.d, a1.e,
a2.a, a2.b, a2.c, a2.d, a2.e,
result.a, result.b, result.c, result.d, result.e);
/* { dg-output "1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */

CHECK(a1.a == 1);
CHECK(a1.b == 127);
Expand Down
3 changes: 1 addition & 2 deletions testsuite/libffi.closures/cls_20byte1.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ static cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,

printf("%d %g %g %d %g %g: %d %g %g\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c,
result.a, result.b, result.c);
/* { dg-output "1 2 3 4 5 7: 5 7 10" } */


CHECK(a1.a == 1);
CHECK(a1.b == 2);
CHECK(a1.c == 3);
Expand Down
4 changes: 2 additions & 2 deletions testsuite/libffi.closures/cls_24byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int main (void)
args_dbl[4] = NULL;

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 4: 22 15 17 25" } */
/* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
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_DOUBLE_EQ(res_dbl.a, 22);
Expand All @@ -133,7 +133,7 @@ int main (void)
cls_struct_24byte,
cls_struct_24byte))
(code))(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 4: 22 15 17 25" } */
/* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
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_DOUBLE_EQ(res_dbl.a, 22);
Expand Down
8 changes: 4 additions & 4 deletions testsuite/libffi.closures/cls_2byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1,
result.b = a1.b + a2.b;

printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);

CHECK(a1.a == 12);
CHECK(a1.b == 127);

CHECK(a2.a == 1);
CHECK(a2.b == 13);

CHECK(result.a == 13);
CHECK(result.b == 140);

return result;
}

Expand Down
3 changes: 1 addition & 2 deletions testsuite/libffi.closures/cls_3byte1.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1,
result.b = a1.b + a2.b;

printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
/* { dg-output "\n12 119 1 15: 13 134" } */

CHECK(a1.a == 12);
CHECK(a1.b == 119);
Expand Down Expand Up @@ -90,7 +89,7 @@ int main (void)
/* { dg-output "\nres: 13 134" } */
CHECK(res_dbl.a == 13);
CHECK(res_dbl.b == 134);

CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn, NULL, code) == FFI_OK);

res_dbl = ((cls_struct_3byte(*)(cls_struct_3byte, cls_struct_3byte))(code))(g_dbl, f_dbl);
Expand Down
1 change: 0 additions & 1 deletion testsuite/libffi.closures/cls_3byte2.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1,
result.b = a1.b + a2.b;

printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
/* { dg-output "\n15 125 9 19: 24 144" } */

CHECK(a1.a == 15);
CHECK(a1.b == 125);
Expand Down
3 changes: 1 addition & 2 deletions testsuite/libffi.closures/cls_3float.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ cls_struct_3float cls_struct_3float_fn(struct cls_struct_3float a1,
printf("%g %g %g %g %g %g: %g %g %g\n", a1.f, a1.g, a1.h,
a2.f, a2.g, a2.h, result.f, result.g, result.h);

/* { dg-output "1 2 3 1 2 3: 2 4 6" } */
CHECK(a1.f == 1);
CHECK(a1.g == 2);
CHECK(a1.h == 3);
Expand Down Expand Up @@ -97,7 +96,7 @@ int main (void)
CHECK(res_dbl.f == 2);
CHECK(res_dbl.g == 4);
CHECK(res_dbl.h == 6);

CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3float_gn, NULL, code) ==
FFI_OK);

Expand Down
1 change: 0 additions & 1 deletion testsuite/libffi.closures/cls_4_1byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ cls_struct_4_1byte cls_struct_4_1byte_fn(struct cls_struct_4_1byte a1,
printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
a2.a, a2.b, a2.c, a2.d,
result.a, result.b, result.c, result.d);
/* { dg-output "12 13 14 15 178 179 180 181: 190 192 194 196" } */

CHECK(a1.a == 12);
CHECK(a1.b == 13);
Expand Down
2 changes: 1 addition & 1 deletion testsuite/libffi.closures/cls_4byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int main (void)
/* { dg-output "\nres: 139 248" } */
CHECK(res_dbl.a == 139);
CHECK(res_dbl.b == 248);

CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4byte_gn, NULL, code) == FFI_OK);

res_dbl = ((cls_struct_4byte(*)(cls_struct_4byte, cls_struct_4byte))(code))(g_dbl, f_dbl);
Expand Down
3 changes: 1 addition & 2 deletions testsuite/libffi.closures/cls_5_1_byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ static cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
a1.a, a1.b, a1.c, a1.d, a1.e,
a2.a, a2.b, a2.c, a2.d, a2.e,
result.a, result.b, result.c, result.d, result.e);
/* { dg-output "\n127 120 1 3 4 12 128 9 3 4: 139 248 10 6 8" } */

CHECK(a1.a == 127);
CHECK(a1.b == 120);
Expand Down Expand Up @@ -133,6 +132,6 @@ int main (void)
CHECK(res_dbl.c == 10);
CHECK(res_dbl.d == 6);
CHECK(res_dbl.e == 8);

exit(0);
}
2 changes: 1 addition & 1 deletion testsuite/libffi.closures/cls_5byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int main (void)
CHECK(res_dbl.a == 139);
CHECK(res_dbl.b == 248);
CHECK(res_dbl.c == 10);

res_dbl.a = 0;
res_dbl.b = 0;
res_dbl.c = 0;
Expand Down
1 change: 0 additions & 1 deletion testsuite/libffi.closures/cls_6_1_byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ static cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
a2.a, a2.b, a2.c, a2.d, a2.e, a2.f,
result.a, result.b, result.c, result.d, result.e, result.f);

/* { dg-output "\n127 120 1 3 4 5 12 128 9 3 4 5: 139 248 10 6 8 10" } */
CHECK(a1.a == 127);
CHECK(a1.b == 120);
CHECK(a1.c == 1);
Expand Down
1 change: 0 additions & 1 deletion testsuite/libffi.closures/cls_7_1_byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ static cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
result.a, result.b, result.c, result.d, result.e, result.f, result.g);
/* { dg-output "\n127 120 1 3 4 5 6 12 128 9 3 4 5 6: 139 248 10 6 8 10 12" } */

CHECK(a1.a == 127);
CHECK(a1.b == 120);
Expand Down
1 change: 0 additions & 1 deletion testsuite/libffi.closures/cls_7byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
a2.a, a2.b, a2.c, a2.d,
result.a, result.b, result.c, result.d);
/* { dg-output "\n127 120 1 254 12 128 9 255: 139 248 10 509" } */

CHECK(a1.a == 127);
CHECK(a1.b == 120);
Expand Down
8 changes: 4 additions & 4 deletions testsuite/libffi.closures/cls_8byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ cls_struct_8byte cls_struct_8byte_fn(struct cls_struct_8byte a1,
result.b = a1.b + a2.b;

printf("%d %g %d %g: %d %g\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);

CHECK(a1.a == 1);
CHECK(a1.b == 2);

CHECK(a2.a == 4);
CHECK(a2.b == 5);

CHECK(result.a == 5);
CHECK(result.b == 7);

Expand Down Expand Up @@ -87,7 +87,7 @@ int main (void)
printf("res: %d %g\n", res_dbl.a, res_dbl.b);
CHECK(res_dbl.a == 5);
CHECK(res_dbl.b == 7);

/* { dg-output "\nres: 5 7" } */
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_8byte_gn, NULL, code) == FFI_OK);

Expand Down
2 changes: 1 addition & 1 deletion testsuite/libffi.closures/cls_9byte1.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,

printf("%d %g %d %g: %d %g\n", b1.a, b1.b, b2.a, b2.b,
result.a, result.b);
/* { dg-output "\n7 8 1 9: 8 17" } */

CHECK(b1.a == 7);
CHECK(b1.b == 8);

Expand Down
2 changes: 1 addition & 1 deletion testsuite/libffi.closures/cls_9byte2.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,

printf("%g %d %g %d: %g %d\n", b1.a, b1.b, b2.a, b2.b,
result.a, result.b);

CHECK(b1.a == 7);
CHECK(b1.b == 8);

Expand Down
3 changes: 1 addition & 2 deletions testsuite/libffi.closures/cls_align_double.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,

printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);

/* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
CHECK(a1.a == 12);
CHECK(a1.b == 4951);
CHECK(a1.c == 127);
Expand Down Expand Up @@ -97,7 +96,7 @@ int main (void)
CHECK(res_dbl.a == 13);
CHECK(res_dbl.b == 14271);
CHECK(res_dbl.c == 140);

CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);

res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
Expand Down
3 changes: 1 addition & 2 deletions testsuite/libffi.closures/cls_align_float.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,

printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);

/* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
CHECK(a1.a == 12);
CHECK(a1.b == 4951);
CHECK(a1.c == 127);
Expand Down Expand Up @@ -95,7 +94,7 @@ int main (void)
CHECK(res_dbl.a == 13);
CHECK(res_dbl.b == 14271);
CHECK(res_dbl.c == 140);

CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);

res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
Expand Down
2 changes: 0 additions & 2 deletions testsuite/libffi.closures/cls_align_longdouble.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,

printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);

/* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */

CHECK(a1.a == 12);
CHECK(a1.b == 4951);
CHECK(a1.c == 127);
Expand Down
11 changes: 3 additions & 8 deletions testsuite/libffi.closures/cls_align_longdouble_split.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ static cls_struct_align cls_struct_align_fn(
a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
r.a, r.b, r.c, r.d, r.e, r.f, r.g);
printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg: "
"%Lg %Lg %Lg %Lg %Lg %Lg %Lg\n",
a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
r.a, r.b, r.c, r.d, r.e, r.f, r.g);
/* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */


CHECK(a1.a == 1);
CHECK(a1.b == 2);
CHECK(a1.c == 3);
Expand Down Expand Up @@ -71,7 +66,7 @@ static cls_struct_align cls_struct_align_fn(
}

static void
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_align a1, a2;
Expand Down Expand Up @@ -148,5 +143,5 @@ int main (void)
CHECK(res_dbl.e == 17);
CHECK(res_dbl.f == 19);
CHECK(res_dbl.g == 21);
exit(0);
exit(0);
}
1 change: 0 additions & 1 deletion testsuite/libffi.closures/cls_align_pointer.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
result.a, (uintptr_t)result.b,
result.c);

/* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
CHECK(a1.a == 12);
CHECK(a1.b == (void *)4951);
CHECK(a1.c == 127);
Expand Down
5 changes: 2 additions & 3 deletions testsuite/libffi.closures/cls_align_sint16.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
result.b = a1.b + a2.b;
result.c = a1.c + a2.c;

printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
CHECK(a1.a == 12);
CHECK(a1.b == 4951);
CHECK(a1.c == 127);
Expand All @@ -34,8 +35,6 @@ static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
CHECK(result.b == 14271);
CHECK(result.c == 140);

printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);

return result;
}

Expand Down Expand Up @@ -94,7 +93,7 @@ int main (void)
CHECK(res_dbl.a == 13);
CHECK(res_dbl.b == 14271);
CHECK(res_dbl.c == 140);

CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);

res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
Expand Down
3 changes: 1 addition & 2 deletions testsuite/libffi.closures/cls_align_sint32.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
result.b = a1.b + a2.b;
result.c = a1.c + a2.c;

printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
CHECK(a1.a == 12);
CHECK(a1.b == 4951);
CHECK(a1.c == 127);
Expand All @@ -34,8 +35,6 @@ static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
CHECK(result.b == 14271);
CHECK(result.c == 140);

printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);

return result;
}

Expand Down
Loading

0 comments on commit 0e0d593

Please sign in to comment.