12 Commits

Author SHA1 Message Date
Joseph Huber
e50bed6da4
[libc] Fix warnings for the GPU test suite (#181763)
Summary:
A lot of fixes mostly around unused variables.
2026-02-17 09:30:36 -06:00
lntue
e2956fefd9
[libc][math] Add LIBC_CONF_MATH_USE_SYSTEM_FENV / LIBC_MATH_USE_SYSTEM_FENV (#172902)
This is to allow math function implementations to use system libc's
fenv.h instead of internal fenv implementations.
2025-12-22 13:19:56 -05:00
lntue
4c59219fc9
[libc][fenv] Refactor x86 fenv implementations to make it work for various fenv_t. (#165015) 2025-12-05 16:00:10 -05:00
Victor Campos
d249e67a6a
[libc][math] Disable FEnvSafeTest.cpp if AArch64 target has no FP support (#166370)
The `FEnvSafeTest.cpp` test fails on AArch64 soft nofp configurations
because LLVM libc does not provide a floating-point environment in these
configurations.

This patch adds another preprocessor guard on `__ARM_FP` to disable the
test on those.
2025-11-05 11:14:02 +00:00
Schrodinger ZHU Yifan
38a4c9c639
[libc][msvc] fix mathlib build on WoA (#161258)
Fix build errors encountered when building math library on WoA.

1. Skip FEnv equality check for MSVC
2. Provide a placeholder type for vector types.
2025-09-29 15:40:21 -04:00
lntue
21821f50cf
[libc] Update floating testing infra for MSVC compatibility. (#159810) 2025-09-19 13:44:42 -04:00
Alexey Samsonov
2422972eea
[libc] Migrate FEnvSafeTest and FPTest to ErrnoCheckingTest. (#152633)
This would ensure that errno value is cleared out before test execution
and tests pass even when LIBC_ERRNO_MODE_SYSTEM_INLINE is specified (and
errno may be clobbered before test execution).

A lot of the tests would fail, however, since errno would end up getting
set to EDOM or ERANGE during test execution and never validated before
the end of the test. This should be fixed - and errno should be
explicitly checked or ignored in all of those cases, but for now add a
TODO to address it later (see open issue #135320) and clear out errno in
test fixture to avoid test failures.
2025-08-07 21:49:57 -07:00
Petr Hosek
5ff3ff33ff
[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98597)
This is a part of #97655.
2024-07-12 09:28:41 -07:00
Mehdi Amini
ce9035f5bd
Revert "[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration" (#98593)
Reverts llvm/llvm-project#98075

bots are broken
2024-07-12 09:12:13 +02:00
Petr Hosek
3f30effe1b
[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98075)
This is a part of #97655.
2024-07-11 12:35:22 -07:00
Roland McGrath
859de94536
[libc] Fix aarch64 build error in FEnvSafeTest change (#89826) 2024-04-23 13:50:55 -07:00
Roland McGrath
837dab96d6
[libc] Make fenv and math tests preserve fenv_t state (#89658)
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-23 13:21:25 -07:00