[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.obs / mutex.pass.cpp
blob889641b14f6cf6051e09cb0176f5043d9d1137d6
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 // mutex_type *mutex() const noexcept;
18 #include <shared_mutex>
19 #include <cassert>
21 #include "test_macros.h"
23 std::shared_timed_mutex m;
25 int main(int, char**)
27 std::shared_lock<std::shared_timed_mutex> lk0;
28 assert(lk0.mutex() == nullptr);
29 std::shared_lock<std::shared_timed_mutex> lk1(m);
30 assert(lk1.mutex() == &m);
31 lk1.unlock();
32 assert(lk1.mutex() == &m);
33 static_assert(noexcept(lk0.mutex()), "mutex() must be noexcept");
35 return 0;