diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/misc/exceptions/Makefile | 2 | ||||
-rw-r--r-- | regress/misc/exceptions/simple2/Makefile | 8 | ||||
-rw-r--r-- | regress/misc/exceptions/simple2/simple2.cc | 20 |
3 files changed, 29 insertions, 1 deletions
diff --git a/regress/misc/exceptions/Makefile b/regress/misc/exceptions/Makefile index 09308234ad3..d246e2d8a28 100644 --- a/regress/misc/exceptions/Makefile +++ b/regress/misc/exceptions/Makefile @@ -1,3 +1,3 @@ -SUBDIR+= simple libbar foo +SUBDIR+= simple simple2 libbar foo .include <bsd.subdir.mk> diff --git a/regress/misc/exceptions/simple2/Makefile b/regress/misc/exceptions/simple2/Makefile new file mode 100644 index 00000000000..40a8ee2b8e0 --- /dev/null +++ b/regress/misc/exceptions/simple2/Makefile @@ -0,0 +1,8 @@ +# $OpenBSD: Makefile,v 1.1 2019/02/02 11:27:03 otto Exp $ + +PROG= simple2 +SRCS= simple2.cc +# This flag has been known to trigger bugs in clang, please keep it +CXXFLAGS=-O0 + +.include <bsd.regress.mk> diff --git a/regress/misc/exceptions/simple2/simple2.cc b/regress/misc/exceptions/simple2/simple2.cc new file mode 100644 index 00000000000..efd54ec9c54 --- /dev/null +++ b/regress/misc/exceptions/simple2/simple2.cc @@ -0,0 +1,20 @@ +#include <iostream> + + +class ex { +}; + +void f(void) { + throw ex(); +} + +int main() { + try { + f(); + } + catch (const ex & myex) { + std::cout << "Catching..." << std::endl; + exit(0); + } + exit(1); +} |