From: Sven Verdoolaege Date: Thu, 22 Apr 2010 06:42:32 +0000 (+0200) Subject: add some more coalescing test cases X-Git-Tag: isl-0.03~219 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef727b1e6646de8ad3e9a5850d56843f67a407d8;p=platform%2Fupstream%2Fisl.git add some more coalescing test cases --- diff --git a/isl_test.c b/isl_test.c index d6b6f1b..7e15ffd 100644 --- a/isl_test.c +++ b/isl_test.c @@ -547,6 +547,20 @@ void test_gist(struct isl_ctx *ctx) test_gist_case(ctx, "gist1"); } +void test_coalesce_set(isl_ctx *ctx, const char *str, int check_one) +{ + isl_set *set, *set2; + + set = isl_set_read_from_str(ctx, str, -1); + set = isl_set_coalesce(set); + set2 = isl_set_read_from_str(ctx, str, -1); + assert(isl_set_is_equal(set, set2)); + if (check_one) + assert(set && set->n == 1); + isl_set_free(set); + isl_set_free(set2); +} + void test_coalesce(struct isl_ctx *ctx) { const char *str; @@ -756,6 +770,12 @@ void test_coalesce(struct isl_ctx *ctx) assert(isl_map_is_equal(map, map2)); isl_map_free(map); isl_map_free(map2); + + test_coalesce_set(ctx, + "[M] -> { [i1] : (i1 >= 2 and i1 <= M) or " + "(i1 = M and M >= 1) }", 0); + test_coalesce_set(ctx, + "{[x,y] : x,y >= 0; [x,y] : 10 <= x <= 20 and y >= -1 }", 0); } void test_closure(struct isl_ctx *ctx)