diff options
author | raghavmedicherla <raghav.medicherla@gmail.com> | 2022-09-08 12:04:12 -0400 |
---|---|---|
committer | raghavmedicherla <raghav.medicherla@gmail.com> | 2022-09-08 12:49:52 -0400 |
commit | 5d3cf8267f90c3715d77f9bf7f97077b65791cb3 (patch) | |
tree | f534a0b623a9b1712cb596809c127e6eba922594 /llvm/unittests/Support/Path.cpp | |
parent | a8c647dbe603a0668e156010e358863bd64de1e4 (diff) | |
download | llvm-5d3cf8267f90c3715d77f9bf7f97077b65791cb3.zip llvm-5d3cf8267f90c3715d77f9bf7f97077b65791cb3.tar.gz llvm-5d3cf8267f90c3715d77f9bf7f97077b65791cb3.tar.bz2 |
Revert "Support: Add mapped_file_region::sync(), equivalent to msync"
This reverts commit 142f51fc2f448845f6a32e767ffaa2b665eea11f.
This shouldn't be committed, it got committed accidentally.
Diffstat (limited to 'llvm/unittests/Support/Path.cpp')
-rw-r--r-- | llvm/unittests/Support/Path.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp index 4457577..3b8ffd8 100644 --- a/llvm/unittests/Support/Path.cpp +++ b/llvm/unittests/Support/Path.cpp @@ -1463,33 +1463,6 @@ TEST_F(FileSystemTest, FileMapping) { ASSERT_NO_ERROR(fs::remove(TempPath)); } -TEST_F(FileSystemTest, FileMappingSync) { - // Create a temp file. - int FD; - SmallString<64> TempPath; - ASSERT_NO_ERROR(fs::createTemporaryFile("prefix", "temp", FD, TempPath)); - StringRef Content("hello there"); - ASSERT_NO_ERROR(fs::resize_file_before_mapping_readwrite(FD, Content.size())); - - { - // Map in the file and write some content. - std::error_code EC; - fs::mapped_file_region mfr(fs::convertFDToNativeFile(FD), - fs::mapped_file_region::readwrite, - Content.size(), 0, EC); - ASSERT_NO_ERROR(EC); - ASSERT_EQ(close(FD), 0); - std::copy(Content.begin(), Content.end(), mfr.data()); - - // Synchronize and check the contents before unmapping. - mfr.sync(); - auto Buffer = MemoryBuffer::getFile(TempPath); - ASSERT_TRUE((bool)Buffer); - ASSERT_EQ(Content, Buffer->get()->getBuffer()); - } - ASSERT_NO_ERROR(fs::remove(TempPath)); -} - TEST(Support, NormalizePath) { // Input, Expected Win, Expected Posix using TestTuple = std::tuple<const char *, const char *, const char *>; |