1 //===-- Exhaustive test for fmodf16 ---------------------------------------===//
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-exception
7 //===----------------------------------------------------------------------===//
9 #include "exhaustive_test.h"
10 #include "src/math/fmodf16.h"
11 #include "utils/MPFRWrapper/MPFRUtils.h"
13 namespace mpfr
= LIBC_NAMESPACE::testing::mpfr
;
15 using LlvmLibcFmodf16ExhaustiveTest
=
16 LlvmLibcBinaryOpExhaustiveMathTest
<float16
, mpfr::Operation::Fmod
,
17 LIBC_NAMESPACE::fmodf16
>;
20 static constexpr uint16_t POS_START
= 0x0000U
;
21 static constexpr uint16_t POS_STOP
= 0x7c00U
;
24 static constexpr uint16_t NEG_START
= 0x8000U
;
25 static constexpr uint16_t NEG_STOP
= 0xfc00U
;
27 TEST_F(LlvmLibcFmodf16ExhaustiveTest
, PostivePositiveRange
) {
28 test_full_range_all_roundings(POS_START
, POS_STOP
, POS_START
, POS_STOP
);
31 TEST_F(LlvmLibcFmodf16ExhaustiveTest
, PostiveNegativeRange
) {
32 test_full_range_all_roundings(POS_START
, POS_STOP
, NEG_START
, NEG_STOP
);
35 TEST_F(LlvmLibcFmodf16ExhaustiveTest
, NegativePositiveRange
) {
36 test_full_range_all_roundings(NEG_START
, NEG_STOP
, POS_START
, POS_STOP
);
39 TEST_F(LlvmLibcFmodf16ExhaustiveTest
, NegativeNegativeRange
) {
40 test_full_range_all_roundings(NEG_START
, NEG_STOP
, POS_START
, POS_STOP
);