URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* Check that arc profiling instrumentation code does not cause problems for
|
/* Check that arc profiling instrumentation code does not cause problems for
|
a program that calls functions that are likely to be in a shared library.
|
a program that calls functions that are likely to be in a shared library.
|
This was added to check the fix for PR target/5469, which prevents arc
|
This was added to check the fix for PR target/5469, which prevents arc
|
profiling code from being inserted between a call and the restore of the
|
profiling code from being inserted between a call and the restore of the
|
call-clobbered global pointer. */
|
call-clobbered global pointer. */
|
|
|
/* { dg-options "-fprofile-arcs" } */
|
/* { dg-options "-fprofile-arcs" } */
|
/* { dg-do run { target native } } */
|
/* { dg-do run { target native } } */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
extern void exit (int);
|
extern void exit (int);
|
|
|
int rand (void);
|
int rand (void);
|
void srand (unsigned int seed);
|
void srand (unsigned int seed);
|
|
|
int globvar;
|
int globvar;
|
|
|
void
|
void
|
leave (int i)
|
leave (int i)
|
{
|
{
|
if (i != 0)
|
if (i != 0)
|
abort ();
|
abort ();
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
void
|
void
|
doit ()
|
doit ()
|
{
|
{
|
srand (12);
|
srand (12);
|
globvar = rand ();
|
globvar = rand ();
|
if (rand () > 0)
|
if (rand () > 0)
|
globvar = 0;
|
globvar = 0;
|
leave (globvar);
|
leave (globvar);
|
}
|
}
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
doit ();
|
doit ();
|
}
|
}
|
|
|
/* { dg-final { cleanup-coverage-files } } */
|
/* { dg-final { cleanup-coverage-files } } */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.