[libcxx-commits] [libcxxabi] r358937 - [libc++abi] Don't use a .sh.cpp test for uncaught_exception

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 22 17:03:35 PDT 2019


Author: ldionne
Date: Mon Apr 22 17:03:34 2019
New Revision: 358937

URL: http://llvm.org/viewvc/llvm-project?rev=358937&view=rev
Log:
[libc++abi] Don't use a .sh.cpp test for uncaught_exception

Otherwise, we don't seem to get the DYLD_LIBRARY_PATH set up correctly
and the tests are run against the system libc++abi dylib.

Added:
    libcxxabi/trunk/test/uncaught_exception.pass.cpp
Removed:
    libcxxabi/trunk/test/uncaught_exception.pass.sh.cpp

Added: libcxxabi/trunk/test/uncaught_exception.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/uncaught_exception.pass.cpp?rev=358937&view=auto
==============================================================================
--- libcxxabi/trunk/test/uncaught_exception.pass.cpp (added)
+++ libcxxabi/trunk/test/uncaught_exception.pass.cpp Mon Apr 22 17:03:34 2019
@@ -0,0 +1,28 @@
+//===------------------- uncaught_exceptions.pass.cpp ---------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: libcxxabi-no-exceptions
+
+// This tests that libc++abi still provides __cxa_uncaught_exception() for
+// ABI compatibility, even though the Standard doesn't require it to.
+
+#include <cxxabi.h>
+#include <cassert>
+
+// namespace __cxxabiv1 {
+//      extern bool __cxa_uncaught_exception () throw();
+// }
+
+struct A {
+    ~A() { assert( __cxxabiv1::__cxa_uncaught_exception()); }
+};
+
+int main () {
+    try { A a; throw 3; assert(false); }
+    catch (int) {}
+}

Removed: libcxxabi/trunk/test/uncaught_exception.pass.sh.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/uncaught_exception.pass.sh.cpp?rev=358936&view=auto
==============================================================================
--- libcxxabi/trunk/test/uncaught_exception.pass.sh.cpp (original)
+++ libcxxabi/trunk/test/uncaught_exception.pass.sh.cpp (removed)
@@ -1,34 +0,0 @@
-//===------------------- uncaught_exceptions.pass.cpp ---------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: libcxxabi-no-exceptions
-
-// This tests that libc++abi still provides __cxa_uncaught_exception() for
-// ABI compatibility, even though the Standard doesn't require it to.
-//
-// We need to explicitly link against libc++abi, because libc++ does not
-// re-export this symbol.
-
-// RUN: %build -lc++abi -o %t.exe
-// RUN: %t.exe
-
-#include <cxxabi.h>
-#include <cassert>
-
-// namespace __cxxabiv1 {
-//      extern bool __cxa_uncaught_exception () throw();
-// }
-
-struct A {
-    ~A() { assert( __cxxabiv1::__cxa_uncaught_exception()); }
-};
-
-int main () {
-    try { A a; throw 3; assert(false); }
-    catch (int) {}
-}




More information about the libcxx-commits mailing list