Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / containers / unord / unord.set / iterator.operators.addressof.compile.pass.cpp
blob457172d11f6bd965ee11cd54f4292c67352aafa3
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 // <unordered_set>
11 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
12 // class Alloc = allocator<Value>>
14 // class unordered_set
16 #include <unordered_set>
18 #include "test_macros.h"
19 #include "operator_hijacker.h"
21 template <class ToIterator, class FromIterator>
22 void test() {
23 FromIterator from;
24 ToIterator copy(from);
25 copy = from;
27 ToIterator move(std::move(from));
28 from = FromIterator();
29 move = std::move(from);
32 void test() {
34 using I = std::unordered_set<operator_hijacker>::iterator;
35 using CI = std::unordered_set<operator_hijacker>::const_iterator;
36 test<I, I>();
37 test<CI, I>();
38 test<CI, CI>();
41 using IL = std::unordered_set<operator_hijacker>::local_iterator;
42 using CIL = std::unordered_set<operator_hijacker>::const_local_iterator;
43 test<IL, IL>();
44 test<CIL, IL>();
45 test<CIL, CIL>();