[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / unord / unord.map / equal_range_const.transparent.pass.cpp
blob9e76f72081edb9b850245903fcfd2f3de5c97ba4
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_map>
11 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
12 // class Alloc = allocator<pair<const Key, T>>>
13 // class unordered_map
15 // template <typename K>
16 // pair<const_iterator, const_iterator> equal_range(const K& k) const;
18 // UNSUPPORTED: c++03, c++11, c++14, c++17
20 #include <unordered_map>
22 #include "test_transparent_unordered.h"
24 int main(int, char**)
26 using key_type = StoredType<int>;
27 using ilist_type = std::initializer_list<std::pair<const key_type, int> >;
30 // Make sure conversions don't happen for transparent non-final hasher and key_equal
31 using map_type = const unord_map_type<std::unordered_map, transparent_hash,
32 std::equal_to<> >;
33 test_transparent_equal_range<map_type>(ilist_type{{1, 2}, {2, 3}});
37 // Make sure conversions don't happen for transparent final hasher and key_equal
38 using map_type = const unord_map_type<std::unordered_map, transparent_hash_final,
39 transparent_equal_final>;
40 test_transparent_equal_range<map_type>(ilist_type{{1, 2}, {2, 3}});
44 // Make sure conversions do happen for non-transparent hasher
45 using map_type = const unord_map_type<std::unordered_map, non_transparent_hash,
46 std::equal_to<> >;
47 test_non_transparent_equal_range<map_type>(ilist_type{{1, 2}, {2, 3}});
51 // Make sure conversions do happen for non-transparent key_equal
52 using map_type = const unord_map_type<std::unordered_map, transparent_hash,
53 std::equal_to<key_type> >;
54 test_non_transparent_equal_range<map_type>(ilist_type{{1, 2}, {2, 3}});
58 // Make sure conversions do happen for both non-transparent hasher and key_equal
59 using map_type = const unord_map_type<std::unordered_map, non_transparent_hash,
60 std::equal_to<key_type> >;
61 test_non_transparent_equal_range<map_type>(ilist_type{{1, 2}, {2, 3}});
64 return 0;