OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [ieee/] [inf-2.c] - Rev 825

Go to most recent revision | Compare with Previous | Blame | View Log

extern void abort (void);
 
void test(double f, double i)
{
  if (f == __builtin_inf())
    abort ();
  if (f == -__builtin_inf())
    abort ();
  if (i == -__builtin_inf())
    abort ();
  if (i != __builtin_inf())
    abort ();
 
  if (f >= __builtin_inf())
    abort ();
  if (f > __builtin_inf())
    abort ();
  if (i > __builtin_inf())
    abort ();
  if (f <= -__builtin_inf())
    abort ();
  if (f < -__builtin_inf())
    abort ();
}
 
void testf(float f, float i)
{
  if (f == __builtin_inff())
    abort ();
  if (f == -__builtin_inff())
    abort ();
  if (i == -__builtin_inff())
    abort ();
  if (i != __builtin_inff())
    abort ();
 
  if (f >= __builtin_inff())
    abort ();
  if (f > __builtin_inff())
    abort ();
  if (i > __builtin_inff())
    abort ();
  if (f <= -__builtin_inff())
    abort ();
  if (f < -__builtin_inff())
    abort ();
}
 
void testl(long double f, long double i)
{
  if (f == __builtin_infl())
    abort ();
  if (f == -__builtin_infl())
    abort ();
  if (i == -__builtin_infl())
    abort ();
  if (i != __builtin_infl())
    abort ();
 
  if (f >= __builtin_infl())
    abort ();
  if (f > __builtin_infl())
    abort ();
  if (i > __builtin_infl())
    abort ();
  if (f <= -__builtin_infl())
    abort ();
  if (f < -__builtin_infl())
    abort ();
}
 
int main()
{
  test (34.0, __builtin_inf());
  testf (34.0f, __builtin_inff());
  testf (34.0l, __builtin_infl());
  return 0;
}
 
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.