[Mlir-commits] [llvm] [mlir] mlir/MathExtras: consolidate with llvm/MathExtras (PR #95087)
Nikita Popov
llvmlistbot at llvm.org
Tue Jun 11 03:43:35 PDT 2024
================
@@ -434,8 +434,25 @@ TEST(MathExtras, IsShiftedInt) {
EXPECT_FALSE((isShiftedInt<6, 10>(int64_t(1) << 15)));
}
-template <typename T>
-class OverflowTest : public ::testing::Test { };
+TEST(MathExtras, DivideCeilSigned) {
+ EXPECT_EQ(divideCeilSigned(14, 3), 5);
+ EXPECT_EQ(divideCeilSigned(14, -3), -4);
+ EXPECT_EQ(divideCeilSigned(-14, -3), 5);
+ EXPECT_EQ(divideCeilSigned(-14, 3), -4);
----------------
nikic wrote:
Should also have test cases with 15 instead of 14 to cover the case where the division is exact.
https://github.com/llvm/llvm-project/pull/95087
More information about the Mlir-commits
mailing list