Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.mike/eh24.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } } |
2 // { dg-options "-fexceptions" } | |
3 | |
4 int fail = 0; | |
5 | |
6 struct A { | |
7 int ok; | |
8 A() { | |
9 ok = 1; | |
10 } | |
11 ~A() { | |
12 if (! ok) | |
13 fail = 1; | |
14 ok = 0; | |
15 } | |
16 }; | |
17 | |
131 | 18 int |
111 | 19 main() { |
20 try { | |
21 try { | |
22 A a; | |
23 throw 1.0; | |
24 } catch (double i) { | |
25 A a1; | |
26 throw 1; // make sure both a1 and a2 are not destroyed when we throw! | |
27 } catch (int i) { | |
28 A a2; | |
29 throw 1.0; | |
30 } | |
31 } catch (int i) { | |
32 } | |
33 return fail; | |
34 } |