]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/4.cc
1 // 2010-12-19 Paolo Carlini <paolo.carlini@oracle.com>
3 // Copyright (C) 2010-2016 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
20 // { dg-options "-std=gnu++11" }
21 // { dg-require-string-conversions "" }
24 #include <testsuite_hooks.h>
28 bool test
__attribute__((unused
)) = true;
36 VERIFY( move(s01
) + move(s02
) == wstring(L
"abcdef") );
38 wstring
s03(L
"abcdefghijklmnopqrstuvw");
41 VERIFY( move(s03
) + move(s04
) == wstring(L
"abcdefghijklmnopqrstuvwxyz") );
45 wstring
s06(L
"defghijklmnopqrstuvwxyz");
46 VERIFY( move(s05
) + move(s06
) == wstring(L
"abcdefghijklmnopqrstuvwxyz") );
48 const wstring
sc1(L
"abc");
51 VERIFY( sc1
+ move(s07
) == wstring(L
"abcdef") );
53 const wstring
sc2(L
"def");
56 VERIFY( move(s08
) + sc2
== wstring(L
"abcdef") );
60 VERIFY( move(s09
) + L
'd' == wstring(L
"abcd") );
64 VERIFY( move(s10
) + L
"def" == wstring(L
"abcdef") );
68 VERIFY( L
'a' + move(s11
) == wstring(L
"abcd") );
72 VERIFY( L
"abc" + move(s12
) == wstring(L
"abcdef") );