xref: /llvm-project/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp (revision ee78181f34ca6abe9b88dd1ccf97816e434e675d)
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 // UNSUPPORTED: c++03
10 
11 // <string>
12 
13 // Test that <string> provides all of the arithmetic, enum, and pointer
14 // hash specializations.
15 
16 #include <string>
17 
18 #include "poisoned_hash_helper.h"
19 
20 #include "test_macros.h"
21 
22 int main(int, char**) {
23   test_library_hash_specializations_available();
24   {
25     test_hash_enabled_for_type<std::string>();
26 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
27     test_hash_enabled_for_type<std::wstring>();
28 #endif
29 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
30     test_hash_enabled_for_type<std::u8string>();
31 #endif
32     test_hash_enabled_for_type<std::u16string>();
33     test_hash_enabled_for_type<std::u32string>();
34   }
35 
36   return 0;
37 }
38