[libc-commits] [libc] [libc] Disable -NaN test on float128 systems (PR #70146)
via libc-commits
libc-commits at lists.llvm.org
Tue Oct 24 16:40:18 PDT 2023
https://github.com/michaelrj-google created https://github.com/llvm/llvm-project/pull/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.
>From b7f82b1cdbca3ca9af191c174ab0a9c00a0757a9 Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Tue, 24 Oct 2023 16:38:42 -0700
Subject: [PATCH] [libc] Disable -NaN test on float128 systems
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.
---
libc/test/src/stdio/sprintf_test.cpp | 4 ++++
1 file changed, 4 insertions(+)
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