This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

S/390: Fix bug in libffi test case


Hello,

this fixes a libffi test suite failure on s390x caused by a test case 
bug in libffi.call/cls_uint.c.  The closure routine should return
its return value via an ffi_arg *, not an unsigned int *; note that
all the other similar test cases get this right.

The bug can show up only on big-endian 64-bit targets (like s390x).

Tested on s390-ibm-linux and s390x-ibm-linux; applied to 3.4 branch
and CVS head.

Bye,
Ulrich

ChangeLog:

	* testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Treat result
	value as of type ffi_arg, not unsigned int.


Index: libffi/testsuite/libffi.call/cls_uint.c
===================================================================
RCS file: /cvs/gcc/gcc/libffi/testsuite/libffi.call/cls_uint.c,v
retrieving revision 1.5
diff -c -p -r1.5 cls_uint.c
*** libffi/testsuite/libffi.call/cls_uint.c	21 Nov 2003 11:24:09 -0000	1.5
--- libffi/testsuite/libffi.call/cls_uint.c	22 Jan 2004 22:22:28 -0000
***************
*** 10,19 ****
  static void cls_ret_uint_fn(ffi_cif* cif,void* resp,void** args,
  			     void* userdata)
   {
!    *(unsigned int*)resp = *(unsigned int *)args[0];
  
     printf("%d: %d\n",*(unsigned int *)args[0],
! 	  *(unsigned int *)resp);
   }
  typedef unsigned int (*cls_ret_uint)(unsigned int);
  
--- 10,19 ----
  static void cls_ret_uint_fn(ffi_cif* cif,void* resp,void** args,
  			     void* userdata)
   {
!    *(ffi_arg *)resp = *(unsigned int *)args[0];
  
     printf("%d: %d\n",*(unsigned int *)args[0],
! 	  *(ffi_arg *)resp);
   }
  typedef unsigned int (*cls_ret_uint)(unsigned int);
  
-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]