tests: IRIX 6.2 cc can't compile -0.0 into .data
authorEric Blake <ebb9@byu.net>
Mon, 12 Jan 2009 13:52:18 +0000 (06:52 -0700)
committerEric Blake <ebb9@byu.net>
Mon, 12 Jan 2009 13:53:04 +0000 (06:53 -0700)
* tests/test-ceill.c (minus_zero): Compute -0.0L at runtime,
rather than at compile-time.
* tests/test-floorl.c (minus_zero): Likewise.
* tests/test-frexpl.c (minus_zero): Likewise.
* tests/test-isnan.c (minus_zerol): Likewise.
* tests/test-isnanl.h (minus_zero): Likewise.
* tests/test-ldexpl.c (minus_zero): Likewise.
* tests/test-roundl.c (minus_zero): Likewise.
* tests/test-signbit.c (minus_zerol): Likewise.
* tests/test-snprintf-posix.h (minus_zerol): Likewise.
* tests/test-sprintf-posix.h (minus_zerol): Likewise.
* tests/test-truncl.c (minus_zero): Likewise.
* tests/test-vasnprintf-posix.c (minus_zerol): Likewise.
* tests/test-vasprintf-posix.c (minus_zerol): Likewise.
Reported by Tom G. Christensen and Nelson H. F. Beebe.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 files changed:
ChangeLog
tests/test-ceill.c
tests/test-floorl.c
tests/test-frexpl.c
tests/test-isnan.c
tests/test-isnanl.h
tests/test-ldexpl.c
tests/test-roundl.c
tests/test-signbit.c
tests/test-snprintf-posix.h
tests/test-sprintf-posix.h
tests/test-truncl.c
tests/test-vasnprintf-posix.c
tests/test-vasprintf-posix.c

index 0c9bcfb..de933c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2009-01-12  Eric Blake  <ebb9@byu.net>
+
+       tests: IRIX 6.2 cc can't compile -0.0 into .data
+       * tests/test-ceill.c (minus_zero): Compute -0.0L at runtime,
+       rather than at compile-time.
+       * tests/test-floorl.c (minus_zero): Likewise.
+       * tests/test-frexpl.c (minus_zero): Likewise.
+       * tests/test-isnan.c (minus_zerol): Likewise.
+       * tests/test-isnanl.h (minus_zero): Likewise.
+       * tests/test-ldexpl.c (minus_zero): Likewise.
+       * tests/test-roundl.c (minus_zero): Likewise.
+       * tests/test-signbit.c (minus_zerol): Likewise.
+       * tests/test-snprintf-posix.h (minus_zerol): Likewise.
+       * tests/test-sprintf-posix.h (minus_zerol): Likewise.
+       * tests/test-truncl.c (minus_zero): Likewise.
+       * tests/test-vasnprintf-posix.c (minus_zerol): Likewise.
+       * tests/test-vasprintf-posix.c (minus_zerol): Likewise.
+       Reported by Tom G. Christensen and Nelson H. F. Beebe.
+
 2009-01-09  Paolo Bonzini  <bonzini@gnu.org>
 
        regex: fix glibc bug 9697
 2009-01-09  Paolo Bonzini  <bonzini@gnu.org>
 
        regex: fix glibc bug 9697
