diff options
author | Hood Chatham <hood@mit.edu> | 2021-07-16 14:33:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 10:33:04 -0400 |
commit | eb2447249540ca568b0b464f6107501dcc0f65ab (patch) | |
tree | c0a1a6a7e4c73ab28a8c06a453bd2b6cff0392da /testsuite/libffi.closures/cls_6byte.c | |
parent | a541fc600f4418441f91073a0834ea47b0989de9 (diff) | |
download | libffi-eb2447249540ca568b0b464f6107501dcc0f65ab.tar.gz |
Use CHECK to assert more things in test suite (#654)
* Use CHECK to assert more things in test suite
* Use snprintf instead of sprintf
* Fix va_struct1 and va_struct3
Diffstat (limited to 'testsuite/libffi.closures/cls_6byte.c')
-rw-r--r-- | testsuite/libffi.closures/cls_6byte.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/testsuite/libffi.closures/cls_6byte.c b/testsuite/libffi.closures/cls_6byte.c index e89c73c..a8e3ea0 100644 --- a/testsuite/libffi.closures/cls_6byte.c +++ b/testsuite/libffi.closures/cls_6byte.c @@ -30,6 +30,21 @@ static cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1, a2.a, a2.b, a2.c, a2.d, result.a, result.b, result.c, result.d); + CHECK(a1.a == 127); + CHECK(a1.b == 120); + CHECK(a1.c == 1); + CHECK(a1.d == 128); + + CHECK(a2.a == 12); + CHECK(a2.b == 128); + CHECK(a2.c == 9); + CHECK(a2.d == 127); + + CHECK(result.a == 139); + CHECK(result.b == 248); + CHECK(result.c == 10); + CHECK(result.d == 255); + return result; } @@ -86,6 +101,10 @@ int main (void) /* { dg-output "127 120 1 128 12 128 9 127: 139 248 10 255" } */ 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(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); + CHECK(res_dbl.d == 255); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_6byte_gn, NULL, code) == FFI_OK); @@ -93,7 +112,10 @@ int main (void) /* { dg-output "\n127 120 1 128 12 128 9 127: 139 248 10 255" } */ 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(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); + CHECK(res_dbl.d == 255); exit(0); } |