Skip to content

Commit ac8ed7f

Browse files
authored
[libc] Remove RandUtils.(h|cpp). (#88044)
1 parent 119b9cd commit ac8ed7f

File tree

5 files changed

+5
-54
lines changed

5 files changed

+5
-54
lines changed

libc/test/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

libc/test/src/math/CMakeLists.txt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
add_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-
133
add_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

libc/test/src/math/FmaTest.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
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

1818
namespace 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
}

libc/test/src/math/RandUtils.cpp

Lines changed: 0 additions & 19 deletions
This file was deleted.

libc/test/src/math/RandUtils.h

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)