[llvm] r210895 - [Win32] Let utils/not aware of abort(), aka llvm_unreachable(), in msvcrt.

Reid Kleckner rnk at google.com
Mon Jun 23 14:35:14 PDT 2014


This broke Clang's test/Index/comment-xml-schema.c test for me.  Apparently
I'm picking up xmllint.exe from Cygwin, and it exits with exit code 3 when
something fails to validate.


On Fri, Jun 13, 2014 at 5:23 AM, NAKAMURA Takumi <geek4civic at gmail.com>
wrote:

> Author: chapuni
> Date: Fri Jun 13 07:23:56 2014
> New Revision: 210895
>
> URL: http://llvm.org/viewvc/llvm-project?rev=210895&view=rev
> Log:
> [Win32] Let utils/not aware of abort(), aka llvm_unreachable(), in msvcrt.
>
> It has exit code as 3. abort(), aka unreachable, may be handled as crash.
>
> FIXME: Could we move this into Win32/Program.inc?
>
> Modified:
>     llvm/trunk/utils/not/not.cpp
>
> Modified: llvm/trunk/utils/not/not.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/not/not.cpp?rev=210895&r1=210894&r2=210895&view=diff
>
> ==============================================================================
> --- llvm/trunk/utils/not/not.cpp (original)
> +++ llvm/trunk/utils/not/not.cpp Fri Jun 13 07:23:56 2014
> @@ -32,6 +32,13 @@ int main(int argc, const char **argv) {
>    std::string ErrMsg;
>    int Result = sys::ExecuteAndWait(Program, argv, nullptr, nullptr, 0, 0,
>                                     &ErrMsg);
> +#ifdef _WIN32
> +  // Handle abort() in msvcrt -- It has exit code as 3.
> +  // abort(), aka unreachable, may be handled as crash.
> +  // FIXME: Could we move this into Win32/Program.inc?
> +  if (Result == 3)
> +    Result = -3;
> +#endif
>    if (Result < 0) {
>      errs() << "Error: " << ErrMsg << "\n";
>      if (ExpectCrash)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140623/24be370d/attachment.html>


More information about the llvm-commits mailing list