[libcxxabi] r209944 - Add EH test case checking that handlers in noexcept functions can still unwind

Jonathan Roelofs jonathan at codesourcery.com
Fri May 30 17:25:59 PDT 2014


Author: jroelofs
Date: Fri May 30 19:25:59 2014
New Revision: 209944

URL: http://llvm.org/viewvc/llvm-project?rev=209944&view=rev
Log:
Add EH test case checking that handlers in noexcept functions can still unwind

Added:
    libcxxabi/trunk/test/catch_in_noexcept.cpp

Added: libcxxabi/trunk/test/catch_in_noexcept.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_in_noexcept.cpp?rev=209944&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_in_noexcept.cpp (added)
+++ libcxxabi/trunk/test/catch_in_noexcept.cpp Fri May 30 19:25:59 2014
@@ -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();
+}





More information about the cfe-commits mailing list