diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-01-28 19:37:01 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-01-28 19:37:01 +0000 |
commit | e00fd4fe929f9f899274681536537e2f7035b800 (patch) | |
tree | c43c4b3a390b42b4f29efbec779743545380bb61 /regress/misc | |
parent | 974fca6fbe75ff39f91dda114a3b06f686c68f34 (diff) |
New test for exceptions.
Diffstat (limited to 'regress/misc')
-rw-r--r-- | regress/misc/exceptions/Makefile | 2 | ||||
-rw-r--r-- | regress/misc/exceptions/foo/Makefile | 15 | ||||
-rw-r--r-- | regress/misc/exceptions/foo/foo.cc | 18 | ||||
-rw-r--r-- | regress/misc/exceptions/libbar/Makefile | 6 | ||||
-rw-r--r-- | regress/misc/exceptions/libbar/bar.cc | 3 | ||||
-rw-r--r-- | regress/misc/exceptions/libbar/shlib_version | 2 |
6 files changed, 45 insertions, 1 deletions
diff --git a/regress/misc/exceptions/Makefile b/regress/misc/exceptions/Makefile index d4d1d960d66..09308234ad3 100644 --- a/regress/misc/exceptions/Makefile +++ b/regress/misc/exceptions/Makefile @@ -1,3 +1,3 @@ -SUBDIR+= simple +SUBDIR+= simple libbar foo .include <bsd.subdir.mk> diff --git a/regress/misc/exceptions/foo/Makefile b/regress/misc/exceptions/foo/Makefile new file mode 100644 index 00000000000..2c1087d388a --- /dev/null +++ b/regress/misc/exceptions/foo/Makefile @@ -0,0 +1,15 @@ +.include <bsd.obj.mk> + +BAR_DIR= ${.CURDIR}/../libbar + +BAR_OBJDIR!= if [ -d $(BAR_DIR)/${__objdir} ]; then \ + echo "$(BAR_DIR)/${__objdir}"; \ + else \ + echo "$(BAR_DIR)"; \ + fi + +PROG= foo +SRCS= foo.cc +LDADD= -Wl,-rpath,$(BAR_OBJDIR) -L$(BAR_OBJDIR) -lbar + +.include <bsd.regress.mk>
\ No newline at end of file diff --git a/regress/misc/exceptions/foo/foo.cc b/regress/misc/exceptions/foo/foo.cc new file mode 100644 index 00000000000..a8fb4eaa85d --- /dev/null +++ b/regress/misc/exceptions/foo/foo.cc @@ -0,0 +1,18 @@ +#include <iostream> + +using namespace std; + +int +main () +{ + cout << "Throwing up" << endl; + try { + throw false; + } + catch (...) { + cout << "Wew, that was close!" << endl; + return 0; + } + cout << "Done" << endl; + return 1; +} diff --git a/regress/misc/exceptions/libbar/Makefile b/regress/misc/exceptions/libbar/Makefile new file mode 100644 index 00000000000..ffb6f3a4a81 --- /dev/null +++ b/regress/misc/exceptions/libbar/Makefile @@ -0,0 +1,6 @@ +LIB= bar +SRCS= bar.cc + +regress: all + +.include <bsd.lib.mk> diff --git a/regress/misc/exceptions/libbar/bar.cc b/regress/misc/exceptions/libbar/bar.cc new file mode 100644 index 00000000000..20e8adc4519 --- /dev/null +++ b/regress/misc/exceptions/libbar/bar.cc @@ -0,0 +1,3 @@ +#include <string> + +std::string bar("bar"); diff --git a/regress/misc/exceptions/libbar/shlib_version b/regress/misc/exceptions/libbar/shlib_version new file mode 100644 index 00000000000..a45aa2c0673 --- /dev/null +++ b/regress/misc/exceptions/libbar/shlib_version @@ -0,0 +1,2 @@ +major=1 +minor=0
\ No newline at end of file |