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/move.pass.cpp4
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp2
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/move.pass.cpp4
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.id/enabled_hashes.pass.cpp27
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.id/thread_id.pass.cpp5
5 files changed, 34 insertions, 8 deletions
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move.pass.cpp
index 2db9430a698d..d3478818c056 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: libcpp-has-no-threads, c++98, c++03
// <thread>
@@ -44,7 +44,6 @@ bool G::op_run = false;
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
assert(G::n_alive == 0);
assert(!G::op_run);
@@ -61,5 +60,4 @@ int main()
assert(G::n_alive == 0);
assert(G::op_run);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
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 437b42037913..d419b8cc855c 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
@@ -106,7 +106,7 @@ public:
// A Each allocation performed during thread construction should be performed
// in the parent thread so that std::terminate is not called if
// std::bad_alloc is thrown by new.
-// B std::threads constructor should properly handle exceptions and not leak
+// B std::thread's constructor should properly handle exceptions and not leak
// memory.
// Plan:
// 1 Create a thread and count the number of allocations, 'N', it performs.
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/move.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/move.pass.cpp
index e88304ec8da9..f349e4c56fcb 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/move.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/move.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: libcpp-has-no-threads, c++98, c++03
// <thread>
@@ -53,7 +53,6 @@ bool G::op_run = false;
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
G g;
assert(G::n_alive == 1);
@@ -68,5 +67,4 @@ int main()
assert(G::op_run);
}
assert(G::n_alive == 0);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/enabled_hashes.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/enabled_hashes.pass.cpp
new file mode 100644
index 000000000000..9799467c4529
--- /dev/null
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/enabled_hashes.pass.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
+
+// <thread>
+
+// Test that <thread> provides all of the arithmetic, enum, and pointer
+// hash specializations.
+
+#include <thread>
+
+#include "poisoned_hash_helper.hpp"
+
+int main() {
+ test_library_hash_specializations_available();
+ {
+ test_hash_enabled_for_type<std::thread::id>();
+ }
+}
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/thread_id.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/thread_id.pass.cpp
index 106c69e2e4a1..4f1491decd31 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/thread_id.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/thread_id.pass.cpp
@@ -9,7 +9,7 @@
//
// UNSUPPORTED: libcpp-has-no-threads
-// <functional>
+// <thread>
// template <class T>
// struct hash
@@ -23,6 +23,8 @@
#include <thread>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
std::thread::id id1;
@@ -30,6 +32,7 @@ int main()
typedef std::hash<std::thread::id> H;
static_assert((std::is_same<typename H::argument_type, std::thread::id>::value), "" );
static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
+ ASSERT_NOEXCEPT(H()(id2));
H h;
assert(h(id1) != h(id2));
}