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/] [nrv1.C] - Blame information for rev 841

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

Line No. Rev Author Line
1 149 jeremybenn
// Test for the named return value optimization.
2
// { dg-do run }
3
// { dg-options -fno-inline }
4
 
5
int c;
6
int d;
7
 
8
struct A
9
{
10
  A() { ++c; }
11
  A(const A&) { ++c; };
12
  ~A() { ++d; }
13
};
14
 
15
inline A f ()
16
{
17
  A a;
18
  return a;
19
}
20
 
21
int main ()
22
{
23
  {
24
    A a = f ();
25
  }
26
 
27
  return !(c == 1 && c == d);
28
}

powered by: WebSVN 2.1.0

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