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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20021120-3.c] - Diff between revs 297 and 338

Only display areas with differences | Details | Blame | View Log

Rev 297 Rev 338
/* Test whether a partly call-clobbered register will be moved over a call.
/* Test whether a partly call-clobbered register will be moved over a call.
   Although the original test case didn't use any GNUisms, it proved
   Although the original test case didn't use any GNUisms, it proved
   difficult to reduce without the named register extension.  */
   difficult to reduce without the named register extension.  */
#if __SH64__ == 32
#if __SH64__ == 32
#define LOC asm ("r10")
#define LOC asm ("r10")
#else
#else
#define LOC
#define LOC
#endif
#endif
 
 
unsigned int foo (char *c, unsigned int x, unsigned int y)
unsigned int foo (char *c, unsigned int x, unsigned int y)
{
{
  register unsigned int z LOC;
  register unsigned int z LOC;
 
 
  sprintf (c, "%d", x / y);
  sprintf (c, "%d", x / y);
  z = x + 1;
  z = x + 1;
  return z / (y + 1);
  return z / (y + 1);
}
}
 
 
int main ()
int main ()
{
{
  char c[16];
  char c[16];
 
 
  if (foo (c, ~1U, 4) != (~0U / 5))
  if (foo (c, ~1U, 4) != (~0U / 5))
    abort ();
    abort ();
  exit (0);
  exit (0);
}
}
 
 

powered by: WebSVN 2.1.0

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