[hwasan] Omit tag check for null pointers (#122206)
[llvm-project.git] / libcxx / test / std / containers / unord / unord.multimap / count.transparent.pass.cpp
blobb9755cfdeaaf20c754de0503c184ce79e856672d
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_multimap
15 // template <typename K>
16 // size_type count(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>;
29 // Make sure conversions don't happen for transparent non-final hasher and key_equal
30 using M = unord_map_type<std::unordered_multimap, transparent_hash, std::equal_to<>>;
31 test_transparent_count<M>({{1, 2}, {1, 3}, {2, 3}});
32 test_transparent_count<const M>({{1, 2}, {1, 3}, {2, 3}});
36 // Make sure conversions don't happen for transparent final hasher and key_equal
37 using M = unord_map_type<std::unordered_multimap, transparent_hash_final, transparent_equal_final>;
38 test_transparent_count<M>({{1, 2}, {1, 3}, {2, 3}});
39 test_transparent_count<const M>({{1, 2}, {1, 3}, {2, 3}});
43 // Make sure conversions do happen for non-transparent hasher
44 using M = unord_map_type<std::unordered_multimap, non_transparent_hash, std::equal_to<>>;
45 test_non_transparent_count<M>({{1, 2}, {1, 3}, {2, 3}});
46 test_non_transparent_count<const M>({{1, 2}, {1, 3}, {2, 3}});
50 // Make sure conversions do happen for non-transparent key_equal
51 using M = unord_map_type<std::unordered_multimap, transparent_hash, std::equal_to<key_type>>;
52 test_non_transparent_count<M>({{1, 2}, {1, 3}, {2, 3}});
53 test_non_transparent_count<const M>({{1, 2}, {1, 3}, {2, 3}});
57 // Make sure conversions do happen for both non-transparent hasher and key_equal
58 using M = unord_map_type<std::unordered_multimap, non_transparent_hash, std::equal_to<key_type>>;
59 test_non_transparent_count<M>({{1, 2}, {1, 3}, {2, 3}});
60 test_non_transparent_count<const M>({{1, 2}, {1, 3}, {2, 3}});
63 return 0;