[libc][NFC] Move test related pieces from FPUtil to util/UnitTest.

Reviewed By: michaelrj

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

GitOrigin-RevId: 6c3f53c7ba3c84a517339f735c8dbe0fd737168f
diff --git a/src/__support/FPUtil/CMakeLists.txt b/src/__support/FPUtil/CMakeLists.txt
index f47b545..01703e0 100644
--- a/src/__support/FPUtil/CMakeLists.txt
+++ b/src/__support/FPUtil/CMakeLists.txt
@@ -35,19 +35,3 @@
     libc.src.__support.common
     libc.src.__support.CPP.standalone_cpp
 )
-
-add_library(
-  LibcFPTestHelpers
-    FPExceptMatcher.cpp
-    FPExceptMatcher.h
-    TestHelpers.cpp
-    TestHelpers.h
-)
-target_include_directories(LibcFPTestHelpers PUBLIC ${LIBC_SOURCE_DIR})
-target_link_libraries(LibcFPTestHelpers LibcUnitTest)
-add_dependencies(
-  LibcFPTestHelpers
-  LibcUnitTest
-  libc.src.__support.CPP.standalone_cpp
-  libc.src.__support.FPUtil.fputil
-)
diff --git a/test/src/fenv/enabled_exceptions_test.cpp b/test/src/fenv/enabled_exceptions_test.cpp
index b971e71..7b91e98 100644
--- a/test/src/fenv/enabled_exceptions_test.cpp
+++ b/test/src/fenv/enabled_exceptions_test.cpp
@@ -11,7 +11,7 @@
 #include "src/fenv/fetestexcept.h"
 
 #include "src/__support/FPUtil/FEnvUtils.h"
-#include "src/__support/FPUtil/FPExceptMatcher.h"
+#include "utils/UnitTest/FPExceptMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <fenv.h>
diff --git a/test/src/fenv/feholdexcept_test.cpp b/test/src/fenv/feholdexcept_test.cpp
index 3f8401f..be836a4 100644
--- a/test/src/fenv/feholdexcept_test.cpp
+++ b/test/src/fenv/feholdexcept_test.cpp
@@ -9,7 +9,7 @@
 #include "src/fenv/feholdexcept.h"
 
 #include "src/__support/FPUtil/FEnvUtils.h"
-#include "src/__support/FPUtil/FPExceptMatcher.h"
+#include "utils/UnitTest/FPExceptMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <fenv.h>
diff --git a/test/src/math/CeilTest.h b/test/src/math/CeilTest.h
index e8933c6..8c1f0d6 100644
--- a/test/src/math/CeilTest.h
+++ b/test/src/math/CeilTest.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/CopySignTest.h b/test/src/math/CopySignTest.h
index 7bc6f59..aab7e39 100644
--- a/test/src/math/CopySignTest.h
+++ b/test/src/math/CopySignTest.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/FAbsTest.h b/test/src/math/FAbsTest.h
index 5065b68..18c9737 100644
--- a/test/src/math/FAbsTest.h
+++ b/test/src/math/FAbsTest.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/FDimTest.h b/test/src/math/FDimTest.h
index 12702a5..a0f241f 100644
--- a/test/src/math/FDimTest.h
+++ b/test/src/math/FDimTest.h
@@ -8,7 +8,7 @@
 
 #include "src/__support/FPUtil/BasicOperations.h"
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/FMaxTest.h b/test/src/math/FMaxTest.h
index c3f1b2f..6bdb4c7 100644
--- a/test/src/math/FMaxTest.h
+++ b/test/src/math/FMaxTest.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/FMinTest.h b/test/src/math/FMinTest.h
index 7faaf34..3f6b258 100644
--- a/test/src/math/FMinTest.h
+++ b/test/src/math/FMinTest.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/FloorTest.h b/test/src/math/FloorTest.h
index b38f7ee..e0f9015 100644
--- a/test/src/math/FloorTest.h
+++ b/test/src/math/FloorTest.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/FmaTest.h b/test/src/math/FmaTest.h
index 20e6c34..a2178e3 100644
--- a/test/src/math/FmaTest.h
+++ b/test/src/math/FmaTest.h
@@ -10,8 +10,8 @@
 #define LLVM_LIBC_TEST_SRC_MATH_FMATEST_H
 
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include "utils/testutils/RandUtils.h"
 
