From: Sven Verdoolaege Date: Thu, 30 Dec 2010 12:47:49 +0000 (+0100) Subject: add some more isl_map_lexmin tests X-Git-Tag: isl-0.06~120 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e7310fb785954298ecb3fccaa60c3e5fd97bb48;p=platform%2Fupstream%2Fisl.git add some more isl_map_lexmin tests Signed-off-by: Sven Verdoolaege --- diff --git a/isl_test.c b/isl_test.c index ab446a2..2a0594b 100644 --- a/isl_test.c +++ b/isl_test.c @@ -1115,7 +1115,7 @@ void test_lex(struct isl_ctx *ctx) void test_lexmin(struct isl_ctx *ctx) { const char *str; - isl_map *map; + isl_map *map, *map2; isl_set *set; isl_set *set2; @@ -1144,6 +1144,36 @@ void test_lexmin(struct isl_ctx *ctx) set = isl_set_intersect(set, set2); assert(!isl_set_is_empty(set)); isl_set_free(set); + + str = "{ [x] -> [y] : x <= y <= 10; [x] -> [5] : -8 <= x <= 8 }"; + map = isl_map_read_from_str(ctx, str, -1); + map = isl_map_lexmin(map); + str = "{ [x] -> [5] : 6 <= x <= 8; " + "[x] -> [x] : x <= 5 or (9 <= x <= 10) }"; + map2 = isl_map_read_from_str(ctx, str, -1); + assert(isl_map_is_equal(map, map2)); + isl_map_free(map); + isl_map_free(map2); + + str = "{ [x] -> [y] : 4y = x or 4y = -1 + x or 4y = -2 + x }"; + map = isl_map_read_from_str(ctx, str, -1); + map2 = isl_map_copy(map); + map = isl_map_lexmin(map); + assert(isl_map_is_equal(map, map2)); + isl_map_free(map); + isl_map_free(map2); + + str = "{ [x] -> [y] : x = 4y; [x] -> [y] : x = 2y }"; + map = isl_map_read_from_str(ctx, str, -1); + map = isl_map_lexmin(map); + str = "{ [x] -> [y] : (4y = x and x >= 0) or " + "(exists (e0 = [(x)/4], e1 = [(-2 + x)/4]: 2y = x and " + "4e1 = -2 + x and 4e0 <= -1 + x and 4e0 >= -3 + x)) or " + "(exists (e0 = [(x)/4]: 2y = x and 4e0 = x and x <= -4)) }"; + map2 = isl_map_read_from_str(ctx, str, -1); + assert(isl_map_is_equal(map, map2)); + isl_map_free(map); + isl_map_free(map2); } struct must_may {