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++.dg/] [opt/] [nrv8.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// PR optimization/19531
2
// forbids NRV on volatile return value.
3
// { dg-options -O2 }
4
// { dg-do run }
5
 
6
extern "C" { void abort(); }
7
 
8
struct A
9
{
10
  int d;
11
 
12
  A ()                     { d = 123; }
13
  A (const A & o)          { d = o.d;  }
14
  A (volatile const A & o) { d = o.d + 2; }
15
};
16
 
17
A bar()
18
{
19
  volatile A l;
20
  return l;
21
}
22
 
23
main()
24
{
25
  A a = bar ();
26
 
27
  if (a.d != 125)
28
    abort();
29
 
30
  return 0;
31
}

powered by: WebSVN 2.1.0

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