Supoprt for them was broken in f1ea969 (isl_stream_read_map: treat divs
as output variables while adding constraints, Thu Mar 17 16:29:06 2011 +0100).
When treating divs as output variables, we need to make sure that
each of them is backed by a variable in the list of active variables.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
{
int n = v->n;
isl_map *map;
+ unsigned total;
if (!bmap)
return NULL;
bmap = isl_basic_set_unwrap(isl_basic_set_lift(isl_basic_map_wrap(bmap)));
+ total = isl_basic_map_total_dim(bmap);
+ while (v->n < total)
+ if (vars_add_anon(v) < 0)
+ goto error;
bmap = add_constraint(s, v, bmap);
bmap = isl_basic_map_simplify(bmap);
vars_drop(v, v->n - n);
return map;
+error:
+ isl_basic_map_free(bmap);
+ return NULL;
}
static struct isl_map *read_disjuncts(struct isl_stream *s,
test_parse_map_equal(ctx, str, str2);
test_parse_pwqp(ctx, "{ [i] -> i + [ (i + [i/3])/2 ] }");
+ test_parse_map(ctx, "{ S1[i] -> [([i/10]),i%10] : 0 <= i <= 45 }");
}
void test_read(struct isl_ctx *ctx)