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]

Re: [patch] execute/20031003-1.c: Enable only when INT_MAX >=2147483647.


Hi Roger,

> > Attached is a patch to enable execute/20031003-1.c only when INT_MAX
> > >= 2147483647.  The value of sizeof (int) on h8300 port can either be
> > 2 or 4.  If it is 2, then the test case does not work.
> >
> > Tested on h8300 port.  OK to apply?
> 
> Ok, provided that the test is changed to be INT_MAX == 2147483647.
> The first test will also fail if "int" is wider than 4 bytes.

Attached is the final patch that I committed.

Kazu Hirata

2003-10-16  Kazu Hirata  <kazu@cs.umass.edu>

	* gcc.c-torture/execute/20031003-1.c: Enable only when INT_MAX
	== 2147483647.

Index: 20031003-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/20031003-1.c,v
retrieving revision 1.2
diff -u -r1.2 20031003-1.c
--- 20031003-1.c	14 Oct 2003 13:31:27 -0000	1.2
+++ 20031003-1.c	16 Oct 2003 10:56:23 -0000
@@ -1,5 +1,7 @@
 /* PR optimization/9325  */
 
+#include <limits.h>
+
 extern void abort (void);
 
 int f1()
@@ -14,10 +16,12 @@
 
 int main()
 {
+#if INT_MAX == 2147483647
   if (f1() != 2147483647)
     abort ();
   if (f2() != 2147483647)
     abort ();
+#endif
   return 0;
 }
 


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