aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorazhan92 <alisonxzhang@gmail.com>2024-04-17 17:56:42 -0400
committerGitHub <noreply@github.com>2024-04-17 17:56:42 -0400
commit678f19f08296fec299438130cf5943714c590b7e (patch)
tree10259878a2b685bdf67a960782cd3996cb9b4e72 /llvm/unittests/Support/CommandLineTest.cpp
parent0ab3f160c4bff1c7d57c046b95ab8c5035ae986f (diff)
downloadllvm-678f19f08296fec299438130cf5943714c590b7e.zip
llvm-678f19f08296fec299438130cf5943714c590b7e.tar.gz
llvm-678f19f08296fec299438130cf5943714c590b7e.tar.bz2
[Support] Report EISDIR when opening a directory (#79880)
The test `llvm/unittests/Support/CommandLineTest.cpp` that handles errors in expansion of response files was previously disabled for AIX. Originally the code was dependent on `read` returning `EISDIR` which occurs on platforms such as Linux. However, other platforms such as AIX allow use of `read` on file descriptors for directories. This change updates `readNativeFile` to produce `EISDIR` on AIX and z/OS when used on a directory (instead of relying on the call to `read` to do so). --------- Co-authored-by: Alison Zhang <alisonzhang@ibm.com> Co-authored-by: James Henderson <46713263+jh7370@users.noreply.github.com>
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r--llvm/unittests/Support/CommandLineTest.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index bbeb9d5..23f6081 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -1117,7 +1117,6 @@ TEST(CommandLineTest, BadResponseFile) {
ASSERT_STREQ(Argv[0], "clang");
ASSERT_STREQ(Argv[1], AFileExp.c_str());
-#if !defined(_AIX) && !defined(__MVS__)
std::string ADirExp = std::string("@") + std::string(ADir.path());
Argv = {"clang", ADirExp.c_str()};
Res = cl::ExpandResponseFiles(Saver, cl::TokenizeGNUCommandLine, Argv);
@@ -1125,7 +1124,6 @@ TEST(CommandLineTest, BadResponseFile) {
ASSERT_EQ(2U, Argv.size());
ASSERT_STREQ(Argv[0], "clang");
ASSERT_STREQ(Argv[1], ADirExp.c_str());
-#endif
}
TEST(CommandLineTest, SetDefaultValue) {