From: Sven Verdoolaege Date: Tue, 26 Oct 2010 09:25:03 +0000 (+0200) Subject: fix isl_union_{set,map}_lex_g{e,t}_union_map X-Git-Tag: isl-0.05~105 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da725dafa573a0f0a3f2f3189d7f73d2af5c9a86;p=platform%2Fupstream%2Fisl.git fix isl_union_{set,map}_lex_g{e,t}_union_map Signed-off-by: Sven Verdoolaege --- diff --git a/isl_test.c b/isl_test.c index b73b642..c4d8b51 100644 --- a/isl_test.c +++ b/isl_test.c @@ -15,6 +15,7 @@ #include #include #include +#include static char *srcdir; @@ -1431,6 +1432,24 @@ void test_split_periods(isl_ctx *ctx) isl_pw_qpolynomial_free(pwqp); } +void test_union(isl_ctx *ctx) +{ + const char *str; + isl_union_set *uset; + isl_union_map *umap1, *umap2; + + str = "{ [i] : 0 <= i <= 1 }"; + uset = isl_union_set_from_set(isl_set_read_from_str(ctx, str, -1)); + str = "{ [1] -> [0] }"; + umap1 = isl_union_map_from_map(isl_map_read_from_str(ctx, str, -1)); + + umap2 = isl_union_set_lex_gt_union_set(isl_union_set_copy(uset), uset); + assert(isl_union_map_is_equal(umap1, umap2)); + + isl_union_map_free(umap1); + isl_union_map_free(umap2); +} + int main() { struct isl_ctx *ctx; @@ -1439,6 +1458,7 @@ int main() assert(srcdir); ctx = isl_ctx_alloc(); + test_union(ctx); test_split_periods(ctx); test_parse(ctx); test_pwqp(ctx); diff --git a/isl_union_map.c b/isl_union_map.c index 6b11f60..836f23f 100644 --- a/isl_union_map.c +++ b/isl_union_map.c @@ -609,25 +609,25 @@ __isl_give isl_union_map *isl_union_set_lex_le_union_set( __isl_give isl_union_map *isl_union_set_lex_gt_union_set( __isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2) { - return isl_union_set_lex_lt_union_set(uset2, uset1); + return isl_union_map_reverse(isl_union_set_lex_lt_union_set(uset2, uset1)); } __isl_give isl_union_map *isl_union_set_lex_ge_union_set( __isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2) { - return isl_union_set_lex_le_union_set(uset2, uset1); + return isl_union_map_reverse(isl_union_set_lex_le_union_set(uset2, uset1)); } __isl_give isl_union_map *isl_union_map_lex_gt_union_map( __isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2) { - return isl_union_map_lex_lt_union_map(umap2, umap1); + return isl_union_map_reverse(isl_union_map_lex_lt_union_map(umap2, umap1)); } __isl_give isl_union_map *isl_union_map_lex_ge_union_map( __isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2) { - return isl_union_map_lex_le_union_map(umap2, umap1); + return isl_union_map_reverse(isl_union_map_lex_le_union_map(umap2, umap1)); } static int intersect_domain_entry(void **entry, void *user)