summaryrefslogtreecommitdiffstats
path: root/libcxxabi/test/catch_in_noexcept.cpp
diff options
context:
space:
mode:
authorJonathan Roelofs <jonathan@codesourcery.com>2014-05-31 00:25:59 +0000
committerJonathan Roelofs <jonathan@codesourcery.com>2014-05-31 00:25:59 +0000
commit20f6f45c5ba74706e54cb3bc60963d598e156912 (patch)
tree3babab07ff67154f6311e350a9dbd9f2011232a9 /libcxxabi/test/catch_in_noexcept.cpp
parent75fd1b5f51299a28407dfb547bdab8d44c61d6f0 (diff)
downloadbcm5719-llvm-20f6f45c5ba74706e54cb3bc60963d598e156912.tar.gz
bcm5719-llvm-20f6f45c5ba74706e54cb3bc60963d598e156912.zip
Add EH test case checking that handlers in noexcept functions can still unwind
llvm-svn: 209944
Diffstat (limited to 'libcxxabi/test/catch_in_noexcept.cpp')
-rw-r--r--libcxxabi/test/catch_in_noexcept.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/libcxxabi/test/catch_in_noexcept.cpp b/libcxxabi/test/catch_in_noexcept.cpp
new file mode 100644
index 00000000000..02fecda495d
--- /dev/null
+++ b/libcxxabi/test/catch_in_noexcept.cpp
@@ -0,0 +1,34 @@
+//===---------------------- catch_in_noexcept.cpp--------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <exception>
+#include <stdlib.h>
+#include <assert.h>
+
+struct A {};
+
+// Despite being marked as noexcept, this function must have an EHT entry that
+// is not 'cantunwind', so that the unwinder can correctly deal with the throw.
+void f1() noexcept
+{
+ try {
+ A a;
+ throw a;
+ assert(false);
+ } catch (...) {
+ assert(true);
+ return;
+ }
+ assert(false);
+}
+
+int main()
+{
+ f1();
+}
OpenPOWER on IntegriCloud