[X86] Add test case for #124871. NFC
[llvm-project.git] / libcxx / test / std / input.output / string.streams / istringstream / istringstream.members / str.string.move.pass.cpp
blobcc929ab9e6c042e2084eda6bbef4c6959acb3583
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++03, c++11, c++14, c++17
11 // <sstream>
13 // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>>
14 // class basic_istringstream
16 // void str(basic_string<charT, traits, Allocator>&& s);
18 #include <sstream>
19 #include <cassert>
21 #include "make_string.h"
22 #include "test_macros.h"
24 #define STR(S) MAKE_STRING(CharT, S)
26 template <class CharT>
27 static void test() {
29 std::basic_istringstream<CharT> ss;
30 std::basic_string<CharT> s(STR("testing"));
31 ss.str(std::move(s));
32 assert(ss.str() == STR("testing"));
36 int main(int, char**) {
37 test<char>();
38 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
39 test<wchar_t>();
40 #endif
41 return 0;