[libc-commits] [libc] [libc] Fix fpbits test running 80bit ld everywhere (PR #115937)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Tue Nov 12 12:45:27 PST 2024


https://github.com/michaelrj-google created https://github.com/llvm/llvm-project/pull/115937

After #115084 the 80 bit long double tests error if sizeof(long double)
isn't 96 or 128 bits. This caused failures in long double is double
systems (since long double is 64 bits) so I've disabled the 80 bit long
double tests on systems that don't use them.


>From acea91b52eb845e65039dc67b949bf1b6555c5fa Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Tue, 12 Nov 2024 12:42:07 -0800
Subject: [PATCH] [libc] Fix fpbits test running 80bit ld everywhere

After #115084 the 80 bit long double tests error if sizeof(long double)
isn't 96 or 128 bits. This caused failures in long double is double
systems (since long double is 64 bits) so I've disabled the 80 bit long
double tests on systems that don't use them.
---
 libc/test/src/__support/FPUtil/fpbits_test.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libc/test/src/__support/FPUtil/fpbits_test.cpp b/libc/test/src/__support/FPUtil/fpbits_test.cpp
index edb04c24ae3876..6953d3aace58f3 100644
--- a/libc/test/src/__support/FPUtil/fpbits_test.cpp
+++ b/libc/test/src/__support/FPUtil/fpbits_test.cpp
@@ -124,6 +124,7 @@ TEST(LlvmLibcFPBitsTest, FPType_IEEE754_Binary128) {
       UInt128(Rep::quiet_nan()));
 }
 
+#ifdef LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
 TEST(LlvmLibcFPBitsTest, FPType_X86_Binary80) {
   using Rep = FPRep<FPType::X86_Binary80>;
 
@@ -269,6 +270,7 @@ TEST(LlvmLibcFPBitsTest, FPType_X86_Binary80_IsNan) {
 #error "unhandled long double type"
 #endif
 }
+#endif // LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
 
 enum class FP {
   ZERO,



More information about the libc-commits mailing list