[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / thread / thread.mutex / thread.lock / thread.lock.shared / thread.lock.shared.cons / mutex_adopt_lock.pass.cpp
blob9cb6dc173db350b0cbd1e233e3dc16af9a911b92
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
10 // UNSUPPORTED: c++03, c++11
12 // <shared_mutex>
14 // template <class Mutex> class shared_lock;
16 // shared_lock(mutex_type& m, adopt_lock_t);
18 #include <shared_mutex>
19 #include <cassert>
20 #include <mutex>
21 #include "nasty_containers.h"
23 #include "test_macros.h"
25 int main(int, char**)
28 typedef std::shared_timed_mutex M;
29 M m;
30 m.lock();
31 std::unique_lock<M> lk(m, std::adopt_lock);
32 assert(lk.mutex() == std::addressof(m));
33 assert(lk.owns_lock() == true);
36 typedef nasty_mutex M;
37 M m;
38 m.lock();
39 std::unique_lock<M> lk(m, std::adopt_lock);
40 assert(lk.mutex() == std::addressof(m));
41 assert(lk.owns_lock() == true);
44 return 0;