lt.pass.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. // <queue>
  9. // template <class T, class Container>
  10. // bool operator< (const queue<T, Container>& x,const queue<T, Container>& y);
  11. //
  12. // template <class T, class Container>
  13. // bool operator> (const queue<T, Container>& x,const queue<T, Container>& y);
  14. //
  15. // template <class T, class Container>
  16. // bool operator>=(const queue<T, Container>& x,const queue<T, Container>& y);
  17. //
  18. // template <class T, class Container>
  19. // bool operator<=(const queue<T, Container>& x,const queue<T, Container>& y);
  20. #include <queue>
  21. #include <cassert>
  22. #include "test_macros.h"
  23. template <class C>
  24. C
  25. make(int n)
  26. {
  27. C c;
  28. for (int i = 0; i < n; ++i)
  29. c.push(i);
  30. return c;
  31. }
  32. int main(int, char**)
  33. {
  34. std::queue<int> q1 = make<std::queue<int> >(5);
  35. std::queue<int> q2 = make<std::queue<int> >(10);
  36. assert(q1 < q2);
  37. assert(q2 > q1);
  38. assert(q1 <= q2);
  39. assert(q2 >= q1);
  40. return 0;
  41. }