diff options
Diffstat (limited to 'libcxx/test/std/numerics')
-rw-r--r-- | libcxx/test/std/numerics/c.math/cmath.pass.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libcxx/test/std/numerics/c.math/cmath.pass.cpp b/libcxx/test/std/numerics/c.math/cmath.pass.cpp index 0b0d8628873..5b78925f0dc 100644 --- a/libcxx/test/std/numerics/c.math/cmath.pass.cpp +++ b/libcxx/test/std/numerics/c.math/cmath.pass.cpp @@ -79,6 +79,7 @@ Ambiguous fma(Ambiguous, Ambiguous, Ambiguous){ return Ambiguous(); } Ambiguous fmax(Ambiguous, Ambiguous){ return Ambiguous(); } Ambiguous fmin(Ambiguous, Ambiguous){ return Ambiguous(); } Ambiguous hypot(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous hypot(Ambiguous, Ambiguous, Ambiguous){ return Ambiguous(); } Ambiguous ilogb(Ambiguous){ return Ambiguous(); } Ambiguous lgamma(Ambiguous){ return Ambiguous(); } Ambiguous llrint(Ambiguous){ return Ambiguous(); } @@ -1010,6 +1011,28 @@ void test_hypot() static_assert((std::is_same<decltype(std::hypot((int)0, (int)0)), double>::value), ""); static_assert((std::is_same<decltype(hypot(Ambiguous(), Ambiguous())), Ambiguous>::value), ""); assert(std::hypot(3,4) == 5); + +#if TEST_STD_VER > 14 + static_assert((std::is_same<decltype(std::hypot((float)0, (float)0, (float)0)), float>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (bool)0, (float)0)), double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (unsigned short)0, (double)0)), double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (int)0, (long double)0)), long double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (unsigned int)0)), double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (double)0, (long)0)), double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (long double)0, (unsigned long)0)), long double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (int)0, (long long)0)), double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (int)0, (unsigned long long)0)), double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (double)0, (double)0)), double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (long double)0, (long double)0)), long double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (float)0, (double)0)), double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (float)0, (long double)0)), long double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((float)0, (double)0, (long double)0)), long double>::value), ""); + static_assert((std::is_same<decltype(std::hypot((int)0, (int)0, (int)0)), double>::value), ""); + static_assert((std::is_same<decltype(hypot(Ambiguous(), Ambiguous(), Ambiguous())), Ambiguous>::value), ""); + + assert(std::hypot(2,3,6) == 7); + assert(std::hypot(1,4,8) == 9); +#endif } void test_ilogb() |