[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / libc / test / src / math / asin_test.cpp
blobd1b8483b8824ede2d82fda82041901f39dc4ef78
1 //===-- Unittests for asin ------------------------------------------------===//
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 //===----------------------------------------------------------------------===//
9 #include "src/math/asin.h"
10 #include "test/UnitTest/FPMatcher.h"
11 #include "test/UnitTest/Test.h"
12 #include "utils/MPFRWrapper/MPFRUtils.h"
13 #include <math.h>
15 #include <errno.h>
16 #include <stdint.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) {
25 errno = 0;
27 EXPECT_FP_EQ(aNaN, __llvm_libc::asin(aNaN));
28 EXPECT_MATH_ERRNO(0);
30 EXPECT_FP_EQ(0.0, __llvm_libc::asin(0.0));
31 EXPECT_MATH_ERRNO(0);
33 EXPECT_FP_EQ(-0.0, __llvm_libc::asin(-0.0));
34 EXPECT_MATH_ERRNO(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);