repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* arm.md (stack_tie): New insn. Use an idiom that the alias code
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.eh
/
rethrow3.C
blob
5ab25d66fd41e46f8df17c9a7d5c288a50933595
1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <exception>
4
5
static void
6
eh_terminate ()
7
{
8
printf ("CALLING TERMINATE\n");
9
exit (1);
10
}
11
12
void
13
eh_test (int level)
14
{
15
try
16
{
17
if (level < 2)
18
eh_test (level + 1);
19
else
20
{
21
printf ("%d: Throwing\n", level);
22
throw (level);
23
}
24
}
25
catch (int &x)
26
{
27
printf ("%d: Got level %d\n",
28
level, x);
29
30
if (level > 0)
31
throw;
32
}
33
}
34
35
int main ()
36
{
37
std::set_terminate (&eh_terminate);
38
eh_test (0);
39
}