Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / iterators / predef.iterators / reverse.iterators / reverse.iter.conv / base.pass.cpp
blob4fb33f542604570fd1fb05923764cb792f410e1b
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 // <iterator>
11 // reverse_iterator
13 // iterator_type base() const; // constexpr since C++17
15 #include <iterator>
16 #include <cassert>
18 #include "test_macros.h"
19 #include "test_iterators.h"
21 TEST_CONSTEXPR_CXX17 bool test() {
22 typedef bidirectional_iterator<int*> Iter;
23 int i = 0;
24 Iter iter(&i);
25 std::reverse_iterator<Iter> const reverse(iter);
26 std::reverse_iterator<Iter>::iterator_type base = reverse.base();
27 assert(base == Iter(&i));
28 return true;
31 int main(int, char**) {
32 test();
33 #if TEST_STD_VER > 14
34 static_assert(test(), "");
35 #endif
36 return 0;