Revert "[libc] Breakup freelist_malloc into separate files" (#119749)
[llvm-project.git] / libcxx / test / std / utilities / memory / util.smartptr / util.smartptr.shared / util.smartptr.shared.const / nullptr_t.pass.cpp
blobf307c9e9f239dfd10a06acc122f0bc8b35be2a3e
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // <memory>
11 // shared_ptr(nullptr_t)
13 #include <memory>
14 #include <cassert>
16 #include "test_macros.h"
18 int main(int, char**)
21 std::shared_ptr<int> p(nullptr);
22 assert(p.use_count() == 0);
23 assert(p.get() == 0);
27 std::shared_ptr<int const> p(nullptr);
28 assert(p.use_count() == 0);
29 assert(p.get() == 0);
32 return 0;