aboutsummaryrefslogtreecommitdiff
path: root/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp')
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
index 5dd6a40a0eb7..437b42037913 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
+++ b/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>
@@ -30,10 +29,10 @@ std::atomic<unsigned> throw_one(0xFFFF);
std::atomic<unsigned> outstanding_new(0);
-void* operator new(std::size_t s) throw(std::bad_alloc)
+void* operator new(std::size_t s) TEST_THROW_SPEC(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);
@@ -41,7 +40,7 @@ void* operator new(std::size_t s) throw(std::bad_alloc)
return ret;
}
-void operator delete(void* p) throw()
+void operator delete(void* p) TEST_NOEXCEPT
{
--outstanding_new;
std::free(p);
@@ -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);