]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/27_io/filesystem/path/concat/94063.cc
1 // Copyright (C) 2020-2022 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
18 // { dg-do run { target { *-*-*mingw* || *-*-cygwin } } }
19 // { dg-require-effective-target c++17 }
22 #include <testsuite_hooks.h>
27 using std::filesystem::path
;
31 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
34 VERIFY( p
.has_root_name() );
35 VERIFY( p
.root_name() == p
);
37 VERIFY( p
.has_root_name() );
38 VERIFY( p
.has_root_directory() );
39 VERIFY( p
.root_name() == L
"C:" );
40 VERIFY( p
.root_directory() == L
"\\" );
44 VERIFY( p
.has_root_name() );
45 VERIFY( p
.root_name() == p
);
47 VERIFY( p
.has_root_name() );
48 VERIFY( p
.has_root_directory() );
49 VERIFY( p
.root_name() == L
"C:" );
50 VERIFY( p
.root_directory() == L
"\\" );
54 VERIFY( p
.has_root_name() );
55 VERIFY( p
.has_root_directory() );
56 VERIFY( p
.root_name() == L
"C:" );
57 VERIFY( p
.root_directory() == L
"/" );
58 VERIFY( p
.filename() == L
"foo" );
62 VERIFY( p
.has_root_name() );
63 VERIFY( p
.has_root_directory() );
64 VERIFY( p
.root_name() == L
"C:" );
65 VERIFY( p
.root_directory() == L
"/" );
66 VERIFY( p
.filename() == L
"foo" );
70 VERIFY( p
.has_root_name() );
71 VERIFY( p
.has_root_directory() );
72 VERIFY( p
.root_name() == L
"C:" );
73 VERIFY( p
.root_directory() == L
"/" );
74 VERIFY( p
.filename() == L
"foo" );
78 VERIFY( p
.has_root_name() );
79 VERIFY( p
.has_root_directory() );
80 VERIFY( p
.root_name() == L
"C:" );
81 VERIFY( p
.root_directory() == L
"/" );
82 VERIFY( p
.filename() == L
"foo" );
83 #elif defined __CYGWIN__
86 VERIFY( p
.has_root_name() );
87 VERIFY( p
.root_name() == p
);
91 VERIFY( p
.has_root_name() );
92 VERIFY( p
.root_name() == p
);
96 VERIFY( !p
.has_root_name() );
97 VERIFY( p
.has_root_directory() );
101 VERIFY( !p
.has_root_name() );
102 VERIFY( p
.has_root_directory() );