URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 318 |
Rev 338 |
/* PR rtl-optimization/9771 */
|
/* PR rtl-optimization/9771 */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-require-effective-target ilp32 } */
|
/* { dg-require-effective-target ilp32 } */
|
/* { dg-options "-O2 -fomit-frame-pointer -ffixed-ebp" } */
|
/* { dg-options "-O2 -fomit-frame-pointer -ffixed-ebp" } */
|
|
|
extern void abort(void);
|
extern void abort(void);
|
extern void exit(int);
|
extern void exit(int);
|
|
|
register long *B asm ("ebp");
|
register long *B asm ("ebp");
|
|
|
long x = 10;
|
long x = 10;
|
long y = 20;
|
long y = 20;
|
|
|
void bar(void)
|
void bar(void)
|
{
|
{
|
B = &y;
|
B = &y;
|
}
|
}
|
|
|
void foo()
|
void foo()
|
{
|
{
|
long *adr = B;
|
long *adr = B;
|
long save = *adr;
|
long save = *adr;
|
|
|
*adr = 123;
|
*adr = 123;
|
|
|
bar();
|
bar();
|
|
|
*adr = save;
|
*adr = save;
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
B = &x;
|
B = &x;
|
|
|
foo();
|
foo();
|
|
|
if (x != 10 || y != 20)
|
if (x != 10 || y != 20)
|
abort();
|
abort();
|
|
|
/* We can't return, as our caller may assume %ebp is preserved! */
|
/* We can't return, as our caller may assume %ebp is preserved! */
|
/* We could save/restore it (like foo), but its easier to exit. */
|
/* We could save/restore it (like foo), but its easier to exit. */
|
exit(0);
|
exit(0);
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.