diff options
author | 2016-04-08 12:50:25 -0700 | |
---|---|---|
committer | 2016-04-08 12:50:25 -0700 | |
commit | 2d072b38c134c60fb796e36466fd4e7a1888ce35 (patch) | |
tree | 5961f0012930229f818fcffaa0aeafdbbd194e3a | |
parent | cd2b667ac80adc54df1496273a3cbe83d2eb1607 (diff) |
Don't test the division by 0 on float16 when compiling with msvc since msvc detects and errors out on divisions by 0.
-rw-r--r-- | unsupported/test/cxx11_float16.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/unsupported/test/cxx11_float16.cpp b/unsupported/test/cxx11_float16.cpp index 44ffa67b3..2dc0872d8 100644 --- a/unsupported/test/cxx11_float16.cpp +++ b/unsupported/test/cxx11_float16.cpp @@ -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() |