Polly 20.0.0git
Macros | Functions | Variables
isl_test_int.c File Reference
#include <assert.h>
#include <stdio.h>
#include <isl_int.h>

Go to the source code of this file.

Macros

#define ARRAY_SIZE(array)   (sizeof(array)/sizeof(*array))
 

Functions

static void int_test_single_value ()
 
static void invoke_alternate_representations_2args (char *arg1, char *arg2, void(*fn)(isl_int, isl_int))
 
static void invoke_alternate_representations_3args (char *arg1, char *arg2, char *arg3, void(*fn)(isl_int, isl_int, isl_int))
 
static void int_test_neg (isl_int expected, isl_int arg)
 
static void int_test_abs (isl_int expected, isl_int arg)
 
static void int_test_divexact (isl_int expected, isl_int lhs, isl_int rhs)
 
static void int_test_mul (isl_int expected, isl_int lhs, isl_int rhs)
 
static void int_test_product (isl_int product, isl_int factor1, isl_int factor2)
 
static void int_test_add (isl_int expected, isl_int lhs, isl_int rhs)
 
static void int_test_sub (isl_int expected, isl_int lhs, isl_int rhs)
 
static void int_test_sum (isl_int sum, isl_int term1, isl_int term2)
 
static void int_test_fdiv (isl_int expected, isl_int lhs, isl_int rhs)
 
static void int_test_cdiv (isl_int expected, isl_int lhs, isl_int rhs)
 
static void int_test_tdiv (isl_int expected, isl_int lhs, isl_int rhs)
 
static void int_test_fdiv_r (isl_int expected, isl_int lhs, isl_int rhs)
 
static void int_test_gcd (isl_int expected, isl_int lhs, isl_int rhs)
 
static void int_test_lcm (isl_int expected, isl_int lhs, isl_int rhs)
 
static int sgn (int val)
 
static void int_test_cmp (int exp, isl_int lhs, isl_int rhs)
 
static void int_test_cmps (isl_int expected, isl_int lhs, isl_int rhs)
 
static void int_test_abs_cmp (isl_int expected, isl_int lhs, isl_int rhs)
 
static void int_test_divisible (isl_int expected, isl_int lhs, isl_int rhs)
 
int main ()
 

Variables

struct {
   void(*   fn )(isl_int, isl_int)
 
   char *   expected
 
   char *   arg
 
int_unary_tests []
 
struct {
   void(*   fn )(isl_int, isl_int, isl_int)
 
   char *   expected
 
   char *   lhs
 
