Files
rtems/testsuites/libtests/dl05/dl-cpp.cc
Sebastian Huber 4a056523cf libtests/dl*: Rename source files
Rename source files to use a %.c -> %.o and %.cc -> %.o pattern.  Use
*.cc for C++ source files instead of *.cpp to be in line with other C++
source files.

Update #3818.
2019-11-26 07:21:44 +01:00

31 lines
649 B
C++

/*
* The base image needs this to include the RTTI data.
*/
#include <cstdio>
#include <stdexcept>
#include "dl-load.h"
void exception_base(bool throw_runtime)
{
printf("%s: begin\n", __func__);
try
{
if (throw_runtime)
throw std::runtime_error("eb: throw std::runtime_error");
else
throw dl_test_throw_me("eb: throw me");
}
catch (std::exception const& e)
{
printf("%s: caught: %s\n", __func__, e.what());
}
catch (dl_test_throw_me const& e)
{
printf("%s: caught: %s\n", __func__, e.what());
}
catch (...)
{
printf("%s: caught: unknown\n", __func__);
}
printf("%s: end\n", __func__);
}