* tests/test-fabsf.c: Include <string.h>, minus-zero.h.
(zero): New variable.
(main): Add tests for signed zero.
* modules/fabsf-tests (Files): Add tests/minus-zero.h.
+2012-02-25 Bruno Haible <bruno@clisp.org>
+
+ fabsf tests: More tests.
+ * tests/test-fabsf.c: Include <string.h>, minus-zero.h.
+ (zero): New variable.
+ (main): Add tests for signed zero.
+ * modules/fabsf-tests (Files): Add tests/minus-zero.h.
+
2012-02-24 Bruno Haible <bruno@clisp.org>
atanl: Provide function definition on MSVC.
Files:
tests/test-fabsf.c
tests/signature.h
+tests/minus-zero.h
tests/macros.h
Depends-on:
#include "signature.h"
SIGNATURE_CHECK (fabsf, float, (float));
+#include <string.h>
+
#include "macros.h"
+#include "minus-zero.h"
volatile float x;
float y;
+float zero = 0.0f;
int
main ()
y = fabsf (x);
ASSERT (y == 0.6f);
+ /* Signed zero. */
+ x = 0.0f;
+ y = fabsf (x);
+ ASSERT (y == 0.0f);
+ ASSERT (memcmp (&y, &zero, sizeof y) == 0);
+
+ x = minus_zerof;
+ y = fabsf (x);
+ ASSERT (y == 0.0f);
+ ASSERT (memcmp (&y, &zero, sizeof y) == 0);
+
return 0;
}