aboutsummaryrefslogtreecommitdiff
path: root/math/test-snan.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2013-03-15 17:41:11 +0100
committerThomas Schwinge <thomas@codesourcery.com>2013-03-16 13:59:52 +0100
commit6cbec759de7941016b30a5e46bdef535657ed0eb (patch)
treecb693c1feedb2b353dbf7b17c12702cb5985dbd6 /math/test-snan.c
parentaefc9b8c7c62ec25568ae9241db333436ae6860b (diff)
downloadglibc-6cbec759de7941016b30a5e46bdef535657ed0eb.tar
glibc-6cbec759de7941016b30a5e46bdef535657ed0eb.tar.gz
glibc-6cbec759de7941016b30a5e46bdef535657ed0eb.tar.bz2
glibc-6cbec759de7941016b30a5e46bdef535657ed0eb.zip
Move "-sNaN" value into a separate variable.
Diffstat (limited to 'math/test-snan.c')
-rw-r--r--math/test-snan.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/math/test-snan.c b/math/test-snan.c
index 6ec9414e79..83657eef01 100644
--- a/math/test-snan.c
+++ b/math/test-snan.c
@@ -94,6 +94,7 @@ NAME (void) \
/* A sNaN is only guaranteed to be representable in variables with */ \
/* static (or thread-local) storage duration. */ \
static volatile FLOAT sNaN_var = __builtin_nans ## SUFFIX (""); \
+ static volatile FLOAT minus_sNaN_var = -__builtin_nans ## SUFFIX (""); \
fenv_t saved_fenv; \
\
zero_var = 0.0; \
@@ -105,6 +106,7 @@ NAME (void) \
(void) &one_var; \
(void) &qNaN_var; \
(void) &sNaN_var; \
+ (void) &minus_sNaN_var; \
(void) &Inf_var; \
\
set_sigaction_FP (); \
@@ -147,7 +149,7 @@ NAME (void) \
printf (#FLOAT " isnan (-sNaN) raised SIGFPE\n"); \
errors++; \
} else { \
- check (#FLOAT " isnan (-sNaN)", isnan (-sNaN_var)); \
+ check (#FLOAT " isnan (-sNaN)", isnan (minus_sNaN_var)); \
} \
\
feclearexcept(FE_ALL_EXCEPT); \
@@ -187,7 +189,7 @@ NAME (void) \
printf (#FLOAT " isinf (-sNaN) raised SIGFPE\n"); \
errors++; \
} else { \
- check (#FLOAT " isinf (-sNaN)", !isinf (-sNaN_var)); \
+ check (#FLOAT " isinf (-sNaN)", !isinf (minus_sNaN_var)); \
} \
\
feclearexcept(FE_ALL_EXCEPT); \
@@ -227,7 +229,7 @@ NAME (void) \
printf (#FLOAT " isfinite (-sNaN) raised SIGFPE\n"); \
errors++; \
} else { \
- check (#FLOAT " isfinite (-sNaN)", !isfinite (-sNaN_var)); \
+ check (#FLOAT " isfinite (-sNaN)", !isfinite (minus_sNaN_var)); \
} \
\
feclearexcept(FE_ALL_EXCEPT); \
@@ -267,7 +269,7 @@ NAME (void) \
printf (#FLOAT " isnormal (-sNaN) raised SIGFPE\n"); \
errors++; \
} else { \
- check (#FLOAT " isnormal (-sNaN)", !isnormal (-sNaN_var)); \
+ check (#FLOAT " isnormal (-sNaN)", !isnormal (minus_sNaN_var)); \
} \
\
feclearexcept(FE_ALL_EXCEPT); \
@@ -297,7 +299,7 @@ NAME (void) \
printf (#FLOAT " fpclassify (sNaN) isnormal SIGFPE\n"); \
errors++; \
} else { \
- check (#FLOAT " fpclassify (sNaN)", (fpclassify (sNaN_var)==FP_NAN)); \
+ check (#FLOAT " fpclassify (sNaN)", fpclassify (sNaN_var) == FP_NAN); \
} \
\
feclearexcept(FE_ALL_EXCEPT); \
@@ -307,7 +309,8 @@ NAME (void) \
printf (#FLOAT " fpclassify (-sNaN) raised SIGFPE\n"); \
errors++; \
} else { \
- check (#FLOAT " fpclassify (-sNaN)", (fpclassify (-sNaN_var)==FP_NAN)); \
+ check (#FLOAT " fpclassify (-sNaN)", \
+ fpclassify (minus_sNaN_var) == FP_NAN); \
} \
\
fesetenv(&saved_fenv); /* restore saved fenv */ \