EXPECT_FP_EQ(nan, func(negZero, nan));
EXPECT_FP_EQ(nan, func(nan, T(-1.2345)));
EXPECT_FP_EQ(nan, func(T(1.2345), nan));
- EXPECT_NE(isnan(func(nan, nan)), 0);
+ EXPECT_FP_EQ(func(nan, nan), nan);
}
void testInfArg(FuncPtr func) {
y = T(1.0);
x = inf;
- EXPECT_NE(isnan(func(x, y, "ient)), 0);
+ EXPECT_FP_EQ(nan, func(x, y, "ient));
x = negInf;
- EXPECT_NE(isnan(func(x, y, "ient)), 0);
+ EXPECT_FP_EQ(nan, func(x, y, "ient));
x = T(1.0);
y = zero;
- EXPECT_NE(isnan(func(x, y, "ient)), 0);
+ EXPECT_FP_EQ(nan, func(x, y, "ient));
y = negZero;
- EXPECT_NE(isnan(func(x, y, "ient)), 0);
+ EXPECT_FP_EQ(nan, func(x, y, "ient));
y = nan;
x = T(1.0);
- EXPECT_NE(isnan(func(x, y, "ient)), 0);
+ EXPECT_FP_EQ(nan, func(x, y, "ient));
y = T(1.0);
x = nan;
- EXPECT_NE(isnan(func(x, y, "ient)), 0);
+ EXPECT_FP_EQ(nan, func(x, y, "ient));
x = nan;
y = nan;
- EXPECT_NE(isnan(func(x, y, "ient)), 0);
+ EXPECT_FP_EQ(nan, func(x, y, "ient));
x = zero;
y = T(1.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);
+ EXPECT_FP_EQ(aNaN, __llvm_libc::fmax(aNaN, aNaN));
}
TEST(FmaxTest, InfArg) {
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);
+ EXPECT_FP_EQ(aNaN, __llvm_libc::fmaxf(aNaN, aNaN));
}
TEST(FmaxfTest, InfArg) {
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);
+ EXPECT_FP_EQ(aNaN, __llvm_libc::fmaxl(aNaN, aNaN));
}
TEST(FmaxlTest, InfArg) {
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);
+ EXPECT_FP_EQ(aNaN, __llvm_libc::fmin(aNaN, aNaN));
}
TEST(FminTest, InfArg) {
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);
+ EXPECT_FP_EQ(aNaN, __llvm_libc::fminf(aNaN, aNaN));
}
TEST(FminfTest, InfArg) {
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);
+ EXPECT_FP_EQ(aNaN, __llvm_libc::fminl(aNaN, aNaN));
}
TEST(FminlTest, InfArg) {