diff options
Diffstat (limited to 'llvm/unittests/Support/Path.cpp')
-rw-r--r-- | llvm/unittests/Support/Path.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp index 5e0581c945b..1802b0031ad 100644 --- a/llvm/unittests/Support/Path.cpp +++ b/llvm/unittests/Support/Path.cpp @@ -185,10 +185,19 @@ TEST(Support, Path) { path::native(*i, temp_store); } - SmallString<32> Relative("foo.cpp"); - sys::fs::make_absolute("/root", Relative); - Relative[5] = '/'; // Fix up windows paths. - ASSERT_EQ("/root/foo.cpp", Relative); + { + SmallString<32> Relative("foo.cpp"); + sys::fs::make_absolute("/root", Relative); + Relative[5] = '/'; // Fix up windows paths. + ASSERT_EQ("/root/foo.cpp", Relative); + } + + { + SmallString<32> Relative("foo.cpp"); + sys::fs::make_absolute("//root", Relative); + Relative[6] = '/'; // Fix up windows paths. + ASSERT_EQ("//root/foo.cpp", Relative); + } } TEST(Support, FilenameParent) { |