1// Copyright (C) 2015 Free Software Foundation, Inc. 2// 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) 7// any later version. 8 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. 13 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/>. 17 18// { dg-options "-std=gnu++11 -lstdc++fs" } 19// { dg-require-filesystem-ts "" } 20 21#include <experimental/filesystem> 22#include <testsuite_hooks.h> 23#include <testsuite_fs.h> 24 25using std::experimental::filesystem::path; 26 27void 28test01() 29{ 30 bool test __attribute__((unused)) = false; 31 32 VERIFY( exists(path{"/"}) ); 33 VERIFY( exists(path{"/."}) ); 34 VERIFY( exists(path{"."}) ); 35 VERIFY( exists(path{".."}) ); 36 VERIFY( exists(std::experimental::filesystem::current_path()) ); 37} 38 39void 40test02() 41{ 42 bool test __attribute__((unused)) = false; 43 44 path rel = __gnu_test::nonexistent_path(); 45 VERIFY( !exists(rel) ); 46} 47 48void 49test03() 50{ 51 bool test __attribute__((unused)) = false; 52 53 path abs = absolute(__gnu_test::nonexistent_path()); 54 VERIFY( !exists(abs) ); 55} 56 57int 58main() 59{ 60 test01(); 61 test02(); 62 test03(); 63} 64