X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-roundf1.c;h=159762ee06b8c8bc940adca78645c38d03901373;hb=2b08e890726e2c572d2ba64f19bece957d1bfd98;hp=8131cb2aaa643a36102ded34f0a8ce755bca171f;hpb=0a56509612c0b43a3f05361ecfb73b8b39f8e66c;p=gnulib.git diff --git a/tests/test-roundf1.c b/tests/test-roundf1.c index 8131cb2aa..159762ee0 100644 --- a/tests/test-roundf1.c +++ b/tests/test-roundf1.c @@ -25,7 +25,7 @@ #include #include -#include "isnanf.h" +#include "isnanf-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.0f. + So we use -zero instead. */ +float zero = 0.0f; + int main () { /* Zero. */ ASSERT (roundf (0.0f) == 0.0f); - ASSERT (roundf (-0.0f) == 0.0f); + ASSERT (roundf (-zero) == 0.0f); /* Positive numbers. */ ASSERT (roundf (0.3f) == 0.0f); ASSERT (roundf (0.5f) == 1.0f);