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: availability=macosx10.7
15 // XFAIL: availability=macosx10.8
23 // atomic_compare_exchange_strong(shared_ptr<T>* p, shared_ptr<T>* v,
26 // UNSUPPORTED: c++98, c++03
31 #include "test_macros.h"
36 std::shared_ptr<int> p(new int(4));
37 std::shared_ptr<int> v(new int(3));
38 std::shared_ptr<int> w(new int(2));
39 bool b = std::atomic_compare_exchange_strong(&p, &v, w);
46 std::shared_ptr<int> p(new int(4));
47 std::shared_ptr<int> v = p;
48 std::shared_ptr<int> w(new int(2));
49 bool b = std::atomic_compare_exchange_strong(&p, &v, w);