summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/testsuite/18_support
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-27 18:07:25 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-27 18:07:25 +0000
commitc13b2ff9b65158efea2e19304ce9559a86dd0a4a (patch)
treec69ac28addcd7b8735559fb38475984fa75e7e49 /libstdc++-v3/testsuite/18_support
parente2ed0ab0c646d8c7586d7415a90fa021e04dc7d6 (diff)
downloadppe42-gcc-c13b2ff9b65158efea2e19304ce9559a86dd0a4a.tar.gz
ppe42-gcc-c13b2ff9b65158efea2e19304ce9559a86dd0a4a.zip
PR libstdc++/60612
* libsupc++/eh_ptr.cc: Assert __cxa_dependent_exception layout is compatible with __cxa_exception. * libsupc++/unwind-cxx.h (__cxa_dependent_exception): Add padding. Fix typos in comments. * testsuite/18_support/exception_ptr/60612-terminate.cc: New. * testsuite/18_support/exception_ptr/60612-unexpected.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208871 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/18_support')
-rw-r--r--libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc41
-rw-r--r--libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc41
2 files changed, 82 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc
new file mode 100644
index 00000000000..ec5940d6b21
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc
@@ -0,0 +1,41 @@
+// { dg-options "-std=gnu++11" }
+// { dg-require-atomic-builtins "" }
+
+// Copyright (C) 2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// PR libstdc++/60612
+
+#include <exception>
+#include <stdlib.h>
+
+void terminate() { _Exit(0); }
+
+void f() noexcept
+{
+ try {
+ throw 1;
+ } catch (...) {
+ std::set_terminate(terminate);
+ std::rethrow_exception(std::current_exception());
+ }
+}
+
+int main()
+{
+ f();
+}
diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc
new file mode 100644
index 00000000000..3f7e2cf379d
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc
@@ -0,0 +1,41 @@
+// { dg-options "-std=gnu++11" }
+// { dg-require-atomic-builtins "" }
+
+// Copyright (C) 2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// PR libstdc++/60612
+
+#include <exception>
+#include <stdlib.h>
+
+void unexpected() { _Exit(0); }
+
+void f() throw()
+{
+ try {
+ throw 1;
+ } catch (...) {
+ std::set_unexpected(unexpected);
+ std::rethrow_exception(std::current_exception());
+ }
+}
+
+int main()
+{
+ f();
+}
OpenPOWER on IntegriCloud