URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// prms-id: 2394
|
// prms-id: 2394
|
|
|
class Foo {
|
class Foo {
|
public:
|
public:
|
int x;
|
int x;
|
int y;
|
int y;
|
Foo(int i, int j) { x = i; y = j; }
|
Foo(int i, int j) { x = i; y = j; }
|
} foo(10, 11);
|
} foo(10, 11);
|
|
|
class Wasted { int unsed; };
|
class Wasted { int unsed; };
|
|
|
class Bar : Wasted, public Foo {
|
class Bar : Wasted, public Foo {
|
public:
|
public:
|
Bar() : Foo(12, 13) { }
|
Bar() : Foo(12, 13) { }
|
} bar;
|
} bar;
|
|
|
int
|
int
|
test0() {
|
test0() {
|
int Foo::* pmi = &Foo::y;
|
int Foo::* pmi = &Foo::y;
|
return (int)(foo.*pmi);
|
return (int)(foo.*pmi);
|
}
|
}
|
|
|
int
|
int
|
test1() {
|
test1() {
|
int Foo::* pmi = &Foo::y;
|
int Foo::* pmi = &Foo::y;
|
return (int)(bar.*pmi);
|
return (int)(bar.*pmi);
|
}
|
}
|
|
|
int
|
int
|
main() {
|
main() {
|
if (test0() != 11)
|
if (test0() != 11)
|
return 1;
|
return 1;
|
if (test1() != 13)
|
if (test1() != 13)
|
return 2;
|
return 2;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.