cls_double.c: Do a check on the result.

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

	* testsuite/libffi.call/cls_double.c: Do a check on the result.
	* 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/return_sc.c: Cleanup whitespaces.

From-SVN: r73369
This commit is contained in:
Andreas Tobler 2003-11-08 19:32:16 +01:00 committed by Andreas Tobler
parent a37336cf73
commit f145ed6b90
7 changed files with 30 additions and 18 deletions

View File

@ -1,3 +1,12 @@
2003-11-08 Andreas Tobler <a.tobler@schweiz.ch>
* testsuite/libffi.call/cls_double.c: Do a check on the result.
* 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/return_sc.c: Cleanup whitespaces.
2003-11-06 Andreas Tobler <a.tobler@schweiz.ch>
* src/prep_cif.c (ffi_prep_cif): Move the validity check after

View File

@ -23,7 +23,7 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[2];
double res;
cl_arg_types[0] = &ffi_type_double;
cl_arg_types[1] = NULL;
@ -34,7 +34,8 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_double_fn, NULL) == FFI_OK);
(*((cls_ret_double)pcl))(21474.789);
res = (*((cls_ret_double)pcl))(21474.789);
/* { dg-output "21474.789000: 21474.789000" } */
CHECK(res == 21474.789000);
exit(0);
}

View File

@ -22,7 +22,7 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[2];
unsigned char res;
cl_arg_types[0] = &ffi_type_uchar;
cl_arg_types[1] = NULL;
@ -33,8 +33,8 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_uchar_fn, NULL) == FFI_OK);
(*((cls_ret_uchar)pcl))(127);
res = (*((cls_ret_uchar)pcl))(127);
/* { dg-output "127: 127" } */
CHECK(res == 127);
exit(0);
}

View File

@ -23,7 +23,7 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[2];
unsigned int res;
cl_arg_types[0] = &ffi_type_uint32;
cl_arg_types[1] = NULL;
@ -34,8 +34,8 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_uint_fn, NULL) == FFI_OK);
(*((cls_ret_uint)pcl))(2147483647);
res = (*((cls_ret_uint)pcl))(2147483647);
/* { dg-output "2147483647: 2147483647" } */
CHECK(res == 2147483647);
exit(0);
}

View File

@ -23,6 +23,7 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[2];
unsigned long long res;
cl_arg_types[0] = &ffi_type_uint64;
cl_arg_types[1] = NULL;
@ -31,10 +32,11 @@ int main (void)
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_uint64, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_ulonglong_fn, NULL) == FFI_OK);
(*((cls_ret_ulonglong)pcl))(214LL);
res = (*((cls_ret_ulonglong)pcl))(214LL);
/* { dg-output "214: 214" } */
(*((cls_ret_ulonglong)pcl))(9223372035854775808LL);
CHECK(res == 214LL);
res = (*((cls_ret_ulonglong)pcl))(9223372035854775808LL);
/* { dg-output "\n9223372035854775808: 9223372035854775808" } */
CHECK(res == 9223372035854775808LL);
exit(0);
}

View File

@ -23,7 +23,7 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[2];
unsigned short res;
cl_arg_types[0] = &ffi_type_ushort;
cl_arg_types[1] = NULL;
@ -34,8 +34,8 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_ushort_fn, NULL) == FFI_OK);
(*((cls_ret_ushort)pcl))(65535);
res = (*((cls_ret_ushort)pcl))(65535);
/* { dg-output "65535: 65535" } */
CHECK(res == 65535);
exit(0);
}

View File

@ -22,12 +22,12 @@ int main (void)
args[0] = &ffi_type_schar;
values[0] = &sc;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_schar, args) == FFI_OK);
for (sc = (signed char) -127;
for (sc = (signed char) -127;
sc < (signed char) 127; sc++)
{
ul++;