URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [opt/] [nrv9.C] - Rev 313
Go to most recent revision | Compare with Previous | Blame | View Log
// PR c++/19317
// If we do both NRV and caller-side return slot opt for ga = f()
// constructing la sets ga.i to 0 too soon.
extern "C" void abort();
struct A
{
int i;
int pad[32]; // force return in memory
A(): i(0) {}
A(int ia): i(ia) {}
};
A ga(42);
A f()
{
A la;
if (ga.i != 42)
abort();
return la;
}
int main()
{
ga = f ();
}
Go to most recent revision | Compare with Previous | Blame | View Log