From: NAKAMURA Takumi Date: Fri, 13 Jun 2014 12:23:56 +0000 (+0000) Subject: [Win32] Let utils/not aware of abort(), aka llvm_unreachable(), in msvcrt. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2e405cb35ad2631e32ae96e57747605f35de7dc;p=platform%2Fupstream%2Fllvm.git [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? llvm-svn: 210895 --- diff --git a/llvm/utils/not/not.cpp b/llvm/utils/not/not.cpp index 546f989..af94250 100644 --- a/llvm/utils/not/not.cpp +++ b/llvm/utils/not/not.cpp @@ -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)