Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / strings / string.view / string.view.deduct / implicit.pass.cpp
blobc76c4a01c696cdb1fb3552428a54cc835909d1cd
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++98, c++03, c++11, c++14
11 // <string_view>
13 // basic_string_view
15 // Make sure that the implicitly-generated CTAD works.
17 #include <string_view>
19 #include "test_macros.h"
21 int main(int, char**) {
23 char const* str = "hello world";
24 std::basic_string_view sv(str);
25 ASSERT_SAME_TYPE(decltype(sv), std::basic_string_view<char>);
27 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
29 wchar_t const* str = L"hello world";
30 std::basic_string_view sv(str);
31 ASSERT_SAME_TYPE(decltype(sv), std::basic_string_view<wchar_t>);
33 #endif
35 return 0;