1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This test uses new symbols that were not defined in the libc++ shipped on 11 // darwin11 and darwin12: 12 // XFAIL: with_system_lib=x86_64-apple-darwin11 13 // XFAIL: with_system_lib=x86_64-apple-darwin12 14 15 // <memory> 16 17 // shared_ptr 18 19 // template <class T> 20 // shared_ptr<T> 21 // atomic_load_explicit(const shared_ptr<T>* p, memory_order mo) 22 23 #include <memory> 24 #include <cassert> 25 26 int main() 27 { 28 #if __has_feature(cxx_atomic) 29 { 30 const std::shared_ptr<int> p(new int(3)); 31 std::shared_ptr<int> q = std::atomic_load_explicit(&p, std::memory_order_relaxed); 32 assert(*q == *p); 33 } 34 #endif 35 } 36