diff options
author | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2016-11-01 15:00:16 +0000 |
---|---|---|
committer | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2016-11-01 15:00:16 +0000 |
commit | 60d6ef63a4e30bbba038d67849fa786314f670f6 (patch) | |
tree | 7a3fc11c8e3f9282fbf4a32283b12d81c222c0ac /libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp | |
parent | 05ce4ca0dd8c43d86f3c5f9b4f55c9ce95ee5a73 (diff) | |
download | bcm5719-llvm-60d6ef63a4e30bbba038d67849fa786314f670f6.tar.gz bcm5719-llvm-60d6ef63a4e30bbba038d67849fa786314f670f6.zip |
Protect lock tests under libcpp-no-exceptions
Skip tests that expect an exception to be thrown.
Differential Revision: https://reviews.llvm.org/D26184
llvm-svn: 285695
Diffstat (limited to 'libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp')
-rw-r--r-- | libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp index 6ce33761068..cb5c55925ee 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // UNSUPPORTED: libcpp-has-no-threads // <mutex> @@ -21,6 +20,8 @@ #include <cstdlib> #include <cassert> +#include "test_macros.h" + std::mutex m; typedef std::chrono::system_clock Clock; @@ -38,6 +39,7 @@ void f() assert(lk.owns_lock() == true); ns d = t1 - t0 - ms(250); assert(d < ms(25)); // within 25ms +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.lock(); @@ -47,8 +49,10 @@ void f() { assert(e.code().value() == EDEADLK); } +#endif lk.unlock(); lk.release(); +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.lock(); @@ -58,6 +62,7 @@ void f() { assert(e.code().value() == EPERM); } +#endif } int main() |