mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 06:10:12 +00:00
[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().
This commit is contained in:
parent
cba422264c
commit
287c93c132
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user