[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.obs / mutex.pass.cpp
blobdd2f5239645f91c46307d2243b85b9885cce4690
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
11 // <mutex>
13 // template <class Mutex> class unique_lock;
15 // mutex_type *mutex() const;
17 #include <mutex>
18 #include <cassert>
20 #include "test_macros.h"
22 std::mutex m;
24 int main(int, char**)
26 std::unique_lock<std::mutex> lk0;
27 assert(lk0.mutex() == nullptr);
28 std::unique_lock<std::mutex> lk1(m);
29 assert(lk1.mutex() == &m);
30 lk1.unlock();
31 assert(lk1.mutex() == &m);
33 return 0;