xref: /llvm-project/libc/test/src/math/exhaustive/acosf_test.cpp (revision b6bc9d72f65a5086f310f321e969d96e9a559e75)
1463dcc87STue Ly //===-- Exhaustive test for acosf -----------------------------------------===//
2463dcc87STue Ly //
3463dcc87STue Ly // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4463dcc87STue Ly // See https://llvm.org/LICENSE.txt for license information.
5463dcc87STue Ly // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6463dcc87STue Ly //
7463dcc87STue Ly //===----------------------------------------------------------------------===//
8463dcc87STue Ly 
9463dcc87STue Ly #include "exhaustive_test.h"
10463dcc87STue Ly #include "src/math/acosf.h"
11463dcc87STue Ly #include "utils/MPFRWrapper/MPFRUtils.h"
12463dcc87STue Ly 
13*b6bc9d72SGuillaume Chatelet namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
14463dcc87STue Ly 
159532074aSTue Ly using LlvmLibcAcosfExhaustiveTest =
169532074aSTue Ly     LlvmLibcUnaryOpExhaustiveMathTest<float, mpfr::Operation::Acos,
17*b6bc9d72SGuillaume Chatelet                                       LIBC_NAMESPACE::acosf>;
18463dcc87STue Ly 
19463dcc87STue Ly // Range: [0, Inf];
209532074aSTue Ly static constexpr uint32_t POS_START = 0x0000'0000U;
219532074aSTue Ly static constexpr uint32_t POS_STOP = 0x7f80'0000U;
22463dcc87STue Ly 
TEST_F(LlvmLibcAcosfExhaustiveTest,PostiveRange)239532074aSTue Ly TEST_F(LlvmLibcAcosfExhaustiveTest, PostiveRange) {
249532074aSTue Ly   test_full_range_all_roundings(POS_START, POS_STOP);
25463dcc87STue Ly }
26463dcc87STue Ly 
27463dcc87STue Ly // Range: [-Inf, 0];
289532074aSTue Ly static constexpr uint32_t NEG_START = 0xb000'0000U;
299532074aSTue Ly static constexpr uint32_t NEG_STOP = 0xff80'0000U;
30463dcc87STue Ly 
TEST_F(LlvmLibcAcosfExhaustiveTest,NegativeRange)319532074aSTue Ly TEST_F(LlvmLibcAcosfExhaustiveTest, NegativeRange) {
329532074aSTue Ly   test_full_range_all_roundings(NEG_START, NEG_STOP);
33463dcc87STue Ly }
34