File tree Expand file tree Collapse file tree 5 files changed +5
-54
lines changed Expand file tree Collapse file tree 5 files changed +5
-54
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function(add_fp_unittest name)
2424 message (FATAL_ERROR "Hermetic math test cannot require MPFR." )
2525 endif ()
2626 set (test_type UNIT_TEST_ONLY)
27- list (APPEND MATH_UNITTEST_LINK_LIBRARIES libcMPFRWrapper libc_math_test_utils -lmpfr -lgmp)
27+ list (APPEND MATH_UNITTEST_LINK_LIBRARIES libcMPFRWrapper -lmpfr -lgmp)
2828 endif ()
2929 list (APPEND MATH_UNITTEST_LINK_LIBRARIES LibcFPTestHelpers)
3030
Original file line number Diff line number Diff line change 11add_custom_target (libc-math-unittests)
22
3- # FIXME: We shouldn't have regular libraries created because we could be
4- # cross-compiling the tests and running through an emulator.
5- if (NOT LIBC_TARGET_OS_IS_GPU)
6- add_library (
7- libc_math_test_utils
8- RandUtils.cpp
9- RandUtils.h
10- )
11- endif ()
12-
133add_fp_unittest(
144 cosf_test
155 NEED_MPFR
@@ -1280,6 +1270,7 @@ add_fp_unittest(
12801270 fmaf_test.cpp
12811271 DEPENDS
12821272 libc.src.math.fmaf
1273+ libc.src.stdlib.rand
12831274 libc.src.__support.FPUtil.fp_bits
12841275 FLAGS
12851276 FMA_OPT__ONLY
@@ -1294,6 +1285,7 @@ add_fp_unittest(
12941285 fma_test.cpp
12951286 DEPENDS
12961287 libc.src.math.fma
1288+ libc.src.stdlib.rand
12971289 libc.src.__support.FPUtil.fp_bits
12981290)
12991291
Original file line number Diff line number Diff line change 1010#define LLVM_LIBC_TEST_SRC_MATH_FMATEST_H
1111
1212#include " src/__support/FPUtil/FPBits.h"
13+ #include " src/stdlib/rand.h"
1314#include " test/UnitTest/FPMatcher.h"
1415#include " test/UnitTest/Test.h"
15- #include " test/src/math/RandUtils.h"
1616#include " utils/MPFRWrapper/MPFRUtils.h"
1717
1818namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
@@ -43,8 +43,7 @@ class FmaTestTemplate : public LIBC_NAMESPACE::testing::Test {
4343 StorageType get_random_bit_pattern () {
4444 StorageType bits{0 };
4545 for (StorageType i = 0 ; i < sizeof (StorageType) / 2 ; ++i) {
46- bits = (bits << 2 ) +
47- static_cast <uint16_t >(LIBC_NAMESPACE::testutils::rand ());
46+ bits = (bits << 2 ) + static_cast <uint16_t >(LIBC_NAMESPACE::rand ());
4847 }
4948 return bits;
5049 }
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments