[Mlir-commits] [mlir] 0512bf3 - [MLIR] PresburgerSetTest: fix comment and add a test case

Arjun P llvmlistbot at llvm.org
Mon Nov 22 06:31:08 PST 2021


Author: Arjun P
Date: 2021-11-22T20:00:56+05:30
New Revision: 0512bf354063098723ba683c63a972eb1a1f74ee

URL: https://github.com/llvm/llvm-project/commit/0512bf354063098723ba683c63a972eb1a1f74ee
DIFF: https://github.com/llvm/llvm-project/commit/0512bf354063098723ba683c63a972eb1a1f74ee.diff

LOG: [MLIR] PresburgerSetTest: fix comment and add a test case

Added: 
    

Modified: 
    mlir/unittests/Analysis/PresburgerSetTest.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/unittests/Analysis/PresburgerSetTest.cpp b/mlir/unittests/Analysis/PresburgerSetTest.cpp
index 4ae76d7f0c329..e146a770c0c83 100644
--- a/mlir/unittests/Analysis/PresburgerSetTest.cpp
+++ b/mlir/unittests/Analysis/PresburgerSetTest.cpp
@@ -224,8 +224,15 @@ TEST(SetTest, Intersect) {
 }
 
 TEST(SetTest, Subtract) {
-  // The interval [2, 8] minus
-  // the interval [10, 20].
+  // The interval [2, 8] minus the interval [10, 20].
+  testSubtractAtPoints(
+      makeSetFromFACs(1, {makeFACFromIneqs(1, {{1, -2},      // x >= 2.
+                                               {-1, 8}})}),  // x <= 8.
+      makeSetFromFACs(1, {makeFACFromIneqs(1, {{1, -10},     // x >= 10.
+                                               {-1, 20}})}), // x <= 20.
+      {{1}, {2}, {8}, {9}, {10}, {20}, {21}});
+
+  // Universe minus [2, 8] U [10, 20]
   testSubtractAtPoints(
       makeSetFromFACs(1, {makeFACFromIneqs(1, {})}),
       makeSetFromFACs(1,


        


More information about the Mlir-commits mailing list