namespace mpfr = __llvm_libc::testing::mpfr;
-static const double zero = FPBits::zero();
-static const double negZero = FPBits::negZero();
-static const double nan = FPBits::buildNaN(1);
-static const double inf = FPBits::inf();
-static const double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(double)
TEST(CeilTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::ceil(zero));
namespace mpfr = __llvm_libc::testing::mpfr;
-static const float zero = FPBits::zero();
-static const float negZero = FPBits::negZero();
-static const float nan = FPBits::buildNaN(1);
-static const float inf = FPBits::inf();
-static const float negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(float)
TEST(CeilfTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::ceilf(zero));
namespace mpfr = __llvm_libc::testing::mpfr;
-static const long double zero = FPBits::zero();
-static const long double negZero = FPBits::negZero();
-static const long double nan = FPBits::buildNaN(1);
-static const long double inf = FPBits::inf();
-static const long double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(long double)
TEST(CeillTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::ceill(zero));
using FPBits = __llvm_libc::fputil::FPBits<double>;
-static const double zero = FPBits::zero();
-static const double negZero = FPBits::negZero();
-static const double nan = FPBits::buildNaN(1);
-static const double inf = FPBits::inf();
-static const double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(double)
TEST(CopySignTest, SpecialNumbers) {
EXPECT_FP_EQ(nan, __llvm_libc::copysign(nan, -1.0));
using FPBits = __llvm_libc::fputil::FPBits<float>;
-static const float zero = FPBits::zero();
-static const float negZero = FPBits::negZero();
-static const float nan = FPBits::buildNaN(1);
-static const float inf = FPBits::inf();
-static const float negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(float)
TEST(CopySinfTest, SpecialNumbers) {
EXPECT_FP_EQ(nan, __llvm_libc::copysignf(nan, -1.0));
using FPBits = __llvm_libc::fputil::FPBits<long double>;
-static const long double zero = FPBits::zero();
-static const long double negZero = FPBits::negZero();
-static const long double nan = FPBits::buildNaN(1);
-static const long double inf = FPBits::inf();
-static const long double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(long double)
TEST(CopySinlTest, SpecialNumbers) {
EXPECT_FP_EQ(nan, __llvm_libc::copysignl(nan, -1.0));
using FPBits = __llvm_libc::fputil::FPBits<double>;
-static const double zero = FPBits::zero();
-static const double negZero = FPBits::negZero();
-static const double nan = FPBits::buildNaN(1);
-static const double inf = FPBits::inf();
-static const double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(double)
namespace mpfr = __llvm_libc::testing::mpfr;
using FPBits = __llvm_libc::fputil::FPBits<float>;
-static const float zero = FPBits::zero();
-static const float negZero = FPBits::negZero();
-static const float nan = FPBits::buildNaN(1);
-static const float inf = FPBits::inf();
-static const float negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(float)
namespace mpfr = __llvm_libc::testing::mpfr;
using FPBits = __llvm_libc::fputil::FPBits<long double>;
-static const long double zero = FPBits::zero();
-static const long double negZero = FPBits::negZero();
-static const long double nan = FPBits::buildNaN(1);
-static const long double inf = FPBits::inf();
-static const long double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(long double)
namespace mpfr = __llvm_libc::testing::mpfr;
using FPBits = __llvm_libc::fputil::FPBits<double>;
-namespace mpfr = __llvm_libc::testing::mpfr;
+DECLARE_SPECIAL_CONSTANTS(double)
-static const double zero = FPBits::zero();
-static const double negZero = FPBits::negZero();
-static const double nan = FPBits::buildNaN(1);
-static const double inf = FPBits::inf();
-static const double negInf = FPBits::negInf();
+namespace mpfr = __llvm_libc::testing::mpfr;
TEST(FloorTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::floor(zero));
using FPBits = __llvm_libc::fputil::FPBits<float>;
-namespace mpfr = __llvm_libc::testing::mpfr;
+DECLARE_SPECIAL_CONSTANTS(float)
-static const float zero = FPBits::zero();
-static const float negZero = FPBits::negZero();
-static const float nan = FPBits::buildNaN(1);
-static const float inf = FPBits::inf();
-static const float negInf = FPBits::negInf();
+namespace mpfr = __llvm_libc::testing::mpfr;
TEST(FloorfTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::floorf(zero));
using FPBits = __llvm_libc::fputil::FPBits<long double>;
-namespace mpfr = __llvm_libc::testing::mpfr;
+DECLARE_SPECIAL_CONSTANTS(long double)
-static const long double zero = FPBits::zero();
-static const long double negZero = FPBits::negZero();
-static const long double nan = FPBits::buildNaN(1);
-static const long double inf = FPBits::inf();
-static const long double negInf = FPBits::negInf();
+namespace mpfr = __llvm_libc::testing::mpfr;
TEST(FloorlTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::floorl(zero));
using FPBits = __llvm_libc::fputil::FPBits<double>;
-double nan = FPBits::buildNaN(1);
-double inf = FPBits::inf();
-double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(double)
TEST(FmaxTest, NaNArg) {
EXPECT_FP_EQ(inf, __llvm_libc::fmax(nan, inf));
using FPBits = __llvm_libc::fputil::FPBits<float>;
-float nan = FPBits::buildNaN(1);
-float inf = FPBits::inf();
-float negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(float)
TEST(FmaxfTest, NaNArg) {
EXPECT_FP_EQ(inf, __llvm_libc::fmaxf(nan, inf));
using FPBits = __llvm_libc::fputil::FPBits<long double>;
-long double nan = FPBits::buildNaN(1);
-long double inf = FPBits::inf();
-long double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(long double)
TEST(FmaxlTest, NaNArg) {
EXPECT_FP_EQ(inf, __llvm_libc::fmaxl(nan, inf));
using FPBits = __llvm_libc::fputil::FPBits<double>;
-double nan = static_cast<double>(FPBits::buildNaN(1));
-double inf = static_cast<double>(FPBits::inf());
-double negInf = static_cast<double>(FPBits::negInf());
+DECLARE_SPECIAL_CONSTANTS(double)
TEST(FminTest, NaNArg) {
EXPECT_FP_EQ(inf, __llvm_libc::fmin(nan, inf));
using FPBits = __llvm_libc::fputil::FPBits<float>;
-float nan = static_cast<float>(FPBits::buildNaN(1));
-float inf = static_cast<float>(FPBits::inf());
-float negInf = static_cast<float>(FPBits::negInf());
+DECLARE_SPECIAL_CONSTANTS(float)
TEST(FminfTest, NaNArg) {
EXPECT_FP_EQ(inf, __llvm_libc::fminf(nan, inf));
using FPBits = __llvm_libc::fputil::FPBits<long double>;
-long double nan = static_cast<long double>(FPBits::buildNaN(1));
-long double inf = static_cast<long double>(FPBits::inf());
-long double negInf = static_cast<long double>(FPBits::negInf());
+DECLARE_SPECIAL_CONSTANTS(long double)
TEST(FminlTest, NaNArg) {
EXPECT_FP_EQ(inf, __llvm_libc::fminl(nan, inf));
namespace mpfr = __llvm_libc::testing::mpfr;
-static const float zero = FPBits::zero();
-static const float negZero = FPBits::negZero();
-static const float nan = FPBits::buildNaN(1);
-static const float inf = FPBits::inf();
-static const float negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(float)
TEST(HypotfTest, SpecialNumbers) {
EXPECT_FP_EQ(__llvm_libc::hypotf(inf, nan), inf);
namespace mpfr = __llvm_libc::testing::mpfr;
-static const double zero = FPBits::zero();
-static const double negZero = FPBits::negZero();
-static const double nan = FPBits::buildNaN(1);
-static const double inf = FPBits::inf();
-static const double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(double)
TEST(RoundTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::round(zero));
namespace mpfr = __llvm_libc::testing::mpfr;
-static const float zero = FPBits::zero();
-static const float negZero = FPBits::negZero();
-static const float nan = FPBits::buildNaN(1);
-static const float inf = FPBits::inf();
-static const float negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(float)
TEST(RoundfTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::roundf(zero));
namespace mpfr = __llvm_libc::testing::mpfr;
-static const long double zero = FPBits::zero();
-static const long double negZero = FPBits::negZero();
-static const long double nan = FPBits::buildNaN(1);
-static const long double inf = FPBits::inf();
-static const long double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(long double)
TEST(RoundlTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::roundl(zero));
constexpr UIntType HiddenBit =
UIntType(1) << __llvm_libc::fputil::MantissaWidth<double>::value;
-double nan = FPBits::buildNaN(1);
-double inf = FPBits::inf();
-double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(double)
TEST(SqrtTest, SpecialValues) {
ASSERT_FP_EQ(nan, __llvm_libc::sqrt(nan));
constexpr UIntType HiddenBit =
UIntType(1) << __llvm_libc::fputil::MantissaWidth<float>::value;
-float nan = FPBits::buildNaN(1);
-float inf = FPBits::inf();
-float negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(float)
TEST(SqrtfTest, SpecialValues) {
ASSERT_FP_EQ(nan, __llvm_libc::sqrtf(nan));
constexpr UIntType HiddenBit =
UIntType(1) << __llvm_libc::fputil::MantissaWidth<long double>::value;
-long double nan = FPBits::buildNaN(1);
-long double inf = FPBits::inf();
-long double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(long double)
TEST(SqrtlTest, SpecialValues) {
ASSERT_FP_EQ(nan, __llvm_libc::sqrtl(nan));
namespace mpfr = __llvm_libc::testing::mpfr;
-static const double zero = FPBits::zero();
-static const double negZero = FPBits::negZero();
-static const double nan = FPBits::buildNaN(1);
-static const double inf = FPBits::inf();
-static const double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(double)
TEST(TruncTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::trunc(zero));
namespace mpfr = __llvm_libc::testing::mpfr;
-static const float zero = FPBits::zero();
-static const float negZero = FPBits::negZero();
-static const float nan = FPBits::buildNaN(1);
-static const float inf = FPBits::inf();
-static const float negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(float)
TEST(TruncfTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::truncf(zero));
namespace mpfr = __llvm_libc::testing::mpfr;
-static const long double zero = FPBits::zero();
-static const long double negZero = FPBits::negZero();
-static const long double nan = FPBits::buildNaN(1);
-static const long double inf = FPBits::inf();
-static const long double negInf = FPBits::negInf();
+DECLARE_SPECIAL_CONSTANTS(long double)
TEST(TrunclTest, SpecialNumbers) {
EXPECT_FP_EQ(zero, __llvm_libc::truncl(zero));