From 2715f9b5d8a0492b86a960b0e1ac06f65374584f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 14 Sep 2021 18:35:31 +0300 Subject: [PATCH] Add a workaround for g++ 4.4, 4.6 --- test/cmath_test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/cmath_test.cpp b/test/cmath_test.cpp index 9e419f1..20b0aab 100644 --- a/test/cmath_test.cpp +++ b/test/cmath_test.cpp @@ -6,6 +6,8 @@ #include #include +#include +#include #include #include @@ -63,10 +65,18 @@ template void test_negative_zero( T x ) BOOST_TEST_EQ( boost::core::fpclassify( x ), boost::core::fp_zero ); +#if defined(BOOST_CORE_USE_GENERIC_CMATH) && BOOST_WORKAROUND(BOOST_GCC, < 40700) + + // g++ 4.4, 4.6 fail these tests with optimizations on + +#else + BOOST_TEST( boost::core::signbit( x ) ); BOOST_TEST_EQ( boost::core::copysign( T(+2), x ), T(-2) ); BOOST_TEST_EQ( boost::core::copysign( T(-2), x ), T(-2) ); + +#endif } template void test_positive_infinity( T x )