diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.mike/eh48.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.mike/eh48.C | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh48.C b/gcc/testsuite/g++.old-deja/g++.mike/eh48.C new file mode 100644 index 000000000..d9caf61b4 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh48.C @@ -0,0 +1,34 @@ +// { dg-do run { xfail sparc64-*-elf arm-*-pe } } +// { dg-options "-fexceptions" } + +#include <exception> +#include <stdlib.h> + +using std::uncaught_exception; +class A { +public: + ~A() { + if (uncaught_exception ()) + exit (0); + } +}; + +int main() { + if (uncaught_exception ()) + return 1; + try { + throw ""; + } catch (...) { + if (uncaught_exception ()) + return 1; + } + if (uncaught_exception ()) + return 1; + try { + A a; + throw ""; + } catch (...) { + return 1; + } + return 1; +} |