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 |
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-O2" } */
|
/* { dg-options "-O2" } */
|
|
|
int func_pure (void) __attribute__ ((pure));
|
int func_pure (void) __attribute__ ((pure));
|
void func_other (int);
|
void func_other (int);
|
int global_int;
|
int global_int;
|
void abort ();
|
void abort ();
|
void func_other(int a)
|
void func_other(int a)
|
{
|
{
|
if (a != global_int)
|
if (a != global_int)
|
abort ();
|
abort ();
|
global_int++;
|
global_int++;
|
}
|
}
|
|
|
int func_pure(void)
|
int func_pure(void)
|
{
|
{
|
return global_int;
|
return global_int;
|
}
|
}
|
|
|
int
|
int
|
func_loop (int arg)
|
func_loop (int arg)
|
{
|
{
|
// global_int ++;
|
// global_int ++;
|
while (arg--)
|
while (arg--)
|
func_other (func_pure ());
|
func_other (func_pure ());
|
}
|
}
|
|
|
int main(void)
|
int main(void)
|
{
|
{
|
func_loop(10);
|
func_loop(10);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.