URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 834 |
Rev 842 |
// This first batch of classes are for PR 11226.
|
// This first batch of classes are for PR 11226.
|
namespace mc {
|
namespace mc {
|
class Base {
|
class Base {
|
protected:
|
protected:
|
int x;
|
int x;
|
|
|
public:
|
public:
|
Base(void) { x = 2; };
|
Base(void) { x = 2; };
|
};
|
};
|
}
|
}
|
|
|
namespace ph {
|
namespace ph {
|
class Middle: public virtual mc::Base {
|
class Middle: public virtual mc::Base {
|
protected:
|
protected:
|
int y;
|
int y;
|
|
|
public:
|
public:
|
Middle(void): mc::Base() { y = 3; };
|
Middle(void): mc::Base() { y = 3; };
|
|
|
int get_y(void)
|
int get_y(void)
|
{
|
{
|
return y; // breakpoint 1
|
return y; // breakpoint 1
|
};
|
};
|
};
|
};
|
|
|
class Derived: public virtual Middle {
|
class Derived: public virtual Middle {
|
protected:
|
protected:
|
int z;
|
int z;
|
|
|
public:
|
public:
|
Derived(void): Middle() { z = 4; };
|
Derived(void): Middle() { z = 4; };
|
|
|
int get_z(void)
|
int get_z(void)
|
{
|
{
|
return z; // breakpoint 2
|
return z; // breakpoint 2
|
};
|
};
|
};
|
};
|
}
|
}
|
|
|
// These classes are for PR 9629.
|
// These classes are for PR 9629.
|
struct A {};
|
struct A {};
|
struct B : virtual A {};
|
struct B : virtual A {};
|
|
|
struct C {int v; C() {v=11;};};
|
struct C {int v; C() {v=11;};};
|
struct D:virtual C{};
|
struct D:virtual C{};
|
|
|
class E:B,D{};
|
class E:B,D{};
|
|
|
// These classes are for another regression test, from
|
// These classes are for another regression test, from
|
// https://bugzilla.redhat.com/show_bug.cgi?id=560741
|
// https://bugzilla.redhat.com/show_bug.cgi?id=560741
|
|
|
class RHA
|
class RHA
|
{
|
{
|
public:
|
public:
|
RHA() : mA(0xaaaaaaaa) {}
|
RHA() : mA(0xaaaaaaaa) {}
|
virtual void a() = 0;
|
virtual void a() = 0;
|
int mA;
|
int mA;
|
};
|
};
|
|
|
class RHB
|
class RHB
|
{
|
{
|
public:
|
public:
|
RHB() : mB(0xbbbbbbbb) {}
|
RHB() : mB(0xbbbbbbbb) {}
|
virtual void b() = 0;
|
virtual void b() = 0;
|
int mB;
|
int mB;
|
};
|
};
|
|
|
class RHC : public RHA,
|
class RHC : public RHA,
|
public RHB
|
public RHB
|
{
|
{
|
public:
|
public:
|
RHC() : RHA(), RHB() {}
|
RHC() : RHA(), RHB() {}
|
virtual void a() {}
|
virtual void a() {}
|
virtual void b() {}
|
virtual void b() {}
|
};
|
};
|
|
|
|
|
|
|
|
|
int main() {
|
int main() {
|
ph::Derived tst;
|
ph::Derived tst;
|
tst.get_y();
|
tst.get_y();
|
tst.get_z();
|
tst.get_z();
|
|
|
E *e = new E;
|
E *e = new E;
|
RHB *b = new RHC();
|
RHB *b = new RHC();
|
|
|
return 0; // breakpoint 3
|
return 0; // breakpoint 3
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.