Polly 19.0.0git
Classes | Macros | Typedefs | Functions | Variables
isl_test2.cc File Reference
#include <assert.h>
#include <stdlib.h>
#include <functional>
#include <iostream>
#include <sstream>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include <isl/cpp.h>

Go to the source code of this file.

Classes

struct  unary
 
struct  binary
 
struct  ternary
 

Macros

#define THROW_INVALID(msg)    isl::exception::throw_error(isl_error_invalid, msg, __FILE__, __LINE__)
 
#define C(FN, ...)   test(ctx, FN, #FN, __VA_ARGS__)
 

Typedefs

template<typename A1 , typename R , typename T >
using binary_fn = R(T::*)(A1) const
 
template<typename A1 , typename A2 , typename R , typename T >
using ternary_fn = R(T::*)(A1, A2) const
 

Functions

template<typename A1 , typename R , typename T >
static binary_fn< A1, R, T > const arg (const binary_fn< A1, R, T > &fn)
 
template<typename A1 , typename A2 , typename R , typename T >
static ternary_fn< A1, A2, R, T > const arg (const ternary_fn< A1, A2, R, T > &fn)
 
template<typename T , typename std::decay< decltype(std::declval< T >().is_equal(std::declval< T >()))>::type = true>
static bool is_equal (const T &a, const T &b)
 
template<typename R , typename T >
static void test (isl::ctx ctx, R(T::*fn)() const, const std::string &name, const std::vector< unary > &tests)
 
template<typename R , typename T , typename A1 >
static void test (isl::ctx ctx, R(T::*fn)(A1) const, const std::string &name, const std::vector< binary > &tests)
 
template<typename R , typename T , typename A1 , typename A2 >
static void test (isl::ctx ctx, R(T::*fn)(A1, A2) const, const std::string &name, const std::vector< ternary > &tests)
 
static void test_space (isl::ctx ctx)
 
static void test_conversion (isl::ctx ctx)
 
static void test_preimage (isl::ctx ctx)
 
static void test_fixed_power (isl::ctx ctx)
 
static void test_intersect (isl::ctx ctx)
 
static void test_gist (isl::ctx ctx)
 
static void test_project (isl::ctx ctx)
 
static void test_scale (isl::ctx ctx)
 
static void test_id_to_id (isl::ctx ctx)
 
int main (int argc, char **argv)
 

Variables

static std::vector< std::pair< const char *, void(*)(isl::ctx)> > tests
 

Macro Definition Documentation

◆ C

