summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/forced.C
blob: 7a9c35964f7ce9a74245f1ce1f4f0125055b4a79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
    }
}