36 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// UNSUPPORTED: no-threads10 11// <memory>12 13// shared_ptr14 15// template <class T>16// shared_ptr<T>17// atomic_load(const shared_ptr<T>* p)18 19// UNSUPPORTED: c++0320 21#include <memory>22#include <cassert>23 24#include "test_macros.h"25 26int main(int, char**)27{28 {29 std::shared_ptr<int> p(new int(3));30 std::shared_ptr<int> q = std::atomic_load(&p);31 assert(*q == *p);32 }33 34 return 0;35}36