diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:09:42 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:09:42 +0000 |
commit | 7d58530341304d403a6626d7f7a1913165fe2f32 (patch) | |
tree | 471ef022d415c89ff4b5544a5e0239a9ac45d841 /misc | |
parent | ec8c29dc013a5e0ca3330ce5e4ae989e811491e6 (diff) | |
download | glibc-7d58530341304d403a6626d7f7a1913165fe2f32.zip glibc-7d58530341304d403a6626d7f7a1913165fe2f32.tar.gz glibc-7d58530341304d403a6626d7f7a1913165fe2f32.tar.bz2 |
Test for stack alignment.
Diffstat (limited to 'misc')
-rw-r--r-- | misc/qefgcvt_r.c | 12 | ||||
-rw-r--r-- | misc/tst-efgcvt.c | 7 |
2 files changed, 18 insertions, 1 deletions
diff --git a/misc/qefgcvt_r.c b/misc/qefgcvt_r.c index 66cc049..d5b2a79 100644 --- a/misc/qefgcvt_r.c +++ b/misc/qefgcvt_r.c @@ -24,6 +24,7 @@ #define FUNC_PREFIX q #define FLOAT_FMT_FLAG "L" #define FLOAT_NAME_EXT l +#define FLOAT_MIN_10_EXP LDBL_MIN_10_EXP #if LDBL_MANT_DIG == 64 # define NDIGIT_MAX 21 #elif LDBL_MANT_DIG == 53 @@ -40,5 +41,16 @@ # error "NDIGIT_MAX must be precomputed" # define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * LDBL_MANT_DIG + 1.0))) #endif +#if LDBL_MIN_10_EXP == -37 +# define FLOAT_MIN_10_NORM 1.0e-37L +#elif LDBL_MIN_10_EXP == -307 +# define FLOAT_MIN_10_NORM 1.0e-307L +#elif LDBL_MIN_10_EXP == -4931 +# define FLOAT_MIN_10_NORM 1.0e-4931L +#else +/* libc can't depend on libm. */ +# error "FLOAT_MIN_10_NORM must be precomputed" +# define FLOAT_MIN_10_NORM exp10l (LDBL_MIN_10_EXP) +#endif #include "efgcvt_r.c" diff --git a/misc/tst-efgcvt.c b/misc/tst-efgcvt.c index 91e5cf9..30ab0f1 100644 --- a/misc/tst-efgcvt.c +++ b/misc/tst-efgcvt.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,6 +20,7 @@ # define _GNU_SOURCE 1 #endif +#include <float.h> #include <math.h> #include <stdio.h> #include <stdlib.h> @@ -59,6 +60,10 @@ static testcase ecvt_tests[] = { 123.01, -4, 3, "" }, { 126.71, -4, 3, "" }, { 0.0, 4, 1, "0000" }, +#if DBL_MANT_DIG == 53 + { 0x1p-1074, 3, -323, "494" }, + { -0x1p-1074, 3, -323, "494" }, +#endif /* -1.0 is end marker. */ { -1.0, 0, 0, "" } }; |