1c6aa206bSSiva Chandra Reddy //===-- Exhaustive test for sinf ------------------------------------------===//
2c6aa206bSSiva Chandra Reddy //
3c6aa206bSSiva Chandra Reddy // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4c6aa206bSSiva Chandra Reddy // See https://llvm.org/LICENSE.txt for license information.
5c6aa206bSSiva Chandra Reddy // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6c6aa206bSSiva Chandra Reddy //
7c6aa206bSSiva Chandra Reddy //===----------------------------------------------------------------------===//
8c6aa206bSSiva Chandra Reddy
9d883a4adSTue Ly #include "exhaustive_test.h"
10c6aa206bSSiva Chandra Reddy #include "src/math/sinf.h"
11c6aa206bSSiva Chandra Reddy #include "utils/MPFRWrapper/MPFRUtils.h"
12d883a4adSTue Ly
13*b6bc9d72SGuillaume Chatelet namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
14c6aa206bSSiva Chandra Reddy
159532074aSTue Ly using LlvmLibcSinfExhaustiveTest =
169532074aSTue Ly LlvmLibcUnaryOpExhaustiveMathTest<float, mpfr::Operation::Sin,
17*b6bc9d72SGuillaume Chatelet LIBC_NAMESPACE::sinf>;
18d883a4adSTue Ly
199532074aSTue Ly // Range: [0, Inf];
20d883a4adSTue Ly static constexpr uint32_t POS_START = 0x0000'0000U;
21d883a4adSTue Ly static constexpr uint32_t POS_STOP = 0x7f80'0000U;
22d883a4adSTue Ly
TEST_F(LlvmLibcSinfExhaustiveTest,PostiveRange)239532074aSTue Ly TEST_F(LlvmLibcSinfExhaustiveTest, PostiveRange) {
249532074aSTue Ly test_full_range_all_roundings(POS_START, POS_STOP);
25d883a4adSTue Ly }
26d883a4adSTue Ly
279532074aSTue Ly // Range: [-Inf, 0];
289532074aSTue Ly static constexpr uint32_t NEG_START = 0xb000'0000U;
29d883a4adSTue Ly static constexpr uint32_t NEG_STOP = 0xff80'0000U;
30d883a4adSTue Ly
TEST_F(LlvmLibcSinfExhaustiveTest,NegativeRange)319532074aSTue Ly TEST_F(LlvmLibcSinfExhaustiveTest, NegativeRange) {
329532074aSTue Ly test_full_range_all_roundings(NEG_START, NEG_STOP);
33c6aa206bSSiva Chandra Reddy }
34