From 46f6e62eb9ea01e43ec45961e68c22f9c00b0a27 Mon Sep 17 00:00:00 2001 From: jeremyd2019 Date: Fri, 1 Aug 2025 10:35:09 -0700 Subject: [LLVM][Support] Fix tests on Cygwin (#151417) Cygwin returns -1 for `getconf(_SC_ARG_MAX)`, which makes `llvm::sys::commandLineFitsWithinSystemLimits` always return true, so skip the `ArgumentLimit` test in that case. Skip the `ArgumentLimitWindows` and `ResponseFileWindows` tests on Cygwin also as it doesn't suffer from the Windows limits either. Cygwin requires the same `dllexport` annotation as Win32 in the `DynamicLibrary` test, so add its preprocessor check to PipSqueak.h. Cygwin's `getcwd` function does not fail with `ENOENT` if the current working directory is unlinked. According to POSIX issue 8, this is not required. Skip the `PhysicalFileSystemWorkingDirFailure` test on Cygwin as it relies on this behavior. --- llvm/unittests/Support/VirtualFileSystemTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/unittests/Support/VirtualFileSystemTest.cpp') diff --git a/llvm/unittests/Support/VirtualFileSystemTest.cpp b/llvm/unittests/Support/VirtualFileSystemTest.cpp index fc3ccea..6228de8 100644 --- a/llvm/unittests/Support/VirtualFileSystemTest.cpp +++ b/llvm/unittests/Support/VirtualFileSystemTest.cpp @@ -553,6 +553,10 @@ TEST(VirtualFileSystemTest, PhysicalFileSystemWorkingDirFailure) { // Some platforms (e.g. Solaris) disallow removal of the working directory. GTEST_SKIP() << "test requires deletion of working directory"; +#ifdef __CYGWIN__ + GTEST_SKIP() << "Cygwin getcwd succeeds with unlinked working directory"; +#endif + // Verify that we still get two separate working directories. auto FS1 = vfs::createPhysicalFileSystem(); auto FS2 = vfs::createPhysicalFileSystem(); -- cgit v1.1