summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-06-13 12:23:56 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-06-13 12:23:56 +0000
commita2e405cb35ad2631e32ae96e57747605f35de7dc (patch)
tree335ed5f1776981a6354729140fb402eb3fcd779d /llvm/utils
parentb8ed66de4d15a02418592cf6cc0676657e37c58f (diff)
downloadbcm5719-llvm-a2e405cb35ad2631e32ae96e57747605f35de7dc.tar.gz
bcm5719-llvm-a2e405cb35ad2631e32ae96e57747605f35de7dc.zip
[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
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/not/not.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/utils/not/not.cpp b/llvm/utils/not/not.cpp
index 546f989d7fa..af942500186 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)
OpenPOWER on IntegriCloud