atomic_is_lock_free.pass.cpp revision 5fec82dc0db3623546038e4a86baa44f749e554f
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// <memory>
11
12// shared_ptr
13
14// template<class T>
15// bool
16// atomic_is_lock_free(const shared_ptr<T>* p);
17
18#include <memory>
19#include <cassert>
20
21int main()
22{
23#if __has_feature(cxx_atomic)
24    {
25        const std::shared_ptr<int> p(new int(3));
26        assert(std::atomic_is_lock_free(&p) == false);
27    }
28#endif
29}
30