Skip to content

Commit ba7d5eb

Browse files
authored
[libc] Fix build breaks caused by f16sqrtf changes (llvm#95459)
See Buildbot failures: - https://lab.llvm.org/buildbot/#/builders/78/builds/13 - https://lab.llvm.org/buildbot/#/builders/182/builds/7
1 parent 52d29eb commit ba7d5eb

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

libc/test/src/math/smoke/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,6 +2597,9 @@ add_fp_unittest(
25972597
HDRS
25982598
SqrtTest.h
25992599
DEPENDS
2600+
# The dependency on sqrtf128 is used to disable the test when float128
2601+
# support is not available.
2602+
libc.src.math.sqrtf128
26002603
libc.src.__support.FPUtil.generic.sqrt
26012604
COMPILE_OPTIONS
26022605
-O3

libc/test/src/stdfix/ISqrtTest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ template <typename T> class ISqrtTest : public LIBC_NAMESPACE::testing::Test {
5555
x_d += 1.0;
5656
++x;
5757
OutType result = func(x);
58-
double expected = LIBC_NAMESPACE::fputil::sqrt(x_d);
58+
double expected = LIBC_NAMESPACE::fputil::sqrt<double>(x_d);
5959
testSpecificInput(x, result, expected, ERR);
6060
}
6161
}

libc/test/src/stdfix/SqrtTest.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ template <typename T> class SqrtTest : public LIBC_NAMESPACE::testing::Test {
4949
T v = LIBC_NAMESPACE::cpp::bit_cast<T>(x);
5050
double v_d = static_cast<double>(v);
5151
double errors = LIBC_NAMESPACE::fputil::abs(
52-
static_cast<double>(func(v)) - LIBC_NAMESPACE::fputil::sqrt(v_d));
52+
static_cast<double>(func(v)) -
53+
LIBC_NAMESPACE::fputil::sqrt<double>(v_d));
5354
if (errors > ERR) {
5455
// Print out the failure input and output.
5556
EXPECT_EQ(v, zero);

0 commit comments

Comments
 (0)