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 installed to fix gcc.dg/wtr-int-type-1.c for 64-bit systems


While reviewing some testresults logs on our website, I happened to
notice that my wtr-int-type-1.c test was failing on alpha systems.
(Basically, the test wasn't written correctly for 64-bit platforms.)

Since I no longer can test on alphas, this was as good a time as any
to start automatically passing -mabi=64/-m64 to the RUNTESTFLAGS in my
irix6/solaris2 tests which should catch these goofs in the future.

Anyway, I installed the following patch which I think solves the
problem so that it passes on either 32 or 64 bit systems.

BTW, do we have to worry about >64 ?

		--Kaveh



Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/ChangeLog,v
retrieving revision 1.697
diff -u -p -r1.697 ChangeLog
--- ChangeLog	2000/09/04 11:18:26	1.697
+++ ChangeLog	2000/09/05 15:51:27
@@ -1,3 +1,7 @@
+2000-09-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* gcc.dg/wtr-int-type-1.c: Fix for 64-bit platforms.
+
 2000-09-04  Nathan Sidwell  <nathan@codesourcery.com>
 
 	* g++.old-deja/g++.pt/crash57.C: New test.
Index: gcc.dg/wtr-int-type-1.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/gcc.dg/wtr-int-type-1.c,v
retrieving revision 1.1
diff -u -p -r1.1 wtr-int-type-1.c
--- wtr-int-type-1.c	2000/08/23 16:13:47	1.1
+++ wtr-int-type-1.c	2000/09/05 15:51:27
@@ -9,16 +9,37 @@ testfunc (void)
 {
   long long i;
   
+  /* Octal and hex values shouldn't issue -Wtraditional warnings. */
   i = 0x80000000;
+  i = 0xFFFFFFFF;
+  i = 037777777777;
+
   i = 0x8000000000000000;
-  i = 9223372036854775807; /* { dg-warning "integer constant.*with -traditional" "integer constant" } */
-  i = 4294967295; /* { dg-warning "decimal constant|integer constant.*with -traditional" "integer constant" } */
+  i = 0xFFFFFFFFFFFFFFFF;
+  i = 01777777777777777777777;
+
+  /* We expect to get either a "width of integer constant changes with
+     -traditional" warning or an "integer constant is unsigned in ISO
+     C, signed with -traditional" warning depending on whether we are
+     testing on a 32 or 64 bit platform.  Either warning means the
+     test passes and both matched by checking for "integer constant".  */
+  i = 18446744073709551615; /* { dg-warning "integer constant" "integer constant" } */
   
-#line 18 "sys-header.h" 3
+#line 29 "sys-header.h" 3
 /* We are in system headers now, no -Wtraditional warnings should issue.  */
 
   i = 0x80000000;
+  i = 0xFFFFFFFF;
+  i = 037777777777;
+  
   i = 0x8000000000000000;
+  i = 0xFFFFFFFFFFFFFFFF;
+  i = 01777777777777777777777;
+  
   i = 9223372036854775807;
-  i = 4294967295; /* { dg-warning "decimal constant" "decimal constant" } */
+  i = 18446744073709551615;
 }
+
+/* Ignore "decimal constant is so large that it is unsigned" warnings.  */
+/* { dg-warning "decimal constant" "decimal constant" { target *-*-* } 26 } */
+/* { dg-warning "decimal constant" "decimal constant" { target *-*-* } 40 } */

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