isl_stream_read_map: allow "not" at start of grouped expression
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 6 Apr 2012 09:58:03 +0000 (11:58 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 7 Apr 2012 14:23:01 +0000 (16:23 +0200)
Reported-by: Vladimir Klebanov <vladimir@cost-ic0701.org>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_input.c
isl_test.c

index c65faac..495366f 100644 (file)
@@ -1064,6 +1064,7 @@ static int resolve_paren_expr(struct isl_stream *s,
                        goto error;
 
        if (isl_stream_next_token_is(s, ISL_TOKEN_EXISTS) ||
+           isl_stream_next_token_is(s, ISL_TOKEN_NOT) ||
            isl_stream_next_token_is(s, ISL_TOKEN_TRUE) ||
            isl_stream_next_token_is(s, ISL_TOKEN_FALSE) ||
            isl_stream_next_token_is(s, ISL_TOKEN_MAP)) {
index c6cd583..4fda4d8 100644 (file)
@@ -190,6 +190,10 @@ int test_parse(struct isl_ctx *ctx)
        test_parse_pwaff(ctx, "{ [i] -> [i + 1] : i > 0; [a] -> [a] : a < 0 }");
        test_parse_pwqp(ctx, "{ [x] -> ([(x)/2] * [(x)/3]) }");
 
+       if (test_parse_map_equal(ctx, "{ [a] -> [b] : (not false) }",
+                                     "{ [a] -> [b] : true }") < 0)
+               return -1;
+
        return 0;
 }