Polly 20.0.0git
isl_test_cpp17-checked.cc
Go to the documentation of this file.
1#include <stdlib.h>
2
3#include <exception>
4#include <iostream>
5
6#include <isl/options.h>
7#include <isl/cpp-checked.h>
8
9/* Select the "checked" interface.
10 */
11namespace isl { using namespace checked; }
12
13/* Print an error message and abort.
14 */
15static void die_impl(const char *file, int line, const char *message)
16{
17 std::cerr << file << ":" << line << ": " << message << "\n";
18 exit(EXIT_FAILURE);
19}
20
21#define die(msg) die_impl(__FILE__, __LINE__, msg)
22
24
25/* Test the C++17 specific features of the isl checked C++ interface
26 *
27 * In particular, test
28 * - id::try_user
29 */
30int main()
31{
32 isl_ctx *ctx = isl_ctx_alloc();
33
35
36 test_try_user(ctx);
37
38 isl_ctx_free(ctx);
39
40 return EXIT_SUCCESS;
41}
isl_ctx * isl_ctx_alloc(void)
Definition: isl_ctx.c:261
void isl_ctx_free(isl_ctx *ctx)
Definition: isl_ctx.c:288
static void die_impl(const char *file, int line, const char *message)
int main()
static void test_try_user(isl::ctx ctx)
These are automatically generated checked C++ bindings for isl.
Definition: ISLTools.h:45
isl_stat isl_options_set_on_error(isl_ctx *ctx, int val)
#define ISL_ON_ERROR_ABORT
Definition: options.h:31