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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20021120-3.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
/* Test whether a partly call-clobbered register will be moved over a call.
2
   Although the original test case didn't use any GNUisms, it proved
3
   difficult to reduce without the named register extension.  */
4
#if __SH64__ == 32
5
#define LOC asm ("r10")
6
#else
7
#define LOC
8
#endif
9
 
10
unsigned int foo (char *c, unsigned int x, unsigned int y)
11
{
12
  register unsigned int z LOC;
13
 
14
  sprintf (c, "%d", x / y);
15
  z = x + 1;
16
  return z / (y + 1);
17
}
18
 
19
int main ()
20
{
21
  char c[16];
22
 
23
  if (foo (c, ~1U, 4) != (~0U / 5))
24
    abort ();
25
  exit (0);
26
}

powered by: WebSVN 2.1.0

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