URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// PR optimization/19531
|
// PR optimization/19531
|
// forbids NRV on volatile return value.
|
// forbids NRV on volatile return value.
|
// { dg-options -O2 }
|
// { dg-options -O2 }
|
// { dg-do run }
|
// { dg-do run }
|
|
|
extern "C" { void abort(); }
|
extern "C" { void abort(); }
|
|
|
struct A
|
struct A
|
{
|
{
|
int d;
|
int d;
|
|
|
A () { d = 123; }
|
A () { d = 123; }
|
A (const A & o) { d = o.d; }
|
A (const A & o) { d = o.d; }
|
A (volatile const A & o) { d = o.d + 2; }
|
A (volatile const A & o) { d = o.d + 2; }
|
};
|
};
|
|
|
A bar()
|
A bar()
|
{
|
{
|
volatile A l;
|
volatile A l;
|
return l;
|
return l;
|
}
|
}
|
|
|
main()
|
main()
|
{
|
{
|
A a = bar ();
|
A a = bar ();
|
|
|
if (a.d != 125)
|
if (a.d != 125)
|
abort();
|
abort();
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.