Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/test_power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ struct power_test

void test_power_functions()
{
#if defined(__clang__) && !defined(__FAST_MATH__)
// This test deliberately unmasks floating-point exceptions below.
#pragma clang fp exceptions(strict)
#endif
// pow
{
std::transform(lhs_input.cbegin(), lhs_input.cend(), rhs_input.cbegin(), expected.begin(),
Expand Down
5 changes: 5 additions & 0 deletions test/test_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ namespace detail
template <class T>
T safe_division(const T& lhs, const T& rhs)
{
#if defined(__clang__) && !defined(__FAST_MATH__)
// Comparisons also run with FE_INVALID unmasked in the power tests.
// Do not speculate a division past the zero-denominator guard.
#pragma clang fp exceptions(strict)
#endif
if (rhs == T(0))
{
return (std::numeric_limits<T>::max)();
Expand Down