diff options
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 +} |
