diff options
Diffstat (limited to 'testsuites/libtests/dl05/dl-o5.cpp')
-rw-r--r-- | testsuites/libtests/dl05/dl-o5.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuites/libtests/dl05/dl-o5.cpp b/testsuites/libtests/dl05/dl-o5.cpp new file mode 100644 index 0000000000..6e8476d5e2 --- /dev/null +++ b/testsuites/libtests/dl05/dl-o5.cpp @@ -0,0 +1,19 @@ +#include <cstdio> +#include <stdexcept> +#include "dl-load.h" /* make the symbol a C linkage */ +void exception_dl(void) +{ + try + { + printf("exception_dl: throwing\n"); + throw std::runtime_error("exception_dl throw"); + } + catch (std::exception const& e) + { + printf("%s: caught: %s\n", __func__, e.what()); + } + catch (...) + { + printf("%s: caught: unknown\n", __func__); + } +} |