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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 jeremybenn
// PR tree-optimization/43655
2
// { dg-do run }
3
// { dg-options "-O0 -ftree-ter" }
4
 
5
extern "C" void abort ();
6
 
7
struct C
8
{
9
  C (int i) : val(i) { }
10
  C (const C& c) : val(c.val) { }
11
  ~C (void) { val = 999; }
12
  C& operator = (const C& c) { val = c.val; return *this; }
13
  C& inc (int i) { val += i; return *this; }
14
  int val;
15
};
16
 
17
C
18
f ()
19
{
20
  return C (3);
21
}
22
 
23
C
24
f (int i)
25
{
26
  return f ().inc (i);
27
}
28
 
29
int
30
main ()
31
{
32
  if (f (2).val != 5)
33
    abort ();
34
}

powered by: WebSVN 2.1.0

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