enabled_hashes.pass.cpp 1.1 KB

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