buildtools/gcc/isl/check_reparse_test_templ.c
Fredrik Holmqvist c8db99d323 Redo Update to ISL 0.22.1
GCC had a horrible .gitignore, untracked files were not applied
2020-07-22 10:07:48 +02:00

29 lines
679 B
C

#define xCAT(A,B) A ## B
#define CAT(A,B) xCAT(A,B)
#undef TYPE
#define TYPE CAT(isl_,BASE)
#define xFN(TYPE,NAME) TYPE ## _ ## NAME
#define FN(TYPE,NAME) xFN(TYPE,NAME)
#define TESTS CAT(reparse_,CAT(BASE,_tests))
/* Test parsing of objects of type TYPE by printing
* the expressions and checking that parsing the output results
* in the same expression.
* Do this for a set of expressions parsed from strings.
*/
static isl_stat FN(check,TESTS)(isl_ctx *ctx)
{
int i;
for (i = 0; i < ARRAY_SIZE(TESTS); ++i) {
TYPE *obj;
obj = FN(TYPE,read_from_str)(ctx, TESTS[i]);
if (FN(check_reparse,BASE)(ctx, obj) < 0)
return isl_stat_error;
}
return isl_stat_ok;
}