URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// { dg-lto-do run }
|
// { dg-lto-do run }
|
|
|
/* This test will fail to link if the vtable for Derived is not emitted. */
|
/* This test will fail to link if the vtable for Derived is not emitted. */
|
|
|
class Base {
|
class Base {
|
public:
|
public:
|
Base(char *buf, unsigned len)
|
Base(char *buf, unsigned len)
|
: _buf(buf),
|
: _buf(buf),
|
_len(len)
|
_len(len)
|
{}
|
{}
|
|
|
virtual int length () { return _len; }
|
virtual int length () { return _len; }
|
|
|
private:
|
private:
|
char * _buf;
|
char * _buf;
|
unsigned _len;
|
unsigned _len;
|
};
|
};
|
|
|
class Derived : public Base {
|
class Derived : public Base {
|
public:
|
public:
|
Derived(char *buf, unsigned len)
|
Derived(char *buf, unsigned len)
|
: Base(buf, len),
|
: Base(buf, len),
|
_ctr(len)
|
_ctr(len)
|
{}
|
{}
|
|
|
virtual int length () { return _ctr; }
|
virtual int length () { return _ctr; }
|
|
|
private:
|
private:
|
unsigned _ctr;
|
unsigned _ctr;
|
};
|
};
|
|
|
int main ()
|
int main ()
|
{
|
{
|
Derived *d = new Derived (new char[256], 256);
|
Derived *d = new Derived (new char[256], 256);
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.