[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 18:00:21 PST 2026


harrisonGPU wrote:

> What exactly is the issue that pops up when trying to use echo in this way on Windows?

For example:
```
$ python ../llvm/utils/update_mc_test_checks.py --llvm-mc-binary=$PWD/bin/llvm-mc.exe ../llvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_ds.txt
Error: Failed to update test ../llvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_ds.txt
Traceback (most recent call last):
  File "D:\llvm-project\llvm\utils\update_mc_test_checks.py", line 521, in main
    update_test(ti)
    ~~~~~~~~~~~^^^^
  File "D:\llvm-project\llvm\utils\update_mc_test_checks.py", line 303, in update_test
    out = invoke_tool(
        ti.args.llvm_mc_binary or mc_tool,
    ...<3 lines>...
        verbose=ti.args.verbose,
    )
  File "D:\llvm-project\llvm\utils\update_mc_test_checks.py", line 45, in invoke_tool
    out = subprocess.run(
          ~~~~~~~~~~~~~~^
        cmd,
        ^^^^
    ...<3 lines>...
        stderr=subprocess.DEVNULL,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ).stdout
    ^
  File "C:\Users\harrison\AppData\Local\Programs\Python\Python314\Lib\subprocess.py", line 577, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'echo "0x00,0x00,0x54,0xd8,0x00,0x01,0x00,0x00" | D:/llvm-project/build/bin/llvm-mc.exe -triple=amdgcn -mcpu=gfx1100 -disassemble -show-encoding' returned non-zero exit status 255.
```



https://github.com/llvm/llvm-project/pull/179381


More information about the llvm-commits mailing list