aboutsummaryrefslogtreecommitdiff
path: root/tools/driver/driver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/driver/driver.cpp')
-rw-r--r--tools/driver/driver.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp
index 61613028625b..626d006ac0d8 100644
--- a/tools/driver/driver.cpp
+++ b/tools/driver/driver.cpp
@@ -460,8 +460,9 @@ int main(int argc_, const char **argv_) {
Res = TheDriver.ExecuteCompilation(*C, FailingCommands);
// Force a crash to test the diagnostics.
- if (::getenv("FORCE_CLANG_DIAGNOSTICS_CRASH")) {
- Diags.Report(diag::err_drv_force_crash) << "FORCE_CLANG_DIAGNOSTICS_CRASH";
+ if (TheDriver.GenReproducer) {
+ Diags.Report(diag::err_drv_force_crash)
+ << !::getenv("FORCE_CLANG_DIAGNOSTICS_CRASH");
// Pretend that every command failed.
FailingCommands.clear();