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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [dtor1.C] - Blame information for rev 704

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
 
3
extern "C" void abort ();
4
 
5
int d = 5;
6
 
7
struct B
8
{
9
  int x;
10
  B (int i) : x (i) { }
11
  ~B () { if (d-- != x) abort (); }
12
};
13
 
14
struct C1 : public B {
15
  C1 (int i) : B (i) {}
16
};
17
 
18
struct C2 : public B {
19
  C2 (int i) : B (i) {}
20
};
21
 
22
struct D : public B {
23
  D (int i) : B (i) {}
24
};
25
 
26
struct E : public B {
27
  E (int i) : B (i) {}
28
};
29
 
30
struct A
31
  : public C1, C2, virtual public D, virtual public E
32
{
33
  A () : D (0), E (1), C1 (2), C2 (3), x1(4), x2(5) {}
34
  B x1;
35
  B x2;
36
};
37
 
38
 
39
int main ()
40
{
41
  A a;
42
  return 0;
43
}

powered by: WebSVN 2.1.0

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