summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce
diff options
context:
space:
mode:
authorRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-11-01 15:00:16 +0000
committerRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-11-01 15:00:16 +0000
commit60d6ef63a4e30bbba038d67849fa786314f670f6 (patch)
tree7a3fc11c8e3f9282fbf4a32283b12d81c222c0ac /libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce
parent05ce4ca0dd8c43d86f3c5f9b4f55c9ce95ee5a73 (diff)
downloadbcm5719-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.once/thread.once.callonce')
-rw-r--r--libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
index 71b054fced8..138b657196d 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
@@ -50,12 +49,13 @@ void init3()
++init3_called;
std::this_thread::sleep_for(ms(250));
if (init3_called == 1)
- throw 1;
+ TEST_THROW(1);
++init3_completed;
}
void f3()
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
std::call_once(flg3, init3);
@@ -63,6 +63,7 @@ void f3()
catch (...)
{
}
+#endif
}
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -197,6 +198,7 @@ int main()
t1.join();
assert(init0_called == 1);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
// check basic exception safety
{
std::thread t0(f3);
@@ -206,6 +208,7 @@ int main()
assert(init3_called == 2);
assert(init3_completed == 1);
}
+#endif
// check deadlock avoidance
{
std::thread t0(f41);
OpenPOWER on IntegriCloud