Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.mike/init1.C

raw
1 // The VxWorks kernel has no implementation of atexit, so local statics
2 // are never destroyed.
3 // { dg-do run { xfail vxworks_kernel } }
4 int count;
5
6 extern "C" void _exit(int);
7
8 struct C {
9 ~C() { if (count != 1) _exit(1); }
10 } c;
11
12 class A {
13 public:
14 ~A () { ++count; }
15 };
16
17 void f() {
18 static A a;
19 }
20
21 void g() {
22 // Since this isn't constructed, we can't destruct it.
23 static A a;
24 }
25
26 int main () {
27 f();
28 }