diff options
Diffstat (limited to 'libc/test')
-rw-r--r-- | libc/test/shared/CMakeLists.txt | 1 | ||||
-rw-r--r-- | libc/test/shared/shared_math_test.cpp | 3 | ||||
-rw-r--r-- | libc/test/src/math/smoke/CMakeLists.txt | 30 | ||||
-rw-r--r-- | libc/test/src/math/smoke/fmaxbf16_test.cpp | 14 | ||||
-rw-r--r-- | libc/test/src/math/smoke/fminbf16_test.cpp | 14 |
5 files changed, 61 insertions, 1 deletions
diff --git a/libc/test/shared/CMakeLists.txt b/libc/test/shared/CMakeLists.txt index 9685aea..b2264e1 100644 --- a/libc/test/shared/CMakeLists.txt +++ b/libc/test/shared/CMakeLists.txt @@ -28,6 +28,7 @@ add_fp_unittest( libc.src.__support.math.atanhf16 libc.src.__support.math.cbrt libc.src.__support.math.cbrtf + libc.src.__support.math.cos libc.src.__support.math.erff libc.src.__support.math.exp libc.src.__support.math.exp10 diff --git a/libc/test/shared/shared_math_test.cpp b/libc/test/shared/shared_math_test.cpp index 5e57c49e..2386b55 100644 --- a/libc/test/shared/shared_math_test.cpp +++ b/libc/test/shared/shared_math_test.cpp @@ -66,8 +66,9 @@ TEST(LlvmLibcSharedMathTest, AllDouble) { EXPECT_FP_EQ(0x1.921fb54442d18p+0, LIBC_NAMESPACE::shared::acos(0.0)); EXPECT_FP_EQ(0x0p+0, LIBC_NAMESPACE::shared::asin(0.0)); EXPECT_FP_EQ(0x0p+0, LIBC_NAMESPACE::shared::atan(0.0)); - EXPECT_FP_EQ(0x0p+0, LIBC_NAMESPACE::shared::cbrt(0.0)); EXPECT_FP_EQ(0x0p+0, LIBC_NAMESPACE::shared::atan2(0.0, 0.0)); + EXPECT_FP_EQ(0x0p+0, LIBC_NAMESPACE::shared::cbrt(0.0)); + EXPECT_FP_EQ(0x1p+0, LIBC_NAMESPACE::shared::cos(0.0)); EXPECT_FP_EQ(0x1p+0, LIBC_NAMESPACE::shared::exp(0.0)); EXPECT_FP_EQ(0x1p+0, LIBC_NAMESPACE::shared::exp10(0.0)); } diff --git a/libc/test/src/math/smoke/CMakeLists.txt b/libc/test/src/math/smoke/CMakeLists.txt index dc1850a..f060ef3 100644 --- a/libc/test/src/math/smoke/CMakeLists.txt +++ b/libc/test/src/math/smoke/CMakeLists.txt @@ -2347,6 +2347,21 @@ add_fp_unittest( ) add_fp_unittest( + fminbf16_test + SUITE + libc-math-smoke-tests + SRCS + fminbf16_test.cpp + HDRS + FMinTest.h + DEPENDS + libc.src.math.fminbf16 + libc.src.__support.CPP.algorithm + libc.src.__support.FPUtil.bfloat16 + libc.src.__support.FPUtil.fp_bits +) + +add_fp_unittest( fmaxf_test SUITE libc-math-smoke-tests @@ -2417,6 +2432,21 @@ add_fp_unittest( ) add_fp_unittest( + fmaxbf16_test + SUITE + libc-math-smoke-tests + SRCS + fmaxbf16_test.cpp + HDRS + FMaxTest.h + DEPENDS + libc.src.math.fmaxbf16 + libc.src.__support.CPP.algorithm + libc.src.__support.FPUtil.bfloat16 + libc.src.__support.FPUtil.fp_bits +) + +add_fp_unittest( fmaximuml_test SUITE libc-math-smoke-tests diff --git a/libc/test/src/math/smoke/fmaxbf16_test.cpp b/libc/test/src/math/smoke/fmaxbf16_test.cpp new file mode 100644 index 0000000..8ff9313 --- /dev/null +++ b/libc/test/src/math/smoke/fmaxbf16_test.cpp @@ -0,0 +1,14 @@ +//===-- Unittests for fmaxbf16 --------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "FMaxTest.h" + +#include "src/__support/FPUtil/bfloat16.h" +#include "src/math/fmaxbf16.h" + +LIST_FMAX_TESTS(bfloat16, LIBC_NAMESPACE::fmaxbf16) diff --git a/libc/test/src/math/smoke/fminbf16_test.cpp b/libc/test/src/math/smoke/fminbf16_test.cpp new file mode 100644 index 0000000..195a0ac --- /dev/null +++ b/libc/test/src/math/smoke/fminbf16_test.cpp @@ -0,0 +1,14 @@ +//===-- Unittests for fminbf16 --------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "FMinTest.h" + +#include "src/__support/FPUtil/bfloat16.h" +#include "src/math/fminbf16.h" + +LIST_FMIN_TESTS(bfloat16, LIBC_NAMESPACE::fminbf16) |