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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 jeremybenn
// PR middle-end/15054
2
 
3
// { dg-do run }
4
// { dg-options "-O2" }
5
 
6
extern "C" void abort (void);
7
 
8
void
9
__attribute__((noinline))
10
check (long x, long y)
11
{
12
  if (x != y)
13
    abort ();
14
}
15
 
16
struct A
17
{
18
  A() : a(2) { check (a, 2); }
19
  ~A() { check (a, 2); }
20
private:
21
  long a;
22
};
23
 
24
class B {
25
  long b;
26
  B& operator =(const B& );
27
public:
28
  B (long p) : b(p) { check (b, 6); }
29
  B (const B& p) : b(p.b) { check (b, 6); }
30
  ~B () { check (b, 6); A obj; check (b, 6); }
31
  B foo() { return B(*this); }
32
};
33
 
34
int main ()
35
{
36
  B o(6);
37
  o.foo().foo();
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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