[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / thread / thread.mutex / thread.lock / thread.lock.unique / thread.lock.unique.cons / copy_ctor.compile.fail.cpp
blobe258198e60bbf772674cb4c1f1bbe686ab8fa9b6
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 // <mutex>
11 // template <class Mutex> class unique_lock;
13 // unique_lock(unique_lock const&) = delete;
15 #include <mutex>
16 #include <cassert>
18 int main(int, char**)
21 typedef std::mutex M;
22 M m;
23 std::unique_lock<M> lk0(m);
24 std::unique_lock<M> lk = lk0;
25 assert(lk.mutex() == &m);
26 assert(lk.owns_lock() == true);
27 assert(lk0.mutex() == nullptr);
28 assert(lk0.owns_lock() == false);
31 return 0;