blob: 0935b891fce3a3626f1c2d631bc7a0768292074e [file] [log] [blame]
Eric Fiselierf9127592017-01-21 00:02:12 +00001//===----------------------------------------------------------------------===//
2//
Chandler Carruth57b08b02019-01-19 10:56:40 +00003// 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
Eric Fiselierf9127592017-01-21 00:02:12 +00006//
7//===----------------------------------------------------------------------===//
8
Louis Dionne31cbe0f2020-06-01 10:38:23 -04009// UNSUPPORTED: c++03
Eric Fiselierf9127592017-01-21 00:02:12 +000010
11// <string>
12
13// Test that <string> provides all of the arithmetic, enum, and pointer
14// hash specializations.
15
16#include <string>
17
Nico Webercc890632019-08-21 00:14:12 +000018#include "poisoned_hash_helper.h"
Eric Fiselierf9127592017-01-21 00:02:12 +000019
Marshall Clow7fc6a552019-05-31 18:35:30 +000020#include "test_macros.h"
21
JF Bastien2df59c52019-02-04 20:31:13 +000022int main(int, char**) {
Eric Fiselierf9127592017-01-21 00:02:12 +000023 test_library_hash_specializations_available();
24 {
25 test_hash_enabled_for_type<std::string>();
26 test_hash_enabled_for_type<std::wstring>();
Marshall Clow7dad0bd2018-12-11 04:35:44 +000027#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
28 test_hash_enabled_for_type<std::u8string>();
29#endif
Eric Fiselierf9127592017-01-21 00:02:12 +000030#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
31 test_hash_enabled_for_type<std::u16string>();
32 test_hash_enabled_for_type<std::u32string>();
33#endif
34 }
JF Bastien2df59c52019-02-04 20:31:13 +000035
36 return 0;
Eric Fiselierf9127592017-01-21 00:02:12 +000037}