Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions compiler-rt/lib/nsan/tests/NSanUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ template <typename FT, auto next> void TestFT() {
ASSERT_EQ(GetULPDiff<FT>(-X, -Y), 3);

// Values with larger differences.
static constexpr const __sanitizer::u64 MantissaSize =
__sanitizer::u64{1} << FTInfo<FT>::kMantissaBits;
static constexpr const __uint128_t MantissaSize =
__uint128_t{1} << FTInfo<FT>::kMantissaBits;
ASSERT_EQ(GetULPDiff<FT>(1.0, next(2.0, 1.0)), MantissaSize - 1);
ASSERT_EQ(GetULPDiff<FT>(1.0, 2.0), MantissaSize);
ASSERT_EQ(GetULPDiff<FT>(1.0, next(2.0, 3.0)), MantissaSize + 1);
Expand All @@ -57,11 +57,6 @@ TEST(NSanTest, Double) {
TestFT<double, static_cast<double (*)(double, double)>(nextafter)>();
}

TEST(NSanTest, Float128) {
// Very basic tests. FIXME: improve when we have nextafter<__float128>.
ASSERT_EQ(GetULPDiff<__float128>(0.0, 0.0), 0);
ASSERT_EQ(GetULPDiff<__float128>(-0.0, 0.0), 0);
ASSERT_NE(GetULPDiff<__float128>(-0.01, 0.01), kMaxULPDiff);
}
TEST(NSanTest, Float128) { TestFT<__float128, nextafterf128>(); }

} // end namespace __nsan