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
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.eh
/
rethrow3.C
blob
952318b80126ce397fe7036ec364aa0e0715751f
1
// { dg-do run }
2
#include <stdio.h>
3
#include <stdlib.h>
4
#include <exception>
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
}