[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 / mutex_adopt_lock.pass.cpp
blob4adbe26777d0bdbd2e1cb3eea8ee6d1246d7045d
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
12 // <mutex>
14 // template <class Mutex> class unique_lock;
16 // unique_lock(mutex_type& m, adopt_lock_t);
18 #include <mutex>
19 #include <cassert>
20 #include "nasty_containers.h"
22 #include "test_macros.h"
24 int main(int, char**)
27 typedef std::mutex M;
28 M m;
29 m.lock();
30 std::unique_lock<M> lk(m, std::adopt_lock);
31 assert(lk.mutex() == std::addressof(m));
32 assert(lk.owns_lock() == true);
35 typedef nasty_mutex M;
36 M m;
37 m.lock();
38 std::unique_lock<M> lk(m, std::adopt_lock);
39 assert(lk.mutex() == std::addressof(m));
40 assert(lk.owns_lock() == true);
43 return 0;