Skip to content

Commit 82ec137

Browse files
legrosbuffleLukacma
authored andcommitted
Revert "[nsan] More unit tests for float128. (llvm#165248)" (llvm#165391)
This reverts commit 2f869c4. Breaks build on some configurations
1 parent f80c2a0 commit 82ec137

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

compiler-rt/lib/nsan/tests/NSanUnitTest.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ template <typename FT, auto next> void TestFT() {
4343
ASSERT_EQ(GetULPDiff<FT>(-X, -Y), 3);
4444

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

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

6267
} // end namespace __nsan

0 commit comments

Comments
 (0)