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] - Blame information for rev 825

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// PR c++/19317
2
// If we do both NRV and caller-side return slot opt for ga = f()
3
// constructing la sets ga.i to 0 too soon.
4
 
5
extern "C" void abort();
6
 
7
struct A
8
{
9
  int i;
10
  int pad[32];                  // force return in memory
11
  A(): i(0) {}
12
  A(int ia): i(ia) {}
13
};
14
 
15
A ga(42);
16
 
17
A f()
18
{
19
  A la;
20
  if (ga.i != 42)
21
    abort();
22
  return la;
23
}
24
 
25
int main()
26
{
27
  ga = f ();
28
}

powered by: WebSVN 2.1.0

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