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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [vbase1.C] - Blame information for rev 749

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

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// { dg-options "-w" }
3
// Origin: Mark Mitchell 
4
 
5
int result;
6
 
7
struct A {
8
  A ();
9
 
10
  int i;
11
};
12
 
13
A* ap;
14
 
15
A::A ()
16
{
17
  ap = this;
18
}
19
 
20
struct B : virtual public A
21
{
22
  B ();
23
  ~B ();
24
 
25
  int j;
26
};
27
 
28
B::B () {
29
  if ((A*) this != ap)
30
    result = 1;
31
}
32
 
33
B::~B () {
34
  if ((A*) this != ap)
35
    result = 1;
36
}
37
 
38
struct C : public B {
39
};
40
 
41
struct D : public C, public B
42
{
43
};
44
 
45
int main ()
46
{
47
  {
48
    D d;
49
  }
50
 
51
  return result;
52
}

powered by: WebSVN 2.1.0

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