brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · d2e63b3 Raw
35 lines · cpp
1//===-- Exhaustive test for atanhf ----------------------------------------===//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/__support/FPUtil/FPBits.h"11#include "src/math/atanhf.h"12#include "utils/MPFRWrapper/MPFRUtils.h"13 14using FPBits = LIBC_NAMESPACE::fputil::FPBits<float>;15 16using LlvmLibcAtanhfExhaustiveTest =17    LlvmLibcUnaryOpExhaustiveMathTest<float, mpfr::Operation::Atanh,18                                      LIBC_NAMESPACE::atanhf>;19 20// Range: [0, 1.0];21static const uint32_t POS_START = 0x0000'0000U;22static const uint32_t POS_STOP = FPBits(1.0f).uintval();23 24TEST_F(LlvmLibcAtanhfExhaustiveTest, PostiveRange) {25  test_full_range_all_roundings(POS_START, POS_STOP);26}27 28// Range: [-1.0, 0];29static const uint32_t NEG_START = 0x8000'0000U;30static const uint32_t NEG_STOP = FPBits(-1.0f).uintval();31 32TEST_F(LlvmLibcAtanhfExhaustiveTest, NegativeRange) {33  test_full_range_all_roundings(NEG_START, NEG_STOP);34}35