[tests][OpenMPIRBuilder] Use EXPECT_EQ instead ASSERT_EQ.

Test execution can continue even if previous cases failed.
This commit is contained in:
Michael Kruse 2020-12-11 11:45:35 -06:00
parent 8b1c4e310c
commit 5577fb229d
1 changed files with 37 additions and 37 deletions

View File

@ -1024,46 +1024,46 @@ TEST_F(OpenMPIRBuilderTest, CanonicalLoopBounds) {
return cast<ConstantInt>(TripCount)->getValue().getZExtValue();
};
ASSERT_EQ(EvalTripCount(0, 0, 1, false, false), 0);
ASSERT_EQ(EvalTripCount(0, 1, 2, false, false), 1);
ASSERT_EQ(EvalTripCount(0, 42, 1, false, false), 42);
ASSERT_EQ(EvalTripCount(0, 42, 2, false, false), 21);
ASSERT_EQ(EvalTripCount(21, 42, 1, false, false), 21);
ASSERT_EQ(EvalTripCount(0, 5, 5, false, false), 1);
ASSERT_EQ(EvalTripCount(0, 9, 5, false, false), 2);
ASSERT_EQ(EvalTripCount(0, 11, 5, false, false), 3);
ASSERT_EQ(EvalTripCount(0, 0xFFFF, 1, false, false), 0xFFFF);
ASSERT_EQ(EvalTripCount(0xFFFF, 0, 1, false, false), 0);
ASSERT_EQ(EvalTripCount(0xFFFE, 0xFFFF, 1, false, false), 1);
ASSERT_EQ(EvalTripCount(0, 0xFFFF, 0x100, false, false), 0x100);
ASSERT_EQ(EvalTripCount(0, 0xFFFF, 0xFFFF, false, false), 1);
EXPECT_EQ(EvalTripCount(0, 0, 1, false, false), 0);
EXPECT_EQ(EvalTripCount(0, 1, 2, false, false), 1);
EXPECT_EQ(EvalTripCount(0, 42, 1, false, false), 42);
EXPECT_EQ(EvalTripCount(0, 42, 2, false, false), 21);
EXPECT_EQ(EvalTripCount(21, 42, 1, false, false), 21);
EXPECT_EQ(EvalTripCount(0, 5, 5, false, false), 1);
EXPECT_EQ(EvalTripCount(0, 9, 5, false, false), 2);
EXPECT_EQ(EvalTripCount(0, 11, 5, false, false), 3);
EXPECT_EQ(EvalTripCount(0, 0xFFFF, 1, false, false), 0xFFFF);
EXPECT_EQ(EvalTripCount(0xFFFF, 0, 1, false, false), 0);
EXPECT_EQ(EvalTripCount(0xFFFE, 0xFFFF, 1, false, false), 1);
EXPECT_EQ(EvalTripCount(0, 0xFFFF, 0x100, false, false), 0x100);
EXPECT_EQ(EvalTripCount(0, 0xFFFF, 0xFFFF, false, false), 1);
ASSERT_EQ(EvalTripCount(0, 6, 5, false, false), 2);
ASSERT_EQ(EvalTripCount(0, 0xFFFF, 0xFFFE, false, false), 2);
ASSERT_EQ(EvalTripCount(0, 0, 1, false, true), 1);
ASSERT_EQ(EvalTripCount(0, 0, 0xFFFF, false, true), 1);
ASSERT_EQ(EvalTripCount(0, 0xFFFE, 1, false, true), 0xFFFF);
ASSERT_EQ(EvalTripCount(0, 0xFFFE, 2, false, true), 0x8000);
EXPECT_EQ(EvalTripCount(0, 6, 5, false, false), 2);
EXPECT_EQ(EvalTripCount(0, 0xFFFF, 0xFFFE, false, false), 2);
EXPECT_EQ(EvalTripCount(0, 0, 1, false, true), 1);
EXPECT_EQ(EvalTripCount(0, 0, 0xFFFF, false, true), 1);
EXPECT_EQ(EvalTripCount(0, 0xFFFE, 1, false, true), 0xFFFF);
EXPECT_EQ(EvalTripCount(0, 0xFFFE, 2, false, true), 0x8000);
ASSERT_EQ(EvalTripCount(0, 0, -1, true, false), 0);
ASSERT_EQ(EvalTripCount(0, 1, -1, true, true), 0);
ASSERT_EQ(EvalTripCount(20, 5, -5, true, false), 3);
ASSERT_EQ(EvalTripCount(20, 5, -5, true, true), 4);
ASSERT_EQ(EvalTripCount(-4, -2, 2, true, false), 1);
ASSERT_EQ(EvalTripCount(-4, -3, 2, true, false), 1);
ASSERT_EQ(EvalTripCount(-4, -2, 2, true, true), 2);
EXPECT_EQ(EvalTripCount(0, 0, -1, true, false), 0);
EXPECT_EQ(EvalTripCount(0, 1, -1, true, true), 0);
EXPECT_EQ(EvalTripCount(20, 5, -5, true, false), 3);
EXPECT_EQ(EvalTripCount(20, 5, -5, true, true), 4);
EXPECT_EQ(EvalTripCount(-4, -2, 2, true, false), 1);
EXPECT_EQ(EvalTripCount(-4, -3, 2, true, false), 1);
EXPECT_EQ(EvalTripCount(-4, -2, 2, true, true), 2);
ASSERT_EQ(EvalTripCount(INT16_MIN, 0, 1, true, false), 0x8000);
ASSERT_EQ(EvalTripCount(INT16_MIN, 0, 1, true, true), 0x8001);
ASSERT_EQ(EvalTripCount(INT16_MIN, 0x7FFF, 1, true, false), 0xFFFF);
ASSERT_EQ(EvalTripCount(INT16_MIN + 1, 0x7FFF, 1, true, true), 0xFFFF);
ASSERT_EQ(EvalTripCount(INT16_MIN, 0, 0x7FFF, true, false), 2);
ASSERT_EQ(EvalTripCount(0x7FFF, 0, -1, true, false), 0x7FFF);
ASSERT_EQ(EvalTripCount(0, INT16_MIN, -1, true, false), 0x8000);
ASSERT_EQ(EvalTripCount(0, INT16_MIN, -16, true, false), 0x800);
ASSERT_EQ(EvalTripCount(0x7FFF, INT16_MIN, -1, true, false), 0xFFFF);
ASSERT_EQ(EvalTripCount(0x7FFF, 1, INT16_MIN, true, false), 1);
ASSERT_EQ(EvalTripCount(0x7FFF, -1, INT16_MIN, true, true), 2);
EXPECT_EQ(EvalTripCount(INT16_MIN, 0, 1, true, false), 0x8000);
EXPECT_EQ(EvalTripCount(INT16_MIN, 0, 1, true, true), 0x8001);
EXPECT_EQ(EvalTripCount(INT16_MIN, 0x7FFF, 1, true, false), 0xFFFF);
EXPECT_EQ(EvalTripCount(INT16_MIN + 1, 0x7FFF, 1, true, true), 0xFFFF);
EXPECT_EQ(EvalTripCount(INT16_MIN, 0, 0x7FFF, true, false), 2);
EXPECT_EQ(EvalTripCount(0x7FFF, 0, -1, true, false), 0x7FFF);
EXPECT_EQ(EvalTripCount(0, INT16_MIN, -1, true, false), 0x8000);
EXPECT_EQ(EvalTripCount(0, INT16_MIN, -16, true, false), 0x800);
EXPECT_EQ(EvalTripCount(0x7FFF, INT16_MIN, -1, true, false), 0xFFFF);
EXPECT_EQ(EvalTripCount(0x7FFF, 1, INT16_MIN, true, false), 1);
EXPECT_EQ(EvalTripCount(0x7FFF, -1, INT16_MIN, true, true), 2);
// Finalize the function and verify it.
Builder.CreateRetVoid();