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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [nrv8.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 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.