1 //===-- Unittests for asin ------------------------------------------------===//
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 "src/math/asin.h"
10 #include "test/UnitTest/FPMatcher.h"
11 #include "test/UnitTest/Test.h"
12 #include "utils/MPFRWrapper/MPFRUtils.h"
18 using FPBits
= __llvm_libc::fputil::FPBits
<double>;
20 namespace mpfr
= __llvm_libc::testing::mpfr
;
22 DECLARE_SPECIAL_CONSTANTS(double)
24 TEST(LlvmLibcAsinTest
, SpecialNumbers
) {
27 EXPECT_FP_EQ(aNaN
, __llvm_libc::asin(aNaN
));
30 EXPECT_FP_EQ(0.0, __llvm_libc::asin(0.0));
33 EXPECT_FP_EQ(-0.0, __llvm_libc::asin(-0.0));
36 EXPECT_FP_EQ(aNaN
, __llvm_libc::asin(inf
));
37 EXPECT_MATH_ERRNO(EDOM
);
39 EXPECT_FP_EQ(aNaN
, __llvm_libc::asin(neg_inf
));
40 EXPECT_MATH_ERRNO(EDOM
);