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
24 #include "make_test_thread.h"
25 #include "test_macros.h"
34 G() : alive_(1) {++n_alive
;}
35 G(const G
& g
) : alive_(g
.alive_
) {++n_alive
;}
36 ~G() {alive_
= 0; --n_alive
;}
47 bool G::op_run
= false;
56 std::set_terminate(f1
);
58 assert(G::n_alive
== 0);
62 std::thread t
= support::make_test_thread(g
);
63 std::this_thread::sleep_for(std::chrono::milliseconds(250));