15a83710eSEric Fiselier //===----------------------------------------------------------------------===// 25a83710eSEric Fiselier // 357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 65a83710eSEric Fiselier // 75a83710eSEric Fiselier //===----------------------------------------------------------------------===// 85a83710eSEric Fiselier // 9*a7f9895cSLouis Dionne // UNSUPPORTED: no-threads 1031cbe0f2SLouis Dionne // UNSUPPORTED: c++03, c++11 112659663eSLouis Dionne 122659663eSLouis Dionne // dylib support for shared_mutex was added in macosx10.12 13c360553cSLouis Dionne // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}} 145a83710eSEric Fiselier 155a83710eSEric Fiselier // <shared_mutex> 165a83710eSEric Fiselier 175a83710eSEric Fiselier // template <class Mutex> class shared_lock; 185a83710eSEric Fiselier 195a83710eSEric Fiselier // shared_lock(); 205a83710eSEric Fiselier 215a83710eSEric Fiselier #include <shared_mutex> 225a83710eSEric Fiselier #include <cassert> 235a83710eSEric Fiselier 247fc6a556SMarshall Clow #include "test_macros.h" 257fc6a556SMarshall Clow main(int,char **)262df59c50SJF Bastienint main(int, char**) 275a83710eSEric Fiselier { 285a83710eSEric Fiselier std::shared_lock<std::shared_timed_mutex> ul; 295a83710eSEric Fiselier assert(!ul.owns_lock()); 305a83710eSEric Fiselier assert(ul.mutex() == nullptr); 312df59c50SJF Bastien 322df59c50SJF Bastien return 0; 335a83710eSEric Fiselier } 34