URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// A test case found by InterViews testing...
|
// A test case found by InterViews testing...
|
|
|
extern "C" int printf(const char *, ...);
|
extern "C" int printf(const char *, ...);
|
|
|
class A {
|
class A {
|
public:
|
public:
|
int foo() { printf("ok nv\n"); return 0; }
|
int foo() { printf("ok nv\n"); return 0; }
|
virtual int vfoo() { printf("ok v\n"); return 0; }
|
virtual int vfoo() { printf("ok v\n"); return 0; }
|
};
|
};
|
|
|
struct S {
|
struct S {
|
int (A::*pfn1)();
|
int (A::*pfn1)();
|
int (A::*pfn2)();
|
int (A::*pfn2)();
|
int (A::*pfn3)();
|
int (A::*pfn3)();
|
};
|
};
|
|
|
// This failed before.
|
// This failed before.
|
S s = { &A::foo, &A::vfoo, &A::foo };
|
S s = { &A::foo, &A::vfoo, &A::foo };
|
|
|
A a;
|
A a;
|
|
|
int main() {
|
int main() {
|
(a.*s.pfn1)();
|
(a.*s.pfn1)();
|
(a.*s.pfn2)();
|
(a.*s.pfn2)();
|
printf("PASS\n");
|
printf("PASS\n");
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.