diff options
Diffstat (limited to 'libc/test/src')
-rw-r--r-- | libc/test/src/math/FDimTest.h | 2 | ||||
-rw-r--r-- | libc/test/src/math/FmaTest.h | 2 | ||||
-rw-r--r-- | libc/test/src/math/HypotTest.h | 2 | ||||
-rw-r--r-- | libc/test/src/math/ILogbTest.h | 2 | ||||
-rw-r--r-- | libc/test/src/math/LdExpTest.h | 2 | ||||
-rw-r--r-- | libc/test/src/math/NextAfterTest.h | 2 | ||||
-rw-r--r-- | libc/test/src/math/RIntTest.h | 2 | ||||
-rw-r--r-- | libc/test/src/math/RemQuoTest.h | 2 | ||||
-rw-r--r-- | libc/test/src/math/RoundToIntegerTest.h | 5 | ||||
-rw-r--r-- | libc/test/src/math/atanf_test.cpp | 2 | ||||
-rw-r--r-- | libc/test/src/math/atanhf_test.cpp | 2 |
11 files changed, 14 insertions, 11 deletions
diff --git a/libc/test/src/math/FDimTest.h b/libc/test/src/math/FDimTest.h index 587913acb1f1..5763e04f95f3 100644 --- a/libc/test/src/math/FDimTest.h +++ b/libc/test/src/math/FDimTest.h @@ -74,7 +74,7 @@ public: private: // constexpr does not work on FPBits yet, so we cannot have these constants as // static. - const T nan = T(__llvm_libc::fputil::FPBits<T>::build_nan(1)); + const T nan = T(__llvm_libc::fputil::FPBits<T>::build_quiet_nan(1)); const T inf = T(__llvm_libc::fputil::FPBits<T>::inf()); const T neg_inf = T(__llvm_libc::fputil::FPBits<T>::neg_inf()); const T zero = T(__llvm_libc::fputil::FPBits<T>::zero()); diff --git a/libc/test/src/math/FmaTest.h b/libc/test/src/math/FmaTest.h index 959c4e837a77..4726267cea40 100644 --- a/libc/test/src/math/FmaTest.h +++ b/libc/test/src/math/FmaTest.h @@ -23,7 +23,7 @@ private: using Func = T (*)(T, T, T); using FPBits = __llvm_libc::fputil::FPBits<T>; using UIntType = typename FPBits::UIntType; - const T nan = T(__llvm_libc::fputil::FPBits<T>::build_nan(1)); + const T nan = T(__llvm_libc::fputil::FPBits<T>::build_quiet_nan(1)); const T inf = T(__llvm_libc::fputil::FPBits<T>::inf()); const T neg_inf = T(__llvm_libc::fputil::FPBits<T>::neg_inf()); const T zero = T(__llvm_libc::fputil::FPBits<T>::zero()); diff --git a/libc/test/src/math/HypotTest.h b/libc/test/src/math/HypotTest.h index 57abef8b6234..b110bcee3311 100644 --- a/libc/test/src/math/HypotTest.h +++ b/libc/test/src/math/HypotTest.h @@ -24,7 +24,7 @@ private: using Func = T (*)(T, T); using FPBits = __llvm_libc::fputil::FPBits<T>; using UIntType = typename FPBits::UIntType; - const T nan = T(FPBits::build_nan(1)); + const T nan = T(FPBits::build_quiet_nan(1)); const T inf = T(FPBits::inf()); const T neg_inf = T(FPBits::neg_inf()); const T zero = T(FPBits::zero()); diff --git a/libc/test/src/math/ILogbTest.h b/libc/test/src/math/ILogbTest.h index e2de14de446d..b026b0557f9c 100644 --- a/libc/test/src/math/ILogbTest.h +++ b/libc/test/src/math/ILogbTest.h @@ -26,7 +26,7 @@ public: EXPECT_EQ(FP_ILOGB0, func(T(__llvm_libc::fputil::FPBits<T>::neg_zero()))); EXPECT_EQ(FP_ILOGBNAN, - func(T(__llvm_libc::fputil::FPBits<T>::build_nan(1)))); + func(T(__llvm_libc::fputil::FPBits<T>::build_quiet_nan(1)))); EXPECT_EQ(INT_MAX, func(T(__llvm_libc::fputil::FPBits<T>::inf()))); EXPECT_EQ(INT_MAX, func(T(__llvm_libc::fputil::FPBits<T>::neg_inf()))); diff --git a/libc/test/src/math/LdExpTest.h b/libc/test/src/math/LdExpTest.h index ca9f33f2f816..5830fc37a6f5 100644 --- a/libc/test/src/math/LdExpTest.h +++ b/libc/test/src/math/LdExpTest.h @@ -32,7 +32,7 @@ class LdExpTestTemplate : public __llvm_libc::testing::Test { const T neg_zero = T(__llvm_libc::fputil::FPBits<T>::neg_zero()); const T inf = T(__llvm_libc::fputil::FPBits<T>::inf()); const T neg_inf = T(__llvm_libc::fputil::FPBits<T>::neg_inf()); - const T nan = T(__llvm_libc::fputil::FPBits<T>::build_nan(1)); + const T nan = T(__llvm_libc::fputil::FPBits<T>::build_quiet_nan(1)); public: typedef T (*LdExpFunc)(T, int); diff --git a/libc/test/src/math/NextAfterTest.h b/libc/test/src/math/NextAfterTest.h index fcc2c43a5aac..12c9bb988ab7 100644 --- a/libc/test/src/math/NextAfterTest.h +++ b/libc/test/src/math/NextAfterTest.h @@ -30,7 +30,7 @@ class NextAfterTestTemplate : public __llvm_libc::testing::Test { const T neg_zero = T(FPBits::neg_zero()); const T inf = T(FPBits::inf()); const T neg_inf = T(FPBits::neg_inf()); - const T nan = T(FPBits::build_nan(1)); + const T nan = T(FPBits::build_quiet_nan(1)); const UIntType min_subnormal = FPBits::MIN_SUBNORMAL; const UIntType max_subnormal = FPBits::MAX_SUBNORMAL; const UIntType min_normal = FPBits::MIN_NORMAL; diff --git a/libc/test/src/math/RIntTest.h b/libc/test/src/math/RIntTest.h index 90945feb6789..de5652b03272 100644 --- a/libc/test/src/math/RIntTest.h +++ b/libc/test/src/math/RIntTest.h @@ -37,7 +37,7 @@ private: const T neg_zero = T(FPBits::neg_zero()); const T inf = T(FPBits::inf()); const T neg_inf = T(FPBits::neg_inf()); - const T nan = T(FPBits::build_nan(1)); + const T nan = T(FPBits::build_quiet_nan(1)); static inline mpfr::RoundingMode to_mpfr_rounding_mode(int mode) { switch (mode) { diff --git a/libc/test/src/math/RemQuoTest.h b/libc/test/src/math/RemQuoTest.h index 5903760c1969..3428f8d6758e 100644 --- a/libc/test/src/math/RemQuoTest.h +++ b/libc/test/src/math/RemQuoTest.h @@ -27,7 +27,7 @@ class RemQuoTestTemplate : public __llvm_libc::testing::Test { const T neg_zero = T(__llvm_libc::fputil::FPBits<T>::neg_zero()); const T inf = T(__llvm_libc::fputil::FPBits<T>::inf()); const T neg_inf = T(__llvm_libc::fputil::FPBits<T>::neg_inf()); - const T nan = T(__llvm_libc::fputil::FPBits<T>::build_nan(1)); + const T nan = T(__llvm_libc::fputil::FPBits<T>::build_quiet_nan(1)); public: typedef T (*RemQuoFunc)(T, T, int *); diff --git a/libc/test/src/math/RoundToIntegerTest.h b/libc/test/src/math/RoundToIntegerTest.h index 27a19e11c27a..a7627b2f50cd 100644 --- a/libc/test/src/math/RoundToIntegerTest.h +++ b/libc/test/src/math/RoundToIntegerTest.h @@ -36,7 +36,7 @@ private: const F neg_zero = F(__llvm_libc::fputil::FPBits<F>::neg_zero()); const F inf = F(__llvm_libc::fputil::FPBits<F>::inf()); const F neg_inf = F(__llvm_libc::fputil::FPBits<F>::neg_inf()); - const F nan = F(__llvm_libc::fputil::FPBits<F>::build_nan(1)); + const F nan = F(__llvm_libc::fputil::FPBits<F>::build_quiet_nan(1)); static constexpr I INTEGER_MIN = I(1) << (sizeof(I) * 8 - 1); static constexpr I INTEGER_MAX = -(INTEGER_MIN + 1); @@ -84,7 +84,10 @@ public: void do_infinity_and_na_n_test(RoundToIntegerFunc func) { test_one_input(func, inf, INTEGER_MAX, true); test_one_input(func, neg_inf, INTEGER_MIN, true); +#if LLVM_LIBC_IMPLEMENTATION_DEFINED_TEST_BEHAVIOR + // Result is not well-defined, we always returns INTEGER_MAX test_one_input(func, nan, INTEGER_MAX, true); +#endif } void testInfinityAndNaN(RoundToIntegerFunc func) { diff --git a/libc/test/src/math/atanf_test.cpp b/libc/test/src/math/atanf_test.cpp index 8dc61bb55a4c..28c5fcd30057 100644 --- a/libc/test/src/math/atanf_test.cpp +++ b/libc/test/src/math/atanf_test.cpp @@ -28,7 +28,7 @@ TEST(LlvmLibcAtanfTest, SpecialNumbers) { errno = 0; __llvm_libc::fputil::clear_except(FE_ALL_EXCEPT); EXPECT_FP_EQ(aNaN, __llvm_libc::atanf(aNaN)); - EXPECT_FP_EXCEPTION(FE_INVALID); + EXPECT_FP_EXCEPTION(0); EXPECT_MATH_ERRNO(0); __llvm_libc::fputil::clear_except(FE_ALL_EXCEPT); diff --git a/libc/test/src/math/atanhf_test.cpp b/libc/test/src/math/atanhf_test.cpp index 306fc1962df5..ad6d56d10ead 100644 --- a/libc/test/src/math/atanhf_test.cpp +++ b/libc/test/src/math/atanhf_test.cpp @@ -26,7 +26,7 @@ TEST(LlvmLibcAtanhfTest, SpecialNumbers) { errno = 0; __llvm_libc::fputil::clear_except(FE_ALL_EXCEPT); EXPECT_FP_EQ(aNaN, __llvm_libc::atanhf(aNaN)); - EXPECT_FP_EXCEPTION(FE_INVALID); + EXPECT_FP_EXCEPTION(0); EXPECT_MATH_ERRNO(0); __llvm_libc::fputil::clear_except(FE_ALL_EXCEPT); |