12561885fSEric Fiselier //===----------------------------------------------------------------------===//
22561885fSEric 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
62561885fSEric Fiselier //
72561885fSEric Fiselier //===----------------------------------------------------------------------===//
82561885fSEric Fiselier 
92561885fSEric Fiselier // <memory>
102561885fSEric Fiselier 
112561885fSEric Fiselier // shared_ptr
122561885fSEric Fiselier 
132561885fSEric Fiselier // template <class T, class D>
142561885fSEric Fiselier //     bool operator==(const unique_ptr<T, D>& x, nullptr_t) noexcept;
152561885fSEric Fiselier // template <class T, class D>
162561885fSEric Fiselier //     bool operator==(nullptr_t, const unique_ptr<T, D>& y) noexcept;
172561885fSEric Fiselier // template <class T, class D>
182561885fSEric Fiselier //     bool operator!=(const unique_ptr<T, D>& x, nullptr_t) noexcept;
192561885fSEric Fiselier // template <class T, class D>
202561885fSEric Fiselier //     bool operator!=(nullptr_t, const unique_ptr<T, D>& y) noexcept;
212561885fSEric Fiselier // template <class T, class D>
222561885fSEric Fiselier //     bool operator<(const unique_ptr<T, D>& x, nullptr_t) noexcept;
232561885fSEric Fiselier // template <class T, class D>
242561885fSEric Fiselier //     bool operator<(nullptr_t, const unique_ptr<T, D>& y) noexcept;
252561885fSEric Fiselier // template <class T, class D>
262561885fSEric Fiselier //     bool operator<=(const unique_ptr<T, D>& x, nullptr_t) noexcept;
272561885fSEric Fiselier // template <class T, class D>
282561885fSEric Fiselier //     bool operator<=(nullptr_t, const unique_ptr<T, D>& y) noexcept;
292561885fSEric Fiselier // template <class T, class D>
302561885fSEric Fiselier //     bool operator>(const unique_ptr<T, D>& x, nullptr_t) noexcept;
312561885fSEric Fiselier // template <class T, class D>
322561885fSEric Fiselier //     bool operator>(nullptr_t, const unique_ptr<T, D>& y) noexcept;
332561885fSEric Fiselier // template <class T, class D>
342561885fSEric Fiselier //     bool operator>=(const unique_ptr<T, D>& x, nullptr_t) noexcept;
352561885fSEric Fiselier // template <class T, class D>
362561885fSEric Fiselier //     bool operator>=(nullptr_t, const unique_ptr<T, D>& y) noexcept;
372561885fSEric Fiselier 
382561885fSEric Fiselier #include <memory>
392561885fSEric Fiselier #include <cassert>
402561885fSEric Fiselier 
41*7fc6a556SMarshall Clow #include "test_macros.h"
42*7fc6a556SMarshall Clow 
do_nothing(int *)432561885fSEric Fiselier void do_nothing(int*) {}
442561885fSEric Fiselier 
main(int,char **)452df59c50SJF Bastien int main(int, char**)
462561885fSEric Fiselier {
472561885fSEric Fiselier     const std::unique_ptr<int> p1(new int(1));
482561885fSEric Fiselier     assert(!(p1 == nullptr));
492561885fSEric Fiselier     assert(!(nullptr == p1));
502561885fSEric Fiselier     assert(!(p1 < nullptr));
512561885fSEric Fiselier     assert( (nullptr < p1));
522561885fSEric Fiselier     assert(!(p1 <= nullptr));
532561885fSEric Fiselier     assert( (nullptr <= p1));
542561885fSEric Fiselier     assert( (p1 > nullptr));
552561885fSEric Fiselier     assert(!(nullptr > p1));
562561885fSEric Fiselier     assert( (p1 >= nullptr));
572561885fSEric Fiselier     assert(!(nullptr >= p1));
582561885fSEric Fiselier 
592561885fSEric Fiselier     const std::unique_ptr<int> p2;
602561885fSEric Fiselier     assert( (p2 == nullptr));
612561885fSEric Fiselier     assert( (nullptr == p2));
622561885fSEric Fiselier     assert(!(p2 < nullptr));
632561885fSEric Fiselier     assert(!(nullptr < p2));
642561885fSEric Fiselier     assert( (p2 <= nullptr));
652561885fSEric Fiselier     assert( (nullptr <= p2));
662561885fSEric Fiselier     assert(!(p2 > nullptr));
672561885fSEric Fiselier     assert(!(nullptr > p2));
682561885fSEric Fiselier     assert( (p2 >= nullptr));
692561885fSEric Fiselier     assert( (nullptr >= p2));
702df59c50SJF Bastien 
712df59c50SJF Bastien   return 0;
722561885fSEric Fiselier }
73