gcc_checking_assert (!m_type);
return;
case VR_VARYING:
- if (flag_finite_math_only)
- gcc_checking_assert (!m_pos_nan && !m_neg_nan);
- else
- gcc_checking_assert (m_pos_nan && m_neg_nan);
gcc_checking_assert (m_type);
gcc_checking_assert (frange_val_is_min (m_min, m_type));
gcc_checking_assert (frange_val_is_max (m_max, m_type));
+ if (HONOR_NANS (m_type))
+ gcc_checking_assert (m_pos_nan && m_neg_nan);
+ else
+ gcc_checking_assert (!m_pos_nan && !m_neg_nan);
return;
case VR_RANGE:
gcc_checking_assert (m_type);
// A range of [-INF,+INF] is actually VARYING if no other properties
// are set.
r0 = frange_float ("-Inf", "+Inf");
- if (r0.maybe_isnan ())
- ASSERT_TRUE (r0.varying_p ());
+ ASSERT_TRUE (r0.varying_p ());
// ...unless it has some special property...
- if (!flag_finite_math_only)
+ if (HONOR_NANS (r0.type ()))
{
r0.clear_nan ();
ASSERT_FALSE (r0.varying_p ());
}
}
+// Run floating range tests for various combinations of NAN and INF
+// support.
+
+static void
+range_tests_floats_various ()
+{
+ int save_finite_math_only = flag_finite_math_only;
+
+ // Test -ffinite-math-only.
+ flag_finite_math_only = 1;
+ range_tests_floats ();
+ // Test -fno-finite-math-only.
+ flag_finite_math_only = 0;
+ range_tests_floats ();
+
+ flag_finite_math_only = save_finite_math_only;
+}
+
void
range_tests ()
{
range_tests_int_range_max ();
range_tests_strict_enum ();
range_tests_nonzero_bits ();
- range_tests_floats ();
+ range_tests_floats_various ();
range_tests_misc ();
}