Skip to content

[libc] Disable -NaN test on float128 systems #70146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

michaelrj-google
Copy link
Contributor

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.

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.
@llvmbot llvmbot added the libc label Oct 24, 2023
@llvmbot
Copy link
Member

llvmbot commented Oct 24, 2023

@llvm/pr-subscribers-libc

Author: None (michaelrj-google)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/70146.diff

1 Files Affected:

  • (modified) libc/test/src/stdio/sprintf_test.cpp (+4)
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.
 

@michaelrj-google michaelrj-google merged commit 2282af2 into llvm:main Oct 24, 2023
@michaelrj-google michaelrj-google deleted the libcPrintfLDFloat128NaN branch October 24, 2023 23:46
@michaelrj-google
Copy link
Contributor Author

Landed without review as a trivial change to fix the buildbots.

@lntue
Copy link
Contributor

lntue commented Oct 25, 2023

Thanks for taking care of this! Probably we should add comments about aarch64's behavior in the test, and add a test to check only NaN containment in the #else clause in the followup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants