URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 384 |
// { dg-do run }
|
// { dg-do run }
|
// Testing exception specifications.
|
// Testing exception specifications.
|
// Test 3: the bad_exception throw succeeds.
|
// Test 3: the bad_exception throw succeeds.
|
|
|
#include
|
#include
|
#include
|
#include
|
|
|
void my_term () { exit (1); }
|
void my_term () { exit (1); }
|
void my_unexp () { throw 42; }
|
void my_unexp () { throw 42; }
|
|
|
void
|
void
|
f () throw (std::bad_exception)
|
f () throw (std::bad_exception)
|
{
|
{
|
throw 'a';
|
throw 'a';
|
}
|
}
|
|
|
int main ()
|
int main ()
|
{
|
{
|
std::set_terminate (my_term);
|
std::set_terminate (my_term);
|
std::set_unexpected (my_unexp);
|
std::set_unexpected (my_unexp);
|
|
|
try
|
try
|
{
|
{
|
f ();
|
f ();
|
}
|
}
|
catch (char)
|
catch (char)
|
{
|
{
|
return 2;
|
return 2;
|
}
|
}
|
catch (int)
|
catch (int)
|
{
|
{
|
return 3;
|
return 3;
|
}
|
}
|
catch (std::bad_exception)
|
catch (std::bad_exception)
|
{
|
{
|
return 0;
|
return 0;
|
}
|
}
|
return 5;
|
return 5;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.