dprintf-posix: Check against memory leak fixed on 2009-12-15.
[gnulib.git] / tests / test-ceilf1.c
index 430e4ab..3241936 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          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 (ceilf (0.0f) == 0.0f);
-  ASSERT (ceilf (-0.0f) == 0.0f);
+  ASSERT (ceilf (-zero) == 0.0f);
   /* Positive numbers.  */
   ASSERT (ceilf (0.3f) == 1.0f);
   ASSERT (ceilf (0.7f) == 1.0f);