   char *   rhs
 
int_binary_tests []
 

Macro Definition Documentation

◆ ARRAY_SIZE

#define ARRAY_SIZE (   array)    (sizeof(array)/sizeof(*array))

Definition at line 15 of file isl_test_int.c.

Function Documentation

◆ int_test_abs()

static void int_test_abs ( isl_int  expected,
isl_int  arg 
)
static

Definition at line 203 of file isl_test_int.c.

References arg, assert, expected, isl_int_abs, isl_int_clear, isl_int_eq, isl_int_init, and result.

◆ int_test_abs_cmp()

static void int_test_abs_cmp ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

Definition at line 471 of file isl_test_int.c.

References assert, expected, isl_int_abs_cmp, isl_int_get_si, lhs, rhs, and sgn().

◆ int_test_add()

static void int_test_add ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

Definition at line 309 of file isl_test_int.c.

References assert, expected, isl_int_add, isl_int_clear, isl_int_eq, isl_int_init, lhs, result, and rhs.

Referenced by int_test_sum().

◆ int_test_cdiv()

static void int_test_cdiv ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

◆ int_test_cmp()

static void int_test_cmp ( int  exp,
isl_int  lhs,
isl_int  rhs 
)
static

Definition at line 440 of file isl_test_int.c.

References assert, isl_int_cmp, isl_int_cmp_si, isl_int_fits_slong, isl_int_get_si, lhs, rhs, and sgn().

Referenced by int_test_cmps().

◆ int_test_cmps()

static void int_test_cmps ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

◆ int_test_divexact()

static void int_test_divexact ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

◆ int_test_divisible()

static void int_test_divisible ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

Definition at line 483 of file isl_test_int.c.

References assert, expected, isl_int_get_si, isl_int_is_divisible_by, lhs, and rhs.

◆ int_test_fdiv()

static void int_test_fdiv ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

◆ int_test_fdiv_r()

static void int_test_fdiv_r ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

Definition at line 392 of file isl_test_int.c.

References assert, expected, isl_int_clear, isl_int_eq, isl_int_fdiv_r, isl_int_init, lhs, result, and rhs.

◆ int_test_gcd()

static void int_test_gcd ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

Definition at line 403 of file isl_test_int.c.

References assert, expected, isl_int_clear, isl_int_eq, isl_int_gcd, isl_int_init, lhs, result, and rhs.

◆ int_test_lcm()

static void int_test_lcm ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

Definition at line 417 of file isl_test_int.c.

References assert, expected, isl_int_clear, isl_int_eq, isl_int_init, isl_int_lcm, lhs, result, and rhs.

◆ int_test_mul()

static void int_test_mul ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

◆ int_test_neg()

static void int_test_neg ( isl_int  expected,
isl_int  arg 
)
static

Definition at line 189 of file isl_test_int.c.

References arg, assert, expected, isl_int_clear, isl_int_eq, isl_int_init, isl_int_neg, and result.

◆ int_test_product()

static void int_test_product ( isl_int  product,
isl_int  factor1,
isl_int  factor2 
)
static

Definition at line 300 of file isl_test_int.c.

References int_test_divexact(), and int_test_mul().

◆ int_test_single_value()

static void int_test_single_value ( )
static

Definition at line 147 of file isl_test_int.c.

Referenced by main().

◆ int_test_sub()

static void int_test_sub ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

Definition at line 320 of file isl_test_int.c.

References assert, expected, isl_int_clear, isl_int_eq, isl_int_init, isl_int_sub, lhs, result, and rhs.

Referenced by int_test_sum().

◆ int_test_sum()

static void int_test_sum ( isl_int  sum,
isl_int  term1,
isl_int  term2 
)
static

Definition at line 334 of file isl_test_int.c.

References int_test_add(), and int_test_sub().

◆ int_test_tdiv()

static void int_test_tdiv ( isl_int  expected,
isl_int  lhs,
isl_int  rhs 
)
static

Definition at line 381 of file isl_test_int.c.

References assert, expected, isl_int_clear, isl_int_eq, isl_int_init, isl_int_tdiv_q, lhs, result, and rhs.

◆ invoke_alternate_representations_2args()

static void invoke_alternate_representations_2args ( char *  arg1,
char *  arg2,
void(*)(isl_int, isl_int fn 
)
static

Definition at line 151 of file isl_test_int.c.

References arg1, arg2, isl_int_clear, isl_int_init, and isl_int_read.

Referenced by main().

◆ invoke_alternate_representations_3args()

static void invoke_alternate_representations_3args ( char *  arg1,
char *  arg2,
char *  arg3,
void(*)(isl_int, isl_int, isl_int fn 
)
static

Definition at line 168 of file isl_test_int.c.

References arg1, arg2, isl_int_clear, isl_int_init, and isl_int_read.

Referenced by main().

◆ main()

int main ( )

◆ sgn()

static int sgn ( int  val)
static

Definition at line 431 of file isl_test_int.c.

References val.

Referenced by int_test_abs_cmp(), and int_test_cmp().

Variable Documentation

◆ arg

char * arg

Definition at line 216 of file isl_test_int.c.

Referenced by int_test_abs(), int_test_neg(), and main().

◆ expected

char* expected

◆ fn

void(* fn) (isl_int, isl_int, isl_int) ( isl_int  ,
isl_int   
)

Definition at line 215 of file isl_test_int.c.

Referenced by main().

◆ 

struct { ... } int_binary_tests[]

Referenced by main().

◆ 

struct { ... } int_unary_tests[]
Initial value:
= {
{ &int_test_neg, "0", "0" },
{ &int_test_neg, "-1", "1" },
{ &int_test_neg, "-2147483647", "2147483647" },
{ &int_test_neg, "-2147483648", "2147483648" },
{ &int_test_neg, "-9223372036854775807", "9223372036854775807" },
{ &int_test_neg, "-9223372036854775808", "9223372036854775808" },
{ &int_test_abs, "0", "0" },
{ &int_test_abs, "1", "1" },
{ &int_test_abs, "1", "-1" },
{ &int_test_abs, "2147483647", "2147483647" },
{ &int_test_abs, "2147483648", "-2147483648" },
{ &int_test_abs, "9223372036854775807", "9223372036854775807" },
{ &int_test_abs, "9223372036854775808", "-9223372036854775808" },
}
static void int_test_abs(isl_int expected, isl_int arg)
Definition: isl_test_int.c:203
static void int_test_neg(isl_int expected, isl_int arg)
Definition: isl_test_int.c:189

Referenced by main().

◆ lhs

char * lhs

◆ rhs

char * rhs