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/] [virtual9.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// Source: Neil Booth, from PR #111.
3
 
4
class A
5
{
6
public :
7
     int i;
8
};
9
 
10
class B : virtual public A
11
{
12
};
13
 
14
class C : virtual public A
15
{
16
};
17
 
18
class D : public B, public C
19
{
20
public :
21
     int f(void);
22
     int g(void);
23
};
24
 
25
int D::f(void)
26
{
27
     return B::i;
28
}
29
 
30
int D::g(void)
31
{
32
     return this->B::i;
33
}
34
 
35
D d;
36
extern "C" void abort (void);
37
 
38
int main(void)
39
{
40
    d.C::i=325;
41
 
42
    if (d.f() != d.B::i || d.f() != d.g())
43
      abort ();
44
 
45
    return 0;
46
}

powered by: WebSVN 2.1.0

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