diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2019-02-02 11:27:04 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2019-02-02 11:27:04 +0000 |
commit | 30547ff65d61d412e16fa59f2ab38c5615d75c2a (patch) | |
tree | 9c2211436ad6004118fc6408fc8a60d2f1711707 /regress | |
parent | b725c60e3c54a021fd5a406a32f73271e587fc77 (diff) |
An extra test that is known to trigger problems with some versions of
clang using -O0
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); +} |