gcc/testsuite/g++.old-deja/g++.mike/eh47.C
raw| 1 | // { dg-do run { xfail sparc64-*-elf arm-*-pe } } |
| 2 | // { dg-options "-fexceptions" } |
| 3 | // { dg-skip-if "requires hosted libstdc++ for cstdlib exit" { ! hostedlib } } |
| 4 | |
| 5 | #include <cstdlib> |
| 6 | #include <exception> |
| 7 | |
| 8 | void myterm() { |
| 9 | exit (0); |
| 10 | } |
| 11 | |
| 12 | int |
| 13 | main() { |
| 14 | try { |
| 15 | throw ""; |
| 16 | } catch (...) { |
| 17 | } |
| 18 | try { |
| 19 | std::set_terminate (myterm); |
| 20 | throw; |
| 21 | } catch (...) { |
| 22 | return 1; |
| 23 | } |
| 24 | return 1; |
| 25 | } |