[libc-commits] [libc] f66cf13 - [libc][NFC] Rename global `nan` in tests to `aNaN`.
Siva Chandra Reddy via libc-commits
libc-commits at lists.llvm.org
Tue Dec 15 22:40:30 PST 2020
Author: Siva Chandra Reddy
Date: 2020-12-15T22:37:02-08:00
New Revision: f66cf13d5d0bc4099d452088c03fd6705aae2bc7
URL: https://github.com/llvm/llvm-project/commit/f66cf13d5d0bc4099d452088c03fd6705aae2bc7
DIFF: https://github.com/llvm/llvm-project/commit/f66cf13d5d0bc4099d452088c03fd6705aae2bc7.diff
LOG: [libc][NFC] Rename global `nan` in tests to `aNaN`.
The name `nan` conflicts with the function `nan` defined declared in
math.h.
Added:
Modified:
libc/test/src/math/ceil_test.cpp
libc/test/src/math/ceilf_test.cpp
libc/test/src/math/ceill_test.cpp
libc/test/src/math/copysign_test.cpp
libc/test/src/math/copysignf_test.cpp
libc/test/src/math/copysignl_test.cpp
libc/test/src/math/fabs_test.cpp
libc/test/src/math/fabsf_test.cpp
libc/test/src/math/fabsl_test.cpp
libc/test/src/math/floor_test.cpp
libc/test/src/math/floorf_test.cpp
libc/test/src/math/floorl_test.cpp
libc/test/src/math/fmax_test.cpp
libc/test/src/math/fmaxf_test.cpp
libc/test/src/math/fmaxl_test.cpp
libc/test/src/math/fmin_test.cpp
libc/test/src/math/fminf_test.cpp
libc/test/src/math/fminl_test.cpp
libc/test/src/math/round_test.cpp
libc/test/src/math/roundf_test.cpp
libc/test/src/math/roundl_test.cpp
libc/test/src/math/sqrt_test.cpp
libc/test/src/math/sqrtf_test.cpp
libc/test/src/math/sqrtl_test.cpp
libc/test/src/math/trunc_test.cpp
libc/test/src/math/truncf_test.cpp
libc/test/src/math/truncl_test.cpp
libc/utils/FPUtil/TestHelpers.h
Removed:
################################################################################
diff --git a/libc/test/src/math/ceil_test.cpp b/libc/test/src/math/ceil_test.cpp
index 0e17b0a7984b..1537227d3180 100644
--- a/libc/test/src/math/ceil_test.cpp
+++ b/libc/test/src/math/ceil_test.cpp
@@ -26,8 +26,8 @@ TEST(CeilTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::ceil(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::ceil(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::ceil(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::ceil(aNaN)), 0);
}
TEST(CeilTest, RoundedNumbers) {
diff --git a/libc/test/src/math/ceilf_test.cpp b/libc/test/src/math/ceilf_test.cpp
index 3d7db68eea3b..aa3ea73f0352 100644
--- a/libc/test/src/math/ceilf_test.cpp
+++ b/libc/test/src/math/ceilf_test.cpp
@@ -26,8 +26,8 @@ TEST(CeilfTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::ceilf(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::ceilf(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::ceilf(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::ceilf(aNaN)), 0);
}
TEST(CeilfTest, RoundedNumbers) {
diff --git a/libc/test/src/math/ceill_test.cpp b/libc/test/src/math/ceill_test.cpp
index 950a97622023..b33d317e0ac6 100644
--- a/libc/test/src/math/ceill_test.cpp
+++ b/libc/test/src/math/ceill_test.cpp
@@ -26,8 +26,8 @@ TEST(CeillTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::ceill(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::ceill(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::ceill(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::ceill(aNaN)), 0);
}
TEST(CeillTest, RoundedNumbers) {
diff --git a/libc/test/src/math/copysign_test.cpp b/libc/test/src/math/copysign_test.cpp
index 09067fa10b56..7ab7ccfdb700 100644
--- a/libc/test/src/math/copysign_test.cpp
+++ b/libc/test/src/math/copysign_test.cpp
@@ -17,8 +17,8 @@ using FPBits = __llvm_libc::fputil::FPBits<double>;
DECLARE_SPECIAL_CONSTANTS(double)
TEST(CopySignTest, SpecialNumbers) {
- EXPECT_FP_EQ(nan, __llvm_libc::copysign(nan, -1.0));
- EXPECT_FP_EQ(nan, __llvm_libc::copysign(nan, 1.0));
+ EXPECT_FP_EQ(aNaN, __llvm_libc::copysign(aNaN, -1.0));
+ EXPECT_FP_EQ(aNaN, __llvm_libc::copysign(aNaN, 1.0));
EXPECT_FP_EQ(negInf, __llvm_libc::copysign(inf, -1.0));
EXPECT_FP_EQ(inf, __llvm_libc::copysign(negInf, 1.0));
diff --git a/libc/test/src/math/copysignf_test.cpp b/libc/test/src/math/copysignf_test.cpp
index e43055041dc3..72082cac8d43 100644
--- a/libc/test/src/math/copysignf_test.cpp
+++ b/libc/test/src/math/copysignf_test.cpp
@@ -17,8 +17,8 @@ using FPBits = __llvm_libc::fputil::FPBits<float>;
DECLARE_SPECIAL_CONSTANTS(float)
TEST(CopySinfTest, SpecialNumbers) {
- EXPECT_FP_EQ(nan, __llvm_libc::copysignf(nan, -1.0));
- EXPECT_FP_EQ(nan, __llvm_libc::copysignf(nan, 1.0));
+ EXPECT_FP_EQ(aNaN, __llvm_libc::copysignf(aNaN, -1.0));
+ EXPECT_FP_EQ(aNaN, __llvm_libc::copysignf(aNaN, 1.0));
EXPECT_FP_EQ(negInf, __llvm_libc::copysignf(inf, -1.0));
EXPECT_FP_EQ(inf, __llvm_libc::copysignf(negInf, 1.0));
diff --git a/libc/test/src/math/copysignl_test.cpp b/libc/test/src/math/copysignl_test.cpp
index 47f439f10ca2..69daa038d991 100644
--- a/libc/test/src/math/copysignl_test.cpp
+++ b/libc/test/src/math/copysignl_test.cpp
@@ -17,8 +17,8 @@ using FPBits = __llvm_libc::fputil::FPBits<long double>;
DECLARE_SPECIAL_CONSTANTS(long double)
TEST(CopySinlTest, SpecialNumbers) {
- EXPECT_FP_EQ(nan, __llvm_libc::copysignl(nan, -1.0));
- EXPECT_FP_EQ(nan, __llvm_libc::copysignl(nan, 1.0));
+ EXPECT_FP_EQ(aNaN, __llvm_libc::copysignl(aNaN, -1.0));
+ EXPECT_FP_EQ(aNaN, __llvm_libc::copysignl(aNaN, 1.0));
EXPECT_FP_EQ(negInf, __llvm_libc::copysignl(inf, -1.0));
EXPECT_FP_EQ(inf, __llvm_libc::copysignl(negInf, 1.0));
diff --git a/libc/test/src/math/fabs_test.cpp b/libc/test/src/math/fabs_test.cpp
index 0e1dc48ccfe7..91d37e3f569b 100644
--- a/libc/test/src/math/fabs_test.cpp
+++ b/libc/test/src/math/fabs_test.cpp
@@ -20,7 +20,7 @@ DECLARE_SPECIAL_CONSTANTS(double)
namespace mpfr = __llvm_libc::testing::mpfr;
TEST(FabsTest, SpecialNumbers) {
- EXPECT_FP_EQ(nan, __llvm_libc::fabs(nan));
+ EXPECT_FP_EQ(aNaN, __llvm_libc::fabs(aNaN));
EXPECT_FP_EQ(inf, __llvm_libc::fabs(inf));
EXPECT_FP_EQ(inf, __llvm_libc::fabs(negInf));
diff --git a/libc/test/src/math/fabsf_test.cpp b/libc/test/src/math/fabsf_test.cpp
index 256748c6b87b..fc0925901fa5 100644
--- a/libc/test/src/math/fabsf_test.cpp
+++ b/libc/test/src/math/fabsf_test.cpp
@@ -20,7 +20,7 @@ DECLARE_SPECIAL_CONSTANTS(float)
namespace mpfr = __llvm_libc::testing::mpfr;
TEST(FabsfTest, SpecialNumbers) {
- EXPECT_FP_EQ(nan, __llvm_libc::fabsf(nan));
+ EXPECT_FP_EQ(aNaN, __llvm_libc::fabsf(aNaN));
EXPECT_FP_EQ(inf, __llvm_libc::fabsf(inf));
EXPECT_FP_EQ(inf, __llvm_libc::fabsf(negInf));
diff --git a/libc/test/src/math/fabsl_test.cpp b/libc/test/src/math/fabsl_test.cpp
index fd3a8825c0fa..1a0cb9d93be5 100644
--- a/libc/test/src/math/fabsl_test.cpp
+++ b/libc/test/src/math/fabsl_test.cpp
@@ -20,7 +20,7 @@ DECLARE_SPECIAL_CONSTANTS(long double)
namespace mpfr = __llvm_libc::testing::mpfr;
TEST(FabslTest, SpecialNumbers) {
- EXPECT_FP_EQ(nan, __llvm_libc::fabsl(nan));
+ EXPECT_FP_EQ(aNaN, __llvm_libc::fabsl(aNaN));
EXPECT_FP_EQ(inf, __llvm_libc::fabsl(inf));
EXPECT_FP_EQ(inf, __llvm_libc::fabsl(negInf));
diff --git a/libc/test/src/math/floor_test.cpp b/libc/test/src/math/floor_test.cpp
index 588b2a3dd56b..35f107a918cc 100644
--- a/libc/test/src/math/floor_test.cpp
+++ b/libc/test/src/math/floor_test.cpp
@@ -26,8 +26,8 @@ TEST(FloorTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::floor(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::floor(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::floor(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::floor(aNaN)), 0);
}
TEST(FloorTest, RoundedNumbers) {
diff --git a/libc/test/src/math/floorf_test.cpp b/libc/test/src/math/floorf_test.cpp
index 5a8e8cf63506..e6bc974f1fc8 100644
--- a/libc/test/src/math/floorf_test.cpp
+++ b/libc/test/src/math/floorf_test.cpp
@@ -26,8 +26,8 @@ TEST(FloorfTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::floorf(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::floorf(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::floorf(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::floorf(aNaN)), 0);
}
TEST(FloorfTest, RoundedNumbers) {
diff --git a/libc/test/src/math/floorl_test.cpp b/libc/test/src/math/floorl_test.cpp
index 3ab5d5f8201b..cad5c70c2f5b 100644
--- a/libc/test/src/math/floorl_test.cpp
+++ b/libc/test/src/math/floorl_test.cpp
@@ -26,8 +26,8 @@ TEST(FloorlTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::floorl(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::floorl(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::floorl(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::floorl(aNaN)), 0);
}
TEST(FloorlTest, RoundedNumbers) {
diff --git a/libc/test/src/math/fmax_test.cpp b/libc/test/src/math/fmax_test.cpp
index 1114307e60a8..b84db3003cc6 100644
--- a/libc/test/src/math/fmax_test.cpp
+++ b/libc/test/src/math/fmax_test.cpp
@@ -17,13 +17,13 @@ using FPBits = __llvm_libc::fputil::FPBits<double>;
DECLARE_SPECIAL_CONSTANTS(double)
TEST(FmaxTest, NaNArg) {
- EXPECT_FP_EQ(inf, __llvm_libc::fmax(nan, inf));
- EXPECT_FP_EQ(negInf, __llvm_libc::fmax(negInf, nan));
- EXPECT_FP_EQ(0.0, __llvm_libc::fmax(nan, 0.0));
- EXPECT_FP_EQ(-0.0, __llvm_libc::fmax(-0.0, nan));
- EXPECT_FP_EQ(-1.2345, __llvm_libc::fmax(nan, -1.2345));
- EXPECT_FP_EQ(1.2345, __llvm_libc::fmax(1.2345, nan));
- EXPECT_NE(isnan(__llvm_libc::fmax(nan, nan)), 0);
+ EXPECT_FP_EQ(inf, __llvm_libc::fmax(aNaN, inf));
+ EXPECT_FP_EQ(negInf, __llvm_libc::fmax(negInf, aNaN));
+ EXPECT_FP_EQ(0.0, __llvm_libc::fmax(aNaN, 0.0));
+ EXPECT_FP_EQ(-0.0, __llvm_libc::fmax(-0.0, aNaN));
+ EXPECT_FP_EQ(-1.2345, __llvm_libc::fmax(aNaN, -1.2345));
+ EXPECT_FP_EQ(1.2345, __llvm_libc::fmax(1.2345, aNaN));
+ EXPECT_NE(isnan(__llvm_libc::fmax(aNaN, aNaN)), 0);
}
TEST(FmaxTest, InfArg) {
diff --git a/libc/test/src/math/fmaxf_test.cpp b/libc/test/src/math/fmaxf_test.cpp
index 3e81c9979114..7d6661cb4b8b 100644
--- a/libc/test/src/math/fmaxf_test.cpp
+++ b/libc/test/src/math/fmaxf_test.cpp
@@ -17,13 +17,13 @@ using FPBits = __llvm_libc::fputil::FPBits<float>;
DECLARE_SPECIAL_CONSTANTS(float)
TEST(FmaxfTest, NaNArg) {
- EXPECT_FP_EQ(inf, __llvm_libc::fmaxf(nan, inf));
- EXPECT_FP_EQ(negInf, __llvm_libc::fmaxf(negInf, nan));
- EXPECT_FP_EQ(0.0f, __llvm_libc::fmaxf(nan, 0.0f));
- EXPECT_FP_EQ(-0.0f, __llvm_libc::fmaxf(-0.0f, nan));
- EXPECT_FP_EQ(-1.2345f, __llvm_libc::fmaxf(nan, -1.2345f));
- EXPECT_FP_EQ(1.2345f, __llvm_libc::fmaxf(1.2345f, nan));
- EXPECT_NE(isnan(__llvm_libc::fmaxf(nan, nan)), 0);
+ EXPECT_FP_EQ(inf, __llvm_libc::fmaxf(aNaN, inf));
+ EXPECT_FP_EQ(negInf, __llvm_libc::fmaxf(negInf, aNaN));
+ EXPECT_FP_EQ(0.0f, __llvm_libc::fmaxf(aNaN, 0.0f));
+ EXPECT_FP_EQ(-0.0f, __llvm_libc::fmaxf(-0.0f, aNaN));
+ EXPECT_FP_EQ(-1.2345f, __llvm_libc::fmaxf(aNaN, -1.2345f));
+ EXPECT_FP_EQ(1.2345f, __llvm_libc::fmaxf(1.2345f, aNaN));
+ EXPECT_NE(isnan(__llvm_libc::fmaxf(aNaN, aNaN)), 0);
}
TEST(FmaxfTest, InfArg) {
diff --git a/libc/test/src/math/fmaxl_test.cpp b/libc/test/src/math/fmaxl_test.cpp
index ce48b5dce76f..72f7636cb0eb 100644
--- a/libc/test/src/math/fmaxl_test.cpp
+++ b/libc/test/src/math/fmaxl_test.cpp
@@ -17,13 +17,13 @@ using FPBits = __llvm_libc::fputil::FPBits<long double>;
DECLARE_SPECIAL_CONSTANTS(long double)
TEST(FmaxlTest, NaNArg) {
- EXPECT_FP_EQ(inf, __llvm_libc::fmaxl(nan, inf));
- EXPECT_FP_EQ(negInf, __llvm_libc::fmaxl(negInf, nan));
- EXPECT_FP_EQ(0.0L, __llvm_libc::fmaxl(nan, 0.0L));
- EXPECT_FP_EQ(-0.0L, __llvm_libc::fmaxl(-0.0L, nan));
- EXPECT_FP_EQ(-1.2345L, __llvm_libc::fmaxl(nan, -1.2345L));
- EXPECT_FP_EQ(1.2345L, __llvm_libc::fmaxl(1.2345L, nan));
- EXPECT_NE(isnan(__llvm_libc::fmaxl(nan, nan)), 0);
+ EXPECT_FP_EQ(inf, __llvm_libc::fmaxl(aNaN, inf));
+ EXPECT_FP_EQ(negInf, __llvm_libc::fmaxl(negInf, aNaN));
+ EXPECT_FP_EQ(0.0L, __llvm_libc::fmaxl(aNaN, 0.0L));
+ EXPECT_FP_EQ(-0.0L, __llvm_libc::fmaxl(-0.0L, aNaN));
+ EXPECT_FP_EQ(-1.2345L, __llvm_libc::fmaxl(aNaN, -1.2345L));
+ EXPECT_FP_EQ(1.2345L, __llvm_libc::fmaxl(1.2345L, aNaN));
+ EXPECT_NE(isnan(__llvm_libc::fmaxl(aNaN, aNaN)), 0);
}
TEST(FmaxlTest, InfArg) {
diff --git a/libc/test/src/math/fmin_test.cpp b/libc/test/src/math/fmin_test.cpp
index 89a25beba8d7..5deaa857c1f2 100644
--- a/libc/test/src/math/fmin_test.cpp
+++ b/libc/test/src/math/fmin_test.cpp
@@ -17,13 +17,13 @@ using FPBits = __llvm_libc::fputil::FPBits<double>;
DECLARE_SPECIAL_CONSTANTS(double)
TEST(FminTest, NaNArg) {
- EXPECT_FP_EQ(inf, __llvm_libc::fmin(nan, inf));
- EXPECT_FP_EQ(negInf, __llvm_libc::fmin(negInf, nan));
- EXPECT_FP_EQ(0.0, __llvm_libc::fmin(nan, 0.0));
- EXPECT_FP_EQ(-0.0, __llvm_libc::fmin(-0.0, nan));
- EXPECT_FP_EQ(-1.2345, __llvm_libc::fmin(nan, -1.2345));
- EXPECT_FP_EQ(1.2345, __llvm_libc::fmin(1.2345, nan));
- EXPECT_NE(isnan(__llvm_libc::fmin(nan, nan)), 0);
+ EXPECT_FP_EQ(inf, __llvm_libc::fmin(aNaN, inf));
+ EXPECT_FP_EQ(negInf, __llvm_libc::fmin(negInf, aNaN));
+ EXPECT_FP_EQ(0.0, __llvm_libc::fmin(aNaN, 0.0));
+ EXPECT_FP_EQ(-0.0, __llvm_libc::fmin(-0.0, aNaN));
+ EXPECT_FP_EQ(-1.2345, __llvm_libc::fmin(aNaN, -1.2345));
+ EXPECT_FP_EQ(1.2345, __llvm_libc::fmin(1.2345, aNaN));
+ EXPECT_NE(isnan(__llvm_libc::fmin(aNaN, aNaN)), 0);
}
TEST(FminTest, InfArg) {
diff --git a/libc/test/src/math/fminf_test.cpp b/libc/test/src/math/fminf_test.cpp
index 6772fb5e96a3..d9a01dd506d8 100644
--- a/libc/test/src/math/fminf_test.cpp
+++ b/libc/test/src/math/fminf_test.cpp
@@ -17,13 +17,13 @@ using FPBits = __llvm_libc::fputil::FPBits<float>;
DECLARE_SPECIAL_CONSTANTS(float)
TEST(FminfTest, NaNArg) {
- EXPECT_FP_EQ(inf, __llvm_libc::fminf(nan, inf));
- EXPECT_FP_EQ(negInf, __llvm_libc::fminf(negInf, nan));
- EXPECT_FP_EQ(0.0f, __llvm_libc::fminf(nan, 0.0f));
- EXPECT_FP_EQ(-0.0f, __llvm_libc::fminf(-0.0f, nan));
- EXPECT_FP_EQ(-1.2345f, __llvm_libc::fminf(nan, -1.2345f));
- EXPECT_FP_EQ(1.2345f, __llvm_libc::fminf(1.2345f, nan));
- EXPECT_NE(isnan(__llvm_libc::fminf(nan, nan)), 0);
+ EXPECT_FP_EQ(inf, __llvm_libc::fminf(aNaN, inf));
+ EXPECT_FP_EQ(negInf, __llvm_libc::fminf(negInf, aNaN));
+ EXPECT_FP_EQ(0.0f, __llvm_libc::fminf(aNaN, 0.0f));
+ EXPECT_FP_EQ(-0.0f, __llvm_libc::fminf(-0.0f, aNaN));
+ EXPECT_FP_EQ(-1.2345f, __llvm_libc::fminf(aNaN, -1.2345f));
+ EXPECT_FP_EQ(1.2345f, __llvm_libc::fminf(1.2345f, aNaN));
+ EXPECT_NE(isnan(__llvm_libc::fminf(aNaN, aNaN)), 0);
}
TEST(FminfTest, InfArg) {
diff --git a/libc/test/src/math/fminl_test.cpp b/libc/test/src/math/fminl_test.cpp
index 20c88d410a47..75200b1212e5 100644
--- a/libc/test/src/math/fminl_test.cpp
+++ b/libc/test/src/math/fminl_test.cpp
@@ -17,13 +17,13 @@ using FPBits = __llvm_libc::fputil::FPBits<long double>;
DECLARE_SPECIAL_CONSTANTS(long double)
TEST(FminlTest, NaNArg) {
- EXPECT_FP_EQ(inf, __llvm_libc::fminl(nan, inf));
- EXPECT_FP_EQ(negInf, __llvm_libc::fminl(negInf, nan));
- EXPECT_FP_EQ(0.0L, __llvm_libc::fminl(nan, 0.0L));
- EXPECT_FP_EQ(-0.0L, __llvm_libc::fminl(-0.0L, nan));
- EXPECT_FP_EQ(-1.2345L, __llvm_libc::fminl(nan, -1.2345L));
- EXPECT_FP_EQ(1.2345L, __llvm_libc::fminl(1.2345L, nan));
- EXPECT_NE(isnan(__llvm_libc::fminl(nan, nan)), 0);
+ EXPECT_FP_EQ(inf, __llvm_libc::fminl(aNaN, inf));
+ EXPECT_FP_EQ(negInf, __llvm_libc::fminl(negInf, aNaN));
+ EXPECT_FP_EQ(0.0L, __llvm_libc::fminl(aNaN, 0.0L));
+ EXPECT_FP_EQ(-0.0L, __llvm_libc::fminl(-0.0L, aNaN));
+ EXPECT_FP_EQ(-1.2345L, __llvm_libc::fminl(aNaN, -1.2345L));
+ EXPECT_FP_EQ(1.2345L, __llvm_libc::fminl(1.2345L, aNaN));
+ EXPECT_NE(isnan(__llvm_libc::fminl(aNaN, aNaN)), 0);
}
TEST(FminlTest, InfArg) {
diff --git a/libc/test/src/math/round_test.cpp b/libc/test/src/math/round_test.cpp
index bc611d4559a1..defa22a05d44 100644
--- a/libc/test/src/math/round_test.cpp
+++ b/libc/test/src/math/round_test.cpp
@@ -26,8 +26,8 @@ TEST(RoundTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::round(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::round(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::round(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::round(aNaN)), 0);
}
TEST(RoundTest, RoundedNumbers) {
diff --git a/libc/test/src/math/roundf_test.cpp b/libc/test/src/math/roundf_test.cpp
index 4a49c095b882..2665e81e54c1 100644
--- a/libc/test/src/math/roundf_test.cpp
+++ b/libc/test/src/math/roundf_test.cpp
@@ -26,8 +26,8 @@ TEST(RoundfTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::roundf(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::roundf(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::roundf(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::roundf(aNaN)), 0);
}
TEST(RoundfTest, RoundedNumbers) {
diff --git a/libc/test/src/math/roundl_test.cpp b/libc/test/src/math/roundl_test.cpp
index 7b2eb6f90c8e..ff33c071b3b6 100644
--- a/libc/test/src/math/roundl_test.cpp
+++ b/libc/test/src/math/roundl_test.cpp
@@ -26,8 +26,8 @@ TEST(RoundlTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::roundl(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::roundl(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::roundl(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::roundl(aNaN)), 0);
}
TEST(RoundlTest, RoundedNumbers) {
diff --git a/libc/test/src/math/sqrt_test.cpp b/libc/test/src/math/sqrt_test.cpp
index beec7adcb7f9..f0a1ffff82f1 100644
--- a/libc/test/src/math/sqrt_test.cpp
+++ b/libc/test/src/math/sqrt_test.cpp
@@ -23,12 +23,12 @@ constexpr UIntType HiddenBit =
DECLARE_SPECIAL_CONSTANTS(double)
TEST(SqrtTest, SpecialValues) {
- ASSERT_FP_EQ(nan, __llvm_libc::sqrt(nan));
+ ASSERT_FP_EQ(aNaN, __llvm_libc::sqrt(aNaN));
ASSERT_FP_EQ(inf, __llvm_libc::sqrt(inf));
- ASSERT_FP_EQ(nan, __llvm_libc::sqrt(negInf));
+ ASSERT_FP_EQ(aNaN, __llvm_libc::sqrt(negInf));
ASSERT_FP_EQ(0.0, __llvm_libc::sqrt(0.0));
ASSERT_FP_EQ(-0.0, __llvm_libc::sqrt(-0.0));
- ASSERT_FP_EQ(nan, __llvm_libc::sqrt(-1.0));
+ ASSERT_FP_EQ(aNaN, __llvm_libc::sqrt(-1.0));
ASSERT_FP_EQ(1.0, __llvm_libc::sqrt(1.0));
ASSERT_FP_EQ(2.0, __llvm_libc::sqrt(4.0));
ASSERT_FP_EQ(3.0, __llvm_libc::sqrt(9.0));
diff --git a/libc/test/src/math/sqrtf_test.cpp b/libc/test/src/math/sqrtf_test.cpp
index b64b0d037623..2f1b8071227b 100644
--- a/libc/test/src/math/sqrtf_test.cpp
+++ b/libc/test/src/math/sqrtf_test.cpp
@@ -23,12 +23,12 @@ constexpr UIntType HiddenBit =
DECLARE_SPECIAL_CONSTANTS(float)
TEST(SqrtfTest, SpecialValues) {
- ASSERT_FP_EQ(nan, __llvm_libc::sqrtf(nan));
+ ASSERT_FP_EQ(aNaN, __llvm_libc::sqrtf(aNaN));
ASSERT_FP_EQ(inf, __llvm_libc::sqrtf(inf));
- ASSERT_FP_EQ(nan, __llvm_libc::sqrtf(negInf));
+ ASSERT_FP_EQ(aNaN, __llvm_libc::sqrtf(negInf));
ASSERT_FP_EQ(0.0f, __llvm_libc::sqrtf(0.0f));
ASSERT_FP_EQ(-0.0f, __llvm_libc::sqrtf(-0.0f));
- ASSERT_FP_EQ(nan, __llvm_libc::sqrtf(-1.0f));
+ ASSERT_FP_EQ(aNaN, __llvm_libc::sqrtf(-1.0f));
ASSERT_FP_EQ(1.0f, __llvm_libc::sqrtf(1.0f));
ASSERT_FP_EQ(2.0f, __llvm_libc::sqrtf(4.0f));
ASSERT_FP_EQ(3.0f, __llvm_libc::sqrtf(9.0f));
diff --git a/libc/test/src/math/sqrtl_test.cpp b/libc/test/src/math/sqrtl_test.cpp
index 4fe03df57eb6..6e7a092aef66 100644
--- a/libc/test/src/math/sqrtl_test.cpp
+++ b/libc/test/src/math/sqrtl_test.cpp
@@ -23,12 +23,12 @@ constexpr UIntType HiddenBit =
DECLARE_SPECIAL_CONSTANTS(long double)
TEST(SqrtlTest, SpecialValues) {
- ASSERT_FP_EQ(nan, __llvm_libc::sqrtl(nan));
+ ASSERT_FP_EQ(aNaN, __llvm_libc::sqrtl(aNaN));
ASSERT_FP_EQ(inf, __llvm_libc::sqrtl(inf));
- ASSERT_FP_EQ(nan, __llvm_libc::sqrtl(negInf));
+ ASSERT_FP_EQ(aNaN, __llvm_libc::sqrtl(negInf));
ASSERT_FP_EQ(0.0L, __llvm_libc::sqrtl(0.0L));
ASSERT_FP_EQ(-0.0L, __llvm_libc::sqrtl(-0.0L));
- ASSERT_FP_EQ(nan, __llvm_libc::sqrtl(-1.0L));
+ ASSERT_FP_EQ(aNaN, __llvm_libc::sqrtl(-1.0L));
ASSERT_FP_EQ(1.0L, __llvm_libc::sqrtl(1.0L));
ASSERT_FP_EQ(2.0L, __llvm_libc::sqrtl(4.0L));
ASSERT_FP_EQ(3.0L, __llvm_libc::sqrtl(9.0L));
diff --git a/libc/test/src/math/trunc_test.cpp b/libc/test/src/math/trunc_test.cpp
index 981a729b4e29..89fa17d9010f 100644
--- a/libc/test/src/math/trunc_test.cpp
+++ b/libc/test/src/math/trunc_test.cpp
@@ -26,8 +26,8 @@ TEST(TruncTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::trunc(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::trunc(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::trunc(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::trunc(aNaN)), 0);
}
TEST(TruncTest, RoundedNumbers) {
diff --git a/libc/test/src/math/truncf_test.cpp b/libc/test/src/math/truncf_test.cpp
index 416eb7c7d212..bd44ce7b1226 100644
--- a/libc/test/src/math/truncf_test.cpp
+++ b/libc/test/src/math/truncf_test.cpp
@@ -26,8 +26,8 @@ TEST(TruncfTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::truncf(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::truncf(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::truncf(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::truncf(aNaN)), 0);
}
TEST(TruncfTest, RoundedNumbers) {
diff --git a/libc/test/src/math/truncl_test.cpp b/libc/test/src/math/truncl_test.cpp
index 1220b7a7cc88..3c70a3a1593b 100644
--- a/libc/test/src/math/truncl_test.cpp
+++ b/libc/test/src/math/truncl_test.cpp
@@ -26,8 +26,8 @@ TEST(TrunclTest, SpecialNumbers) {
EXPECT_FP_EQ(inf, __llvm_libc::truncl(inf));
EXPECT_FP_EQ(negInf, __llvm_libc::truncl(negInf));
- ASSERT_NE(isnan(nan), 0);
- ASSERT_NE(isnan(__llvm_libc::truncl(nan)), 0);
+ ASSERT_NE(isnan(aNaN), 0);
+ ASSERT_NE(isnan(__llvm_libc::truncl(aNaN)), 0);
}
TEST(TrunclTest, RoundedNumbers) {
diff --git a/libc/utils/FPUtil/TestHelpers.h b/libc/utils/FPUtil/TestHelpers.h
index 8addb0c58db5..48abed85f276 100644
--- a/libc/utils/FPUtil/TestHelpers.h
+++ b/libc/utils/FPUtil/TestHelpers.h
@@ -68,7 +68,7 @@ FPMatcher<T, C> getMatcher(T expectedValue) {
#define DECLARE_SPECIAL_CONSTANTS(T) \
static const T zero = __llvm_libc::fputil::FPBits<T>::zero(); \
static const T negZero = __llvm_libc::fputil::FPBits<T>::negZero(); \
- static const T nan = __llvm_libc::fputil::FPBits<T>::buildNaN(1); \
+ static const T aNaN = __llvm_libc::fputil::FPBits<T>::buildNaN(1); \
static const T inf = __llvm_libc::fputil::FPBits<T>::inf(); \
static const T negInf = __llvm_libc::fputil::FPBits<T>::negInf();
More information about the libc-commits
mailing list