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-macosx10.7
15 // XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
23 // atomic_compare_exchange_strong_explicit(shared_ptr<T>* p, shared_ptr<T>* v,
24 // shared_ptr<T> w, memory_order success,
25 // memory_order failure);
27 // UNSUPPORTED: c++98, c++03
32 #include "test_macros.h"
37 std::shared_ptr<int> p(new int(4));
38 std::shared_ptr<int> v(new int(3));
39 std::shared_ptr<int> w(new int(2));
40 bool b = std::atomic_compare_exchange_strong_explicit(&p, &v, w,
41 std::memory_order_seq_cst,
42 std::memory_order_seq_cst);
49 std::shared_ptr<int> p(new int(4));
50 std::shared_ptr<int> v = p;
51 std::shared_ptr<int> w(new int(2));
52 bool b = std::atomic_compare_exchange_strong_explicit(&p, &v, w,
53 std::memory_order_seq_cst,
54 std::memory_order_seq_cst);