summaryrefslogtreecommitdiff
path: root/libc/test
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-05-03 08:28:24 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2023-05-03 11:37:49 -0500
commitc00f8f1314479d6f764f89cfa4efe2f23a640adf (patch)
tree0c91bf38af2cdef3ea3a07ee575ebf86f913270b /libc/test
parente2f8f77e159ba345b5f1dc8531342da7c0d3370e (diff)
downloadllvm-c00f8f1314479d6f764f89cfa4efe2f23a640adf.tar.gz
[libc] Split out FPExceptMatcher from the FP utils
The FPEceptMatcher.cpp file uses system utilities and includes C++ libraries. This patch pulls it out of the main `FPTestHelpers` target so we can exclude it from hermetic only tests. Depends on D149705 Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D149745
Diffstat (limited to 'libc/test')
-rw-r--r--libc/test/UnitTest/CMakeLists.txt16
-rw-r--r--libc/test/src/fenv/CMakeLists.txt4
2 files changed, 17 insertions, 3 deletions
diff --git a/libc/test/UnitTest/CMakeLists.txt b/libc/test/UnitTest/CMakeLists.txt
index cc8140713106..f74577bacabc 100644
--- a/libc/test/UnitTest/CMakeLists.txt
+++ b/libc/test/UnitTest/CMakeLists.txt
@@ -71,8 +71,6 @@ add_header_library(
add_library(
LibcFPTestHelpers
- FPExceptMatcher.cpp
- FPExceptMatcher.h
FPMatcher.h
RoundingModeUtils.cpp
RoundingModeUtils.h
@@ -85,6 +83,17 @@ add_dependencies(
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 @@ add_dependencies(
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)
diff --git a/libc/test/src/fenv/CMakeLists.txt b/libc/test/src/fenv/CMakeLists.txt
index 325ec5b1d263..11179cc88c38 100644
--- a/libc/test/src/fenv/CMakeLists.txt
+++ b/libc/test/src/fenv/CMakeLists.txt
@@ -104,6 +104,8 @@ if (NOT (LLVM_USE_SANITIZER OR (${LIBC_TARGET_OS} STREQUAL "windows")
libc.src.fenv.feraiseexcept
libc.src.fenv.fetestexcept
libc.src.__support.FPUtil.fenv_impl
+ LINK_LIBRARIES
+ LibcFPExceptionHelpers
)
add_fp_unittest(
@@ -116,5 +118,7 @@ if (NOT (LLVM_USE_SANITIZER OR (${LIBC_TARGET_OS} STREQUAL "windows")
libc.include.fenv
libc.src.fenv.feholdexcept
libc.src.__support.FPUtil.fenv_impl
+ LINK_LIBRARIES
+ LibcFPExceptionHelpers
)
endif()