[libc-commits] [PATCH] D149745: [libc] Split out FPExceptMatcher from the FP utils

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed May 3 09:19:11 PDT 2023


jhuber6 updated this revision to Diff 519110.
jhuber6 added a comment.

Change to explicit link libraries


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149745

Files:
  libc/test/UnitTest/CMakeLists.txt
  libc/test/src/CMakeLists.txt
  libc/test/src/fenv/CMakeLists.txt


Index: libc/test/src/fenv/CMakeLists.txt
===================================================================
--- libc/test/src/fenv/CMakeLists.txt
+++ libc/test/src/fenv/CMakeLists.txt
@@ -104,6 +104,8 @@
       libc.src.fenv.feraiseexcept
       libc.src.fenv.fetestexcept
       libc.src.__support.FPUtil.fenv_impl
+    LINK_LIBRARIES
+      LibcFPExceptionHelpers
   )
 
   add_fp_unittest(
@@ -116,5 +118,7 @@
       libc.include.fenv
       libc.src.fenv.feholdexcept
       libc.src.__support.FPUtil.fenv_impl
+    LINK_LIBRARIES
+      LibcFPExceptionHelpers
   )
 endif()
Index: libc/test/src/CMakeLists.txt
===================================================================
--- libc/test/src/CMakeLists.txt
+++ libc/test/src/CMakeLists.txt
@@ -24,7 +24,7 @@
     set(test_type UNIT_TEST_ONLY)
     list(APPEND MATH_UNITTEST_LINK_LIBRARIES libcMPFRWrapper libc_math_test_utils -lmpfr -lgmp)
   endif()
-  list(APPEND MATH_UNITTEST_LINK_LIBRARIES LibcFPTestHelpers)
+    list(APPEND MATH_UNITTEST_LINK_LIBRARIES LibcFPTestHelpers)
 
   add_libc_unittest(
     ${name}
Index: libc/test/UnitTest/CMakeLists.txt
===================================================================
--- libc/test/UnitTest/CMakeLists.txt
+++ libc/test/UnitTest/CMakeLists.txt
@@ -71,8 +71,6 @@
 
 add_library(
   LibcFPTestHelpers
-  FPExceptMatcher.cpp
-  FPExceptMatcher.h
   FPMatcher.h
   RoundingModeUtils.cpp
   RoundingModeUtils.h
@@ -85,6 +83,17 @@
   libc.src.__support.FPUtil.fenv_impl
   libc.test.UnitTest.string_utils
 )
+add_library(
+  LibcFPExceptionHelpers
+  FPExceptMatcher.cpp
+  FPExceptMatcher.h
+)
+add_dependencies(
+  LibcFPExceptionHelpers
+  LibcUnitTest
+  libc.src.__support.FPUtil.fp_bits
+  libc.src.__support.FPUtil.fenv_impl
+)
 
 add_library(
   LibcMemoryHelpers
@@ -123,7 +132,8 @@
   libc.test.UnitTest.string_utils
 )
 
-foreach(lib LibcFPTestHelpers LibcMemoryHelpers LibcPrintfHelpers LibcScanfHelpers)
+foreach(lib LibcFPTestHelpers LibcFPExceptionHelpers LibcMemoryHelpers 
+            LibcPrintfHelpers LibcScanfHelpers)
   target_include_directories(${lib} PUBLIC ${LIBC_SOURCE_DIR})
   target_compile_options(${lib} PRIVATE -fno-exceptions -fno-rtti)
   target_link_libraries(${lib} LibcUnitTest)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149745.519110.patch
Type: text/x-patch
Size: 2228 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230503/07a83222/attachment-0001.bin>


More information about the libc-commits mailing list