PR c++/28145
[official-gcc.git] / gcc / testsuite / g++.dg / abi / forced.C
blob7a9c35964f7ce9a74245f1ce1f4f0125055b4a79
1 // This test only applies to glibc (NPTL) targets.
2 // { dg-do run { target *-*-linux* } }
3 // { dg-options "-pthread" }
5 #include <pthread.h>
6 #include <cxxabi.h>
7 extern "C" int printf (const char *, ...);
9 int main()
11   try
12     {
13       pthread_exit (0);
14     }
15   catch (abi::__forced_unwind &)
16     {
17       printf ("caught forced unwind\n");
18       throw;
19     }
20   catch (...)
21     {
22       printf ("caught ...\n");
23       return 1;
24     }