summaryrefslogtreecommitdiff
path: root/regress/misc
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-12-04 05:02:16 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-12-04 05:02:16 +0000
commit9991fff84b182f9e631cab82f35808aa75c20350 (patch)
tree77acf4d0655993dec2db1df3a4911659efdac425 /regress/misc
parentbe1e9b84f3670dbb9a0b7988e5b30be91815876e (diff)
Trivial test to see if c++ exceptions work.
Diffstat (limited to 'regress/misc')
-rw-r--r--regress/misc/Makefile7
-rw-r--r--regress/misc/exceptions/Makefile6
-rw-r--r--regress/misc/exceptions/exceptions.cc19
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);
+}