xref: /llvm-project/libc/test/src/math/exhaustive/sqrtf_test.cpp (revision b6bc9d72f65a5086f310f321e969d96e9a559e75)
1b79507a4STue Ly //===-- Exhaustive test for sqrtf -----------------------------------------===//
2b79507a4STue Ly //
3b79507a4STue Ly // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4b79507a4STue Ly // See https://llvm.org/LICENSE.txt for license information.
5b79507a4STue Ly // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6b79507a4STue Ly //
7b79507a4STue Ly //===---------------------------------------------------------------------===//
8b79507a4STue Ly 
99532074aSTue Ly #include "exhaustive_test.h"
10b79507a4STue Ly #include "src/math/sqrtf.h"
11b79507a4STue Ly #include "utils/MPFRWrapper/MPFRUtils.h"
12b79507a4STue Ly 
13*b6bc9d72SGuillaume Chatelet namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
14b79507a4STue Ly 
159532074aSTue Ly using LlvmLibcSqrtfExhaustiveTest =
169532074aSTue Ly     LlvmLibcUnaryOpExhaustiveMathTest<float, mpfr::Operation::Sqrt,
17*b6bc9d72SGuillaume Chatelet                                       LIBC_NAMESPACE::sqrtf>;
189532074aSTue Ly 
199532074aSTue Ly // Range: [0, Inf];
209532074aSTue Ly static constexpr uint32_t POS_START = 0x0000'0000U;
219532074aSTue Ly static constexpr uint32_t POS_STOP = 0x7f80'0000U;
229532074aSTue Ly 
TEST_F(LlvmLibcSqrtfExhaustiveTest,PostiveRange)239532074aSTue Ly TEST_F(LlvmLibcSqrtfExhaustiveTest, PostiveRange) {
249532074aSTue Ly   test_full_range_all_roundings(POS_START, POS_STOP);
25b79507a4STue Ly }
26