URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
// Test that terminate gets run when a catch filter fails to match while
|
// Test that terminate gets run when a catch filter fails to match while
|
// running destructors. Original bug depended on a::~a being inlined.
|
// running destructors. Original bug depended on a::~a being inlined.
|
// { dg-do run }
|
// { dg-do run }
|
// { dg-options -O }
|
// { dg-options -O }
|
|
|
#include
|
#include
|
#include
|
#include
|
|
|
struct e1 {};
|
struct e1 {};
|
struct e2 {};
|
struct e2 {};
|
|
|
struct a
|
struct a
|
{
|
{
|
a () { }
|
a () { }
|
|
|
~a ()
|
~a ()
|
{
|
{
|
try
|
try
|
{
|
{
|
throw e1();
|
throw e1();
|
}
|
}
|
catch (e2 &)
|
catch (e2 &)
|
{
|
{
|
}
|
}
|
}
|
}
|
};
|
};
|
|
|
void
|
void
|
ex_test ()
|
ex_test ()
|
{
|
{
|
a aa;
|
a aa;
|
try
|
try
|
{
|
{
|
throw e1 ();
|
throw e1 ();
|
}
|
}
|
catch (e2 &)
|
catch (e2 &)
|
{
|
{
|
}
|
}
|
}
|
}
|
|
|
void my_terminate ()
|
void my_terminate ()
|
{
|
{
|
std::exit (0);
|
std::exit (0);
|
}
|
}
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
std::set_terminate (my_terminate);
|
std::set_terminate (my_terminate);
|
|
|
try
|
try
|
{
|
{
|
ex_test ();
|
ex_test ();
|
}
|
}
|
catch (...)
|
catch (...)
|
{
|
{
|
}
|
}
|
abort ();
|
abort ();
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.