summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-11-08 00:01:32 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-11-08 00:01:32 +0000
commitcbb5c86837d419b7be6d0b840c92c4209b757428 (patch)
treea00e39ccb8363abd2fb64b556be9199e6f3aea38 /llvm/unittests/Support
parent4f36c7ad90f2d4322156455528a1e27e55c13b30 (diff)
downloadbcm5719-llvm-cbb5c86837d419b7be6d0b840c92c4209b757428.tar.gz
bcm5719-llvm-cbb5c86837d419b7be6d0b840c92c4209b757428.zip
Extend virtual file system with `isLocal` method
Expose the `llvm::sys::fs::is_local` function through the VFS. Differential revision: https://reviews.llvm.org/D54127 llvm-svn: 346372
Diffstat (limited to 'llvm/unittests/Support')
-rw-r--r--llvm/unittests/Support/VirtualFileSystemTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/unittests/Support/VirtualFileSystemTest.cpp b/llvm/unittests/Support/VirtualFileSystemTest.cpp
index d5c01141bba..466cd117a50 100644
--- a/llvm/unittests/Support/VirtualFileSystemTest.cpp
+++ b/llvm/unittests/Support/VirtualFileSystemTest.cpp
@@ -885,6 +885,17 @@ TEST_F(InMemoryFileSystemTest, WorkingDirectory) {
getPosixPath(NormalizedFS.getCurrentWorkingDirectory().get()));
}
+TEST_F(InMemoryFileSystemTest, IsLocal) {
+ FS.setCurrentWorkingDirectory("/b");
+ FS.addFile("c", 0, MemoryBuffer::getMemBuffer(""));
+
+ std::error_code EC;
+ bool IsLocal = true;
+ EC = FS.isLocal("c", IsLocal);
+ ASSERT_FALSE(EC);
+ ASSERT_FALSE(IsLocal);
+}
+
#if !defined(_WIN32)
TEST_F(InMemoryFileSystemTest, GetRealPath) {
SmallString<16> Path;
OpenPOWER on IntegriCloud