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: libcpp-has-no-threads
10 // UNSUPPORTED: c++03, c++11
11 
12 // dylib support for shared_mutex was added in macosx10.12
13 // XFAIL: with_system_cxx_lib=macosx10.11
14 // XFAIL: with_system_cxx_lib=macosx10.10
15 // XFAIL: with_system_cxx_lib=macosx10.9
16 
17 // <shared_mutex>
18 
19 // template <class Mutex> class shared_lock;
20 
21 // shared_lock();
22 
23 #include <shared_mutex>
24 #include <cassert>
25 
26 #include "test_macros.h"
27 
28 int main(int, char**)
29 {
30     std::shared_lock<std::shared_timed_mutex> ul;
31     assert(!ul.owns_lock());
32     assert(ul.mutex() == nullptr);
33 
34   return 0;
35 }
36