Skip to content

release/23.x: [Support][test] Fix OpenDirectoryAsFileForRead test on AIX and z/OS (#216241) - #216342

Merged
dyung merged 1 commit into
llvm:release/23.xfrom
llvmbot:issue216241
Aug 21, 2026
Merged

release/23.x: [Support][test] Fix OpenDirectoryAsFileForRead test on AIX and z/OS (#216241)#216342
dyung merged 1 commit into
llvm:release/23.xfrom
llvmbot:issue216241

Conversation

@llvmbot

@llvmbot llvmbot commented Aug 14, 2026

Copy link
Copy Markdown
Member

Backport 828d2d7

Requested by: @amy-kwan

@llvmbot

llvmbot commented Aug 14, 2026

Copy link
Copy Markdown
Member Author

@perry-ca What do you think about merging this PR to the release branch?

@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-llvm-support

Author: llvmbot

Changes

Backport 828d2d7

Requested by: @amy-kwan


Full diff: https://github.com/llvm/llvm-project/pull/216342.diff

1 Files Affected:

  • (modified) llvm/unittests/Support/Path.cpp (+1-1)
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index b63ab426bb080..31599f6152e92 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/unittests/Support/Path.cpp
@@ -2040,7 +2040,7 @@ TEST_F(FileSystemTest, SetLastAccessAndModificationTimeDirectory) {
 TEST_F(FileSystemTest, OpenDirectoryAsFileForRead) {
   std::string Buf(5, '?');
   Expected<fs::file_t> FD = fs::openNativeFileForRead(TestDirectory);
-#ifdef _WIN32
+#if defined(_WIN32) || defined(_AIX) || defined(__MVS__)
   EXPECT_EQ(errorToErrorCode(FD.takeError()), errc::is_a_directory);
 #else
   ASSERT_THAT_EXPECTED(FD, Succeeded());

@dyung dyung moved this from Needs Triage to Needs Review in LLVM Release Status Aug 15, 2026
@dyung

dyung commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Could we get a review of whether this should go into the release branch?

@perry-ca

Copy link
Copy Markdown
Member

The change is safe. I also did a very rough performance comparison on z/OS and saw a 5-15% performance improvement.

We don't need this for z/OS in LLVM 23, but if there is a benefit for AIX (@hubert-reinterpretcast) I'd say go for it as the risk is low.

@hubert-reinterpretcast hubert-reinterpretcast left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The behaviour change is expected (and as can be seen, is not novel but is behaviour also seen under Windows).

@github-project-automation github-project-automation Bot moved this from Needs Review to Needs Merge in LLVM Release Status Aug 21, 2026
…lvm#216241)

Commit 9c7ba7b ("[AIX][SystemZ][Support] Check if file is dir on
open instead of read") moved the `fstat`/`EISDIR` check from
`readNativeFile()` to `openNativeFileForRead()` on AIX and z/OS. This
means `openNativeFileForRead()` now returns `EISDIR` immediately on
those
platforms, but the test `FileSystemTest.OpenDirectoryAsFileForRead` was
not updated to match, causing it to fail at the
`ASSERT_THAT_EXPECTED(FD, Succeeded())` assertion.

Add a `#elif defined(_AIX) || defined(__MVS__)` branch to the test that
expects the error to be returned from `openNativeFileForRead()` rather
than from `readNativeFile()`, consistent with the behavior introduced by
that commit.

(cherry picked from commit 828d2d7)
@dyung
dyung merged commit 18daae2 into llvm:release/23.x Aug 21, 2026
1 of 2 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Merge to Done in LLVM Release Status Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

5 participants