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: 6486
|
// PRMS Id: 6486
|
// Make sure that no confused handling of COND_EXPRs and SAVE_EXPRs messes
|
// Make sure that no confused handling of COND_EXPRs and SAVE_EXPRs messes
|
// with the number of calls to foo.
|
// with the number of calls to foo.
|
|
|
int c;
|
int c;
|
|
|
struct A {
|
struct A {
|
void f () {}
|
void f () {}
|
virtual void g () {}
|
virtual void g () {}
|
};
|
};
|
|
|
A& foo ()
|
A& foo ()
|
{
|
{
|
static A a;
|
static A a;
|
++c;
|
++c;
|
return a;
|
return a;
|
}
|
}
|
|
|
int main ()
|
int main ()
|
{
|
{
|
void (A::*p)() = &A::f;
|
void (A::*p)() = &A::f;
|
(foo ().*p)();
|
(foo ().*p)();
|
p = &A::g;
|
p = &A::g;
|
(foo ().*p)();
|
(foo ().*p)();
|
|
|
return 2 - c;
|
return 2 - c;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.