28 lines · cpp
1//===-- Exhaustive test for rsqrtf ----------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "exhaustive_test.h"10#include "src/math/rsqrtf.h"11#include "utils/MPFRWrapper/MPFRUtils.h"12 13using LlvmLibcRsqrtfTest = LIBC_NAMESPACE::testing::FPTest<float>;14 15using LlvmLibcRsqrtfExhaustiveTest =16 LlvmLibcUnaryOpExhaustiveMathTest<float, mpfr::Operation::Rsqrt,17 LIBC_NAMESPACE::rsqrtf>;18 19namespace mpfr = LIBC_NAMESPACE::testing::mpfr;20 21// Range: [0, Inf]22static constexpr uint32_t POS_START = 0x0000'0000U;23static constexpr uint32_t POS_STOP = 0x7f80'0000U;24 25TEST_F(LlvmLibcRsqrtfExhaustiveTest, PositiveRange) {26 test_full_range_all_roundings(POS_START, POS_STOP);27}28