summaryrefslogtreecommitdiff
path: root/libc/test/src/fenv/enabled_exceptions_test.cpp
AgeCommit message (Collapse)Author
2024-04-23[libc] Make fenv and math tests preserve fenv_t state (#89658)Roland McGrath
This adds a new test fixture class FEnvSafeTest (usable as a base class for other fixtures) that ensures each test doesn't perturb the `fenv_t` state that the next test will start with. It also provides types and methods tests can use to explicitly wrap code under test either to check that it doesn't perturb the state or to save and restore the state around particular test code. All the fenv and math tests are updated to use this so that none can affect another. Expectations that code under test and/or tests themselves don't perturb state can be added later.
2024-04-09[libc] Add proxy header for fenv.h macro constants. #87863 (#87896)Job Henandez Lara
Hello, this addresses #87863.
2023-09-26[libc] Start to refactor riscv platform abstraction to support both 32 and ↵Mikhail R. Gadelha
64 bits versions This patch enables the compilation of libc for rv32 by unifying the current rv64 and rv32 implementation into a single rv implementation. We updated the cmake file to match the new riscv32 arch and force LIBC_TARGET_ARCHITECTURE to be "riscv" whenever we find "riscv32" or "riscv64". This is required as LIBC_TARGET_ARCHITECTURE is used in the path for several platform specific implementations. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D148797
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-03-08[libc] Add riscv64 fenv implementation and enable the fenv.h functions.Siva Chandra
Reviewed By: mikhail.ramalho Differential Revision: https://reviews.llvm.org/D145560
2023-03-06[libc] Add arm 32 FEnvImpl.Siva Chandra Reddy
Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D145347
2023-02-09[libc][NFC] Move architectures.h to properties subfolderGuillaume Chatelet
2023-02-07[libc][NFC] Rename macrosGuillaume Chatelet
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.
2023-02-07[libc][NFC] Rename architecture macros and move to macros folderGuillaume Chatelet
2022-03-04[libc] Remove the redundant header FPUtil/FEnvUtils.hTue Ly
Remove the redundant header FPUtil/FEnvUtils.h, use FPUtil/FEnvImpl.h header instead. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D120965
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-07[libc] apply new lint rulesMichael Jones
This patch applies the lint rules described in the previous patch. There was also a significant amount of effort put into manually fixing things, since all of the templated functions, or structs defined in /spec, were not updated and had to be handled manually. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D114302
2021-11-02[libc] Add more robust compile time architecture detectionGuillaume Chatelet
We may want to restrict the detected platforms to only `x86_64` and `aarch64`. There are still custom detection in api.td but I don't think we can handle these: - config/linux/api.td:205 - config/linux/api.td:199 Differential Revision: https://reviews.llvm.org/D112818
2021-10-29Revert "[libc] Add more robust compile time architecture detection"Guillaume Chatelet
This reverts commit a72e2499865b55cb007b63673100c06cc85faf97.
2021-10-29[libc] Add more robust compile time architecture detectionGuillaume Chatelet
We may want to restrict the detected platforms to only `x86_64` and `aarch64`. There are still custom detection in api.td but I don't think we can handle these: - config/linux/api.td:205 - config/linux/api.td:199 Differential Revision: https://reviews.llvm.org/D112818
2021-10-29[libc][NFC] Move test related pieces from FPUtil to util/UnitTest.Siva Chandra Reddy
Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D112673
2021-09-09[libc] Skip fenv exception tests on aarch64 if HW doesn't support exceptions.Siva Chandra Reddy
Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D109538
2021-08-06[libc][nfc] move ctype_utils and FPUtils to __supportMichael Jones
Some ctype functions are called from other libc functions (e.g. isspace is used in atoi). By moving ctype_utils.h to __support it becomes easier to include just the implementations of these functions. For these reasons the implementation for isspace was moved into ctype_utils as well. FPUtils was moved to simplify the build order, and to clarify which files are a part of the actual libc. Many files were modified to accomodate these changes, mostly changing the #include paths. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D107600
2021-07-30[libc] Move FPExceptMatcher out of TestHelpers.hSiva Chandra Reddy
TestHelpers.h pulls few pieces from LLVM libc's unittest framework which aren't available on platforms like Fuchsia which use their own unittest framework. So, by moving FPExceptMatcher to a different file we can exclude LLVM libc specific pieces in a cleaner way. In a later pass, it might make more sense to rename TestHelpers.h also to FPMatcher.h. That way, we can make macros like EXPECT_FP_EQ to be equivalent to EXPECT_EQ on platforms like Fuchsia. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D107129
2021-07-23[libc] Accommodate Fuchsia's death test framework in fenv tests.Siva Chandra Reddy
Fuchsia's death test framework runs the closure which can die in a different thread. Hence, the FP exceptions which cause the closure to die should be enalbed in the closure. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D106683
2021-07-22[libc] Rename FEnv.h and refactor subsequent filesHedin Garca
Because Windows's pathnames are not case sensitive, to avoid include conflicts between our header file FEnv.h and the one from the C Standard library, <fenv.h>, the prior file was renamed. The motive for the relabel came to fix this include error in TestHelpers.cpp since a conflict arose with a file in the same directory when #include <fenv.h> was being used. Reviewed By: sivachandra, aeubanks Differential Revision: https://reviews.llvm.org/D106470
2021-07-21[libc][NFC] Adjust enabled_exceptions_test wrt FE_INEXACT.Siva Chandra Reddy
Since exceptions like FE_DIVBYZERO can raise FE_INEXACT, we need to ensure that we don't raise FE_DIVBYZERO (or others which can also raise FE_INEXACT) when FE_INEXACT is enabled.
2021-07-21[libc] Add a new test matcher for tests raising floating point exceptions.Siva Chandra Reddy
This new matcher does not use death tests to check if SIGFPE is raised. Instead, that a SIGFPE was raised is checked using a SIGFPE signal handler. Reviewed By: mcgrathr Differential Revision: https://reviews.llvm.org/D106086
2021-02-01[libc][NFC] Add a death test API adaptation macroMichael Jones
Fuchsia's zxtest has a slightly different death test definition, and this macro makes our death test API work on Fuchsia. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D95648
2021-02-01[libc] Small adjustments to fenv testsMichael Jones
Some libcs define non-standard FE_* macros and include them in FE_ALL_EXCEPT. This change adjusts the fenv tests so that the non-standard FE_* macros do not interfere when compiled with fenv.h from another libc. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D95650
2021-01-20[libc][NFC] add "LlvmLibc" as a prefix to all test namesMichael Jones
Summary: Having a consistent prefix makes selecting all of the llvm libc tests easier on any platform that is also using the gtest framework. This also modifies the TEST and TEST_F macros to enforce this change moving forward. Reviewers: sivachandra Subscribers:
2020-12-08[libc] Raise x87 exceptions by synchronizing with "fwait".Siva Chandra Reddy
Couple of helper functions enableExcept and disableExcept have been added. In a later round, they will be used to implemented the GNU extension functions feenableexcept and fedisableexcept. Differential Revision: https://reviews.llvm.org/D92821