aboutsummaryrefslogtreecommitdiff
path: root/flang
diff options
context:
space:
mode:
authorpeter klausler <pklausler@nvidia.com>2021-04-01 15:59:56 -0700
committerpeter klausler <pklausler@nvidia.com>2021-04-01 16:20:07 -0700
commit287c93c1321b4342608f28e1a2816300780502e1 (patch)
tree6552fafdd3628e25e222691e1cdf5dfd2f2c9878 /flang
parent[OpenMP51] Accept `primary` as proc bind affinity policy in Clang (diff)
downloadllvm-project-287c93c1321b4342608f28e1a2816300780502e1.tar.gz
llvm-project-287c93c1321b4342608f28e1a2816300780502e1.tar.bz2
llvm-project-287c93c1321b4342608f28e1a2816300780502e1.zip
[flang] Fix unit test failure on POWER
A new unit test for the Fortran runtime needs to allow for some architectural variation on Infinity and NaN edge cases of NINT().
Diffstat (limited to 'flang')
-rw-r--r--flang/unittests/RuntimeGTest/Numeric.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/flang/unittests/RuntimeGTest/Numeric.cpp b/flang/unittests/RuntimeGTest/Numeric.cpp
index 60a878dbd280..b8d8a993f8bf 100644
--- a/flang/unittests/RuntimeGTest/Numeric.cpp
+++ b/flang/unittests/RuntimeGTest/Numeric.cpp
@@ -118,10 +118,12 @@ TEST(Numeric, Nint) {
EXPECT_EQ(RTNAME(Nint4_4)(Real<4>{2.5}), 3);
EXPECT_EQ(RTNAME(Nint8_4)(Real<8>{-2.5}), -3);
EXPECT_EQ(RTNAME(Nint8_8)(Real<8>{0}), 0);
- EXPECT_EQ(RTNAME(Nint4_4)(std::numeric_limits<Real<4>>::infinity()),
- std::numeric_limits<Int<4>>::min());
- EXPECT_EQ(RTNAME(Nint4_4)(std::numeric_limits<Real<4>>::quiet_NaN()),
- std::numeric_limits<Int<4>>::min());
+ auto nintInf{RTNAME(Nint4_4)(std::numeric_limits<Real<4>>::infinity())};
+ EXPECT_TRUE(nintInf == std::numeric_limits<Int<4>>::min() ||
+ nintInf == std::numeric_limits<Int<4>>::max());
+ auto nintNaN{RTNAME(Nint4_4)(std::numeric_limits<Real<4>>::quiet_NaN())};
+ EXPECT_TRUE(nintNaN == std::numeric_limits<Int<4>>::min() ||
+ nintNaN == std::numeric_limits<Int<4>>::max());
}
TEST(Numeric, RRSpacing) {