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 //===----------------------------------------------------------------------===//
8 
9 // <memory>
10 
11 // shared_ptr
12 
13 // template<class T, class U> bool operator==(const shared_ptr<T>& a, const shared_ptr<U>& b);
14 // template<class T, class U> bool operator!=(const shared_ptr<T>& a, const shared_ptr<U>& b);
15 
16 #include <memory>
17 #include <cassert>
18 
19 #include "test_macros.h"
20 
do_nothing(int *)21 void do_nothing(int*) {}
22 
main(int,char **)23 int main(int, char**)
24 {
25     int* ptr1(new int);
26     int* ptr2(new int);
27     const std::shared_ptr<int> p1(ptr1);
28     const std::shared_ptr<int> p2(ptr2);
29     const std::shared_ptr<int> p3(ptr2, do_nothing);
30     assert(p1 != p2);
31     assert(p2 == p3);
32 
33   return 0;
34 }
35