diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-06-20 20:51:51 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-06-20 20:51:51 +0000 |
commit | 8199dadab8237e25c39acdef7d8b1bc0835dff98 (patch) | |
tree | b99a24691df6ab05a833f84b27ab06418aa257d7 /llvm/unittests/Support/CommandLineTest.cpp | |
parent | 3dbef856d44b3d6336fe500a0dbf5ba2b3137d56 (diff) | |
download | llvm-8199dadab8237e25c39acdef7d8b1bc0835dff98.zip llvm-8199dadab8237e25c39acdef7d8b1bc0835dff98.tar.gz llvm-8199dadab8237e25c39acdef7d8b1bc0835dff98.tar.bz2 |
Support: chunk writing on Linux
This is a workaround for large file writes. It has been witnessed that
write(2) failing with EINVAL (22) due to a large value (>2G). Thanks to
James Knight for the help with coming up with a sane test case.
llvm-svn: 305846
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r-- | llvm/unittests/Support/CommandLineTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp index f9dc393..660df11 100644 --- a/llvm/unittests/Support/CommandLineTest.cpp +++ b/llvm/unittests/Support/CommandLineTest.cpp @@ -13,6 +13,7 @@ #include "llvm/Config/config.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" +#include "llvm/Support/Program.h" #include "llvm/Support/StringSaver.h" #include "gtest/gtest.h" #include <fstream> @@ -546,6 +547,11 @@ TEST(CommandLineTest, GetRegisteredSubcommands) { } } +TEST(CommandLineTest, ArgumentLimit) { + std::string args(32 * 4096, 'a'); + EXPECT_FALSE(llvm::sys::commandLineFitsWithinSystemLimits("cl", args.data())); +} + TEST(CommandLineTest, ResponseFiles) { llvm::SmallString<128> TestDir; std::error_code EC = |