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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [return.C] - Blame information for rev 779

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

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// PRMS Id: 5331
3
// Bug: the return value of foo is constructed in a temporary and then
4
// copied into the return slot.  This is not necessary.
5
 
6
int c = 0;
7
 
8
struct X {
9
   X(int i) { }
10
   X(X const &XX) { c = 1; }
11
   ~X() { }
12
};
13
 
14
const X foo() {
15
  return X(3);
16
}
17
 
18
int main()
19
{
20
  foo();
21
  return c;
22
}

powered by: WebSVN 2.1.0

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