X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-round1.c;h=0f2ed94af0ad620d6b86afaba84947e655122b40;hb=2464bbfa7a6b82eca7bf3f7d517515ed462f1b23;hp=2710f911f5190efd6a25b8d4a3eea5f78473a7fe;hpb=0a56509612c0b43a3f05361ecfb73b8b39f8e66c;p=gnulib.git diff --git a/tests/test-round1.c b/tests/test-round1.c index 2710f911f..0f2ed94af 100644 --- a/tests/test-round1.c +++ b/tests/test-round1.c @@ -25,7 +25,7 @@ #include #include -#include "isnand.h" +#include "isnand-nolibm.h" #include "nan.h" #define ASSERT(expr) \ @@ -34,17 +34,22 @@ if (!(expr)) \ { \ fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ abort (); \ } \ } \ while (0) +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + So we use -zero instead. */ +double zero = 0.0; + int main () { /* Zero. */ ASSERT (round (0.0) == 0.0); - ASSERT (round (-0.0) == 0.0); + ASSERT (round (-zero) == 0.0); /* Positive numbers. */ ASSERT (round (0.3) == 0.0); ASSERT (round (0.5) == 1.0);