From d17afdd1f5e49c0c5dcf6a6e0687330dcdc8e6bf Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 5 Aug 2011 18:02:18 +0200 Subject: [PATCH] isl_set_product: call isl_map_range_product instead of isl_map_product A set only has a "range", so we should only compute the product of that range and not of the domain. Signed-off-by: Sven Verdoolaege --- isl_map.c | 3 +-- isl_test.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/isl_map.c b/isl_map.c index 0c2cd15..7496da7 100644 --- a/isl_map.c +++ b/isl_map.c @@ -7584,8 +7584,7 @@ __isl_give isl_map *isl_map_flat_product(__isl_take isl_map *map1, */ struct isl_set *isl_set_product(struct isl_set *set1, struct isl_set *set2) { - return (struct isl_set *)isl_map_product((struct isl_map *)set1, - (struct isl_map *)set2); + return isl_map_range_product(set1, set2); } __isl_give isl_set *isl_set_flat_product(__isl_take isl_set *set1, diff --git a/isl_test.c b/isl_test.c index d8248a3..4d1bfd1 100644 --- a/isl_test.c +++ b/isl_test.c @@ -2337,6 +2337,25 @@ int test_dim_max(isl_ctx *ctx) return 0; } +int test_product(isl_ctx *ctx) +{ + const char *str; + isl_set *set; + int ok; + + str = "{ A[i] }"; + set = isl_set_read_from_str(ctx, str, -1); + set = isl_set_product(set, isl_set_copy(set)); + ok = isl_set_is_wrapping(set); + isl_set_free(set); + if (ok < 0) + return -1; + if (!ok) + isl_die(ctx, isl_error_unknown, "unexpected result", return -1); + + return 0; +} + int main() { struct isl_ctx *ctx; @@ -2345,6 +2364,8 @@ int main() assert(srcdir); ctx = isl_ctx_alloc(); + if (test_product(ctx) < 0) + goto error; if (test_dim_max(ctx) < 0) goto error; if (test_aff(ctx) < 0) -- 2.7.4