URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [eh/] [filter2.C] - Rev 315
Go to most recent revision | Compare with Previous | Blame | View Log
// Test that terminate gets run when a catch filter fails to match while
// running destructors. Original bug depended on a::~a being inlined.
// { dg-do run }
// { dg-options -O }
#include <exception>
#include <cstdlib>
struct e1 {};
struct e2 {};
struct a
{
a () { }
~a ()
{
try
{
throw e1();
}
catch (e2 &)
{
}
}
};
void
ex_test ()
{
a aa;
try
{
throw e1 ();
}
catch (e2 &)
{
}
}
void my_terminate ()
{
std::exit (0);
}
int
main ()
{
std::set_terminate (my_terminate);
try
{
ex_test ();
}
catch (...)
{
}
abort ();
}
Go to most recent revision | Compare with Previous | Blame | View Log