cls_double.c: Do a check on the result.
authorAndreas Tobler <a.tobler@schweiz.ch>
Sat, 8 Nov 2003 18:32:16 +0000 (19:32 +0100)
committerAndreas Tobler <andreast@gcc.gnu.org>
Sat, 8 Nov 2003 18:32:16 +0000 (19:32 +0100)
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

libffi/ChangeLog
libffi/testsuite/libffi.call/cls_double.c
libffi/testsuite/libffi.call/cls_uchar.c
libffi/testsuite/libffi.call/cls_uint.c
libffi/testsuite/libffi.call/cls_ulonglong.c
libffi/testsuite/libffi.call/cls_ushort.c
libffi/testsuite/libffi.call/return_sc.c

index 1a472aa7954d2fe0db98d31baa00f7dd95441f0b..8546b9a3555ae378c7a05cd10dd1bc96c6c3557c 100644 (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
index 76a1df7a34014351e2edb5d5d01b953ccf2ad7f2..2bfc6432f2f6c8f7084ebc17ca76274c4d1fced3 100644 (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);
 }
index 28fb1e3c232aee940ec1e6ce661a99efbd91042f..dfa4d97a9b954f0d2e5d05d1eff6ad597f58aa0a 100644 (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);
 }
index f0977ab23080c7a5dbdd010836ccd01fb0e27036..684002217ce8c12391cc1c121de2fbab90ca8c48 100644 (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);
 }
index 7c98d757fd0462f89220880f97280c1162aeaf70..8d1a74d7705b24733d95caa4b8d8f50e05d35844 100644 (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);
 }
index e3acc1529aa261cd16b213812df18e2c0a345ebc..401ff77be720ff145e1abf76f90c95e634973c2a 100644 (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);
 }
index 6f91ff6b4c595f2945a7b051e2de615e6cb560ba..e528a8467b038a2f712012e8c9bcc42b78dc5ff4 100644 (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++;