Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / containers / container.adaptors / stack / stack.cons / ctor_copy.pass.cpp
blobe38c12b91b0e9a4d6681200701530f24d87f72b0
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 //===----------------------------------------------------------------------===//
9 // <stack>
11 // stack(const stack&) = default;
13 #include <stack>
14 #include <cassert>
16 #include "test_macros.h"
18 template <class C>
20 make(int n)
22 C c;
23 for (int i = 0; i < n; ++i)
24 c.push_back(i);
25 return c;
28 int main(int, char**)
30 std::stack<int> q(make<std::deque<int> >(5));
31 std::stack<int> q2 = q;
32 assert(q2 == q);
34 return 0;