15#include <isl/cpp-checked.h>
17namespace isl {
using namespace checked; }
25 fprintf(stderr,
"Assertion failed in %s:%d %s\n", file, line, message);
39 return s.
is_error() ? -1 : unsigned(s);
43#define assert(exp) assert_impl(exp, __FILE__, __LINE__, #exp)
44#define IS_TRUE(b) (b).is_true()
45#define SIZE_VAL(s) size_val(s)
83 assert(
bool(b_true) ==
true);
84 assert(
bool(b_false) ==
false);
88 assert((!b_false).is_true());
89 assert((!b_true).is_false());
90 assert((!b_error).is_error());
136 isl::set s(ctx,
"{ [0]; [1]; [2] }");
138 std::vector<isl::basic_set> basic_sets;
141 basic_sets.push_back(bs);
148 assert(basic_sets.size() == 3);
195 assert(root.map_descendant_bottom_up(fail_map).is_null());
210 assert(root.foreach_descendant_top_down(inc_count_once).is_ok());
216 assert(root.child(0).every_descendant(is_not_domain).is_true());
217 assert(root.every_descendant(is_not_domain).is_false());
222 assert(root.every_descendant(fail).is_error());
229 filters = filters.unite(filter.filter());
233 assert(!root.every_descendant(collect_filters).is_error());
248 int count_ast_fail = 0;
249 auto fail_inc_count_ast =
256 build = build.set_at_each_domain(fail_inc_count_ast);
257 auto ast = build.node_from(
schedule);
259 assert(count_ast_fail > 0);
260 auto build_copy = build;
267 build_copy = build_copy.set_at_each_domain(inc_count_ast);
268 ast = build_copy.node_from(
schedule);
275 assert(count_ast_fail == 2);
stat foreach_basic_set(const std::function< stat(isl::basic_set)> &fn) const
boolean every_set(const std::function< boolean(isl::set)> &test) const
isl_ctx * isl_ctx_alloc(void)
void isl_ctx_free(isl_ctx *ctx)
static int count(int *con, unsigned len, int status)
static bool is_equal(const T &a, const T &b)
static void test_space(isl::ctx ctx)
static void test_ast_build(isl::ctx ctx)
static void assert_impl(bool condition, const char *file, int line, const char *message)
static int size_val(isl::size s)
static void test_every(isl::ctx ctx)
void test_return(isl::ctx ctx)
static void test_schedule_tree(isl::ctx ctx)
void test_foreach(isl::ctx ctx)
void test_return_bool(isl::ctx ctx)
void test_return_string(isl::ctx ctx)
void test_return_int(isl::ctx ctx)
static void test_ast_build_expr(isl::ctx ctx)
static void test_every_generic(isl::ctx ctx)
static isl::schedule test_ast_build_generic(isl::ctx ctx)
static isl::schedule_node test_schedule_tree_generic(isl::ctx ctx)
void test_parameters(isl::ctx ctx)
void test_return_obj(isl::ctx ctx)
void test_pointer(isl::ctx ctx)
void test_constructors(isl::ctx ctx)
static isl_stat inc_count(__isl_take isl_map *map, void *user)
These are automatically generated checked C++ bindings for isl.
boolean manage(isl_bool val)
isl_stat isl_options_set_on_error(isl_ctx *ctx, int val)
#define ISL_ON_ERROR_ABORT