diff --git a/test/src/math/FrexpTest.h b/test/src/math/FrexpTest.h
index 4a3efb4..edbcb61 100644
--- a/test/src/math/FrexpTest.h
+++ b/test/src/math/FrexpTest.h
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/HypotTest.h b/test/src/math/HypotTest.h
index 45d7115..11adc2f 100644
--- a/test/src/math/HypotTest.h
+++ b/test/src/math/HypotTest.h
@@ -11,8 +11,8 @@
 
 #include "src/__support/FPUtil/FPBits.h"
 #include "src/__support/FPUtil/Hypot.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/LdExpTest.h b/test/src/math/LdExpTest.h
index e015e6e..3112d97 100644
--- a/test/src/math/LdExpTest.h
+++ b/test/src/math/LdExpTest.h
@@ -11,7 +11,7 @@
 
 #include "src/__support/FPUtil/FPBits.h"
 #include "src/__support/FPUtil/NormalFloat.h"
-#include "src/__support/FPUtil/TestHelpers.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <limits.h>
diff --git a/test/src/math/LogbTest.h b/test/src/math/LogbTest.h
index 4db5475..4d820f6 100644
--- a/test/src/math/LogbTest.h
+++ b/test/src/math/LogbTest.h
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/__support/FPUtil/ManipulationFunctions.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/ModfTest.h b/test/src/math/ModfTest.h
index 59e854b..8cc62aa 100644
--- a/test/src/math/ModfTest.h
+++ b/test/src/math/ModfTest.h
@@ -8,8 +8,8 @@
 
 #include "src/__support/FPUtil/BasicOperations.h"
 #include "src/__support/FPUtil/NearestIntegerOperations.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/NextAfterTest.h b/test/src/math/NextAfterTest.h
index 262fcb8..73eb601 100644
--- a/test/src/math/NextAfterTest.h
+++ b/test/src/math/NextAfterTest.h
@@ -12,7 +12,7 @@
 #include "src/__support/CPP/TypeTraits.h"
 #include "src/__support/FPUtil/BasicOperations.h"
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/RIntTest.h b/test/src/math/RIntTest.h
index eef39c6..dbe2fe3 100644
--- a/test/src/math/RIntTest.h
+++ b/test/src/math/RIntTest.h
@@ -11,8 +11,8 @@
 
 #include "src/__support/FPUtil/FEnvUtils.h"
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <fenv.h>
diff --git a/test/src/math/RemQuoTest.h b/test/src/math/RemQuoTest.h
index 80880f4..ce77be1 100644
--- a/test/src/math/RemQuoTest.h
+++ b/test/src/math/RemQuoTest.h
@@ -11,8 +11,8 @@
 
 #include "src/__support/FPUtil/BasicOperations.h"
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/RoundTest.h b/test/src/math/RoundTest.h
index 1bc224b..928268e 100644
--- a/test/src/math/RoundTest.h
+++ b/test/src/math/RoundTest.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/SqrtTest.h b/test/src/math/SqrtTest.h
index 469c287..02aeb42 100644
--- a/test/src/math/SqrtTest.h
+++ b/test/src/math/SqrtTest.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/TruncTest.h b/test/src/math/TruncTest.h
index 15a44b5..9f4ff50 100644
--- a/test/src/math/TruncTest.h
+++ b/test/src/math/TruncTest.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/cos_test.cpp b/test/src/math/cos_test.cpp
index 6c9aea3..e99cb39 100644
--- a/test/src/math/cos_test.cpp
+++ b/test/src/math/cos_test.cpp
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/cos.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/cosf_test.cpp b/test/src/math/cosf_test.cpp
index de7d5db..92f193b 100644
--- a/test/src/math/cosf_test.cpp
+++ b/test/src/math/cosf_test.cpp
@@ -8,10 +8,10 @@
 
 #include "src/__support/CPP/Array.h"
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/cosf.h"
 #include "test/src/math/sdcomp26094.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/exp2f_test.cpp b/test/src/math/exp2f_test.cpp
