Don't test the division by 0 on float16 when compiling with msvc since msvc detects and errors out on divisions by 0.

This commit is contained in:
Benoit Steiner 2016-04-08 12:50:25 -07:00
parent cd2b667ac8
commit 2d072b38c1

View File

@ -64,9 +64,13 @@ void test_conversion()
VERIFY((numext::isnan)(float(half(__half{0xfc01}))));
VERIFY((numext::isinf)(float(half(__half{0x7c00}))));
VERIFY((numext::isnan)(float(half(__half{0x7c01}))));
#if !EIGEN_COMP_MSVC
// Visual Studio errors out on divisions by 0
VERIFY((numext::isnan)(float(half(0.0 / 0.0))));
VERIFY((numext::isinf)(float(half(1.0 / 0.0))));
VERIFY((numext::isinf)(float(half(-1.0 / 0.0))));
#endif
// Exactly same checks as above, just directly on the half representation.
VERIFY(!(numext::isinf)(half(__half{0x7bff})));
@ -75,9 +79,13 @@ void test_conversion()
VERIFY((numext::isnan)(half(__half{0xfc01})));
VERIFY((numext::isinf)(half(__half{0x7c00})));
VERIFY((numext::isnan)(half(__half{0x7c01})));
#if !EIGEN_COMP_MSVC
// Visual Studio errors out on divisions by 0
VERIFY((numext::isnan)(half(0.0 / 0.0)));
VERIFY((numext::isinf)(half(1.0 / 0.0)));
VERIFY((numext::isinf)(half(-1.0 / 0.0)));
#endif
}
void test_arithmetic()