Back to index

glibc  2.9
Defines | Functions | Variables
test-tgmath-ret.c File Reference
#include <math.h>
#include <complex.h>
#include <tgmath.h>
#include <stdio.h>
#include "../test-skeleton.c"

Go to the source code of this file.

Defines

#define CHECK_RET_CONST_TYPE(func, rettype, arg, name)
#define CHECK_RET_CONST_FLOAT(func, rettype)   CHECK_RET_CONST_TYPE (func, rettype, fx, float)
#define CHECK_RET_CONST_DOUBLE(func, rettype)   CHECK_RET_CONST_TYPE (func, rettype, dx, double)
#define CHECK_RET_CONST_LDOUBLE(func, rettype)   CHECK_RET_CONST_TYPE (func, rettype, lx, long double)
#define CHECK_RET_CONST(func, rettype)
#define TEST_FUNCTION   do_test ()

Functions

static void our_error (const char *c)
static int do_test (void)

Variables

static float fx
static double dx
static long double lx
static int errors = 0

Define Documentation

#define CHECK_RET_CONST (   func,
  rettype 
)
Value:
static void                                                          \
check_return_ ##func (void)                                          \
{                                                                    \
  CHECK_RET_CONST_FLOAT (func, rettype)                                     \
  CHECK_RET_CONST_DOUBLE (func, rettype)                             \
  CHECK_RET_CONST_LDOUBLE (func, rettype)                            \
}

Definition at line 55 of file test-tgmath-ret.c.

#define CHECK_RET_CONST_DOUBLE (   func,
  rettype 
)    CHECK_RET_CONST_TYPE (func, rettype, dx, double)

Definition at line 46 of file test-tgmath-ret.c.

#define CHECK_RET_CONST_FLOAT (   func,
  rettype 
)    CHECK_RET_CONST_TYPE (func, rettype, fx, float)

Definition at line 44 of file test-tgmath-ret.c.

#define CHECK_RET_CONST_LDOUBLE (   func,
  rettype 
)    CHECK_RET_CONST_TYPE (func, rettype, lx, long double)

Definition at line 51 of file test-tgmath-ret.c.

#define CHECK_RET_CONST_TYPE (   func,
  rettype,
  arg,
  name 
)
Value:
if (sizeof (func (arg)) != sizeof (rettype))                                \
    our_error ("Return size of " #func " is wrong with " #name " argument");

Definition at line 40 of file test-tgmath-ret.c.

#define TEST_FUNCTION   do_test ()

Definition at line 84 of file test-tgmath-ret.c.


Function Documentation

static int do_test ( void  ) [static]

Definition at line 71 of file test-tgmath-ret.c.

{
  check_return_ilogb ();
  check_return_lrint ();
  check_return_lround ();
  check_return_llrint ();
  check_return_llround ();

  printf ("%Zd\n", sizeof(carg (lx)));

  return errors != 0;
}

Here is the call graph for this function:

static void our_error ( const char *  c) [static]

Definition at line 32 of file test-tgmath-ret.c.

{
  puts (c);
  ++errors;
}

Here is the call graph for this function:


Variable Documentation

double dx [static]

Definition at line 27 of file test-tgmath-ret.c.

int errors = 0 [static]

Definition at line 29 of file test-tgmath-ret.c.

float fx [static]

Definition at line 26 of file test-tgmath-ret.c.

long double lx [static]

Definition at line 28 of file test-tgmath-ret.c.