X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-trunc1.c;h=b9e8a3c88a539febd729017db76940d408cc00ad;hb=35600a9a833bc287a025214c9601574e4a8115d7;hp=7f1bd103792b77350544aa1d79cb05664dbfe632;hpb=0a56509612c0b43a3f05361ecfb73b8b39f8e66c;p=gnulib.git diff --git a/tests/test-trunc1.c b/tests/test-trunc1.c index 7f1bd1037..b9e8a3c88 100644 --- a/tests/test-trunc1.c +++ b/tests/test-trunc1.c @@ -23,7 +23,7 @@ #include #include -#include "isnand.h" +#include "isnand-nolibm.h" #include "nan.h" #define ASSERT(expr) \ @@ -32,17 +32,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 (trunc (0.0) == 0.0); - ASSERT (trunc (-0.0) == 0.0); + ASSERT (trunc (-zero) == 0.0); /* Positive numbers. */ ASSERT (trunc (0.3) == 0.0); ASSERT (trunc (0.7) == 0.0);