1 | //===-- Unittests for erff ------------------------------------------------===// |
---|---|
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-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #include "hdr/math_macros.h" |
10 | #include "src/__support/FPUtil/FPBits.h" |
11 | #include "src/math/erff.h" |
12 | #include "test/UnitTest/FPMatcher.h" |
13 | #include "test/UnitTest/Test.h" |
14 | |
15 | #include <errno.h> |
16 | #include <stdint.h> |
17 | |
18 | using LlvmLibcErffTest = LIBC_NAMESPACE::testing::FPTest<float>; |
19 | |
20 | TEST_F(LlvmLibcErffTest, SpecialNumbers) { |
21 | EXPECT_FP_EQ_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::erff(aNaN)); |
22 | EXPECT_FP_EQ_ALL_ROUNDING(1.0f, LIBC_NAMESPACE::erff(inf)); |
23 | EXPECT_FP_EQ_ALL_ROUNDING(-1.0f, LIBC_NAMESPACE::erff(neg_inf)); |
24 | EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::erff(zero)); |
25 | EXPECT_FP_EQ_ALL_ROUNDING(neg_zero, LIBC_NAMESPACE::erff(neg_zero)); |
26 | } |
27 |