aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/eh48.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.mike/eh48.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh48.C32
1 files changed, 32 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 00000000000..5cefacd5f1e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh48.C
@@ -0,0 +1,32 @@
+// Special g++ Options: -fexceptions
+// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
+
+#include <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;
+}