[llvm-branch-commits] [llvm] 5577fb2 - [tests][OpenMPIRBuilder] Use EXPECT_EQ instead ASSERT_EQ.

Michael Kruse via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Dec 11 09:55:03 PST 2020


Author: Michael Kruse
Date: 2020-12-11T11:49:50-06:00
New Revision: 5577fb229d3cd080dfe1f6b44240bbbdb85053d0

URL: https://github.com/llvm/llvm-project/commit/5577fb229d3cd080dfe1f6b44240bbbdb85053d0
DIFF: https://github.com/llvm/llvm-project/commit/5577fb229d3cd080dfe1f6b44240bbbdb85053d0.diff

LOG: [tests][OpenMPIRBuilder] Use EXPECT_EQ instead ASSERT_EQ.

Test execution can continue even if previous cases failed.

Added: 
    

Modified: 
    llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
index 6e69af725ccb..ad58fb837006 100644
--- a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+++ b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
@@ -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);
-
-  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);
-
-  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);
-
-  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(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);
+
+  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);
+
+  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);
+
+  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();


        


More information about the llvm-branch-commits mailing list