diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.eh/terminate2.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.eh/terminate2.C | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/terminate2.C b/gcc/testsuite/g++.old-deja/g++.eh/terminate2.C new file mode 100644 index 000000000..3a3115843 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.eh/terminate2.C @@ -0,0 +1,17 @@ +// { dg-do run } +// Test that an unhandled exception causes us to call terminate. + +#include <exception> +#include <cstdlib> + +void my_terminate () +{ + std::exit (0); +} + +int main (void) +{ + std::set_terminate (my_terminate); + throw 1; + return 1; +} |