summaryrefslogtreecommitdiffstats
path: root/tools/regression/lib/msun/test-fmaxmin.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2013-06-02 04:30:03 +0000
committerdas <das@FreeBSD.org>2013-06-02 04:30:03 +0000
commitc13ee16ab4b2ed670be4b050ae59d428dab4196f (patch)
tree9dcbcaa240ab78a1929ca23098781c6fb4b09726 /tools/regression/lib/msun/test-fmaxmin.c
parent44ec97062dafc83b639c425da20387c8c7fb2d8b (diff)
downloadFreeBSD-src-c13ee16ab4b2ed670be4b050ae59d428dab4196f.zip
FreeBSD-src-c13ee16ab4b2ed670be4b050ae59d428dab4196f.tar.gz
Factor out some common code from the libm tests. This is a bit messy
because different tests have different ideas about what it means to be "close enough" to the right answer, depending on the properties of the function being tested. In the process, I fixed some warnings and added a few more 'volatile' hacks, which are sufficient to make all the tests pass at -O2 with clang.
Diffstat (limited to 'tools/regression/lib/msun/test-fmaxmin.c')
-rw-r--r--tools/regression/lib/msun/test-fmaxmin.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/tools/regression/lib/msun/test-fmaxmin.c b/tools/regression/lib/msun/test-fmaxmin.c
index fdba529..7ddcc87 100644
--- a/tools/regression/lib/msun/test-fmaxmin.c
+++ b/tools/regression/lib/msun/test-fmaxmin.c
@@ -36,25 +36,11 @@ __FBSDID("$FreeBSD$");
#include <math.h>
#include <stdio.h>
-#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \
- FE_OVERFLOW | FE_UNDERFLOW)
+#include "test-utils.h"
#pragma STDC FENV_ACCESS ON
/*
- * Test for equality with two special rules:
- * fpequal(NaN, NaN) is true
- * fpequal(+0.0, -0.0) is false
- */
-static inline int
-fpequal(long double x, long double y)
-{
-
- return ((x == y && !signbit(x) == !signbit(y))
- || (isnan(x) && isnan(y)));
-}
-
-/*
* Test whether func(x, y) has the expected result, and make sure no
* exceptions are raised.
*/
OpenPOWER on IntegriCloud