URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.eh/] [rethrow3.C] - Rev 154
Compare with Previous | Blame | View Log
// { dg-do run }
#include <stdio.h>
#include <stdlib.h>
#include <exception>
static void
eh_terminate ()
{
printf ("CALLING TERMINATE\n");
exit (1);
}
void
eh_test (int level)
{
try
{
if (level < 2)
eh_test (level + 1);
else
{
printf ("%d: Throwing\n", level);
throw (level);
}
}
catch (int &x)
{
printf ("%d: Got level %d\n",
level, x);
if (level > 0)
throw;
}
}
int main ()
{
std::set_terminate (&eh_terminate);
eh_test (0);
}