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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
extern "C" int printf (const char*, ...);
3
 
4
struct A
5
{
6
  virtual void f () {
7
    printf ("%x\n", this);
8
  }
9
};
10
 
11
struct B : public A
12
{
13
};
14
 
15
struct C : public A
16
{
17
};
18
 
19
struct D : virtual public B, public C
20
{
21
};
22
 
23
int main ()
24
{
25
  D d;
26
 
27
  A* a1 = (A*) (B*) &d;
28
  A* a2 = (A*) (C*) &d;
29
 
30
  a1->f ();
31
  a2->f ();
32
}

powered by: WebSVN 2.1.0

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