summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2019-05-23 10:48:28 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-05-27 11:52:22 +0200
commitc3571d2922d41617e81fa9e8ae971d08fb9e94af (patch)
tree82eeed0286f2cd4ebb1f5592acee5591c698936c /tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
parent4df554c652568805424e3fa256380c7310ccac72 (diff)
Correct qfloat16's 1/inf == 0 test
It should have been qfloat16(1)/qfloat16(infinity) in any case. Sadly, that behaves no better than qfloat16(1.f/qfloat16(infinity)), which was promoting the infinity back to float. So retain the check for over-optimization (but make the comment more accurate). This is a follow-up to d441f6bba7b2aaf1e11b95c1ad4c785e6939f6ba. Change-Id: Iec4afe4b04081b0ebfbf98058da606dc3ade07f4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp')
-rw-r--r--tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
index aa6f0935e8..b73a297245 100644
--- a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
+++ b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
@@ -172,9 +172,9 @@ void tst_qfloat16::qNan()
QVERIFY(qIsInf(-inf));
QVERIFY(qIsInf(2.f*inf));
QVERIFY(qIsInf(inf*2.f));
- // QTBUG-75812: QEMU's over-optimized arm64 flakily fails 1/inf == 0 :-(
+ // QTBUG-75812: QEMU/arm64 compiler over-optimizes, so flakily fails 1/inf == 0 :-(
if (qfloat16(9.785e-4f) == qfloat16(9.794e-4f))
- QCOMPARE(qfloat16(1.f/inf), qfloat16(0.f));
+ QCOMPARE(qfloat16(1.f) / inf, qfloat16(0.f));
#ifdef Q_CC_INTEL
QEXPECT_FAIL("", "ICC optimizes zero * anything to zero", Continue);
#endif