isl_test_cpp17-generic.cc: work around std::optional::value issue in older macOS
[isl.git] / isl_test_cpp17-checked.cc
blob3c213987fe4df4f970738c663e5122f1ffeca90f
1 #include <stdlib.h>
3 #include <exception>
4 #include <iostream>
6 #include <isl/options.h>
7 #include <isl/cpp-checked.h>
9 /* Select the "checked" interface.
11 namespace isl { using namespace checked; }
13 /* Print an error message and abort.
15 static void die_impl(const char *file, int line, const char *message)
17 std::cerr << file << ":" << line << ": " << message << "\n";
18 exit(EXIT_FAILURE);
21 #define die(msg) die_impl(__FILE__, __LINE__, msg)
23 #include "isl_test_cpp17-generic.cc"
25 /* Test the C++17 specific features of the isl checked C++ interface
27 * In particular, test
28 * - id::try_user
30 int main()
32 isl_ctx *ctx = isl_ctx_alloc();
34 isl_options_set_on_error(ctx, ISL_ON_ERROR_ABORT);
36 test_try_user(ctx);
38 isl_ctx_free(ctx);
40 return EXIT_SUCCESS;