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]

PATCH: problem for 16 bit 'int' types.



For a machine with 'int' as a 16 bit type, the test
gcc.c-torture/execute/920730-1.c fails because it assumes that
ints are 32 bits.

By using limits.h, we can make this test more portable.

ChangeLog

2001-01-09  Alan Lehotsky  <lehotsky@tiac.net>

	* execute/920730-1.c: Use values from <limits.h> to parameterize.


Index: 920730-1.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/gcc.c-torture/execute/920730-1.c,v
retrieving revision 1.2
diff -c -p -d -r1.2 920730-1.c
*** 920730-1.c  2000/07/11 21:12:40     1.2
--- 920730-1.c  2001/01/09 14:30:18
***************
*** 1,27 ****
  /* 920730-1.c */
! 
  f1()
  {
!       int b=0x80000000;
!       return b>=0x80000000;
  }
  
  f2()
  {
!       int b=0x80000001;
!       return b>=0x80000001;
  }
  
  f3()
  {
!       int b=0x7fffffff;
!       return b>=0x7fffffff;
  }
  
  f4()
  {
!       int b=0xffffffff;
!       return b>=0xffffffff;
  }
  
  main ()
--- 1,27 ----
  /* 920730-1.c */
! #include <limits.h>
  f1()
  {
!       int b=INT_MIN;
!       return b>=INT_MIN;
  }
  
  f2()
  {
!       int b=INT_MIN+1;
!       return b>= (INT_MIN+1);
  }
  
  f3()
  {
!       int b=INT_MAX;
!       return b>=INT_MAX;
  }
  
  f4()
  {
!       int b=-1;
!       return b>=-1;
  }
  
  main ()

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