Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / thread / thread.mutex / thread.lock / thread.lock.scoped / copy.verify.cpp
blob37e60b885e083cc22a4cb835d97608196202c3f7
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-threads
10 // UNSUPPORTED: c++03, c++11, c++14
12 // <mutex>
14 // template <class ...Mutex> class scoped_lock;
16 // scoped_lock(scoped_lock const&) = delete;
18 #include <mutex>
19 #include "test_macros.h"
21 int main(int, char**)
23 using M = std::mutex;
24 M m0, m1, m2;
26 using LG = std::scoped_lock<>;
27 const LG Orig;
28 LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
31 using LG = std::scoped_lock<M>;
32 const LG Orig(m0);
33 LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
36 using LG = std::scoped_lock<M, M>;
37 const LG Orig(m0, m1);
38 LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
41 using LG = std::scoped_lock<M, M, M>;
42 const LG Orig(m0, m1, m2);
43 LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
46 return 0;