2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20021120-3.c
blobe875f1f45c473af0b04907013cbef68f966de9e7
1 /* 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
10 unsigned int foo (char *c, unsigned int x, unsigned int y)
12 register unsigned int z LOC;
14 sprintf (c, "%d", x / y);
15 z = x + 1;
16 return z / (y + 1);
19 int main ()
21 char c[16];
23 if (foo (c, ~1U, 4) != (~0U / 5))
24 abort ();
25 exit (0);