OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [p2736.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// The VxWorks kernel has no implementation of atexit, so local statics
2
// are never destroyed.
3
// { dg-do run { xfail vxworks_kernel } }
4
// This is a poor test case, it is meant to ensure that function local
5
// statics are destroyed at the right time.  See PR 2736 for details.
6
// prms-id: 2736
7
 
8
#include 
9
 
10
int count;
11
 
12
struct A {
13
  int which;
14
  A(int i) :which(i) {
15
    // printf("ctor %x\n", this);
16
  }
17
  ~A() {
18
    // printf("dtor %x\n", this);
19
    if (++count != which)
20
      abort ();
21
    }
22
};
23
 
24
void
25
foo() {
26
  static A a(1);
27
}
28
 
29
A a(2);
30
 
31
int main() {
32
  foo();
33
}

powered by: WebSVN 2.1.0

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