index b3ff9fd..16811fb 100644
--- a/test/src/math/exp2f_test.cpp
+++ b/test/src/math/exp2f_test.cpp
@@ -7,9 +7,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/exp2f.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/expf_test.cpp b/test/src/math/expf_test.cpp
index 3b85927..b06b560 100644
--- a/test/src/math/expf_test.cpp
+++ b/test/src/math/expf_test.cpp
@@ -7,9 +7,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/expf.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/expm1f_test.cpp b/test/src/math/expm1f_test.cpp
index c49e5f5..523b195 100644
--- a/test/src/math/expm1f_test.cpp
+++ b/test/src/math/expm1f_test.cpp
@@ -7,9 +7,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/expm1f.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/fdim_test.cpp b/test/src/math/fdim_test.cpp
index 7aa2948..a4726f2 100644
--- a/test/src/math/fdim_test.cpp
+++ b/test/src/math/fdim_test.cpp
@@ -9,8 +9,8 @@
 #include "FDimTest.h"
 
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/fdim.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/fdimf_test.cpp b/test/src/math/fdimf_test.cpp
index 7c646aa..45f960c 100644
--- a/test/src/math/fdimf_test.cpp
+++ b/test/src/math/fdimf_test.cpp
@@ -9,8 +9,8 @@
 #include "FDimTest.h"
 
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/fdimf.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/fdiml_test.cpp b/test/src/math/fdiml_test.cpp
index 7368b45..b828193 100644
--- a/test/src/math/fdiml_test.cpp
+++ b/test/src/math/fdiml_test.cpp
@@ -9,8 +9,8 @@
 #include "FDimTest.h"
 
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/fdiml.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/ilogb_test.cpp b/test/src/math/ilogb_test.cpp
index 8b46c16..8b8b51c 100644
--- a/test/src/math/ilogb_test.cpp
+++ b/test/src/math/ilogb_test.cpp
@@ -10,8 +10,8 @@
 
 #include "src/__support/FPUtil/FPBits.h"
 #include "src/__support/FPUtil/ManipulationFunctions.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/ilogb.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/ilogbf_test.cpp b/test/src/math/ilogbf_test.cpp
index 104c00f..9fabc01 100644
--- a/test/src/math/ilogbf_test.cpp
+++ b/test/src/math/ilogbf_test.cpp
@@ -10,8 +10,8 @@
 
 #include "src/__support/FPUtil/FPBits.h"
 #include "src/__support/FPUtil/ManipulationFunctions.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/ilogbf.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/ilogbl_test.cpp b/test/src/math/ilogbl_test.cpp
index f31e569..f36746b 100644
--- a/test/src/math/ilogbl_test.cpp
+++ b/test/src/math/ilogbl_test.cpp
@@ -10,8 +10,8 @@
 
 #include "src/__support/FPUtil/FPBits.h"
 #include "src/__support/FPUtil/ManipulationFunctions.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/ilogbl.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/mod_k_pi_test.cpp b/test/src/math/mod_k_pi_test.cpp
index 008e93d..12d915b 100644
--- a/test/src/math/mod_k_pi_test.cpp
+++ b/test/src/math/mod_k_pi_test.cpp
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/generic/dp_trig.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/sin_test.cpp b/test/src/math/sin_test.cpp
index b0485a5..bce7a72 100644
--- a/test/src/math/sin_test.cpp
+++ b/test/src/math/sin_test.cpp
@@ -7,9 +7,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/sin.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/test/src/math/sincosf_test.cpp b/test/src/math/sincosf_test.cpp
index 77fe377..7812fbe 100644
--- a/test/src/math/sincosf_test.cpp
+++ b/test/src/math/sincosf_test.cpp
@@ -8,10 +8,10 @@
 
 #include "src/__support/CPP/Array.h"
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/sincosf.h"
 #include "test/src/math/sdcomp26094.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/sinf_test.cpp b/test/src/math/sinf_test.cpp
index a3620ef..6770e47 100644
--- a/test/src/math/sinf_test.cpp
+++ b/test/src/math/sinf_test.cpp
@@ -8,10 +8,10 @@
 
 #include "src/__support/CPP/Array.h"
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/sinf.h"
 #include "test/src/math/sdcomp26094.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 #include <math.h>
 
diff --git a/test/src/math/tan_test.cpp b/test/src/math/tan_test.cpp
index 52798e2..de3d6f1 100644
--- a/test/src/math/tan_test.cpp
+++ b/test/src/math/tan_test.cpp
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/FPUtil/TestHelpers.h"
 #include "src/math/tan.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
+#include "utils/UnitTest/FPMatcher.h"
 #include "utils/UnitTest/Test.h"
 
 #include <math.h>
diff --git a/utils/MPFRWrapper/MPFRUtils.cpp b/utils/MPFRWrapper/MPFRUtils.cpp
index 8bcaa13..9a2a125 100644
--- a/utils/MPFRWrapper/MPFRUtils.cpp
+++ b/utils/MPFRWrapper/MPFRUtils.cpp
@@ -10,7 +10,7 @@
 
 #include "src/__support/CPP/StringView.h"
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/FPUtil/TestHelpers.h"
+#include "utils/UnitTest/FPMatcher.h"
 
 #include <cmath>
 #include <memory>