#define C (   FN,
  ... 
)    test(ctx, FN, #FN, __VA_ARGS__)

Definition at line 197 of file isl_test2.cc.

◆ THROW_INVALID

#define THROW_INVALID (   msg)     isl::exception::throw_error(isl_error_invalid, msg, __FILE__, __LINE__)

Definition at line 112 of file isl_test2.cc.

Typedef Documentation

◆ binary_fn

template<typename A1 , typename R , typename T >
using binary_fn = R (T::*)(A1) const

Definition at line 38 of file isl_test2.cc.

◆ ternary_fn

template<typename A1 , typename A2 , typename R , typename T >
using ternary_fn = R (T::*)(A1, A2) const

Definition at line 55 of file isl_test2.cc.

Function Documentation

◆ arg() [1/2]

template<typename A1 , typename R , typename T >
static binary_fn< A1, R, T > const arg ( const binary_fn< A1, R, T > &  fn)
static

Definition at line 45 of file isl_test2.cc.

References fn.

◆ arg() [2/2]

template<typename A1 , typename A2 , typename R , typename T >
static ternary_fn< A1, A2, R, T > const arg ( const ternary_fn< A1, A2, R, T > &  fn)
static

Definition at line 62 of file isl_test2.cc.

References fn.

◆ is_equal()

template<typename T , typename std::decay< decltype(std::declval< T >().is_equal(std::declval< T >()))>::type = true>
static bool is_equal ( const T &  a,
const T &  b 
)
static

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 421 of file isl_test2.cc.

References assert, f, ISL_ARG_ALL, isl_ctx_alloc_with_options(), isl_ctx_free(), and tests.

◆ test() [1/3]

template<typename R , typename T >
static void test ( isl::ctx  ctx,
R(T::*)() const  fn,
const std::string &  name,
const std::vector< unary > &  tests 
)
static

Definition at line 120 of file isl_test2.cc.

References expected, fn, is_equal(), name, obj, res, test, tests, and THROW_INVALID.

◆ test() [2/3]

template<typename R , typename T , typename A1 >
static void test ( isl::ctx  ctx,
R(T::*)(A1) const  fn,
const std::string &  name,
const std::vector< binary > &  tests 
)
static

Definition at line 145 of file isl_test2.cc.

References arg1, expected, fn, is_equal(), name, obj, res, test, tests, and THROW_INVALID.

◆ test() [3/3]

template<typename R , typename T , typename A1 , typename A2 >
static void test ( isl::ctx  ctx,
R(T::*)(A1, A2) const  fn,
const std::string &  name,
const std::vector< ternary > &  tests 
)
static

Definition at line 171 of file isl_test2.cc.

References arg1, arg2, expected, fn, is_equal(), name, obj, res, test, tests, and THROW_INVALID.

◆ test_conversion()

static void test_conversion ( isl::ctx  ctx)
static

Definition at line 221 of file isl_test2.cc.

References isl::multi_pw_aff::as_set(), and C.

◆ test_fixed_power()

static void test_fixed_power ( isl::ctx  ctx)
static

Definition at line 297 of file isl_test2.cc.

References C, and isl::map::fixed_power().

◆ test_gist()

static void test_gist ( isl::ctx  ctx)
static

Definition at line 337 of file isl_test2.cc.

References C.

◆ test_id_to_id()

static void test_id_to_id ( isl::ctx  ctx)
static

Definition at line 388 of file isl_test2.cc.

References C.

◆ test_intersect()

static void test_intersect ( isl::ctx  ctx)
static

Definition at line 314 of file isl_test2.cc.

References C.

◆ test_preimage()

static void test_preimage ( isl::ctx  ctx)
static

◆ test_project()

static void test_project ( isl::ctx  ctx)
static

Definition at line 348 of file isl_test2.cc.

References C.

◆ test_scale()

static void test_scale ( isl::ctx  ctx)
static

Definition at line 365 of file isl_test2.cc.

References C, isl::pw_multi_aff::scale(), and isl::pw_multi_aff::scale_down().

◆ test_space()

static void test_space ( isl::ctx  ctx)
static

Definition at line 201 of file isl_test2.cc.

References C, isl::space::domain(), isl::space::params(), and isl::space::range().

Referenced by main().

Variable Documentation

◆ tests

std::vector<std::pair<const char *, void (*)(isl::ctx)> > tests
static
Initial value:
=
{
{ "space", &test_space },
{ "conversion", &test_conversion },
{ "preimage", &test_preimage },
{ "fixed power", &test_fixed_power },
{ "intersect", &test_intersect },
{ "gist", &test_gist },
{ "project out parameters", &test_project },
{ "scale", &test_scale },
{ "id-to-id", &test_id_to_id },
}
static void test_preimage(isl::ctx ctx)
Definition: isl_test2.cc:231
static void test_id_to_id(isl::ctx ctx)
Definition: isl_test2.cc:388
static void test_project(isl::ctx ctx)
Definition: isl_test2.cc:348
static void test_gist(isl::ctx ctx)
Definition: isl_test2.cc:337
static void test_intersect(isl::ctx ctx)
Definition: isl_test2.cc:314
static void test_scale(isl::ctx ctx)
Definition: isl_test2.cc:365
static void test_space(isl::ctx ctx)
Definition: isl_test2.cc:201
static void test_conversion(isl::ctx ctx)
Definition: isl_test2.cc:221
static void test_fixed_power(isl::ctx ctx)
Definition: isl_test2.cc:297

Definition at line 406 of file isl_test2.cc.

Referenced by main(), and test().