================ @@ -631,6 +631,46 @@ TEST(APFloatTest, Maximum) { EXPECT_TRUE(std::isnan(maximum(nan, f1).convertToDouble())); } +TEST(APFloatTest, MinimumNumber) { + APFloat f1(1.0); + APFloat f2(2.0); + APFloat zp(0.0); + APFloat zn(-0.0); + APFloat nan = APFloat::getNaN(APFloat::IEEEdouble()); + APFloat snan = APFloat::getSNaN(APFloat::IEEEdouble()); + + EXPECT_EQ(1.0, minimumnum(f1, f2).convertToDouble()); + EXPECT_EQ(1.0, minimumnum(f2, f1).convertToDouble()); + EXPECT_EQ(-0.0, minimumnum(zp, zn).convertToDouble()); + EXPECT_EQ(-0.0, minimumnum(zn, zp).convertToDouble()); ---------------- jcranmer-intel wrote:
I don't think this is testing what you want to test, as `0.0 == -0.0` https://github.com/llvm/llvm-project/pull/93841 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits