OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [opt/] [nrv9.C] - Rev 149

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.