[libc] Enable hermetic floating point tests again.
authorTue Ly <lntue@google.com>
Wed, 14 Jun 2023 14:52:23 +0000 (10:52 -0400)
committerTue Ly <lntue@google.com>
Wed, 14 Jun 2023 14:53:35 +0000 (10:53 -0400)
commit055be3c30c78e6ed1e219f8007fbe8302bcbea43
tree53b189bc8a02f02112534938051a49cde9b1d9dc
parenta734de6d3753b5ac8c58a68d28deaaaadd1d30fe
[libc] Enable hermetic floating point tests again.

Fixing an issue with LLVM libc's fenv.h defined rounding mode macros
differently from system libc, making get_round() return different values from
fegetround().  Also letting math tests to skip rounding modes that cannot be
set.  This should allow math tests to be run on platforms in which fenv.h is not
implemented yet.

This allows us to re-enable hermatic floating point tests in
https://reviews.llvm.org/D151123 and reverting https://reviews.llvm.org/D152742.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D152873
41 files changed:
libc/include/llvm-libc-macros/fenv-macros.h
libc/src/__support/FPUtil/FEnvImpl.h
libc/test/UnitTest/CMakeLists.txt
libc/test/UnitTest/FPMatcher.h
libc/test/UnitTest/RoundingModeUtils.cpp
libc/test/UnitTest/RoundingModeUtils.h
libc/test/src/CMakeLists.txt
libc/test/src/__support/FPUtil/CMakeLists.txt
libc/test/src/__support/FPUtil/rounding_mode_test.cpp
libc/test/src/fenv/CMakeLists.txt
libc/test/src/math/SqrtTest.h
libc/test/src/math/exhaustive/acosf_test.cpp
libc/test/src/math/exhaustive/acoshf_test.cpp
libc/test/src/math/exhaustive/asinf_test.cpp
libc/test/src/math/exhaustive/asinhf_test.cpp
libc/test/src/math/exhaustive/atanf_test.cpp
libc/test/src/math/exhaustive/atanhf_test.cpp
libc/test/src/math/exhaustive/cosf_test.cpp
libc/test/src/math/exhaustive/coshf_test.cpp
libc/test/src/math/exhaustive/exp10f_test.cpp
libc/test/src/math/exhaustive/exp2f_test.cpp
libc/test/src/math/exhaustive/expf_test.cpp
libc/test/src/math/exhaustive/expm1f_test.cpp
libc/test/src/math/exhaustive/hypotf_test.cpp
libc/test/src/math/exhaustive/log10f_test.cpp
libc/test/src/math/exhaustive/log1pf_test.cpp
libc/test/src/math/exhaustive/log2f_test.cpp
libc/test/src/math/exhaustive/logf_test.cpp
libc/test/src/math/exhaustive/sincosf_test.cpp
libc/test/src/math/exhaustive/sinf_test.cpp
libc/test/src/math/exhaustive/sinhf_test.cpp
libc/test/src/math/exhaustive/tanf_test.cpp
libc/test/src/math/exhaustive/tanhf_test.cpp
libc/test/src/math/log10_test.cpp
libc/test/src/math/log1p_test.cpp
libc/test/src/math/log2_test.cpp
libc/test/src/math/log_test.cpp
libc/test/src/math/sincosf_test.cpp
libc/test/src/stdio/sprintf_test.cpp
libc/utils/MPFRWrapper/MPFRUtils.h
utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel