aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2012-07-17 05:09:29 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2012-07-17 05:09:29 +0000
commitdf9b933aa354b8108cee028cc4726cfa9f2df62c (patch)
tree002c57be26f370e2fcd1f05b933637d46d0e4c64
parente5756792d2303f500381204845cee5b6990dcaec (diff)
[Win32] Rework crash-report since r145389.
- lib/Driver/Driver.cpp, tools/driver/driver.cpp: Exit status should not be propagated, although clang driver should catch exceptions. - test/Driver/crash-report.c: Add REQUIRES:shell for now. FIXME: setenv should work also on Lit.InternalShellRunner. - test/Driver/crash-report.c: Remove XFAIL. Thanks to Chad, To point out the issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160343 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Driver/Driver.cpp8
-rw-r--r--test/Driver/crash-report.c2
-rw-r--r--tools/driver/driver.cpp8
3 files changed, 10 insertions, 8 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index a2afb76fe5..7f6fcb1a5e 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -582,14 +582,8 @@ int Driver::ExecuteCompilation(const Compilation &C,
C.CleanupFileList(C.getResultFiles(), true);
// Failure result files are valid unless we crashed.
- if (Res < 0) {
+ if (Res < 0)
C.CleanupFileList(C.getFailureResultFiles(), true);
-#ifdef _WIN32
- // Exit status should not be negative on Win32,
- // unless abnormal termination.
- Res = 1;
-#endif
- }
}
// Print extra information about abnormal failures, if possible.
diff --git a/test/Driver/crash-report.c b/test/Driver/crash-report.c
index ffa375334c..f9f62da5f2 100644
--- a/test/Driver/crash-report.c
+++ b/test/Driver/crash-report.c
@@ -4,7 +4,7 @@
// RUN: cat %t/crash-report-*.c | FileCheck --check-prefix=CHECKSRC %s
// RUN: cat %t/crash-report-*.sh | FileCheck --check-prefix=CHECKSH %s
// REQUIRES: crash-recovery
-// XFAIL: mingw32,win32
+// REQUIRES: shell
#pragma clang __debug parser_crash
// CHECK: Preprocessed source(s) and associated run script(s) are located at:
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp
index 7813f355e4..12a93298c0 100644
--- a/tools/driver/driver.cpp
+++ b/tools/driver/driver.cpp
@@ -490,5 +490,13 @@ int main(int argc_, const char **argv_) {
llvm::llvm_shutdown();
+#ifdef _WIN32
+ // Exit status should not be negative on Win32, unless abnormal termination.
+ // Once abnormal termiation was caught, negative status should not be
+ // propagated.
+ if (Res < 0)
+ Res = 1;
+#endif
+
return Res;
}