1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } }
2 // { dg-options "-fexceptions" }
3 
4 int count;
5 
6 class A {
7 public:
A()8   A() {
9 //    printf("ctor %x\n", (int)this);
10     if (count==3)
11       throw 1;
12     ++count;
13     }
~A()14   ~A() {
15     --count;
16 //    printf("dtor %x\n", (int)this);
17   }
18 };
19 
20 int
main()21 main() {
22   try {
23     A a[5];
24   } catch (...) {
25     return count;
26   }
27   return 1;
28 }
29