URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
// Test for the named return value optimization.
|
// Test for the named return value optimization.
|
// { dg-do run }
|
// { dg-do run }
|
// { dg-options -fno-inline }
|
// { dg-options -fno-inline }
|
|
|
int c;
|
int c;
|
int d;
|
int d;
|
|
|
struct A
|
struct A
|
{
|
{
|
A() { ++c; }
|
A() { ++c; }
|
A(const A&) { ++c; };
|
A(const A&) { ++c; };
|
~A() { ++d; }
|
~A() { ++d; }
|
};
|
};
|
|
|
inline A f ()
|
inline A f ()
|
{
|
{
|
A a;
|
A a;
|
return a;
|
return a;
|
}
|
}
|
|
|
int main ()
|
int main ()
|
{
|
{
|
{
|
{
|
A a = f ();
|
A a = f ();
|
}
|
}
|
|
|
return !(c == 1 && c == d);
|
return !(c == 1 && c == d);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.