summaryrefslogtreecommitdiff
path: root/libc/test/src/stdlib/strtold_test.cpp
AgeCommit message (Collapse)Author
2025-06-17Fix/reapply "[libc] Migrate stdio tests to ErrnoCheckingTest. (#144134)Alexey Samsonov
This reverts commit 92a116c4ef822950f8c57eaa5164c844c73a1f7e with a fix for fgets test - convert nullptr to fgets return type (char*), since the matcher is pedantic.
2025-06-13Revert "Fix/reapply "[libc] Migrate stdio tests to ErrnoCheckingTest."" ↵Alexey Samsonov
(#144129) Reverts llvm/llvm-project#143972 - matcher seems to be pedantic for fgets tests, reverting to verify and fix.
2025-06-13Fix/reapply "[libc] Migrate stdio tests to ErrnoCheckingTest." (#143972)Alexey Samsonov
This reverts commit a93e55e57ed00a55f822c64e3520c7c732b58480 and fixes build and test failures: * Proper include added to setvbuf_test.cpp * fgetc/fgetc_unlocked/fgets tests are ported to ErrnoSetterMatcher and are made more precise. This fixes inconsistencies between expectations in regular and GPU builds - ErrnoSetterMatcher is configured to omit errno matching on GPUs, as fgetc implementation on GPU doesn't set errno, in contrast to Linux.
2025-06-11Revert "[libc] Migrate stdio tests to ErrnoCheckingTest." (#143829)Alexey Samsonov
Reverts llvm/llvm-project#143802. Follow-up fix 3c7af175e51c3ab08ac3c442146c2b822f38c01e wasn't robust enough and itself got reverted.
2025-06-11[libc] Migrate stdio tests to ErrnoCheckingTest. (#143802)Alexey Samsonov
Reduce the direct use of libc_errno in stdio unit tests by adopting ErrnoCheckingTest where appropriate. Also removes the libc_errno.h inclusions from stdlib.h tests that were accidentally added in d87eea35fac5a34a841c637db8908128409a184e
2025-06-11[libc] Move libc_errno.h to libc/src/__support and make ↵lntue
LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187) This is the first step in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-06-11[libc] Reduce direct use of errno in src/stdlib and src/__support tests. ↵Alexey Samsonov
(#143767) * Get rid of libc_errno assignments in str_to_* __support tests, since those API have been migrated to return error in a struct instead. * Migrate tests for atof and to strto* functions from <stdlib.h> and for strdup from <string.h> to use ErrnoCheckingTest harness.
2024-11-12[libc][i386] FPBit support for 96b long double (#115084)Nick Desaulniers
`long double` is haunted on most architectures, but it is especially so on i386-linux-gnu. While have 80b of significant data, on i386-linux-gnu this type has 96b of storage. Fixes for supporting printf family of conversions for `long double` on i386-linux-gnu. This allows the libc-stdlib-tests and libc_stdio_unittests ninja target tests to pass on i386-linux-gnu. Fixes: #110894 Link: #93709 Co-authored-by: Michael Jones <michaelrj@google.com>
2024-04-06[libc][NFC] Rename `UInt.h` to `big_int.h` and `UInt128.h` to `uint128.h` ↵Guillaume Chatelet
for consistency (#87808)
2024-03-04[libc][NFC] Rename `LIBC_LONG_DOUBLE_IS_` macros (#83399)Guillaume Chatelet
Umbrella bug #83182
2024-02-06[libc] Move libc_errno inside of LIBC_NAMESPACE (#80774)michaelrj-google
Having libc_errno outside of the namespace causes versioning issues when trying to link the tests against LLVM-libc. Most of this patch is just moving libc_errno inside the namespace in tests. This isn't necessary in the function implementations since those are already inside the namespace.
2024-01-26[libc][NFC] Use specific ASSERT macros to test errno (#79573)Guillaume Chatelet
This patch provides specific test macros to deal with `errno`. This will help abstract away the differences between unit test and integration/hermetic tests in #79319. In one case we use `libc_errno` which is a struct, in the other case we deal directly with `errno`.
2024-01-24[libc] Add C23 limits.h header. (#78887)lntue
2024-01-18[libc][NFC] Introduce a Sign type for FPBits (#78500)Guillaume Chatelet
Another patch is needed to cover `DyadicFloat` and `NormalFloat` constructors.
2024-01-04[libc][NFC] Simplify `FPBits` (#76835)Guillaume Chatelet
This patch reduces the scope of `FPBits` exported variables and functions. It also moves storage up into `FPRep` and tries to make the default and specialized versions of `FPBits` more uniform. The next step is to move the specialization from `FPBits` to `FPRep` so we can manipulate floating point representations through `FPType` alone - that is - independently from the host architecture.
2023-12-01[libc][NFC] Rename SPECIAL_X86_LONG_DOUBLE in ↵Guillaume Chatelet
LIBC_LONG_DOUBLE_IS_X86_FLOAT80 (#73950)
2023-12-01[libc][NFC] rename LONG_DOUBLE_IS_DOUBLE into LIBC_LONG_DOUBLE_IS_FLOAT64 ↵Guillaume Chatelet
(#73948)
2023-09-26[libc] Mass replace enclosing namespace (#67032)Guillaume Chatelet
This is step 4 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
2023-05-22[libc] Use MPFR for strtofloat fuzzingMichael Jones
The previous string to float tests didn't check correctness, but due to the atof differential test proving unreliable the strtofloat fuzz test has been changed to use MPFR for correctness checking. Some minor bugs have been found and fixed as well. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D150905
2023-03-03[libc] move stdlib and stdio to new errno patternMichael Jones
Fixes https://github.com/llvm/llvm-project/issues/61071 Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D145191
2023-02-07[libc][NFC] Move UnitTest and IntegrationTest to the 'test' directory.Siva Chandra Reddy
This part of the effort to make all test related pieces into the `test` directory. This helps is excluding test related pieces in a straight forward manner if LLVM_INCLUDE_TESTS is OFF. Future patches will also move the MPFR wrapper and testutils into the 'test' directory.
2022-08-25[NFC][libc] Move Uint implementation to parent directoryGuillaume Chatelet
Differential Revision: https://reviews.llvm.org/D132638
2022-06-24[libc] Add Uint128 type as a fallback when __uint128_t is not available.Siva Chandra Reddy
Also, the unused specializations of __int128_t have been removed. Differential Revision: https://reviews.llvm.org/D128304
2022-05-03[libc] fix strtold tests on 32 bit systemsMichael Jones
This patch fixes the string to long double tests for systems that use long double is double, and don't support uint128. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D124803
2022-04-28[libc] Support 32-bit ARM platform testsDominic Chen
Set LONG_DOUBLE_IS_DOUBLE, add ifdefs for 128-bit integer types Differential Revision: https://reviews.llvm.org/D124204
2022-03-10[libc] Initial support for darwin-aarch64.Tue Ly
Add initial support for darwin-aarch64 (macOS M1). Some differences compared to linux-aarch64: - `math.h` defined `math_errhandling` by the compiler builtin `__math_errhandling()` but Apple Clang 13.0.0 on M1 does not support `__math_errhandling()` builtin as a macro function or a constexpr function. - `math.h` defines `UNDERFLOW` and `OVERFLOW` macros. - Besides 5 usual floating point exceptions: `FE_INEXACT`, `FE_UNDERFLOW`, `FE_OVERFLOW`, `FE_DIVBYZERO`, and `FE_INVALID`, `fenv.h` also has another floating point exception: `FE_FLUSHTOZERO`. The corresponding trap for `FE_FLUSHTOZERO` in the control register is at the different location compared to the status register. - `FE_FLUSHTOZERO` exception flag cannot be raised with the default CPU floating point operation mode. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D120914
2022-01-12[libc] fix strtold_test formatting on ARMMichael Jones
I missed a variable when reformatting the tests. This fixes that. Differential Revision: https://reviews.llvm.org/D117161
2022-01-12[libc] add working ARM entrypointsMichael Jones
Some functions were added to x86_64 that were untested on Aarch64. Now that I've had an opportunity to test them, they all work on Aarch64 with the minor formatting change included. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D117146
2021-12-22[libc] apply formatting to testsMichael Jones
Apply the formatting rules that were applied to the libc/src directory to the libc/test directory, as well as the files in libc/utils that are included by the tests. This does not include automated enforcement. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D116127
2021-12-13[libc] add basic strtold implementationMichael Jones
Due to the differences between the types of long double, this function is effectively three functions in one. This patch adds basic support for the types of long double, although it's just using the fast path and the fallback for the moment. I still need to implement a version of Eisel-Lemire for performance, but the existing algorithms should be correct. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D113710