diff options
-rw-r--r-- | regress/misc/Makefile | 7 | ||||
-rw-r--r-- | regress/misc/exceptions/Makefile | 6 | ||||
-rw-r--r-- | regress/misc/exceptions/exceptions.cc | 19 |
3 files changed, 32 insertions, 0 deletions
diff --git a/regress/misc/Makefile b/regress/misc/Makefile new file mode 100644 index 00000000000..fb2c4490a90 --- /dev/null +++ b/regress/misc/Makefile @@ -0,0 +1,7 @@ +# $OpenBSD: Makefile,v 1.1 2002/12/04 05:02:15 art Exp $ + +SUBDIR+= exceptions + +install: + +.include <bsd.subdir.mk> diff --git a/regress/misc/exceptions/Makefile b/regress/misc/exceptions/Makefile new file mode 100644 index 00000000000..af6a22ff04b --- /dev/null +++ b/regress/misc/exceptions/Makefile @@ -0,0 +1,6 @@ +# $OpenBSD: Makefile,v 1.1 2002/12/04 05:02:15 art Exp $ + +PROG= exceptions +SRCS= exceptions.cc + +.include <bsd.regress.mk> diff --git a/regress/misc/exceptions/exceptions.cc b/regress/misc/exceptions/exceptions.cc new file mode 100644 index 00000000000..273a88a287e --- /dev/null +++ b/regress/misc/exceptions/exceptions.cc @@ -0,0 +1,19 @@ +/* $OpenBSD: exceptions.cc,v 1.1 2002/12/04 05:02:15 art Exp $ */ +/* + * Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain + */ + +#include <cstring> + +int +main() +{ + try { + throw("foo"); + } + catch(const char *p) { + if (!strcmp(p, "foo")) + return (0); + } + return (1); +} |