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]

Adjust ieee/20000320-1.x


While comparing testsuite failures for powerpc-eabi and powerpc-linux
I noticed that 20000320-1.c was passing on Linux when I expected it to
fail.  It turns out the test was getting stubbed out, because it uses
ULONG_LONG_MAX in a cpp directive, and:

#  if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
/* Minimum and maximum values a `signed long long int' can hold.  */
#    undef LONG_LONG_MIN
#    define LONG_LONG_MIN (-LONG_LONG_MAX-1)
#    undef LONG_LONG_MAX
#    define LONG_LONG_MAX __LONG_LONG_MAX__

/* Maximum value an `unsigned long long int' can hold.  (Minimum is 0).  */
#    undef ULONG_LONG_MAX
#    define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
#   endif

That's from newlib, but GCC's glimits.h has substantially the same
text.  There's a different condition for ULLONG_MAX, and it's
available with -std=c99 for gcc, glibc, and newlib, so it seemed like
the best choice to use that.  OK?

-- 
Daniel Jacobowitz
CodeSourcery

2007-03-26  Daniel Jacobowitz  <dan@codesourcery.com>

	gcc/testsuite/
	* gcc.c-torture/execute/ieee/20000320-1.c: Use ULLONG_MAX.
	* gcc.c-torture/execute/ieee/20000320-1.x: New file.

Index: gcc.c-torture/execute/ieee/20000320-1.c
===================================================================
--- gcc.c-torture/execute/ieee/20000320-1.c	(revision 166840)
+++ gcc.c-torture/execute/ieee/20000320-1.c	(working copy)
@@ -2,7 +2,7 @@
 #include <sys/fpu.h>
 #endif /* defined(__mips__) && defined(__sgi__) */
 #include <limits.h>
-#if UINT_MAX != 4294967295u || (ULONG_LONG_MAX != 18446744073709551615ull && ULONG_MAX != 18446744073709551615ull)
+#if UINT_MAX != 4294967295u || (ULLONG_MAX != 18446744073709551615ull && ULONG_MAX != 18446744073709551615ull)
 int main(void) { exit (0); }
 #else
 #if ULONG_MAX != 18446744073709551615ull
Index: gcc.c-torture/execute/ieee/20000320-1.x
===================================================================
--- gcc.c-torture/execute/ieee/20000320-1.x	(revision 0)
+++ gcc.c-torture/execute/ieee/20000320-1.x	(revision 0)
@@ -0,0 +1,3 @@
+# Make sure ULLONG_MAX is available.
+set additional_flags "-std=c99"
+return 0


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