Back to index

glibc  2.9
Defines | Functions | Variables
test-tgmath.c File Reference
#include <math.h>
#include <stdio.h>
#include <tgmath.h>
#include "test-tgmath.c"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define __NO_MATH_INLINES   1
#define NCALLS   115
#define NCALLS_INT   4
#define NCCALLS   47
#define HAVE_MAIN
#define F(name)   name
#define TYPE   double
#define TEST_INT   1
#define x   dx
#define y   dy
#define z   dz
#define count   count_double
#define ccount   count_cdouble
#define F(name)   name##f
#define TYPE   float
#define x   fx
#define y   fy
#define z   fz
#define count   count_float
#define ccount   count_cfloat
#define F(name)   name##l
#define TYPE   long double
#define x   lx
#define y   ly
#define z   lz
#define count   count_ldouble
#define ccount   count_cldouble

Functions

static void compile_test (void)
static void compile_testf (void)
static void compile_testl (void)
int main (void)

Variables

float fx
double dx
long double lx
const float fy = 1.25
const double dy = 1.25
const long double ly = 1.25
complex float fz
complex double dz
complex long double lz
int count_double
int count_float
int count_ldouble
int count_cdouble
int count_cfloat
int count_cldouble

Define Documentation

#define __NO_MATH_INLINES   1

Definition at line 24 of file test-tgmath.c.

#define ccount   count_cdouble

Definition at line 210 of file test-tgmath.c.

#define ccount   count_cfloat

Definition at line 210 of file test-tgmath.c.

#define ccount   count_cldouble

Definition at line 210 of file test-tgmath.c.

#define count   count_double

Definition at line 209 of file test-tgmath.c.

#define count   count_float

Definition at line 209 of file test-tgmath.c.

#define count   count_ldouble

Definition at line 209 of file test-tgmath.c.

#define F (   name)    name

Definition at line 204 of file test-tgmath.c.

#define F (   name)    name##f

Definition at line 204 of file test-tgmath.c.

#define F (   name)    name##l

Definition at line 204 of file test-tgmath.c.

#define HAVE_MAIN

Definition at line 182 of file test-tgmath.c.

#define NCALLS   115

Definition at line 54 of file test-tgmath.c.

#define NCALLS_INT   4

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

#define NCCALLS   47

Definition at line 56 of file test-tgmath.c.

#define TEST_INT   1

Definition at line 186 of file test-tgmath.c.

#define TYPE   double

Definition at line 205 of file test-tgmath.c.

#define TYPE   float

Definition at line 205 of file test-tgmath.c.

#define TYPE   long double

Definition at line 205 of file test-tgmath.c.

#define x   dx

Definition at line 206 of file test-tgmath.c.

#define x   fx

Definition at line 206 of file test-tgmath.c.

#define x   lx

Definition at line 206 of file test-tgmath.c.

#define y   dy

Definition at line 207 of file test-tgmath.c.

#define y   fy

Definition at line 207 of file test-tgmath.c.

#define y   ly

Definition at line 207 of file test-tgmath.c.

#define z   dz

Definition at line 208 of file test-tgmath.c.

#define z   fz

Definition at line 208 of file test-tgmath.c.

#define z   lz

Definition at line 208 of file test-tgmath.c.


Function Documentation

static void compile_test ( void  ) [static]

Here is the caller graph for this function:

static void compile_testf ( void  ) [static]

Here is the caller graph for this function:

static void compile_testl ( void  ) [static]

Here is the caller graph for this function:

int main ( void  )

Definition at line 59 of file test-tgmath.c.

{
  int result = 0;

  count_float = count_double = count_ldouble = 0;
  count_cfloat = count_cdouble = count_cldouble = 0;
  compile_test ();
  if (count_float != 0 || count_cfloat != 0)
    {
      puts ("float function called for double test");
      result = 1;
    }
  if (count_ldouble != 0 || count_cldouble != 0)
    {
      puts ("long double function called for double test");
      result = 1;
    }
  if (count_double < NCALLS + NCALLS_INT)
    {
      printf ("double functions not called often enough (%d)\n",
             count_double);
      result = 1;
    }
  else if (count_double > NCALLS + NCALLS_INT)
    {
      printf ("double functions called too often (%d)\n",
             count_double);
      result = 1;
    }
  if (count_cdouble < NCCALLS)
    {
      printf ("double complex functions not called often enough (%d)\n",
             count_cdouble);
      result = 1;
    }
  else if (count_cdouble > NCCALLS)
    {
      printf ("double complex functions called too often (%d)\n",
             count_cdouble);
      result = 1;
    }

  count_float = count_double = count_ldouble = 0;
  count_cfloat = count_cdouble = count_cldouble = 0;
  compile_testf ();
  if (count_double != 0 || count_cdouble != 0)
    {
      puts ("double function called for float test");
      result = 1;
    }
  if (count_ldouble != 0 || count_cldouble != 0)
    {
      puts ("long double function called for float test");
      result = 1;
    }
  if (count_float < NCALLS)
    {
      printf ("float functions not called often enough (%d)\n", count_float);
      result = 1;
    }
  else if (count_float > NCALLS)
    {
      printf ("float functions called too often (%d)\n",
             count_double);
      result = 1;
    }
  if (count_cfloat < NCCALLS)
    {
      printf ("float complex functions not called often enough (%d)\n",
             count_cfloat);
      result = 1;
    }
  else if (count_cfloat > NCCALLS)
    {
      printf ("float complex functions called too often (%d)\n",
             count_cfloat);
      result = 1;
    }

#ifndef NO_LONG_DOUBLE
  count_float = count_double = count_ldouble = 0;
  count_cfloat = count_cdouble = count_cldouble = 0;
  compile_testl ();
  if (count_float != 0 || count_cfloat != 0)
    {
      puts ("float function called for long double test");
      result = 1;
    }
  if (count_double != 0 || count_cdouble != 0)
    {
      puts ("double function called for long double test");
      result = 1;
    }
  if (count_ldouble < NCALLS)
    {
      printf ("long double functions not called often enough (%d)\n",
             count_ldouble);
      result = 1;
    }
  else if (count_ldouble > NCALLS)
    {
      printf ("long double functions called too often (%d)\n",
             count_double);
      result = 1;
    }
  if (count_cldouble < NCCALLS)
    {
      printf ("long double complex functions not called often enough (%d)\n",
             count_cldouble);
      result = 1;
    }
  else if (count_cldouble > NCCALLS)
    {
      printf ("long double complex functions called too often (%d)\n",
             count_cldouble);
      result = 1;
    }
#endif

  return result;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 50 of file test-tgmath.c.

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

Definition at line 52 of file test-tgmath.c.

Definition at line 47 of file test-tgmath.c.

Definition at line 48 of file test-tgmath.c.

Definition at line 49 of file test-tgmath.c.

double dx

Definition at line 38 of file test-tgmath.c.

const double dy = 1.25

Definition at line 41 of file test-tgmath.c.

complex double dz

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

float fx

Definition at line 37 of file test-tgmath.c.

const float fy = 1.25

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

complex float fz

Definition at line 43 of file test-tgmath.c.

long double lx

Definition at line 39 of file test-tgmath.c.

const long double ly = 1.25

Definition at line 42 of file test-tgmath.c.

complex long double lz

Definition at line 45 of file test-tgmath.c.