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 // template<class Callable, class ...Args>
16 // void call_once(once_flag& flag, Callable&& func, Args&&... args);
18 // This test is supposed to be run with ThreadSanitizer and verifies that
19 // call_once properly synchronizes user state, a data race that was fixed
26 #include "make_test_thread.h"
27 #include "test_macros.h"
39 std::call_once(flg0
, init0
);
45 std::thread t0
= support::make_test_thread(f0
);
46 std::thread t1
= support::make_test_thread(f0
);