URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// Test that an exception thrown out of the constructor for the exception
|
// Test that an exception thrown out of the constructor for the exception
|
// object (i.e. "after completing evaluation of the expression to be thrown
|
// object (i.e. "after completing evaluation of the expression to be thrown
|
// but before the exception is caught") causes us to call terminate.
|
// but before the exception is caught") causes us to call terminate.
|
|
|
#include
|
#include
|
#include
|
#include
|
|
|
void my_terminate ()
|
void my_terminate ()
|
{
|
{
|
std::exit (0);
|
std::exit (0);
|
}
|
}
|
|
|
struct A
|
struct A
|
{
|
{
|
A () {}
|
A () {}
|
A (const A&) { throw 1; }
|
A (const A&) { throw 1; }
|
};
|
};
|
|
|
int main (void)
|
int main (void)
|
{
|
{
|
std::set_terminate (my_terminate);
|
std::set_terminate (my_terminate);
|
|
|
A a;
|
A a;
|
try { throw a; }
|
try { throw a; }
|
catch (...) {}
|
catch (...) {}
|
return 1;
|
return 1;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.