1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// On Windows Clang bugs out when both __declspec and __attribute__ are present,
11// the processing goes awry preventing the definition of the types.
12// XFAIL: LIBCXX-WINDOWS-FIXME
13
14// UNSUPPORTED: libcpp-has-no-threads
15// REQUIRES: thread-safety
16
17// <mutex>
18
19// MODULES_DEFINES: _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
20#define _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
21
22#include <mutex>
23
24std::mutex m;
25
26int main() {
27  m.lock();
28} // expected-error {{mutex 'm' is still held at the end of function}}
29