[libc-commits] [libc] 746e729 - [libc] Fix floating point test failing to build on the GPU

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Mon Jun 12 13:06:41 PDT 2023


Author: Joseph Huber
Date: 2023-06-12T15:06:33-05:00
New Revision: 746e72910fce9ea8feeaa94907089fcb39c5cc49

URL: https://github.com/llvm/llvm-project/commit/746e72910fce9ea8feeaa94907089fcb39c5cc49
DIFF: https://github.com/llvm/llvm-project/commit/746e72910fce9ea8feeaa94907089fcb39c5cc49.diff

LOG: [libc] Fix floating point test failing to build on the GPU

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 but that had
to be reverted. For now disable these so the tests pass.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D152742

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libc/test/src/__support/FPUtil/CMakeLists.txt b/libc/test/src/__support/FPUtil/CMakeLists.txt
index 411b8281470cf..9367e2bb40a7a 100644
--- a/libc/test/src/__support/FPUtil/CMakeLists.txt
+++ b/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 @@ add_libc_test(
     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()


        


More information about the libc-commits mailing list