ctor_default.pass.cpp 724 B

123456789101112131415161718192021222324252627282930
  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. // <stack>
  9. // stack();
  10. #include <stack>
  11. #include <vector>
  12. #include <cassert>
  13. #include "test_macros.h"
  14. #include "test_allocator.h"
  15. int main(int, char**)
  16. {
  17. std::stack<int, std::vector<int, limited_allocator<int, 10> > > q;
  18. assert(q.size() == 0);
  19. q.push(1);
  20. q.push(2);
  21. assert(q.size() == 2);
  22. assert(q.top() == 2);
  23. return 0;
  24. }