atomic_store_explicit.pass.cpp revision cedb7fcc10556aaf4302917913c672b1bc6a1db0
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// This test uses new symbols that were not defined in the libc++ shipped on
11// darwin11 and darwin12:
12// XFAIL: with_system_lib=x86_64-apple-darwin11
13// XFAIL: with_system_lib=x86_64-apple-darwin12
14
15// <memory>
16
17// shared_ptr
18
19// template <class T>
20// void
21// atomic_store_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo)
22
23#include <memory>
24#include <cassert>
25
26int main()
27{
28#if __has_feature(cxx_atomic)
29    {
30        std::shared_ptr<int> p;
31        std::shared_ptr<int> r(new int(3));
32        std::atomic_store_explicit(&p, r, std::memory_order_seq_cst);
33        assert(*p == *r);
34    }
35#endif
36}
37