* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73369
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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;
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);
}
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;
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);
}
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;
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);
}
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;
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);
}
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;
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);
}
args[0] = &ffi_type_schar;
values[0] = ≻
-
+
/* 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++;