1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-threads
15 // thread& operator=(thread&& t);
21 #include "make_test_thread.h"
22 #include "test_macros.h"
31 G() : alive_(1) {++n_alive
;}
32 G(const G
& g
) : alive_(g
.alive_
) {++n_alive
;}
33 ~G() {alive_
= 0; --n_alive
;}
44 bool G::op_run
= false;
48 assert(G::n_alive
== 0);
52 assert(G::n_alive
== 1);
55 std::thread t0
= support::make_test_thread(g
);
56 std::thread::id id
= t0
.get_id();
60 assert(t1
.get_id() == id
);
61 assert(t0
.get_id() == std::thread::id());
64 assert(G::n_alive
== 1);
67 assert(G::n_alive
== 0);