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 // UNSUPPORTED: !stdlib=libc++ && (c++11 || c++14)
11 
12 // <string_view>
13 
14 // Test that <string_view> provides all of the arithmetic, enum, and pointer
15 // hash specializations.
16 
17 #include <string_view>
18 
19 #include "poisoned_hash_helper.h"
20 
21 #include "test_macros.h"
22 
main(int,char **)23 int main(int, char**) {
24   test_library_hash_specializations_available();
25   {
26     test_hash_enabled_for_type<std::string_view>();
27 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
28     test_hash_enabled_for_type<std::wstring_view>();
29 #endif
30 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
31     test_hash_enabled_for_type<std::u8string_view>();
32 #endif
33     test_hash_enabled_for_type<std::u16string_view>();
34     test_hash_enabled_for_type<std::u32string_view>();
35   }
36 
37   return 0;
38 }
39