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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [20020201-1.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* 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
extern void abort (void);
11
extern void exit (int);
12
 
13
int rand (void);
14
void srand (unsigned int seed);
15
 
16
int globvar;
17
 
18
void
19
leave (int i)
20
{
21
  if (i != 0)
22
    abort ();
23
  exit (0);
24
}
25
 
26
void
27
doit ()
28
{
29
  srand (12);
30
  globvar = rand ();
31
  if (rand () > 0)
32
    globvar = 0;
33
  leave (globvar);
34
}
35
 
36
int
37
main ()
38
{
39
  doit ();
40
}
41
 
42
/* { dg-final { cleanup-coverage-files } } */

powered by: WebSVN 2.1.0

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