summaryrefslogtreecommitdiff
path: root/m4/isnanl.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2010-12-06 22:57:23 +0100
committerBruno Haible <bruno@clisp.org>2010-12-06 22:57:23 +0100
commit1f8c872f267bc608644d6de67aa5fab6285a8533 (patch)
tree58aab145b174e82cfa77e0db534061e7dab8aade /m4/isnanl.m4
parente8eabe5a3d44bcd5ca87fba668d52203192b1645 (diff)
downloadgnulib-1f8c872f267bc608644d6de67aa5fab6285a8533.tar.gz
Put more information about failed tests into the test return codes.
* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Change test program so that it returns an enumerated value (0, 1, 2, 3, 4, ...). * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Likewise. * m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise. * m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Likewise. * m4/getdelim.m4 (gl_FUNC_GETDELIM): Likewise. * m4/getline.m4 (gl_FUNC_GETLINE): Likewise. * m4/intdiv0.m4 (gt_INTDIV0): Likewise. * m4/isapipe.m4 (gl_PREREQ_ISAPIPE): Likewise. * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise. * m4/posix_spawn.m4 (gl_POSIX_SPAWN_WORKS): Likewise. * m4/putenv.m4 (gl_FUNC_PUTENV): Likewise. * m4/sleep.m4 (gl_FUNC_SLEEP): Likewise. * m4/stdint.m4 (gl_STDINT_H): Likewise. * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Change test program so that it returns a bit mask. * m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Likewise. * m4/chown.m4 (gl_FUNC_CHOWN_FOLLOWS_SYMLINK): Likewise. * m4/dup2.m4 (gl_FUNC_DUP2): Likewise. * m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Likewise. * m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Likewise. * m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Likewise. * m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Likewise. * m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Likewise. * m4/iconv.m4 (AM_ICONV_LINK): Likewise. * m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN_UTF): Likewise. * m4/isfinite.m4 (gl_ISFINITEL_WORKS): Likewise. * m4/isnanf.m4 (gl_ISNANF_WORKS): Likewise. * m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): Likewise. * m4/ldexpl.m4 (gl_FUNC_LDEXPL_WORKS): Likewise. * m4/link.m4 (gl_FUNC_LINK): Likewise. * m4/linkat.m4 (gl_FUNC_LINKAT): Likewise. * m4/mbrlen.m4 (gl_MBRLEN_RETVAL): Likewise. * m4/mbrtowc.m4 (gl_MBRTOWC_RETVAL): Likewise. * m4/mbsrtowcs.m4 (gl_MBSRTOWCS_WORKS): Likewise. * m4/memchr.m4 (gl_FUNC_MEMCHR): Likewise. * m4/memmem.m4 (gl_FUNC_MEMMEM): Likewise. * m4/mkfifo.m4 (gl_FUNC_MKFIFO): Likewise. * m4/mkstemp.m4 (gl_FUNC_MKSTEMP): Likewise. * m4/mktime.m4 (AC_FUNC_MKTIME): Likewise. * m4/open.m4 (gl_FUNC_OPEN): Likewise. * m4/poll.m4 (gl_FUNC_POLL): Likewise. * m4/popen.m4 (gl_FUNC_POPEN): Likewise. * m4/printf.m4 (gl_PRINTF_SIZES_C99, gl_PRINTF_LONG_DOUBLE, gl_PRINTF_INFINITE, gl_PRINTF_INFINITE_LONG_DOUBLE, gl_PRINTF_DIRECTIVE_A, gl_PRINTF_DIRECTIVE_F, gl_PRINTF_DIRECTIVE_LS, gl_PRINTF_PRECISION): Likewise. * m4/regex.m4 (gl_REGEX): Likewise. * m4/rename.m4 (gl_FUNC_RENAME): Likewise. * m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise. * m4/setenv.m4 (gl_FUNC_SETENV_SEPARATE): Likewise. * m4/stat.m4 (gl_FUNC_STAT): Likewise. * m4/stpncpy.m4 (gl_FUNC_STPNCPY): Likewise. * m4/strcasestr.m4 (gl_FUNC_STRCASESTR): Likewise. * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Likewise. * m4/strsignal.m4 (gl_FUNC_STRSIGNAL): Likewise. * m4/strstr.m4 (gl_FUNC_STRSTR): Likewise. * m4/strtod.m4 (gl_FUNC_STRTOD): Likewise. * m4/symlink.m4 (gl_FUNC_SYMLINK): Likewise. * m4/tsearch.m4 (gl_FUNC_TSEARCH): Likewise. * m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Likewise. * m4/unlink-busy.m4 (gl_FUNC_UNLINK_BUSY_TEXT): Likewise. * m4/unlink.m4 (gl_FUNC_UNLINK): Likewise. * m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Likewise. * m4/utimes.m4 (gl_FUNC_UTIMES): Likewise. * m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Likewise. * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Likewise. * m4/signbit.m4 (gl_SIGNBIT_TEST_PROGRAM): Likewise. (gl_FLOATTYPE_SIGN_LOCATION): Change test program so that it returns an enumerated value. * m4/acl.m4 (gl_ACL_GET_FILE): Use "if ... return 1; return 0;" style.
Diffstat (limited to 'm4/isnanl.m4')
-rw-r--r--m4/isnanl.m448
1 files changed, 26 insertions, 22 deletions
diff --git a/m4/isnanl.m4 b/m4/isnanl.m4
index de7eafb049..0f425a11db 100644
--- a/m4/isnanl.m4
+++ b/m4/isnanl.m4
@@ -1,4 +1,4 @@
-# isnanl.m4 serial 13
+# isnanl.m4 serial 14
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -151,22 +151,26 @@ static long double NaNl ()
#endif
int main ()
{
- memory_long_double m;
- unsigned int i;
+ int result = 0;
if (!isnanl (NaNl ()))
- return 1;
+ result |= 1;
- /* The isnanl function should be immune against changes in the sign bit and
- in the mantissa bits. The xor operation twiddles a bit that can only be
- a sign bit or a mantissa bit (since the exponent never extends to
- bit 31). */
- m.value = NaNl ();
- m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
- for (i = 0; i < NWORDS; i++)
- m.word[i] |= 1;
- if (!isnanl (m.value))
- return 1;
+ {
+ memory_long_double m;
+ unsigned int i;
+
+ /* The isnanl function should be immune against changes in the sign bit and
+ in the mantissa bits. The xor operation twiddles a bit that can only be
+ a sign bit or a mantissa bit (since the exponent never extends to
+ bit 31). */
+ m.value = NaNl ();
+ m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
+ for (i = 0; i < NWORDS; i++)
+ m.word[i] |= 1;
+ if (!isnanl (m.value))
+ result |= 1;
+ }
#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
/* Representation of an 80-bit 'long double' as an initializer for a sequence
@@ -185,14 +189,14 @@ int main ()
static memory_long_double x =
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
if (!isnanl (x.value))
- return 1;
+ result |= 2;
}
{
/* Signalling NaN. */
static memory_long_double x =
{ LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
if (!isnanl (x.value))
- return 1;
+ result |= 2;
}
/* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities,
Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in
@@ -205,35 +209,35 @@ int main ()
static memory_long_double x =
{ LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
if (!isnanl (x.value))
- return 1;
+ result |= 4;
}
{ /* Pseudo-Infinity. */
static memory_long_double x =
{ LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
if (!isnanl (x.value))
- return 1;
+ result |= 8;
}
{ /* Pseudo-Zero. */
static memory_long_double x =
{ LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
if (!isnanl (x.value))
- return 1;
+ result |= 16;
}
{ /* Unnormalized number. */
static memory_long_double x =
{ LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
if (!isnanl (x.value))
- return 1;
+ result |= 32;
}
{ /* Pseudo-Denormal. */
static memory_long_double x =
{ LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
if (!isnanl (x.value))
- return 1;
+ result |= 64;
}
#endif
- return 0;
+ return result;
}]])],
[gl_cv_func_isnanl_works=yes],
[gl_cv_func_isnanl_works=no],