summaryrefslogtreecommitdiff
path: root/tests/test-isnand.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-03 19:11:32 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-03 19:11:32 +0100
commit00893e79fc62966067af1a106567db96bd170338 (patch)
tree52b35cd0b42ca28e62a2ffbecade2e13dd8332cf /tests/test-isnand.h
parent26112352a774737e1ce5580c93654a26c1e82b39 (diff)
New upstream version 1.2upstream/1.2
Diffstat (limited to 'tests/test-isnand.h')
-rw-r--r--tests/test-isnand.h22
1 files changed, 4 insertions, 18 deletions
diff --git a/tests/test-isnand.h b/tests/test-isnand.h
index ef758608..5369e336 100644
--- a/tests/test-isnand.h
+++ b/tests/test-isnand.h
@@ -1,5 +1,5 @@
/* Test of isnand() substitute.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
#include "minus-zero.h"
#include "infinity.h"
#include "nan.h"
+#include "snan.h"
#include "macros.h"
int
@@ -40,24 +41,9 @@ main ()
ASSERT (!isnand (- Infinityd ()));
/* Quiet NaN. */
ASSERT (isnand (NaNd ()));
-#if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
+#if HAVE_SNAND
/* Signalling NaN. */
- {
- #define NWORDS \
- ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
- typedef union { double value; unsigned int word[NWORDS]; } memory_double;
- memory_double m;
- m.value = NaNd ();
-# if DBL_EXPBIT0_BIT > 0
- m.word[DBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (DBL_EXPBIT0_BIT - 1);
-# else
- m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-# endif
- m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- |= (unsigned int) 1 << DBL_EXPBIT0_BIT;
- ASSERT (isnand (m.value));
- }
+ ASSERT (isnand (SNaNd ()));
#endif
return 0;
}