aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2019-04-15 22:51:53 +0000
committerShoaib Meenai <smeenai@fb.com>2019-04-15 22:51:53 +0000
commitd60ac111e67161215a601f70e1bcd6125c9825f7 (patch)
tree3eedcfa4272fc92a7dcaf4aacb82c81e3900908c /llvm/unittests/Support/CommandLineTest.cpp
parentd9d0c3e1382350c941bb9db998189633e1b63e18 (diff)
downloadllvm-d60ac111e67161215a601f70e1bcd6125c9825f7.zip
llvm-d60ac111e67161215a601f70e1bcd6125c9825f7.tar.gz
llvm-d60ac111e67161215a601f70e1bcd6125c9825f7.tar.bz2
Revert [Support] Fix recursive response file expansion guard
This reverts r358452 (git commit c8df4fb9c3865eac52a99602c26bbc070098c3d4) A dependent commit breaks the Windows buildbots. llvm-svn: 358460
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r--llvm/unittests/Support/CommandLineTest.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index 99db7e2..782a816 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -813,43 +813,6 @@ TEST(CommandLineTest, RecursiveResponseFiles) {
EXPECT_STREQ(Argv[i], ResponseFileRef.c_str());
}
-TEST(CommandLineTest, ResponseFilesAtArguments) {
- SmallString<128> TestDir;
- std::error_code EC = sys::fs::createUniqueDirectory("unittest", TestDir);
- EXPECT_TRUE(!EC);
-
- SmallString<128> ResponseFilePath;
- sys::path::append(ResponseFilePath, TestDir, "test.rsp");
-
- std::ofstream ResponseFile(ResponseFilePath.c_str());
- EXPECT_TRUE(ResponseFile.is_open());
- ResponseFile << "-foo" << "\n";
- ResponseFile << "-bar" << "\n";
- ResponseFile.close();
-
- // Ensure we expand rsp files after lots of non-rsp arguments starting with @.
- constexpr size_t NON_RSP_AT_ARGS = 64;
- llvm::SmallVector<const char *, 4> Argv = {"test/test"};
- Argv.append(NON_RSP_AT_ARGS, "@non_rsp_at_arg");
- std::string ResponseFileRef = std::string("@") + ResponseFilePath.c_str();
- Argv.push_back(ResponseFileRef.c_str());
-
- llvm::BumpPtrAllocator A;
- llvm::StringSaver Saver(A);
- bool Res = llvm::cl::ExpandResponseFiles(
- Saver, llvm::cl::TokenizeGNUCommandLine, Argv, false, false);
- EXPECT_FALSE(Res);
-
- // ASSERT instead of EXPECT to prevent potential out-of-bounds access.
- ASSERT_EQ(Argv.size(), 1 + NON_RSP_AT_ARGS + 2);
- size_t i = 0;
- EXPECT_STREQ(Argv[i++], "test/test");
- for (; i < 1 + NON_RSP_AT_ARGS; ++i)
- EXPECT_STREQ(Argv[i], "@non_rsp_at_arg");
- EXPECT_STREQ(Argv[i++], "-foo");
- EXPECT_STREQ(Argv[i++], "-bar");
-}
-
TEST(CommandLineTest, SetDefautValue) {
cl::ResetCommandLineParser();