index 49e0c65..d1f0266 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of rounding towards positive infinity.
 /* Test of rounding towards positive infinity.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zero = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zero (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
 #else
 long double minus_zero = -0.0L;
 #endif
 #else
 long double minus_zero = -0.0L;
 #endif
index 9a8e5a8..14979e6 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of rounding towards negative infinity.
 /* Test of rounding towards negative infinity.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zero = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zero (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
 #else
 long double minus_zero = -0.0L;
 #endif
 #else
 long double minus_zero = -0.0L;
 #endif
index 91f2d67..2b968b8 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of splitting a 'long double' into fraction and mantissa.
 /* Test of splitting a 'long double' into fraction and mantissa.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zero = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zero (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
 #else
 long double minus_zero = -0.0L;
 #endif
 #else
 long double minus_zero = -0.0L;
 #endif
index b5fa112..6149017 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of isnand() substitute.
 /* Test of isnand() substitute.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -50,10 +50,16 @@ double zerod = 0.0;
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zerol (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zerol compute_minus_zerol ()
 #else
 long double minus_zerol = -0.0L;
 #endif
 #else
 long double minus_zerol = -0.0L;
 #endif
index 8567f39..37e2857 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of isnanl() substitute.
 /* Test of isnanl() substitute.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zero = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zero (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
 #else
 long double minus_zero = -0.0L;
 #endif
 #else
 long double minus_zero = -0.0L;
 #endif
index 272fc4f..395c00f 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of multiplying a 'long double' by a power of 2.
 /* Test of multiplying a 'long double' by a power of 2.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zero = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zero (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
 #else
 long double minus_zero = -0.0L;
 #endif
 #else
 long double minus_zero = -0.0L;
 #endif
index 1da3f44..51cd1cd 100644 (file)
@@ -1,9 +1,9 @@
 /* Test of rounding to nearest, breaking ties away from zero.
 /* Test of rounding to nearest, breaking ties away from zero.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
    any later version.
 
    This program is distributed in the hope that it will be useful,
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zero = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zero (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
 #else
 long double minus_zero = -0.0L;
 #endif
 #else
 long double minus_zero = -0.0L;
 #endif
index d6efe08..97f68e6 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of signbit() substitute.
 /* Test of signbit() substitute.
-   Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -49,10 +49,16 @@ long double zerol = 0.0L;
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zerol (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zerol compute_minus_zerol ()
 #else
 long double minus_zerol = -0.0L;
 #endif
 #else
 long double minus_zerol = -0.0L;
 #endif
index 09b1867..9fb2e67 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible vsnprintf() and snprintf() functions.
 /* Test of POSIX compatible vsnprintf() and snprintf() functions.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -33,10 +33,16 @@ double zerod = 0.0;
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zerol (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zerol compute_minus_zerol ()
 #else
 long double minus_zerol = -0.0L;
 #endif
 #else
 long double minus_zerol = -0.0L;
 #endif
index 5fb9250..e8b8ba8 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible vsprintf() and sprintf() functions.
 /* Test of POSIX compatible vsprintf() and sprintf() functions.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -33,10 +33,16 @@ double zerod = 0.0;
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zerol (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zerol compute_minus_zerol ()
 #else
 long double minus_zerol = -0.0L;
 #endif
 #else
 long double minus_zerol = -0.0L;
 #endif
index 4b00e35..aad677d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of rounding towards zero.
 /* Test of rounding towards zero.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zero instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zero = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zero (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
 #else
 long double minus_zero = -0.0L;
 #endif
 #else
 long double minus_zero = -0.0L;
 #endif
index bf12548..07c173e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible vasnprintf() and asnprintf() functions.
 /* Test of POSIX compatible vasnprintf() and asnprintf() functions.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -58,10 +58,16 @@ double zerod = 0.0;
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zerol (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zerol compute_minus_zerol ()
 #else
 long double minus_zerol = -0.0L;
 #endif
 #else
 long double minus_zerol = -0.0L;
 #endif
index 2f287fc..5f471b4 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible vasprintf() and asprintf() functions.
 /* Test of POSIX compatible vasprintf() and asprintf() functions.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -57,10 +57,16 @@ double zerod = 0.0;
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use minus_zerol instead.
+   IRIX cc can't put -0.0L into .data, but can compute at runtime.
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
    Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
    platforms, such as when cross-compiling to PowerPC on MacOS X 10.5.  */
 #if defined __hpux || defined __sgi
-long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+static long double
+compute_minus_zerol (void)
+{
+  return -LDBL_MIN * LDBL_MIN;
+}
+# define minus_zerol compute_minus_zerol ()
 #else
 long double minus_zerol = -0.0L;
 #endif
 #else
 long double minus_zerol = -0.0L;
 #endif