aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/forced.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/abi/forced.C')
-rw-r--r--gcc/testsuite/g++.dg/abi/forced.C25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/abi/forced.C b/gcc/testsuite/g++.dg/abi/forced.C
new file mode 100644
index 00000000000..7a9c35964f7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/forced.C
@@ -0,0 +1,25 @@
+// This test only applies to glibc (NPTL) targets.
+// { dg-do run { target *-*-linux* } }
+// { dg-options "-pthread" }
+
+#include <pthread.h>
+#include <cxxabi.h>
+extern "C" int printf (const char *, ...);
+
+int main()
+{
+ try
+ {
+ pthread_exit (0);
+ }
+ catch (abi::__forced_unwind &)
+ {
+ printf ("caught forced unwind\n");
+ throw;
+ }
+ catch (...)
+ {
+ printf ("caught ...\n");
+ return 1;
+ }
+}