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 //===----------------------------------------------------------------------===//
8 
9 // <unordered_map>
10 
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
14 
15 // size_type bucket(const key_type& __k) const;
16 
17 // REQUIRES: has-unix-headers
18 // UNSUPPORTED: c++03
19 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
20 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
21 
22 #include <unordered_map>
23 #include <string>
24 
25 #include "check_assertion.h"
26 
main(int,char **)27 int main(int, char**) {
28     typedef std::unordered_multimap<int, std::string> C;
29     C c;
30     TEST_LIBCPP_ASSERT_FAILURE(c.bucket(3), "unordered container::bucket(key) called when bucket_count() == 0");
31 
32     return 0;
33 }
34