[libc-commits] [PATCH] D150983: [libc] Fix test failing on the GPU due to undefined floating point type

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri May 19 12:04:04 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2ac91712cc7b: [libc] Fix test failing on the GPU due to undefined floating point type (authored by jhuber6).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150983/new/

https://reviews.llvm.org/D150983

Files:
  libc/test/src/__support/FPUtil/fpbits_test.cpp


Index: libc/test/src/__support/FPUtil/fpbits_test.cpp
===================================================================
--- libc/test/src/__support/FPUtil/fpbits_test.cpp
+++ libc/test/src/__support/FPUtil/fpbits_test.cpp
@@ -197,9 +197,9 @@
 }
 #else
 TEST(LlvmLibcFPBitsTest, LongDoubleType) {
-  if constexpr (sizeof(long double) == sizeof(double))
-    return; // The tests for the "double" type cover for this case.
-
+#if defined(LONG_DOUBLE_IS_DOUBLE)
+  return; // The tests for the "double" type cover for this case.
+#else
   EXPECT_STREQ(FPBits<long double>::inf().str().c_str(), "(+Infinity)");
   EXPECT_STREQ(FPBits<long double>::neg_inf().str().c_str(), "(-Infinity)");
   EXPECT_STREQ(
@@ -262,5 +262,6 @@
   EXPECT_STREQ(negnum.str().c_str(),
                "0xBFFF2000000000000000000000000000 = "
                "(S: 1, E: 0x3FFF, M: 0x00002000000000000000000000000000)");
+#endif
 }
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150983.523886.patch
Type: text/x-patch
Size: 914 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230519/59fe0b43/attachment.bin>


More information about the libc-commits mailing list