[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / sequences / deque / iterators.pass.cpp
blob1f06ffde41ac2da24349a7327751a5abc16e0374
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 // <deque>
11 // Test nested types and default template args:
13 // template <class T, class Allocator = allocator<T> >
14 // class deque;
16 // iterator, const_iterator
18 #include <deque>
19 #include <iterator>
20 #include <cassert>
22 #include "test_macros.h"
23 #include "min_allocator.h"
25 int main(int, char**)
28 typedef std::deque<int> C;
29 C c;
30 C::iterator i;
31 i = c.begin();
32 C::const_iterator j;
33 j = c.cbegin();
34 assert(i == j);
36 #if TEST_STD_VER >= 11
38 typedef std::deque<int, min_allocator<int>> C;
39 C c;
40 C::iterator i;
41 i = c.begin();
42 C::const_iterator j;
43 j = c.cbegin();
44 assert(i == j);
46 #endif
47 #if TEST_STD_VER > 11
48 { // N3644 testing
49 std::deque<int>::iterator ii1{}, ii2{};
50 std::deque<int>::iterator ii4 = ii1;
51 std::deque<int>::const_iterator cii{};
52 assert ( ii1 == ii2 );
53 assert ( ii1 == ii4 );
55 assert (!(ii1 != ii2 ));
57 assert ( (ii1 == cii ));
58 assert ( (cii == ii1 ));
59 assert (!(ii1 != cii ));
60 assert (!(cii != ii1 ));
61 assert (!(ii1 < cii ));
62 assert (!(cii < ii1 ));
63 assert ( (ii1 <= cii ));
64 assert ( (cii <= ii1 ));
65 assert (!(ii1 > cii ));
66 assert (!(cii > ii1 ));
67 assert ( (ii1 >= cii ));
68 assert ( (cii >= ii1 ));
69 assert (cii - ii1 == 0);
70 assert (ii1 - cii == 0);
72 // std::deque<int> c;
73 // assert ( ii1 != c.cbegin());
74 // assert ( cii != c.begin());
75 // assert ( cii != c.cend());
76 // assert ( ii1 != c.end());
78 #endif
80 return 0;