[llvm] r286150 - [lit] Print negative exit codes on Windows in hex

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 13:17:44 PST 2016


On Mon, Nov 7, 2016 at 4:06 PM, Reid Kleckner via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: rnk
> Date: Mon Nov  7 15:06:20 2016
> New Revision: 286150
>
> URL: http://llvm.org/viewvc/llvm-project?rev=286150&view=rev
> Log:
> [lit] Print negative exit codes on Windows in hex
>
> Negative exit codes are usually exceptions. They're easier to recognize
> in hex. Compare -1073741502 to 0xc0000142.

Thank you for this! That is going to save a bit of time now and again. :-)

~Aaron

>
> Modified:
>     llvm/trunk/utils/lit/lit/TestRunner.py
>
> Modified: llvm/trunk/utils/lit/lit/TestRunner.py
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=286150&r1=286149&r2=286150&view=diff
> ==============================================================================
> --- llvm/trunk/utils/lit/lit/TestRunner.py (original)
> +++ llvm/trunk/utils/lit/lit/TestRunner.py Mon Nov  7 15:06:20 2016
> @@ -555,8 +555,14 @@ def executeScriptInternal(test, litConfi
>
>          # Show the error conditions:
>          if result.exitCode != 0:
> -            out += "error: command failed with exit status: %d\n" % (
> -                result.exitCode,)
> +            # On Windows, a negative exit code indicates a signal, and those are
> +            # easier to recognize or look up if we print them in hex.
> +            if litConfig.isWindows and result.exitCode < 0:
> +                codeStr = hex(int(result.exitCode & 0xFFFFFFFF)).rstrip("L")
> +            else:
> +                codeStr = str(result.exitCode)
> +            out += "error: command failed with exit status: %s\n" % (
> +                codeStr,)
>          if litConfig.maxIndividualTestTime > 0:
>              out += 'error: command reached timeout: %s\n' % (
>                  str(result.timeoutReached),)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list