15a83710eSEric Fiselier //===----------------------------------------------------------------------===//
25a83710eSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65a83710eSEric Fiselier //
75a83710eSEric Fiselier //===----------------------------------------------------------------------===//
85a83710eSEric Fiselier 
95a83710eSEric Fiselier // <memory>
105a83710eSEric Fiselier 
115a83710eSEric Fiselier // shared_ptr();
125a83710eSEric Fiselier 
135a83710eSEric Fiselier #include <memory>
145a83710eSEric Fiselier #include <cassert>
155a83710eSEric Fiselier 
167fc6a556SMarshall Clow #include "test_macros.h"
177fc6a556SMarshall Clow 
18ce195fb2Szoecarver struct A {};
19ce195fb2Szoecarver 
20ce195fb2Szoecarver template <class T>
test()21ce195fb2Szoecarver void test() {
22ce195fb2Szoecarver   std::shared_ptr<T> p;
235a83710eSEric Fiselier   assert(p.use_count() == 0);
245a83710eSEric Fiselier   assert(p.get() == 0);
25ce195fb2Szoecarver }
26ce195fb2Szoecarver 
main(int,char **)27ce195fb2Szoecarver int main(int, char**) {
28ce195fb2Szoecarver   test<int>();
29*6b9e0af8SLouis Dionne   test<int const>();
30ce195fb2Szoecarver   test<A>();
31*6b9e0af8SLouis Dionne   test<A const>();
32ce195fb2Szoecarver   test<int*>();
33*6b9e0af8SLouis Dionne   test<int const*>();
34ce195fb2Szoecarver   test<int[]>();
35ce195fb2Szoecarver   test<int[8]>();
362df59c50SJF Bastien 
372df59c50SJF Bastien   return 0;
385a83710eSEric Fiselier }
39