diff options
| author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-11-30 23:28:07 +0000 |
|---|---|---|
| committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-11-30 23:28:07 +0000 |
| commit | 545cbdf063b3e31be4ef6de06c3109beba8ec714 (patch) | |
| tree | e1542a0446e31ebec56fa5460d1392dc8da5cc3d /llvm/unittests/Support/Path.cpp | |
| parent | e1d3603dc6d4d6fc563e9197fb83da861cf0ef97 (diff) | |
| download | bcm5719-llvm-545cbdf063b3e31be4ef6de06c3109beba8ec714.tar.gz bcm5719-llvm-545cbdf063b3e31be4ef6de06c3109beba8ec714.zip | |
Support/PathV2: Implement reverse iteration and parent_path.
llvm-svn: 120496
Diffstat (limited to 'llvm/unittests/Support/Path.cpp')
| -rw-r--r-- | llvm/unittests/Support/Path.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp index 2c7c3cba9e6..b8f818ff1db 100644 --- a/llvm/unittests/Support/Path.cpp +++ b/llvm/unittests/Support/Path.cpp @@ -71,6 +71,15 @@ TEST(Support, Path) { } outs() << "]\n"; + outs() << " Reverse Iteration: ["; + for (sys::path::reverse_iterator ci = sys::path::rbegin(*i), + ce = sys::path::rend(*i); + ci != ce; + ++ci) { + outs() << *ci << ','; + } + outs() << "]\n"; + StringRef res; SmallString<16> temp_store; if (error_code ec = sys::path::root_path(*i, res)) @@ -82,6 +91,9 @@ TEST(Support, Path) { if (error_code ec = sys::path::root_directory(*i, res)) ASSERT_FALSE(ec.message().c_str()); outs() << " root_directory: " << res << '\n'; + if (error_code ec = sys::path::parent_path(*i, res)) + ASSERT_FALSE(ec.message().c_str()); + outs() << " parent_path: " << res << '\n'; temp_store = *i; if (error_code ec = sys::path::make_absolute(temp_store)) |

