summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/eh/crossjump1.C
blob: ccb0ffb2185568969c4ed11d16b5f37b61475dcd (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
26
27
28
29
30
31
// This testcase failed on s390, because cross-jumping merged 2 calls,
// one with REG_EH_REGION note with no handlers (ie. termination)
// and one without REG_EH_REGION note.
// { dg-do run }
// { dg-options "-O2" }

#include <exception>
#include <string>

struct E : public std::exception
{
  std::string m;
  E () : m ("test") { }
  ~E () throw() { }
};

struct C : public E { };

void foo ()
{
  throw C ();
}

int main ()
{
  try
    {
      foo ();
    }
  catch (...) { }
}