OSDN Git Service

Merge tree-ssa-20020619-branch into mainline.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / 20020201-1.c
1 /* Check that arc profiling instrumentation code does not cause problems for
2    a program that calls functions that are likely to be in a shared library.
3    This was added to check the fix for PR target/5469, which prevents arc
4    profiling code from being inserted between a call and the restore of the
5    call-clobbered global pointer.  */
6
7 /* { dg-options "-fprofile-arcs" } */
8 /* { dg-do run { target native } } */
9
10 int rand (void);
11 void srand (unsigned int seed);
12
13 int globvar;
14
15 void
16 leave (int i)
17 {
18   if (i != 0)
19     abort ();
20   exit (0);
21 }
22
23 void
24 doit ()
25 {
26   srand (12);
27   globvar = rand ();
28   if (rand () > 0)
29     globvar = 0;
30   leave (globvar);
31 }
32
33 int
34 main ()
35 {
36   doit ();
37 }