diff --git a/libc/test/src/math/differential_testing/CMakeLists.txt b/libc/test/src/math/differential_testing/CMakeLists.txt --- a/libc/test/src/math/differential_testing/CMakeLists.txt +++ b/libc/test/src/math/differential_testing/CMakeLists.txt @@ -126,3 +126,23 @@ COMPILE_OPTIONS -fno-builtin ) + +add_diff_binary( + sqrtf_diff + SRCS + sqrtf_diff.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.sqrtf +) + +add_diff_binary( + sqrtf_perf + SRCS + sqrtf_perf.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.sqrtf + COMPILE_OPTIONS + -fno-builtin +) diff --git a/libc/test/src/math/differential_testing/sqrtf_diff.cpp b/libc/test/src/math/differential_testing/sqrtf_diff.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/sqrtf_diff.cpp @@ -0,0 +1,17 @@ +//===-- Differential test for sqrtf +//----------------------------------------===// +// +// 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 "SingleInputSingleOutputDiff.h" + +#include "src/math/sqrtf.h" + +#include + +SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, __llvm_libc::sqrtf, ::sqrtf, + "sqrtf_diff.log") diff --git a/libc/test/src/math/differential_testing/sqrtf_perf.cpp b/libc/test/src/math/differential_testing/sqrtf_perf.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/sqrtf_perf.cpp @@ -0,0 +1,17 @@ +//===-- Differential test for sqrtf +//----------------------------------------===// +// +// 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 "SingleInputSingleOutputDiff.h" + +#include "src/math/sqrtf.h" + +#include + +SINGLE_INPUT_SINGLE_OUTPUT_PERF(float, __llvm_libc::sqrtf, ::sqrtf, + "sqrtf_perf.log")