[libc-commits] [libc] 2282af2 - [libc] Disable -NaN test on float128 systems (#70146)

via libc-commits libc-commits at lists.llvm.org
Tue Oct 24 16:45:58 PDT 2023


Author: michaelrj-google
Date: 2023-10-24T16:45:54-07:00
New Revision: 2282af26ead1f58fc3b8a9acb36f6af532c17a45

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

LOG: [libc] Disable -NaN test on float128 systems (#70146)

Some float128 systems (specifically the ones used for aarch64 buildbots)
don't respect signs for long double NaNs. This patch disables the printf
test that was failing due to this.

Added: 
    

Modified: 
    libc/test/src/stdio/sprintf_test.cpp

Removed: 
    


################################################################################
diff  --git a/libc/test/src/stdio/sprintf_test.cpp b/libc/test/src/stdio/sprintf_test.cpp
index 5aa346c414b1fe1..a68ee97d6d6edc4 100644
--- a/libc/test/src/stdio/sprintf_test.cpp
+++ b/libc/test/src/stdio/sprintf_test.cpp
@@ -1008,8 +1008,12 @@ TEST_F(LlvmLibcSPrintfTest, FloatDecimalConv) {
   written = LIBC_NAMESPACE::sprintf(buff, "%Lf", ld_nan);
   ASSERT_STREQ_LEN(written, buff, "nan");
 
+// Some float128 systems (specifically the ones used for aarch64 buildbots)
+// don't respect signs for long double NaNs.
+#if defined(SPECIAL_X86_LONG_DOUBLE) || defined(LONG_DOUBLE_IS_DOUBLE)
   written = LIBC_NAMESPACE::sprintf(buff, "%LF", -ld_nan);
   ASSERT_STREQ_LEN(written, buff, "-NAN");
+#endif
 
   // Length Modifier Tests.
 


        


More information about the libc-commits mailing list