summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/thread/thread.threads
diff options
context:
space:
mode:
authorAsiri Rathnayake <asiri.rathnayake@arm.com>2016-10-06 11:15:41 +0000
committerAsiri Rathnayake <asiri.rathnayake@arm.com>2016-10-06 11:15:41 +0000
commit08eb2148ffe8b627c83a3a14ac24d1dd4e418690 (patch)
tree15364e3a90bdffc0ab52373efa8a5849dd997296 /libcxx/test/std/thread/thread.threads
parent47faf3be89e303ee8ca4029e8b1cf4f5ea969217 (diff)
downloadbcm5719-llvm-08eb2148ffe8b627c83a3a14ac24d1dd4e418690.tar.gz
bcm5719-llvm-08eb2148ffe8b627c83a3a14ac24d1dd4e418690.zip
[libcxx] Recover no-exceptions XFAILs - I
First batch of changes to get some of these XFAILs working in the no-exceptions libc++ variant. Changed some XFAILs to UNSUPPORTED where the test is all about exception handling. In other cases, used the test macros TEST_THROW and TEST_HAS_NO_EXCEPTIONS to conditionally exclude those parts of the test that concerns exception handling behaviour. Reviewers: EricWF, mclow.lists Differential revision: https://reviews.llvm.org/D24562 llvm-svn: 283441
Diffstat (limited to 'libcxx/test/std/thread/thread.threads')
-rw-r--r--libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp b/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
index 5dd6a40a0eb..a965b700b04 100644
--- a/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
+++ b/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <thread>
@@ -33,7 +32,7 @@ std::atomic<unsigned> outstanding_new(0);
void* operator new(std::size_t s) throw(std::bad_alloc)
{
if (throw_one == 0)
- throw std::bad_alloc();
+ TEST_THROW(std::bad_alloc());
--throw_one;
++outstanding_new;
void* ret = std::malloc(s);
@@ -118,6 +117,7 @@ public:
// 3 Finally check that a thread runs successfully if we throw after 'N+1'
// allocations.
void test_throwing_new_during_thread_creation() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
throw_one = 0xFFF;
{
std::thread t(f);
@@ -142,6 +142,7 @@ void test_throwing_new_during_thread_creation() {
}
f_run = false;
throw_one = 0xFFF;
+#endif
}
int main()
@@ -162,6 +163,7 @@ int main()
assert(G::op_run);
}
G::op_run = false;
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
try
{
@@ -178,6 +180,7 @@ int main()
assert(!G::op_run);
}
}
+#endif
#if TEST_STD_VER >= 11
{
assert(G::n_alive == 0);
OpenPOWER on IntegriCloud