[libcxx-commits] [libcxx] 27ea671 - [SystemZ][z/OS] Fix filesystem testing
Muiez Ahmed via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Nov 18 12:59:27 PST 2021
Author: Muiez Ahmed
Date: 2021-11-18T15:57:50-05:00
New Revision: 27ea67136ea067c1e4a3e79eca49583bcbf3953b
URL: https://github.com/llvm/llvm-project/commit/27ea67136ea067c1e4a3e79eca49583bcbf3953b
DIFF: https://github.com/llvm/llvm-project/commit/27ea67136ea067c1e4a3e79eca49583bcbf3953b.diff
LOG: [SystemZ][z/OS] Fix filesystem testing
This patch resolves many of the failures in the `filesystems/` buckets in the libc++ tests. It adds the correct flag to `fopen` and marks a test case as unsupported. In particular, that test assumes time is stored as a 64 bit value when on MVS it is stored as 32 bit.
Differential Revision: https://reviews.llvm.org/D113298
Added:
Modified:
libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp
libcxx/test/support/filesystem_test_helper.h
Removed:
################################################################################
diff --git a/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp
index 0b914aa99f4e..dc7c1891501c 100644
--- a/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp
+++ b/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp
@@ -15,6 +15,9 @@
// other platforms.
// UNSUPPORTED: windows
+// This test assumes that time is stored as a 64 bit value when on MVS it is stored as 32 bit
+// UNSUPPORTED: target={{.+}}-zos{{.*}}
+
// TODO(ldionne): This test fails on Ubuntu Focal on our CI nodes (and only there), in 32 bit mode.
// UNSUPPORTED: linux && 32bits-on-64bits
diff --git a/libcxx/test/support/filesystem_test_helper.h b/libcxx/test/support/filesystem_test_helper.h
index 7b1fccfd9777..ea645e28e285 100644
--- a/libcxx/test/support/filesystem_test_helper.h
+++ b/libcxx/test/support/filesystem_test_helper.h
@@ -193,10 +193,10 @@ struct scoped_test_env
abort();
}
-#ifndef _WIN32
-#define FOPEN_CLOEXEC_FLAG "e"
+#if defined(_WIN32) || defined(__MVS__)
+# define FOPEN_CLOEXEC_FLAG ""
#else
-#define FOPEN_CLOEXEC_FLAG ""
+# define FOPEN_CLOEXEC_FLAG "e"
#endif
FILE* file = large_file_fopen(filename.c_str(), "w" FOPEN_CLOEXEC_FLAG);
if (file == nullptr) {
More information about the libcxx-commits
mailing list