diff --git a/utils/UnitTest/CMakeLists.txt b/utils/UnitTest/CMakeLists.txt
index 4140c6d..2870fb2 100644
--- a/utils/UnitTest/CMakeLists.txt
+++ b/utils/UnitTest/CMakeLists.txt
@@ -17,3 +17,18 @@
 add_dependencies(LibcUnitTestMain LibcUnitTest libc.src.__support.CPP.standalone_cpp)
 target_link_libraries(LibcUnitTestMain PUBLIC LibcUnitTest libc_test_utils)
 
+add_library(
+  LibcFPTestHelpers
+    FPExceptMatcher.cpp
+    FPExceptMatcher.h
+    FPMatcher.cpp
+    FPMatcher.h
+)
+target_include_directories(LibcFPTestHelpers PUBLIC ${LIBC_SOURCE_DIR})
+target_link_libraries(LibcFPTestHelpers LibcUnitTest)
+add_dependencies(
+  LibcFPTestHelpers
+  LibcUnitTest
+  libc.src.__support.CPP.standalone_cpp
+  libc.src.__support.FPUtil.fputil
+)
diff --git a/src/__support/FPUtil/FPExceptMatcher.cpp b/utils/UnitTest/FPExceptMatcher.cpp
similarity index 100%
rename from src/__support/FPUtil/FPExceptMatcher.cpp
rename to utils/UnitTest/FPExceptMatcher.cpp
diff --git a/src/__support/FPUtil/FPExceptMatcher.h b/utils/UnitTest/FPExceptMatcher.h
similarity index 91%
rename from src/__support/FPUtil/FPExceptMatcher.h
rename to utils/UnitTest/FPExceptMatcher.h
index fd51fa0..23fd945 100644
--- a/src/__support/FPUtil/FPExceptMatcher.h
+++ b/utils/UnitTest/FPExceptMatcher.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_FP_EXCEPT_MATCHER_H
-#define LLVM_LIBC_SRC_SUPPORT_FPUTIL_FP_EXCEPT_MATCHER_H
+#ifndef LLVM_LIBC_UTILS_UNITTEST_FPEXCEPTMATCHER_H
+#define LLVM_LIBC_UTILS_UNITTEST_FPEXCEPTMATCHER_H
 
 #ifndef LLVM_LIBC_TEST_USE_FUCHSIA
 
@@ -64,4 +64,4 @@
 #define ASSERT_RAISES_FP_EXCEPT(func) ASSERT_DEATH(func, WITH_SIGNAL(SIGFPE))
 #endif // LLVM_LIBC_TEST_USE_FUCHSIA
 
-#endif // LLVM_LIBC_SRC_SUPPORT_FPUTIL_FP_EXCEPT_MATCHER_H
+#endif // LLVM_LIBC_UTILS_UNITTEST_FPEXCEPTMATCHER_H
diff --git a/src/__support/FPUtil/TestHelpers.cpp b/utils/UnitTest/FPMatcher.cpp
similarity index 96%
rename from src/__support/FPUtil/TestHelpers.cpp
rename to utils/UnitTest/FPMatcher.cpp
index 2c7614e..8f19f11 100644
--- a/src/__support/FPUtil/TestHelpers.cpp
+++ b/utils/UnitTest/FPMatcher.cpp
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "TestHelpers.h"
+#include "FPMatcher.h"
 
-#include "FPBits.h"
+#include "src/__support/FPUtil/FPBits.h"
 
 #include <string>
 
diff --git a/src/__support/FPUtil/TestHelpers.h b/utils/UnitTest/FPMatcher.h
similarity index 94%
rename from src/__support/FPUtil/TestHelpers.h
rename to utils/UnitTest/FPMatcher.h
index 4ee0bb9..ff383d5 100644
--- a/src/__support/FPUtil/TestHelpers.h
+++ b/utils/UnitTest/FPMatcher.h
@@ -6,10 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_TEST_HELPERS_H
-#define LLVM_LIBC_SRC_SUPPORT_FPUTIL_TEST_HELPERS_H
+#ifndef LLVM_LIBC_UTILS_UNITTEST_FPMATCHER_H
+#define LLVM_LIBC_UTILS_UNITTEST_FPMATCHER_H
 
-#include "FPBits.h"
+#include "src/__support/FPUtil/FPBits.h"
 
 #include "utils/UnitTest/Test.h"
 
@@ -98,4 +98,4 @@
       __llvm_libc::fputil::testing::getMatcher<__llvm_libc::testing::Cond_NE>( \
           expected))
 
-#endif // LLVM_LIBC_SRC_SUPPORT_FPUTIL_TEST_HELPERS_H
+#endif // LLVM_LIBC_UTILS_UNITTEST_FPMATCHER_H