Polly 19.0.0git
check_parse_fail_test_templ.c
Go to the documentation of this file.
1/*
2 * Copyright 2021 Cerebras Systems
3 *
4 * Use of this software is governed by the MIT license
5 *
6 * Written by Sven Verdoolaege,
7 * Cerebras Systems, 1237 E Arques Ave, Sunnyvale, CA, USA
8 */
9
10#define xCAT(A,B) A ## B
11#define CAT(A,B) xCAT(A,B)
12#undef TYPE
13#define TYPE CAT(isl_,BASE)
14#define xFN(TYPE,NAME) TYPE ## _ ## NAME
15#define FN(TYPE,NAME) xFN(TYPE,NAME)
16
17#undef TESTS
18#define TESTS CAT(parse_,CAT(BASE,_fail_tests))
19
20/* Test parsing of objects of type TYPE
21 * that are expected to fail.
22 */
23static isl_stat FN(check,TESTS)(isl_ctx *ctx)
24{
25 int i, n;
26 int on_error;
27
31 for (i = 0; i < n; ++i) {
32 TYPE *obj;
33
34 obj = FN(TYPE,read_from_str)(ctx, TESTS[i]);
35 FN(TYPE,free)(obj);
36 if (obj)
37 break;
38 }
40 if (i < n)
42 "parsing not expected to succeed",
43 return isl_stat_error);
44
45 return isl_stat_ok;
46}
#define TYPE
#define FN(TYPE, NAME)
#define TESTS
isl_stat
Definition: ctx.h:84
@ isl_stat_error
Definition: ctx.h:85
@ isl_stat_ok
Definition: ctx.h:86
#define isl_die(ctx, errno, msg, code)
Definition: ctx.h:137
@ isl_error_unknown
Definition: ctx.h:78
#define ARRAY_SIZE(array)
static struct isl_arg_choice on_error[]
Definition: isl_options.c:45
const char * obj
Definition: isl_test.c:3316
isl_stat isl_options_set_on_error(isl_ctx *ctx, int val)
int isl_options_get_on_error(isl_ctx *ctx)
#define ISL_ON_ERROR_CONTINUE
Definition: options.h:30
n
Definition: youcefn.c:8