[llvm] [update_mc_test_checks] Fix llvm-mc invocation on Windows by avoiding echo pipe (PR #179381)
Harrison Hao via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 3 07:37:31 PST 2026
https://github.com/harrisonGPU updated https://github.com/llvm/llvm-project/pull/179381
>From b246d8dec4840f325e79ce087aa1a137497004d5 Mon Sep 17 00:00:00 2001
From: Harrison Hao <tsworld1314 at gmail.com>
Date: Tue, 3 Feb 2026 11:12:00 +0800
Subject: [PATCH] [update_mc_test_checks] Fix llvm-mc invocation on Windows by
avoiding echo pipe
---
llvm/utils/update_mc_test_checks.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/utils/update_mc_test_checks.py b/llvm/utils/update_mc_test_checks.py
index a109fba5fc075..5444ba19b598f 100755
--- a/llvm/utils/update_mc_test_checks.py
+++ b/llvm/utils/update_mc_test_checks.py
@@ -38,8 +38,7 @@ def invoke_tool(exe, check_rc, cmd_args, testline, verbose=False):
substs = SUBSTITUTIONS + [(t, exe) for t in mc_LIKE_TOOLS]
args = [common.applySubstitutions(cmd, substs) for cmd in cmd_args.split("|")]
- testline = testline.replace('"', '\\"')
- cmd = 'echo "' + testline + '" | ' + exe + " " + " | ".join(args)
+ cmd = exe + " " + " | ".join(args)
if verbose:
print("Command: ", cmd)
@@ -47,6 +46,7 @@ def invoke_tool(exe, check_rc, cmd_args, testline, verbose=False):
cmd,
shell=True,
check=check_rc,
+ input=(testline + "\n").encode("utf-8"),
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
).stdout
More information about the llvm-commits
mailing list