[compiler-rt] cc22c9c - Revert "[nsan] More unit tests for `float128`. (#165248)" (#165391)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 28 06:38:38 PDT 2025


Author: Clement Courbet
Date: 2025-10-28T14:38:34+01:00
New Revision: cc22c9c4559f9436c9c3f9f2fa95f0c7a3b4b31d

URL: https://github.com/llvm/llvm-project/commit/cc22c9c4559f9436c9c3f9f2fa95f0c7a3b4b31d
DIFF: https://github.com/llvm/llvm-project/commit/cc22c9c4559f9436c9c3f9f2fa95f0c7a3b4b31d.diff

LOG: Revert "[nsan] More unit tests for `float128`. (#165248)" (#165391)

This reverts commit 2f869c427b6c800f37147458ac03d1fa6f9ad9d3.

Breaks build on some configurations

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/nsan/tests/NSanUnitTest.cpp b/compiler-rt/lib/nsan/tests/NSanUnitTest.cpp
index 73b59671fe07a..d121292c36682 100644
--- a/compiler-rt/lib/nsan/tests/NSanUnitTest.cpp
+++ b/compiler-rt/lib/nsan/tests/NSanUnitTest.cpp
@@ -43,8 +43,8 @@ template <typename FT, auto next> void TestFT() {
   ASSERT_EQ(GetULPDiff<FT>(-X, -Y), 3);
 
   // Values with larger 
diff erences.
-  static constexpr const __uint128_t MantissaSize =
-      __uint128_t{1} << FTInfo<FT>::kMantissaBits;
+  static constexpr const __sanitizer::u64 MantissaSize =
+      __sanitizer::u64{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);
@@ -57,6 +57,11 @@ TEST(NSanTest, Double) {
   TestFT<double, static_cast<double (*)(double, double)>(nextafter)>();
 }
 
-TEST(NSanTest, Float128) { TestFT<__float128, nextafterf128>(); }
+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);
+}
 
 } // end namespace __nsan


        


More information about the llvm-commits mailing list