aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOverMighty <its.overmighty@gmail.com>2024-06-13 21:48:36 +0200
committerGitHub <noreply@github.com>2024-06-13 15:48:36 -0400
commitba7d5ebe4bb2dc9b6885adf8346529e763cd6fce (patch)
treea7cfae9b3a031be319f522dc9b28b0e218554023
parent52d29eb2874580f0fe96e5cbb96faffbbdc432a7 (diff)
downloadllvm-ba7d5ebe4bb2dc9b6885adf8346529e763cd6fce.zip
llvm-ba7d5ebe4bb2dc9b6885adf8346529e763cd6fce.tar.gz
llvm-ba7d5ebe4bb2dc9b6885adf8346529e763cd6fce.tar.bz2
[libc] Fix build breaks caused by f16sqrtf changes (#95459)
See Buildbot failures: - https://lab.llvm.org/buildbot/#/builders/78/builds/13 - https://lab.llvm.org/buildbot/#/builders/182/builds/7
-rw-r--r--libc/test/src/math/smoke/CMakeLists.txt3
-rw-r--r--libc/test/src/stdfix/ISqrtTest.h2
-rw-r--r--libc/test/src/stdfix/SqrtTest.h3
3 files changed, 6 insertions, 2 deletions
diff --git a/libc/test/src/math/smoke/CMakeLists.txt b/libc/test/src/math/smoke/CMakeLists.txt
index 3bb87d2..3e9edc5 100644
--- a/libc/test/src/math/smoke/CMakeLists.txt
+++ b/libc/test/src/math/smoke/CMakeLists.txt
@@ -2597,6 +2597,9 @@ add_fp_unittest(
HDRS
SqrtTest.h
DEPENDS
+ # The dependency on sqrtf128 is used to disable the test when float128
+ # support is not available.
+ libc.src.math.sqrtf128
libc.src.__support.FPUtil.generic.sqrt
COMPILE_OPTIONS
-O3
diff --git a/libc/test/src/stdfix/ISqrtTest.h b/libc/test/src/stdfix/ISqrtTest.h
index ddf292f..692488b 100644
--- a/libc/test/src/stdfix/ISqrtTest.h
+++ b/libc/test/src/stdfix/ISqrtTest.h
@@ -55,7 +55,7 @@ public:
x_d += 1.0;
++x;
OutType result = func(x);
- double expected = LIBC_NAMESPACE::fputil::sqrt(x_d);
+ double expected = LIBC_NAMESPACE::fputil::sqrt<double>(x_d);
testSpecificInput(x, result, expected, ERR);
}
}
diff --git a/libc/test/src/stdfix/SqrtTest.h b/libc/test/src/stdfix/SqrtTest.h
index 47ec129..2a8a825 100644
--- a/libc/test/src/stdfix/SqrtTest.h
+++ b/libc/test/src/stdfix/SqrtTest.h
@@ -49,7 +49,8 @@ public:
T v = LIBC_NAMESPACE::cpp::bit_cast<T>(x);
double v_d = static_cast<double>(v);
double errors = LIBC_NAMESPACE::fputil::abs(
- static_cast<double>(func(v)) - LIBC_NAMESPACE::fputil::sqrt(v_d));
+ static_cast<double>(func(v)) -
+ LIBC_NAMESPACE::fputil::sqrt<double>(v_d));
if (errors > ERR) {
// Print out the failure input and output.
EXPECT_EQ(v, zero);