summaryrefslogtreecommitdiff
path: root/regress/misc/exceptions/exceptions.cc
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/exceptions/exceptions.cc
parentbe1e9b84f3670dbb9a0b7988e5b30be91815876e (diff)
Trivial test to see if c++ exceptions work.
Diffstat (limited to 'regress/misc/exceptions/exceptions.cc')
-rw-r--r--regress/misc/exceptions/exceptions.cc19
1 files changed, 19 insertions, 0 deletions
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);
+}