diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:46:46 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:46:46 +0000 |
| commit | 61b9a7258a7693d7f3674a5a1daf7b036ff1d382 (patch) | |
| tree | ec41ed70ffca97240e76f9a78bb2dedba28f310c /test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp | |
| parent | f857581820d15e410e9945d2fcd5f7163be25a96 (diff) | |
Notes
Diffstat (limited to 'test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp')
| -rw-r--r-- | test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp new file mode 100644 index 0000000000000..d4a39c878ac7a --- /dev/null +++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// UNSUPPORTED: libcpp-has-no-threads +// +// This test uses new symbols that were not defined in the libc++ shipped on +// darwin11 and darwin12: +// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11 +// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12 + +// <memory> + +// shared_ptr + +// template <class T> +// shared_ptr<T> +// atomic_load(const shared_ptr<T>* p) + +#include <memory> +#include <cassert> + +int main() +{ +#if __has_feature(cxx_atomic) + { + std::shared_ptr<int> p(new int(3)); + std::shared_ptr<int> q = std::atomic_load(&p); + assert(*q == *p); + } +#endif +} |
