Skip to content

Commit b95f543

Browse files
committed
[lit] [Windows] Print exit codes > 255 as hex too
891bb48 made negative exit codes be printed as hex, which makes it easier to recognize e.g. 0xC0000005 instead of -1073741819. However, current Python versions (at least the ones I'm using) seem to end up with positive unsigned return codes, so that again ends up printed as 3221225477. Print any return code over 255 as a hexadecimal number instead. Differential Revision: https://reviews.llvm.org/D137771
1 parent ae59131 commit b95f543

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/utils/lit/lit/TestRunner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ def executeScriptInternal(test, litConfig, tmpBase, commands, cwd):
988988
if result.exitCode != 0:
989989
# On Windows, a negative exit code indicates a signal, and those are
990990
# easier to recognize or look up if we print them in hex.
991-
if litConfig.isWindows and result.exitCode < 0:
991+
if litConfig.isWindows and (result.exitCode < 0 or result.exitCode > 255):
992992
codeStr = hex(int(result.exitCode & 0xFFFFFFFF)).rstrip("L")
993993
else:
994994
codeStr = str(result.exitCode)

0 commit comments

Comments
 (0)