1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // UNSUPPORTED: libcpp-has-no-threads
12 // This test uses new symbols that were not defined in the libc++ shipped on
13 // darwin11 and darwin12:
14 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
15 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
23 // atomic_exchange(shared_ptr<T>* p, shared_ptr<T> r)
30 #if __has_feature(cxx_atomic)
32 std::shared_ptr<int> p(new int(4));
33 std::shared_ptr<int> r(new int(3));
34 r = std::atomic_exchange(&p, r);