OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.eh/] [rethrow3.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
#include 
3
#include 
4
#include 
5
 
6
static void
7
eh_terminate ()
8
{
9
  printf ("CALLING TERMINATE\n");
10
  exit (1);
11
}
12
 
13
void
14
eh_test (int level)
15
{
16
  try
17
    {
18
      if (level < 2)
19
        eh_test (level + 1);
20
      else
21
        {
22
          printf ("%d: Throwing\n", level);
23
          throw (level);
24
        }
25
    }
26
  catch (int &x)
27
    {
28
      printf ("%d: Got level %d\n",
29
              level, x);
30
 
31
      if (level > 0)
32
        throw;
33
    }
34
}
35
 
36
int main ()
37
{
38
  std::set_terminate (&eh_terminate);
39
  eh_test (0);
40
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.