[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 / move_ctor.pass.cpp
blobcce0eb5fb90572fd63d4c4d056b191181fe7f255
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 //===----------------------------------------------------------------------===//
8 //
9 // UNSUPPORTED: no-threads, c++03
11 // <mutex>
13 // template <class Mutex> class unique_lock;
15 // unique_lock(unique_lock&& u);
17 #include <mutex>
18 #include <cassert>
19 #include "nasty_containers.h"
21 #include "test_macros.h"
23 int main(int, char**)
26 typedef std::mutex M;
27 M m;
28 std::unique_lock<M> lk0(m);
29 std::unique_lock<M> lk = std::move(lk0);
30 assert(lk.mutex() == std::addressof(m));
31 assert(lk.owns_lock() == true);
32 assert(lk0.mutex() == nullptr);
33 assert(lk0.owns_lock() == false);
36 typedef nasty_mutex M;
37 M m;
38 std::unique_lock<M> lk0(m);
39 std::unique_lock<M> lk = std::move(lk0);
40 assert(lk.mutex() == std::addressof(m));
41 assert(lk.owns_lock() == true);
42 assert(lk0.mutex() == nullptr);
43 assert(lk0.owns_lock() == false);
46 return 0;