[llvm] [SystemZ][z/OS] Enable lit testing for z/OS (PR #107631)
Abhina Sree via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 9 10:10:40 PDT 2024
https://github.com/abhina-sree updated https://github.com/llvm/llvm-project/pull/107631
>From 310fe43f057e2a5e99b1d1411e5b5c1b3b511e64 Mon Sep 17 00:00:00 2001
From: Abhina Sreeskantharajan <Abhina.Sreeskantharajan at ibm.com>
Date: Fri, 6 Sep 2024 15:11:55 -0400
Subject: [PATCH 1/3] [SystemZ][z/OS] Enable lit testing for z/OS
---
llvm/lib/Support/raw_ostream.cpp | 4 ++++
llvm/utils/lit/lit/run.py | 5 +++--
llvm/utils/lit/lit/util.py | 5 ++++-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 2ce54faa9857e6..e39c03c918f735 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -843,6 +843,10 @@ size_t raw_fd_ostream::preferred_buffer_size() const {
if (IsWindowsConsole)
return 0;
return raw_ostream::preferred_buffer_size();
+#elif defined(__MVS__)
+ // The buffer size on zOS is defined with macro BUFSIZ, which can be retrieved
+ // by invoking function raw_ostream::preferred_buffer_size().
+ return raw_ostream::preferred_buffer_size();
#else
assert(FD >= 0 && "File not yet open!");
struct stat statbuf;
diff --git a/llvm/utils/lit/lit/run.py b/llvm/utils/lit/lit/run.py
index 535c859352cc4d..62070e824e87fa 100644
--- a/llvm/utils/lit/lit/run.py
+++ b/llvm/utils/lit/lit/run.py
@@ -1,5 +1,6 @@
import multiprocessing
import os
+import platform
import time
import lit.Test
@@ -136,6 +137,6 @@ def _increase_process_limit(self):
"Raised process limit from %d to %d" % (soft_limit, desired_limit)
)
except Exception as ex:
- # Warn, unless this is Windows, in which case this is expected.
- if os.name != "nt":
+ # Warn, unless this is Windows or z/OS, in which case this is expected.
+ if os.name != "nt" and platform.system() != "OS/390":
self.lit_config.warning("Failed to raise process limit: %s" % ex)
diff --git a/llvm/utils/lit/lit/util.py b/llvm/utils/lit/lit/util.py
index a2452f5566b772..4e75cce092c672 100644
--- a/llvm/utils/lit/lit/util.py
+++ b/llvm/utils/lit/lit/util.py
@@ -502,7 +502,7 @@ def killProcessAndChildrenIsSupported():
otherwise is contains a string describing why the function is
not supported.
"""
- if platform.system() == "AIX":
+ if platform.system() == "AIX" or platform.system() == "OS/390":
return (True, "")
try:
import psutil # noqa: F401
@@ -528,6 +528,9 @@ def killProcessAndChildren(pid):
"""
if platform.system() == "AIX":
subprocess.call("kill -kill $(ps -o pid= -L{})".format(pid), shell=True)
+ elif platform.system() == "OS/390":
+ # FIXME: Only the process is killed.
+ subprocess.call("kill -KILL $(ps -s {} -o pid=)".format(pid), shell=True)
else:
import psutil
>From e5c806d7300263cda5638fcb7e3342a2be530cd9 Mon Sep 17 00:00:00 2001
From: Abhina Sree <Abhina.Sreeskantharajan at ibm.com>
Date: Mon, 9 Sep 2024 12:56:35 -0400
Subject: [PATCH 2/3] Update llvm/lib/Support/raw_ostream.cpp
Co-authored-by: Zibi Sarbinowski <zibi at ca.ibm.com>
---
llvm/lib/Support/raw_ostream.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index e39c03c918f735..5b684a3d91bcad 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -844,7 +844,7 @@ size_t raw_fd_ostream::preferred_buffer_size() const {
return 0;
return raw_ostream::preferred_buffer_size();
#elif defined(__MVS__)
- // The buffer size on zOS is defined with macro BUFSIZ, which can be retrieved
+ // The buffer size on z/OS is defined with macro BUFSIZ, which can be retrieved
// by invoking function raw_ostream::preferred_buffer_size().
return raw_ostream::preferred_buffer_size();
#else
>From b297c25855a8a438f7f7ff4ab2b500a70efd1db2 Mon Sep 17 00:00:00 2001
From: Abhina Sreeskantharajan <Abhina.Sreeskantharajan at ibm.com>
Date: Mon, 9 Sep 2024 13:10:26 -0400
Subject: [PATCH 3/3] formatting
---
llvm/lib/Support/raw_ostream.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 5b684a3d91bcad..3d0824000337e8 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -844,8 +844,8 @@ size_t raw_fd_ostream::preferred_buffer_size() const {
return 0;
return raw_ostream::preferred_buffer_size();
#elif defined(__MVS__)
- // The buffer size on z/OS is defined with macro BUFSIZ, which can be retrieved
- // by invoking function raw_ostream::preferred_buffer_size().
+ // The buffer size on z/OS is defined with macro BUFSIZ, which can be
+ // retrieved by invoking function raw_ostream::preferred_buffer_size().
return raw_ostream::preferred_buffer_size();
#else
assert(FD >= 0 && "File not yet open!");
More information about the llvm-commits
mailing list