OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [pmf7.C] - Diff between revs 305 and 338

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;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.