summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/experimental/filesystem/path
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/experimental/filesystem/path')
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/append/path.cc63
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/assign/assign.cc89
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/assign/copy.cc55
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/compare/compare.cc50
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/compare/path.cc50
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/compare/strings.cc48
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/concat/path.cc68
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/concat/strings.cc51
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/construct/copy.cc54
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/construct/default.cc50
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/construct/locale.cc39
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/construct/range.cc60
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/decompose/extension.cc61
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/decompose/filename.cc58
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/decompose/parent_path.cc63
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/decompose/relative_path.cc65
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_directory.cc60
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_name.cc42
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_path.cc55
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/decompose/stem.cc53
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/factory/TODO0
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/generic/generic_string.cc48
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/io/TODO0
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/itr/traversal.cc86
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/clear.cc45
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/make_preferred.cc63
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/remove_filename.cc53
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_extension.cc52
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_filename.cc52
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/swap.cc44
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/native/TODO0
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/nonmember/hash_value.cc51
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/query/empty.cc43
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/query/has_extension.cc43
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/query/has_filename.cc43
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/query/has_parent_path.cc43
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/query/has_relative_path.cc43
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_directory.cc43
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_name.cc43
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_path.cc43
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/query/has_stem.cc43
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/path/query/is_relative.cc43
42 files changed, 2058 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/append/path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/append/path.cc
new file mode 100644
index 00000000000..75d2df0c8a3
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/append/path.cc
@@ -0,0 +1,63 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.3 path appends [path.append]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ const path p("/foo/bar");
+
+ path pp = p;
+ pp /= p;
+ VERIFY( pp.native() == "/foo/bar/foo/bar" );
+
+ path q("baz");
+
+ path qq = q;
+ qq /= q;
+ VERIFY( qq.native() == "baz/baz" );
+
+ q /= p;
+ VERIFY( q.native() == "baz/foo/bar" );
+
+ path r = "";
+ r /= path();
+ VERIFY( r.empty() );
+
+ r /= path("rel");
+ VERIFY( !r.is_absolute() );
+
+ path s = "dir/";
+ s /= path("/file");
+ VERIFY( s.native() == "dir//file" );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/assign/assign.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/assign/assign.cc
new file mode 100644
index 00000000000..6fd24a77cf3
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/assign/assign.cc
@@ -0,0 +1,89 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+using __gnu_test::compare_paths;
+
+void
+test01()
+{
+ for (std::string s : __gnu_test::test_paths)
+ {
+ path p0 = s, p1, p2, p3, p4;
+
+ p1 = s;
+ compare_paths(p0, p1);
+
+ p2 = s.c_str();
+ compare_paths(p0, p2);
+
+ std::wstring ws(s.begin(), s.end());
+
+ p3 = ws;
+ compare_paths(p0, p3);
+
+ p4 = ws.c_str();
+ compare_paths(p0, p4);
+ }
+}
+
+void
+test02()
+{
+ for (std::string s : __gnu_test::test_paths)
+ {
+ path p0 = s, p1, p2, p3, p4, p5, p6, p7, p8;
+
+ p1.assign(s);
+ compare_paths(p0, p1);
+
+ p2.assign( s.begin(), s.end() );
+ compare_paths(p0, p2);
+
+ p3.assign( s.c_str() );
+ compare_paths(p0, p3);
+
+ p4.assign( s.c_str(), s.c_str() + s.size() );
+ compare_paths(p0, p4);
+
+ std::wstring ws(s.begin(), s.end());
+
+ p5.assign(ws);
+ compare_paths(p0, p5);
+
+ p6.assign( ws.begin(), ws.end() );
+ compare_paths(p0, p6);
+
+ p7.assign( ws.c_str() );
+ compare_paths(p0, p7);
+
+ p8.assign( ws.c_str(), ws.c_str() + ws.size() );
+ compare_paths(p0, p8);
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/assign/copy.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/assign/copy.cc
new file mode 100644
index 00000000000..29dbcd4035d
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/assign/copy.cc
@@ -0,0 +1,55 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <experimental/filesystem>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+using __gnu_test::compare_paths;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path copy;
+ copy = p;
+ __gnu_test::compare_paths(p, copy);
+ }
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path copy = p;
+ path move;
+ move = std::move(copy);
+ __gnu_test::compare_paths(p, move);
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/compare/compare.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/compare/compare.cc
new file mode 100644
index 00000000000..e8f5e41cfa1
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/compare/compare.cc
@@ -0,0 +1,50 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.8 path compare [path.compare]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ path p("/foo/bar");
+ VERIFY( p.compare(p) == 0 );
+ VERIFY( p.compare("/foo//bar") == 0 );
+
+ path q("/foo/baz");
+ VERIFY( p.compare(q) < 0 );
+ VERIFY( q.compare(p) > 0 );
+
+ path r("/foo/bar/.");
+ VERIFY( p.compare(r) < 0 );
+
+ VERIFY( path("a/b/").compare("a/b/.") == 0 );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/compare/path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/compare/path.cc
new file mode 100644
index 00000000000..7858af16228
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/compare/path.cc
@@ -0,0 +1,50 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.8 path compare [path.compare]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ const path p0 = "/a/a/b/b";
+ for (const path& p : __gnu_test::test_paths)
+ {
+ VERIFY( p.compare(p) == 0 );
+ int cmp = p.compare(p0);
+ if (cmp == 0)
+ VERIFY( p0.compare(p) == 0 );
+ else if (cmp < 0)
+ VERIFY( p0.compare(p) > 0 );
+ else if (cmp > 0)
+ VERIFY( p0.compare(p) < 0 );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/compare/strings.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/compare/strings.cc
new file mode 100644
index 00000000000..7e6156819ad
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/compare/strings.cc
@@ -0,0 +1,48 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.8 path compare [path.compare]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ const std::string s0 = "/a/a/b/b";
+ const path p0 = s0;
+ for (const std::string& s : __gnu_test::test_paths)
+ {
+ path p(s);
+ VERIFY( p.compare(s) == 0 );
+ VERIFY( p.compare(s.c_str()) == 0 );
+ VERIFY( p.compare(p0) == p.compare(s0) );
+ VERIFY( p.compare(p0) == p.compare(s0.c_str()) );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/concat/path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/concat/path.cc
new file mode 100644
index 00000000000..fceae117d2e
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/concat/path.cc
@@ -0,0 +1,68 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.4 path concatenation [path.concat]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ const path p("/foo/bar");
+
+ path pp = p;
+ pp += p;
+ VERIFY( pp.native() == "/foo/bar/foo/bar" );
+ VERIFY( std::distance(pp.begin(), pp.end()) == 5 );
+
+ path q("foo/bar");
+
+ path qq = q;
+ qq += q;
+ VERIFY( qq.native() == "foo/barfoo/bar" );
+ VERIFY( std::distance(qq.begin(), qq.end()) == 3 );
+
+ q += p;
+ VERIFY( q.native() == "foo/bar/foo/bar" );
+ VERIFY( std::distance(q.begin(), q.end()) == 4 );
+}
+
+void
+test02()
+{
+ for (path p : __gnu_test::test_paths)
+ {
+ auto prior_native = p.native();
+ path x("//blah/di/blah");
+ p += x;
+ VERIFY( p.native() == prior_native + x.native() );
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/concat/strings.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/concat/strings.cc
new file mode 100644
index 00000000000..e75e790a491
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/concat/strings.cc
@@ -0,0 +1,51 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.4 path concatenation [path.concat]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ path p("/");
+ p += path::string_type("foo");
+ VERIFY( p.filename() == "foo" );
+ p += "bar";
+ VERIFY( p.filename() == "foobar" );
+ p += '/';
+ VERIFY( p.parent_path() == "/foobar" && p.filename() == "." );
+ p += L"baz.txt";
+ VERIFY( p.filename() == "baz.txt" );
+ p.concat("/dir/");
+ VERIFY( p.parent_path() == "/foobar/baz.txt/dir" && p.filename() == "." );
+ std::string file = "file";
+ p.concat(file.begin(), file.end());
+ VERIFY( p.filename() == "file" );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/construct/copy.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/construct/copy.cc
new file mode 100644
index 00000000000..d0180b6c0a2
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/construct/copy.cc
@@ -0,0 +1,54 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.1 path constructors [path.construct]
+
+#include <experimental/filesystem>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path copy = p;
+ __gnu_test::compare_paths(p, copy);
+ }
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path copy = p;
+ path move = std::move(copy);
+ __gnu_test::compare_paths(p, move);
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/construct/default.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/construct/default.cc
new file mode 100644
index 00000000000..d8952a73726
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/construct/default.cc
@@ -0,0 +1,50 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.1 path constructors [path.construct]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ path p;
+ VERIFY( p.empty() );
+ VERIFY( !p.has_root_path() );
+ VERIFY( !p.has_root_name() );
+ VERIFY( !p.has_root_directory() );
+ VERIFY( !p.has_relative_path() );
+ VERIFY( !p.has_parent_path() );
+ VERIFY( !p.has_filename() );
+ VERIFY( !p.has_stem() );
+ VERIFY( !p.has_extension() );
+ VERIFY( !p.is_absolute() );
+ VERIFY( p.is_relative() );
+ VERIFY( std::distance(p.begin(), p.end()) == 0 );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/construct/locale.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/construct/locale.cc
new file mode 100644
index 00000000000..4c8c1841599
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/construct/locale.cc
@@ -0,0 +1,39 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.1 path constructors [path.construct]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ path p("/foo/bar", std::locale::classic());
+ VERIFY( p.string() == "/foo/bar" );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/construct/range.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/construct/range.cc
new file mode 100644
index 00000000000..03e50854772
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/construct/range.cc
@@ -0,0 +1,60 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.1 path constructors [path.construct]
+
+#include <experimental/filesystem>
+#include <string>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+using __gnu_test::compare_paths;
+
+void
+test01()
+{
+ for (std::string s : __gnu_test::test_paths)
+ {
+ path p1 = s;
+ path p2( s.begin(), s.end() );
+ path p3( s.c_str() );
+ path p4( s.c_str(), s.c_str() + s.size() );
+
+ std::wstring ws(s.begin(), s.end());
+ path p5 = ws;
+ path p6( ws.begin(), ws.end() );
+ path p7( ws.c_str() );
+ path p8( ws.c_str(), ws.c_str() + ws.size() );
+
+ compare_paths(p1, p2);
+ compare_paths(p1, p3);
+ compare_paths(p1, p4);
+ compare_paths(p1, p5);
+ compare_paths(p1, p6);
+ compare_paths(p1, p7);
+ compare_paths(p1, p8);
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/extension.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/extension.cc
new file mode 100644
index 00000000000..96f5bf5344e
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/extension.cc
@@ -0,0 +1,61 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ VERIFY( path("/foo/bar.txt").extension() == path(".txt") );
+ VERIFY( path("/foo/bar.baz.txt").extension() == path(".txt") );
+ VERIFY( path(".bar.baz.txt").extension() == path(".txt") );
+
+ VERIFY( path(".hidden").extension() == path(".hidden") );
+
+ VERIFY( path().extension() == path() );
+ VERIFY( path(".").extension() == path() );
+ VERIFY( path("..").extension() == path() );
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ auto stem = p.stem();
+ auto ext = p.extension();
+ auto file = p.filename();
+ VERIFY( stem.native() + ext.native() == file.native() );
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/filename.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/filename.cc
new file mode 100644
index 00000000000..dc3f07ff693
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/filename.cc
@@ -0,0 +1,58 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ VERIFY( path("/foo/bar.txt").filename() == "bar.txt" );
+ VERIFY( path("/").filename() == "/" );
+ VERIFY( path(".").filename() == "." );
+ VERIFY( path("..").filename() == ".." );
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path f = p.filename();
+ if (p.empty())
+ VERIFY( f.empty() );
+ else
+ VERIFY( f == *--p.end() );
+ if (p != p.root_path())
+ VERIFY( !f.has_root_path() );
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/parent_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/parent_path.cc
new file mode 100644
index 00000000000..41df1bfb59c
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/parent_path.cc
@@ -0,0 +1,63 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ path p0;
+ VERIFY( p0.parent_path() == p0 );
+ path p1 = "foo";
+ VERIFY( p1.parent_path() == p0 );
+ path p2 = "foo/bar";
+ VERIFY( p2.parent_path() == p1 );
+ path p3 = "/foo/bar";
+ VERIFY( p3.parent_path() == path("/foo") );
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ if (p.begin() == p.end())
+ continue;
+ path pp;
+ for (auto i = p.begin(), end = --p.end(); i != end; ++i)
+ {
+ pp /= *i;
+ }
+ VERIFY( p.parent_path() == pp );
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/relative_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/relative_path.cc
new file mode 100644
index 00000000000..16e8f864ad8
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/relative_path.cc
@@ -0,0 +1,65 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ path p1 = "foo";
+ VERIFY( p1.relative_path() == p1 );
+ path p2 = "foo/bar";
+ VERIFY( p2.relative_path() == p2 );
+ path p3 = "/foo/bar";
+ VERIFY( p3.relative_path() == p2 );
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ bool after_root = false;
+ const path prel = p.relative_path();
+ VERIFY( !prel.has_root_name() );
+ path rel;
+ for (const auto& cmpt : p)
+ {
+ if (!cmpt.has_root_path())
+ after_root = true;
+ if (after_root)
+ rel /= cmpt;
+ }
+ VERIFY( prel == rel );
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_directory.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_directory.cc
new file mode 100644
index 00000000000..4f372d6ddb3
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_directory.cc
@@ -0,0 +1,60 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ path p1 = "foo/bar";
+ VERIFY( p1.root_directory() == path() );
+ path p2 = "/foo/bar";
+ VERIFY( p2.root_directory() == path("/") );
+ path p3 = "//foo";
+ VERIFY( p3.root_directory() == path() );
+ path p4 = "///foo";
+ VERIFY( p4.root_directory() == path("/") );
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path rootdir = p.root_directory();
+ // If root-directory is composed of 'slash name',
+ // 'slash' is excluded from the returned string.
+ if (!rootdir.empty() && rootdir.native() != "/")
+ VERIFY( rootdir.native()[0] != '/' );
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_name.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_name.cc
new file mode 100644
index 00000000000..01886738be4
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_name.cc
@@ -0,0 +1,42 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ VERIFY( path("/foo/bar.txt").extension() == ".txt" );
+ VERIFY( path("/foo/bar.baz.txt").extension() == ".txt" );
+ VERIFY( path(".").extension().empty() );
+ VERIFY( path("..").extension().empty() );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_path.cc
new file mode 100644
index 00000000000..feb4e7995dd
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_path.cc
@@ -0,0 +1,55 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ path p1 = "foo/bar";
+ VERIFY( p1.root_path() == path() );
+ path p2 = "/foo/bar";
+ VERIFY( p2.root_path() == path("/") );
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path rootp = p.root_path();
+ path rootn = p.root_name();
+ path rootd = p.root_directory();
+ VERIFY( rootp == (rootn / rootd) );
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/stem.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/stem.cc
new file mode 100644
index 00000000000..d3611b88776
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/stem.cc
@@ -0,0 +1,53 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ VERIFY( path("/foo/bar.txt").stem() == path("bar") );
+ path p = "foo.bar.baz.tar";
+ std::vector<std::string> v;
+ for (; !p.extension().empty(); p = p.stem())
+ v.push_back(p.extension().native());
+ VERIFY( v.at(0) == ".tar" );
+ VERIFY( v.at(1) == ".baz" );
+ VERIFY( v.at(2) == ".bar" );
+
+ VERIFY( path(".hidden").stem() == path() );
+
+ VERIFY( path().stem() == path() );
+ VERIFY( path(".").stem() == path(".") );
+ VERIFY( path("..").stem() == path("..") );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/factory/TODO b/libstdc++-v3/testsuite/experimental/filesystem/path/factory/TODO
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/factory/TODO
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/generic/generic_string.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/generic/generic_string.cc
new file mode 100644
index 00000000000..1e302f2bf72
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/generic/generic_string.cc
@@ -0,0 +1,48 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.7 path generic format observers [path.generic.obs]
+
+#include <experimental/filesystem>
+#include <testsuite_fs.h>
+#include <testsuite_hooks.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path p2(p), p3;
+ p2.swap(p3);
+ VERIFY( p2 == path() );
+ VERIFY( p3 == p );
+ p2.swap(p3);
+ VERIFY( p2 == p );
+ VERIFY( p3 == path() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/io/TODO b/libstdc++-v3/testsuite/experimental/filesystem/path/io/TODO
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/io/TODO
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/itr/traversal.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/itr/traversal.cc
new file mode 100644
index 00000000000..0e543349d98
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/itr/traversal.cc
@@ -0,0 +1,86 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.5 path iterators [path.itr]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <algorithm>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ path p;
+ VERIFY( p.begin() == p.end() );
+
+ std::vector<path> v, v2;
+
+ p = "/";
+ v.assign(p.begin(), p.end());
+ v2 = { "/" };
+ VERIFY( v == v2 );
+
+ p = "filename";
+ v.assign(p.begin(), p.end());
+ v2 = { "filename" };
+ VERIFY( v == v2 );
+
+ p = "dir/";
+ v.assign(p.begin(), p.end());
+ v2 = { "dir", "." };
+ VERIFY( v == v2 );
+
+ p = "//rootname/dir/";
+ v.assign(p.begin(), p.end());
+ v2 = { "//rootname", "/", "dir", "." };
+ VERIFY( v == v2 );
+
+ p = "//rootname/dir/filename";
+ v.assign(p.begin(), p.end());
+ v2 = { "//rootname", "/", "dir", "filename" };
+ VERIFY( v == v2 );
+}
+
+void
+test02()
+{
+ using reverse_iterator = std::reverse_iterator<path::iterator>;
+ std::vector<path> fwd, rev;
+
+ for (const path& p : __gnu_test::test_paths)
+ {
+ const auto begin = p.begin(), end = p.end();
+ fwd.assign(begin, end);
+ rev.assign(reverse_iterator(end), reverse_iterator(begin));
+ VERIFY( fwd.size() == rev.size() );
+ VERIFY( std::equal(fwd.begin(), fwd.end(), rev.rbegin()) );
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/clear.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/clear.cc
new file mode 100644
index 00000000000..e28f900315a
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/clear.cc
@@ -0,0 +1,45 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.5 path modifiers [path.modifiers]
+
+#include <experimental/filesystem>
+#include <testsuite_fs.h>
+#include <testsuite_hooks.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (path p : __gnu_test::test_paths)
+ {
+ path empty;
+ p.clear();
+ VERIFY( p.empty() );
+ __gnu_test::compare_paths(p, empty);
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/make_preferred.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/make_preferred.cc
new file mode 100644
index 00000000000..f38ecf6fc05
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/make_preferred.cc
@@ -0,0 +1,63 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.5 path modifiers [path.modifiers]
+
+#include <experimental/filesystem>
+#include <testsuite_fs.h>
+#include <testsuite_hooks.h>
+
+using std::experimental::filesystem::path;
+
+template<typename T, T sep>
+struct checker
+{
+ static void check(const char* s) { }
+};
+
+template<>
+struct checker<char, '/'>
+{
+ static void check()
+ {
+ VERIFY( path("foo/bar").make_preferred() == "foo/bar" );
+ }
+};
+
+template<>
+struct checker<wchar_t, L'\\'>
+{
+ static void check()
+ {
+ VERIFY( path("foo/bar").make_preferred() == L"foo\\bar" );
+ }
+};
+
+void
+test01()
+{
+ checker<path::value_type, path::preferred_separator>::check();
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/remove_filename.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/remove_filename.cc
new file mode 100644
index 00000000000..4612e4490d6
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/remove_filename.cc
@@ -0,0 +1,53 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.5 path modifiers [path.modifiers]
+
+#include <experimental/filesystem>
+#include <testsuite_fs.h>
+#include <testsuite_hooks.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ VERIFY( path("/foo").remove_filename() == "/" );
+ VERIFY( path("/").remove_filename() == "" );
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path p2(p);
+ p2.remove_filename();
+ p2 /= p.filename();
+ VERIFY( p2 == p );
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_extension.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_extension.cc
new file mode 100644
index 00000000000..163016b09a1
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_extension.cc
@@ -0,0 +1,52 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.5 path modifiers [path.modifiers]
+
+#include <experimental/filesystem>
+#include <testsuite_fs.h>
+#include <testsuite_hooks.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ VERIFY( path("/foo.txt").replace_extension("cpp") == "/foo.cpp" );
+ VERIFY( path("/foo.txt").replace_extension(".cpp") == "/foo.cpp" );
+ VERIFY( path("/").replace_extension("bar") == "/.bar" );
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path p2 = p;
+ VERIFY(p2.replace_extension(p2.extension()) == p);
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_filename.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_filename.cc
new file mode 100644
index 00000000000..c9706008a07
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_filename.cc
@@ -0,0 +1,52 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.5 path modifiers [path.modifiers]
+
+#include <experimental/filesystem>
+#include <testsuite_fs.h>
+#include <testsuite_hooks.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ VERIFY( path("/foo").replace_filename("bar") == "/bar" );
+ VERIFY( path("/").replace_filename("bar") == "bar" );
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path p2(p);
+ p2.replace_filename(p.filename());
+ VERIFY( p2 == p );
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/swap.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/swap.cc
new file mode 100644
index 00000000000..df990e05f41
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/swap.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.5 path modifiers [path.modifiers]
+
+#include <experimental/filesystem>
+#include <testsuite_fs.h>
+#include <testsuite_hooks.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ const path p("/foo/bar");
+ path p1;
+ path p2 = p;
+ p1.swap(p2);
+ VERIFY( p2.empty() );
+ __gnu_test::compare_paths(p1, p);
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/native/TODO b/libstdc++-v3/testsuite/experimental/filesystem/path/native/TODO
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/native/TODO
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/nonmember/hash_value.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/nonmember/hash_value.cc
new file mode 100644
index 00000000000..3971237a657
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/nonmember/hash_value.cc
@@ -0,0 +1,51 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.6 path non-member functions [path.non-member]
+
+#include <experimental/filesystem>
+#include <testsuite_fs.h>
+#include <testsuite_hooks.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ VERIFY( hash_value(path("a//b")) == hash_value(path("a/b")) );
+ VERIFY( hash_value(path("a/")) == hash_value(path("a/.")) );
+}
+
+void
+test02()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ path pp = p.native();
+ VERIFY( hash_value(p) == hash_value(pp) );
+ }
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/empty.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/empty.cc
new file mode 100644
index 00000000000..b636f072619
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/empty.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const std::string& s : __gnu_test::test_paths)
+ {
+ VERIFY( s.empty() == path(s).empty() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_extension.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_extension.cc
new file mode 100644
index 00000000000..1edee38112f
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_extension.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ VERIFY( p.has_extension() == !p.extension().empty() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_filename.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_filename.cc
new file mode 100644
index 00000000000..308f78762ab
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_filename.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ VERIFY( p.has_filename() == !p.filename().empty() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_parent_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_parent_path.cc
new file mode 100644
index 00000000000..5068ebb04b9
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_parent_path.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ VERIFY( p.has_parent_path() == !p.parent_path().empty() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_relative_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_relative_path.cc
new file mode 100644
index 00000000000..13ab666ae4a
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_relative_path.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ VERIFY( p.has_relative_path() == !p.relative_path().empty() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_directory.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_directory.cc
new file mode 100644
index 00000000000..16df83c0ab1
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_directory.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ VERIFY( p.has_root_directory() == !p.root_directory().empty() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_name.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_name.cc
new file mode 100644
index 00000000000..e8f2de70693
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_name.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ VERIFY( p.has_root_name() == !p.root_name().empty() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_path.cc
new file mode 100644
index 00000000000..fed615fb579
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_path.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ VERIFY( p.has_root_path() == !p.root_path().empty() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_stem.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_stem.cc
new file mode 100644
index 00000000000..eab381a227b
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_stem.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ VERIFY( p.has_stem() == !p.stem().empty() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/is_relative.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/is_relative.cc
new file mode 100644
index 00000000000..4512f6e747f
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/is_relative.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11 -lstdc++fs" }
+// { dg-require-filesystem-ts "" }
+
+// Copyright (C) 2014-2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 8.4.9 path decomposition [path.decompose]
+
+#include <experimental/filesystem>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+using std::experimental::filesystem::path;
+
+void
+test01()
+{
+ for (const path& p : __gnu_test::test_paths)
+ {
+ VERIFY( p.is_relative() == !p.is_absolute() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}