From 53a420fba21cf1644972b34dcd811a43cdb8368d Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 2 Jan 2017 19:18:58 +0000 Subject: Vendor import of libc++ trunk r290819: https://llvm.org/svn/llvm-project/libcxx/trunk@290819 --- .../thread.mutex/thread.lock.algorithm/lock.pass.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp') diff --git a/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp index eac7600b5d11..46d04cdac350 100644 --- a/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp @@ -7,9 +7,13 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // UNSUPPORTED: libcpp-has-no-threads +// This test hangs forever when built against libstdc++. In order to allow +// validation of the test suite against other STLs we have to mark it +// unsupported. +// UNSUPPORTED: libstdc++ + // // template @@ -18,6 +22,8 @@ #include #include +#include "test_macros.h" + class L0 { bool locked_; @@ -73,12 +79,12 @@ public: void lock() { - throw 1; + TEST_THROW(1); } bool try_lock() { - throw 1; + TEST_THROW(1); return locked_; } @@ -110,6 +116,7 @@ int main() assert(l0.locked()); assert(l1.locked()); } +#ifndef TEST_HAS_NO_EXCEPTIONS { L0 l0; L2 l1; @@ -180,6 +187,7 @@ int main() assert(!l1.locked()); } } +#endif #ifndef _LIBCPP_HAS_NO_VARIADICS { L0 l0; @@ -190,6 +198,7 @@ int main() assert(l1.locked()); assert(l2.locked()); } +#ifndef TEST_HAS_NO_EXCEPTIONS { L2 l0; L2 l1; @@ -206,6 +215,7 @@ int main() assert(!l2.locked()); } } +#endif { L0 l0; L0 l1; @@ -233,6 +243,7 @@ int main() assert(l1.locked()); assert(l2.locked()); } +#ifndef TEST_HAS_NO_EXCEPTIONS { L0 l0; L0 l1; @@ -377,6 +388,7 @@ int main() assert(!l2.locked()); } } +#endif // TEST_HAS_NO_EXCEPTIONS { L0 l0; L0 l1; @@ -432,6 +444,7 @@ int main() assert(l2.locked()); assert(l3.locked()); } +#ifndef TEST_HAS_NO_EXCEPTIONS { L0 l0; L0 l1; @@ -504,5 +517,6 @@ int main() assert(!l3.locked()); } } +#endif // TEST_HAS_NO_EXCEPTIONS #endif // _LIBCPP_HAS_NO_VARIADICS } -- cgit v1.2.3