1 // { dg-do run { xfail { ! "powerpc*-*-linux*" } } }
2 // Objects must be destructed in decreasing cnt order
3 // Original test attributed to James Kanze <jkanze@otelo.ibmmail.com>
5 extern "C" void abort ();
13 ~A() { if (--cnt != myCnt) abort(); }
16 void f() { static A a; /* a.myCnt == 1 */ }
21 B() : myCnt(cnt+1) { f(); ++cnt; }
22 ~B() { if (--cnt != myCnt) abort(); }
25 static A a1; // a1.myCnt == 0
26 static B b1; // b1.myCnt == 2
27 static A a2; // a2.myCnt == 3