The only debatable case is that of an empty map, which in principle
could be considered to be a subset of any map. This patch considers
empty maps not to be subsets of maps in other spaces.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
if (!map1 || !map2)
return -1;
+ if (!isl_map_has_equal_dim(map1, map2))
+ return 0;
+
if (isl_map_is_empty(map1))
return 1;
return 0;
}
+int test_equal(isl_ctx *ctx)
+{
+ const char *str;
+ isl_set *set, *set2;
+ int equal;
+
+ str = "{ S_6[i] }";
+ set = isl_set_read_from_str(ctx, str, -1);
+ str = "{ S_7[i] }";
+ set2 = isl_set_read_from_str(ctx, str, -1);
+ equal = isl_set_is_equal(set, set2);
+ isl_set_free(set);
+ isl_set_free(set2);
+ if (equal < 0)
+ return -1;
+ if (equal)
+ isl_die(ctx, isl_error_unknown, "unexpected result", return -1);
+
+ return 0;
+}
+
int main()
{
struct isl_ctx *ctx;
assert(srcdir);
ctx = isl_ctx_alloc();
+ if (test_equal(ctx) < 0)
+ goto error;
if (test_product(ctx) < 0)
goto error;
if (test_dim_max(ctx) < 0)