[libc-commits] [PATCH] D152742: [libc] Fix floating point test failing to build on the GPU

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Jun 12 12:19:32 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: lntue, sivachandra, michaelrj, tra.
Herald added projects: libc-project, All.
Herald added a subscriber: libc-commits.
jhuber6 requested review of this revision.

A patch enabled this test which uses that `add_fp_unittest`.
Unfortunately we do not support these on the GPU because it attempts to
link in the floating point utils which are not built supporting
hermetic tests. This was attempted to be fixed in D151123 <https://reviews.llvm.org/D151123> but that had
to be reverted. For now disable these so the tests pass.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152742

Files:
  libc/test/src/__support/FPUtil/CMakeLists.txt


Index: libc/test/src/__support/FPUtil/CMakeLists.txt
===================================================================
--- libc/test/src/__support/FPUtil/CMakeLists.txt
+++ libc/test/src/__support/FPUtil/CMakeLists.txt
@@ -1,15 +1,17 @@
 add_custom_target(libc-fputil-tests)
 
-add_fp_unittest(
-  dyadic_float_test
-  NEED_MPFR
-  SUITE
-    libc-fputil-tests
-  SRCS
-    dyadic_float_test.cpp
-  DEPENDS
-    libc.src.__support.FPUtil.dyadic_float
-)
+if(NOT LIBC_TARGET_ARCHITECTURE_IS_GPU)
+  add_fp_unittest(
+    dyadic_float_test
+    NEED_MPFR
+    SUITE
+      libc-fputil-tests
+    SRCS
+      dyadic_float_test.cpp
+    DEPENDS
+      libc.src.__support.FPUtil.dyadic_float
+  )
+endif()
 
 add_libc_test(
   fpbits_test
@@ -22,12 +24,14 @@
     libc.src.__support.FPUtil.fpbits_str
 )
 
-add_fp_unittest(
-  rounding_mode_test
-  SUITE
-    libc-fputil-tests
-  SRCS
-    rounding_mode_test.cpp
-  DEPENDS
-    libc.src.__support.FPUtil.rounding_mode
-)
+if(NOT LIBC_TARGET_ARCHITECTURE_IS_GPU)
+  add_fp_unittest(
+    rounding_mode_test
+    SUITE
+      libc-fputil-tests
+    SRCS
+      rounding_mode_test.cpp
+    DEPENDS
+      libc.src.__support.FPUtil.rounding_mode
+  )
+endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152742.530632.patch
Type: text/x-patch
Size: 1205 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230612/712c74c2/attachment.bin>


More information about the libc-commits mailing list