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 
15 #include <memory>
16 #include <cassert>
17 
18 #include "test_macros.h"
19 
do_nothing(int *)20 void do_nothing(int*) {}
21 
main(int,char **)22 int main(int, char**)
23 {
24     int* ptr1(new int);
25     int* ptr2(new int);
26     const std::shared_ptr<int> p1(ptr1);
27     const std::shared_ptr<int> p2(ptr2);
28     const std::shared_ptr<int> p3(ptr2, do_nothing);
29     assert((p1 < p2) == (ptr1 < ptr2));
30     assert(!(p2 < p3) && !(p3 < p2));
31 
32   return 0;
33 }
34