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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [930529-1.c] - Rev 801

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

dd (x,d) { return x / d; }
 
main ()
{
  int i;
  for (i = -3; i <= 3; i++)
    {
      if (dd (i, 1) != i / 1)
	abort ();
      if (dd (i, 2) != i / 2)
	abort ();
      if (dd (i, 3) != i / 3)
	abort ();
      if (dd (i, 4) != i / 4)
	abort ();
      if (dd (i, 5) != i / 5)
	abort ();
      if (dd (i, 6) != i / 6)
	abort ();
      if (dd (i, 7) != i / 7)
	abort ();
      if (dd (i, 8) != i / 8)
	abort ();
    }
  for (i = ((unsigned) ~0 >> 1) - 3; i <= ((unsigned) ~0 >> 1) + 3; i++)
    {
      if (dd (i, 1) != i / 1)
	abort ();
      if (dd (i, 2) != i / 2)
	abort ();
      if (dd (i, 3) != i / 3)
	abort ();
      if (dd (i, 4) != i / 4)
	abort ();
      if (dd (i, 5) != i / 5)
	abort ();
      if (dd (i, 6) != i / 6)
	abort ();
      if (dd (i, 7) != i / 7)
	abort ();
      if (dd (i, 8) != i / 8)
	abort ();
    }
  exit (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.