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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [net21.C] - Blame information for rev 305

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

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// Make sure we can initialize complex (MI ambiguous) vtables.
3
 
4
extern "C" int printf(const char *, ...);
5
 
6
struct a
7
{
8
    virtual void f() = 0;
9
};
10
 
11
struct b
12
{
13
    virtual void g() { }
14
};
15
 
16
struct c: public a, public b
17
{
18
    virtual void f();
19
    virtual void g();
20
};
21
 
22
void c::f()
23
{
24
    printf("c::f()\n");
25
}
26
 
27
void c::g()
28
{
29
    printf("c::g()\n");
30
}
31
 
32
struct e: public b
33
{
34
};
35
 
36
struct h
37
{
38
};
39
 
40
struct d: public c, public e, public h
41
{
42
    virtual void f();
43
    virtual void g();
44
};
45
void d::f()
46
{
47
    printf("d::f()\n");
48
}
49
 
50
void d::g()
51
{
52
    printf("d::g()\n");
53
}
54
 
55
int main(int argc, char* argv[])
56
{
57
    a* tmp = new d;
58
    tmp->f();
59
    return 0;
60
}

powered by: WebSVN 2.1.0

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