workaround apparent MSVC mis-optimization
MSVC appears to misapply the identity "A + -A == 0" which is not true for non-finite floating point values.
This commit is contained in:
@@ -612,18 +612,12 @@ MAIN(epicsCalcTest)
|
||||
testExpr(0.0 + NaN);
|
||||
testExpr(Inf + 0.0);
|
||||
testExpr(Inf + Inf);
|
||||
#if defined(_WIN64) && defined(_MSC_VER)
|
||||
// only test CALC as MSVC seems to incorrectly evaluate this expression at compile time.
|
||||
// see note in epicsMathTest
|
||||
testCalc("Inf + -Inf", NaN);
|
||||
#else
|
||||
testExpr(Inf + -Inf);
|
||||
#endif
|
||||
testExpr(Inf + NaN);
|
||||
testExpr(-Inf + 0.0);
|
||||
#if defined(_WIN64) && defined(_MSC_VER)
|
||||
testCalc("-Inf + Inf", NaN);
|
||||
#else
|
||||
testExpr(-Inf + Inf);
|
||||
#endif
|
||||
testExpr(-Inf + -Inf);
|
||||
testExpr(-Inf + NaN);
|
||||
testExpr(NaN + 0.0);
|
||||
|
||||
@@ -32,23 +32,23 @@ MAIN(epicsMathTest)
|
||||
testOk1(epicsINF > 0.0);
|
||||
testOk1(epicsINF - epicsINF != 0.0);
|
||||
|
||||
#if defined(_WIN64) && defined(_MSC_VER)
|
||||
testTodoBegin("Known failure on windows-x64");
|
||||
#if defined(_MSC_VER)
|
||||
testTodoBegin("Known failure on windows (MSVC optimizer bug?)");
|
||||
#endif
|
||||
testOk1(epicsINF + -epicsINF != 0.0);
|
||||
testOk1(-epicsINF + epicsINF != 0.0);
|
||||
#if defined(_WIN64) && defined(_MSC_VER)
|
||||
#if defined(_MSC_VER)
|
||||
testTodoEnd();
|
||||
#endif
|
||||
|
||||
testOk1(isnan(epicsINF - epicsINF));
|
||||
|
||||
#if defined(_WIN64) && defined(_MSC_VER)
|
||||
testTodoBegin("Known failure on windows-x64");
|
||||
#if defined(_MSC_VER)
|
||||
testTodoBegin("Known failure on windows (MSVC optimizer bug?)");
|
||||
#endif
|
||||
testOk1(isnan(epicsINF + -epicsINF));
|
||||
testOk1(isnan(-epicsINF + epicsINF));
|
||||
#if defined(_WIN64) && defined(_MSC_VER)
|
||||
#if defined(_MSC_VER)
|
||||
testTodoEnd();
|
||||
#endif
|
||||
|
||||
@@ -62,12 +62,12 @@ MAIN(epicsMathTest)
|
||||
testOk1(!(epicsNAN > epicsNAN));
|
||||
testOk1(isnan(epicsNAN - epicsNAN));
|
||||
|
||||
#if defined(_WIN64) && defined(_MSC_VER)
|
||||
testTodoBegin("Known failure on windows-x64");
|
||||
#if defined(_MSC_VER)
|
||||
testTodoBegin("Known failure on windows (MSVC optimizer bug?)");
|
||||
#endif
|
||||
testOk1(isnan(epicsNAN + -epicsNAN));
|
||||
testOk1(isnan(-epicsNAN + epicsNAN));
|
||||
#if defined(_WIN64) && defined(_MSC_VER)
|
||||
#if defined(_MSC_VER)
|
||||
testTodoEnd();
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user