1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
18 #include "test_macros.h"
25 B(const B
&) {++count
;}
26 virtual ~B() {--count
;}
37 A(const A
& other
) : B(other
) {++count
;}
46 std::shared_ptr
<B
> p(new B
);
48 assert(A::count
== 0);
49 assert(B::count
== 0);
50 assert(p
.use_count() == 0);
53 assert(A::count
== 0);
57 assert(A::count
== 0);
58 assert(B::count
== 0);
59 assert(p
.use_count() == 0);
62 assert(A::count
== 0);