2013-11-16 Edward Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / libstdc++-v3 / testsuite / experimental / string_view / literals / values.cc
blob20b8a4d74a741f46645e3803bce84fca502b0e41
1 // { dg-do run }
2 // { dg-options "-std=gnu++1y" }
4 // Copyright (C) 2013 Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
21 #include <experimental/string_view>
22 #include <testsuite_hooks.h>
24 void
25 test01()
27 using namespace std::experimental::literals::string_view_literals;
29 std::experimental::string_view planet = "Mercury"sv;
30 std::experimental::wstring_view wplanet = L"Venus"sv;
31 std::experimental::string_view u8planet = u8"Mars"sv;
32 std::experimental::u16string_view u16planet = u"Juiter"sv;
33 std::experimental::u32string_view u32planet = U"Saturn"sv;
35 VERIFY( planet == std::experimental::string_view("Mercury") );
36 VERIFY( wplanet == std::experimental::wstring_view(L"Venus") );
37 VERIFY( u8planet == std::experimental::string_view(u8"Mars") );
38 VERIFY( u16planet == std::experimental::u16string_view(u"Juiter") );
39 VERIFY( u32planet == std::experimental::u32string_view(U"Saturn") );
42 int
43 main()
45 test01();