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.0rc4/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [static11.C] - Blame information for rev 519

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// Some targets (e.g. those with "set_board_info needs_status_wrapper 1"
2
// in their dejagnu baseboard description) require that the status is
3
// final when exit is entered (or main returns), and not "overruled" by a
4
// destructor calling _exit.  It's not really worth it to handle that.
5
// { dg-do run { target unwrapped } }
6
 
7
// Bug: g++ was failing to destroy C::a because it was using two
8
// different sentry variables for construction and destruction.
9
 
10
extern "C" void _exit (int);
11
 
12
int r = 1;
13
 
14
struct A
15
{
16
  void f(){}
17
  A(){ ++r; }
18
  ~A(){ r -= 2; _exit (r); }
19
};
20
 
21
template
22
struct C
23
{
24
  C(){ a.f(); }
25
  static A a;
26
};
27
 
28
template  A C::a;
29
typedef C B;
30
 
31
int main()
32
{
33
  C c;
34
  return r;
35
}

powered by: WebSVN 2.1.0

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