[llvm] r324713 - [bugpoint] Report non-existent opt binary
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 8 22:09:15 PST 2018
Author: vedantk
Date: Thu Feb 8 22:09:15 2018
New Revision: 324713
URL: http://llvm.org/viewvc/llvm-project?rev=324713&view=rev
Log:
[bugpoint] Report non-existent opt binary
Bugpoint will keep going even if the opt binary it's given doesn't
exist. It should at least alert the user, so it's clear why reductions
are failing.
Modified:
llvm/trunk/test/BugPoint/unsymbolized.ll
llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
Modified: llvm/trunk/test/BugPoint/unsymbolized.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/BugPoint/unsymbolized.ll?rev=324713&r1=324712&r2=324713&view=diff
==============================================================================
--- llvm/trunk/test/BugPoint/unsymbolized.ll (original)
+++ llvm/trunk/test/BugPoint/unsymbolized.ll Thu Feb 8 22:09:15 2018
@@ -4,6 +4,7 @@
; RUN: echo "exit(1)" >> %t.py
; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -opt-command="%python" -opt-args %t.py | FileCheck %s
; RUN: not --crash opt -load %llvmshlibdir/BugpointPasses%shlibext %s -bugpoint-crashcalls -disable-symbolication 2>&1 | FileCheck --check-prefix=CRASH %s
+; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -opt-command=%t.non.existent.opt.binary -opt-args %t.py 2>&1 | FileCheck %s --check-prefix=BAD-OPT
; Test that bugpoint disables symbolication on the opt tool to reduce runtime overhead when opt crashes
; CHECK: args = {{.*}}'-disable-symbolication'
@@ -15,6 +16,7 @@
; now.
; CRASH-NOT: Signals.inc
+; BAD-OPT: Specified `opt' binary does not exist: {{.*}}non.existent.opt.binary
define void @f() {
call void @f()
ret void
Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=324713&r1=324712&r2=324713&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Thu Feb 8 22:09:15 2018
@@ -177,6 +177,10 @@ bool BugDriver::runPasses(Module *Progra
errs() << "Cannot find `opt' in PATH!\n";
return 1;
}
+ if (!sys::fs::exists(tool)) {
+ errs() << "Specified `opt' binary does not exist: " << tool << "\n";
+ return 1;
+ }
std::string Prog;
if (UseValgrind) {
More information about the llvm-commits
mailing list