summaryrefslogtreecommitdiff
path: root/test/std/thread/thread.threads/thread.thread.class
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/thread/thread.threads/thread.thread.class')
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp17
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp9
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp4
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp2
4 files changed, 11 insertions, 21 deletions
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp
index 7198d226960a..6c31df593c0e 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp
@@ -8,13 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
-
-// NOTE: std::terminate is called so the destructors are not invoked and the
-// memory is not freed. This will cause ASAN to fail.
-// XFAIL: asan
-
-// NOTE: TSAN will report this test as leaking a thread.
-// XFAIL: tsan
+// UNSUPPORTED: c++98, c++03
// <thread>
@@ -38,12 +32,7 @@ public:
G(const G& g) : alive_(g.alive_) {++n_alive;}
~G() {alive_ = 0; --n_alive;}
- void operator()()
- {
- assert(alive_ == 1);
- assert(n_alive >= 1);
- op_run = true;
- }
+
void operator()(int i, double j)
{
@@ -60,7 +49,7 @@ bool G::op_run = false;
void f1()
{
- std::exit(0);
+ std::_Exit(0);
}
int main()
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 a8b4be16e631..3de15af8929b 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <thread>
@@ -22,6 +23,8 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
unsigned throw_one = 0xFFFF;
void* operator new(std::size_t s) throw(std::bad_alloc)
@@ -75,7 +78,7 @@ public:
int G::n_alive = 0;
bool G::op_run = false;
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#if TEST_STD_VER >= 11
class MoveOnly
{
@@ -137,7 +140,7 @@ int main()
assert(!G::op_run);
}
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#if TEST_STD_VER >= 11
{
assert(G::n_alive == 0);
assert(!G::op_run);
@@ -150,5 +153,5 @@ int main()
std::thread t = std::thread(MoveOnly(), MoveOnly());
t.join();
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif
}
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp
index ddf96d095730..0efb7713e985 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp
@@ -9,8 +9,6 @@
//
// UNSUPPORTED: libcpp-has-no-threads
-// NOTE: TSAN will report this test as leaking a thread.
-// XFAIL: tsan
// <thread>
@@ -47,7 +45,7 @@ bool G::op_run = false;
void f1()
{
- std::exit(0);
+ std::_Exit(0);
}
int main()
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp
index f4a4d1f777f1..726395d99044 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp
@@ -19,7 +19,7 @@
#include <atomic>
#include <cassert>
-std::atomic_bool done = ATOMIC_VAR_INIT(false);
+std::atomic_bool done(false);
class G
{