URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
// { dg-do run }
|
// { dg-do run }
|
// PR c++/22132
|
// PR c++/22132
|
|
|
extern "C" void abort ();
|
extern "C" void abort ();
|
|
|
struct foo {
|
struct foo {
|
int a;
|
int a;
|
int b;
|
int b;
|
};
|
};
|
|
|
class Foobar : public foo {
|
class Foobar : public foo {
|
public:
|
public:
|
Foobar() { a = 1; b = 2; };
|
Foobar() { a = 1; b = 2; };
|
virtual ~Foobar() {};
|
virtual ~Foobar() {};
|
};
|
};
|
|
|
Foobar obj;
|
Foobar obj;
|
const Foobar* objPtr = &obj;
|
const Foobar* objPtr = &obj;
|
foo* f = (foo*)objPtr;
|
foo* f = (foo*)objPtr;
|
|
|
int main () {
|
int main () {
|
if (f->a != 1 || f->b != 2)
|
if (f->a != 1 || f->b != 2)
|
abort ();
|
abort ();
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.