2a30b8f4b2
Upstream commit: dcaf51b41e259387602774829c45222d0507f90a - elf: Change ldconfig auxcache magic number (bug 32231) - Make tst-strtod-underflow type-generic - Add crt1-2.0.o for glibc 2.0 compatibility tests - Add tests of more strtod special cases - Add more tests of strtod end pointer - Make tst-strtod2 and tst-strtod5 type-generic - powerpc64le: Build new strtod tests with long double ABI flags (bug 32145) - Do not set errno for overflowing NaN payload in strtod/nan (bug 32045) - Improve NaN payload testing - Make __strtod_internal tests type-generic - Fix strtod subnormal rounding (bug 30220) - More thoroughly test underflow / errno in tst-strtod-round - Test errno setting on strtod overflow in tst-strtod-round - Add tests of fread - stdio-common: Add new test for fdopen - libio: Attempt wide backup free only for non-legacy code - debug: Fix read error handling in pcprofiledump - elf: Fix tst-dlopen-tlsreinit1.out test dependency - elf: Avoid re-initializing already allocated TLS in dlopen (bug 31717) - elf: Clarify and invert second argument of _dl_allocate_tls_init - elf: Support recursive use of dynamic TLS in interposed malloc - nptl: Use <support/check.h> facilities in tst-setuid3 - posix: Use <support/check.h> facilities in tst-truncate and tst-truncate64 - ungetc: Fix backup buffer leak on program exit [BZ #27821] - ungetc: Fix uninitialized read when putting into unused streams [BZ #27821] - Make tst-ungetc use libsupport - stdio-common: Add test for vfscanf with matches longer than INT_MAX [BZ #27650] - support: Add FAIL test failure helper - string: strerror, strsignal cannot use buffer after dlmopen (bug 32026) - Define __libc_initial for the static libc - x86: Fix bug in strchrnul-evex512 [BZ #32078] - Adjust check-local-headers test for libaudit 4.0 - x32/cet: Support shadow stack during startup for Linux 6.10 - x86-64: Remove sysdeps/x86_64/x32/dl-machine.h - support: Add options list terminator to the test driver - manual/stdio: Further clarify putc, putwc, getc, and getwc - Fix name space violation in fortify wrappers (bug 32052) - resolv: Fix tst-resolv-short-response for older GCC (bug 32042) - Add mremap tests - mremap: Update manual entry - linux: Update the mremap C implementation [BZ #31968] - Enhanced test coverage for strncmp, wcsncmp - Enhance test coverage for strnlen, wcsnlen Resolves: RHEL-57776 Resolves: RHEL-57777 Resolves: RHEL-61392
52 lines
1.6 KiB
Diff
52 lines
1.6 KiB
Diff
commit 293e4e3c90e390fa0b839c66f388a723ac6787e2
|
|
Author: Joseph Myers <josmyers@redhat.com>
|
|
Date: Wed Aug 14 17:15:46 2024 +0000
|
|
|
|
Test errno setting on strtod overflow in tst-strtod-round
|
|
|
|
We have no tests that errno is set to ERANGE on overflow of
|
|
strtod-family functions (we do have some tests for underflow, in
|
|
tst-strtod-underflow). Add such tests to tst-strtod-round.
|
|
|
|
Tested for x86_64.
|
|
|
|
(cherry picked from commit 207d64feb26279e152c50744e3c37e68491aca99)
|
|
|
|
diff --git a/stdlib/tst-strtod-round-skeleton.c b/stdlib/tst-strtod-round-skeleton.c
|
|
index 6fba4b522862cbb9..c3cc0201d4b1a062 100644
|
|
--- a/stdlib/tst-strtod-round-skeleton.c
|
|
+++ b/stdlib/tst-strtod-round-skeleton.c
|
|
@@ -21,6 +21,7 @@
|
|
declared in the headers. */
|
|
#define _LIBC_TEST 1
|
|
#define __STDC_WANT_IEC_60559_TYPES_EXT__
|
|
+#include <errno.h>
|
|
#include <fenv.h>
|
|
#include <float.h>
|
|
#include <math.h>
|
|
@@ -205,7 +206,9 @@ struct test {
|
|
#define GEN_ONE_TEST(FSUF, FTYPE, FTOSTR, LSUF, CSUF) \
|
|
{ \
|
|
feclearexcept (FE_ALL_EXCEPT); \
|
|
+ errno = 0; \
|
|
FTYPE f = STRTO (FSUF) (s, NULL); \
|
|
+ int new_errno = errno; \
|
|
if (f != expected->FSUF \
|
|
|| (copysign ## CSUF) (1.0 ## LSUF, f) \
|
|
!= (copysign ## CSUF) (1.0 ## LSUF, expected->FSUF)) \
|
|
@@ -254,6 +257,14 @@ struct test {
|
|
printf ("ignoring this exception error\n"); \
|
|
} \
|
|
} \
|
|
+ if (overflow->FSUF && new_errno != ERANGE) \
|
|
+ { \
|
|
+ printf (FNPFXS "to" #FSUF \
|
|
+ " (" STRM ") left errno == %d," \
|
|
+ " not %d (ERANGE)\n", \
|
|
+ s, new_errno, ERANGE); \
|
|
+ result = 1; \
|
|
+ } \
|
|
} \
|
|
}
|
|
|