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