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++.pt/] [static11.C] - Diff between revs 305 and 338

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// Some targets (e.g. those with "set_board_info needs_status_wrapper 1"
// Some targets (e.g. those with "set_board_info needs_status_wrapper 1"
// in their dejagnu baseboard description) require that the status is
// in their dejagnu baseboard description) require that the status is
// final when exit is entered (or main returns), and not "overruled" by a
// final when exit is entered (or main returns), and not "overruled" by a
// destructor calling _exit.  It's not really worth it to handle that.
// destructor calling _exit.  It's not really worth it to handle that.
// { dg-do run { target unwrapped } }
// { dg-do run { target unwrapped } }
// Bug: g++ was failing to destroy C::a because it was using two
// Bug: g++ was failing to destroy C::a because it was using two
// different sentry variables for construction and destruction.
// different sentry variables for construction and destruction.
extern "C" void _exit (int);
extern "C" void _exit (int);
int r = 1;
int r = 1;
struct A
struct A
{
{
  void f(){}
  void f(){}
  A(){ ++r; }
  A(){ ++r; }
  ~A(){ r -= 2; _exit (r); }
  ~A(){ r -= 2; _exit (r); }
};
};
template
template
struct C
struct C
{
{
  C(){ a.f(); }
  C(){ a.f(); }
  static A a;
  static A a;
};
};
template  A C::a;
template  A C::a;
typedef C B;
typedef C B;
int main()
int main()
{
{
  C c;
  C c;
  return r;
  return r;
}
}
 
 

powered by: WebSVN 2.1.0

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