diff options
-rw-r--r-- | include/klee/CommandLine.h | 2 | ||||
-rw-r--r-- | lib/Basic/CmdLineOptions.cpp | 5 | ||||
-rw-r--r-- | lib/Core/Executor.cpp | 5 | ||||
-rw-r--r-- | tools/kleaver/main.cpp | 24 |
4 files changed, 28 insertions, 8 deletions
diff --git a/include/klee/CommandLine.h b/include/klee/CommandLine.h index 39290e7b..bcb490cf 100644 --- a/include/klee/CommandLine.h +++ b/include/klee/CommandLine.h @@ -20,6 +20,8 @@ extern llvm::cl::opt<bool> UseIndependentSolver; extern llvm::cl::opt<int> MinQueryTimeToLog; +extern llvm::cl::opt<double> MaxSTPTime; + ///The different query logging solvers that can switched on/off enum QueryLoggingSolverType { diff --git a/lib/Basic/CmdLineOptions.cpp b/lib/Basic/CmdLineOptions.cpp index f14b813a..714ae131 100644 --- a/lib/Basic/CmdLineOptions.cpp +++ b/lib/Basic/CmdLineOptions.cpp @@ -35,6 +35,11 @@ MinQueryTimeToLog("min-query-time-to-log", "Only queries longer than threshold will be logged. (default=0). " "Set this param to a negative value to log timeouts only.")); +llvm::cl::opt<double> +MaxSTPTime("max-stp-time", + llvm::cl::desc("Maximum amount of time for a single query (default=0s (off)). Enables --use-forked-stp"), + llvm::cl::init(0.0)); + /* Using cl::list<> instead of cl::bits<> results in quite a bit of ugliness when it comes to checking * if an option is set. Unfortunately with gcc4.7 cl::bits<> is broken with LLVM2.9 and I doubt everyone diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index b2ddb9b1..ec053597 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -201,11 +201,6 @@ namespace { cl::desc("Amount of time to dedicate to seeds, before normal search (default=0 (off))"), cl::init(0)); - cl::opt<double> - MaxSTPTime("max-stp-time", - cl::desc("Maximum amount of time for a single query (default=0s (off)). Enables --use-forked-stp"), - cl::init(0.0)); - cl::opt<unsigned int> StopAfterNInstructions("stop-after-n-instructions", cl::desc("Stop execution after specified number of instructions (default=0 (off))"), diff --git a/tools/kleaver/main.cpp b/tools/kleaver/main.cpp index 6b0008db..48c24257 100644 --- a/tools/kleaver/main.cpp +++ b/tools/kleaver/main.cpp @@ -179,8 +179,18 @@ static bool EvaluateInputAST(const char *Filename, return false; // FIXME: Support choice of solver. - Solver *S, *STP = S = - UseDummySolver ? createDummySolver() : new STPSolver(true); + Solver *S = 0; + Solver *STP = 0; + if (!UseDummySolver) { + STPSolver* stpSolver = new STPSolver(true); + if (0 != MaxSTPTime) { + stpSolver->setTimeout(MaxSTPTime); + } + STP = S = stpSolver; + } + else { + STP = S = createDummySolver(); + } if (true == optionIsSet(queryLoggingOptions, SOLVER_PC)) S = createPCLoggingSolver(S, SOLVER_QUERIES_PC_FILE_NAME, MinQueryTimeToLog); if (UseFastCexSolver) @@ -252,7 +262,15 @@ static bool EvaluateInputAST(const char *Filename, std::cout << "\n"; } } else { - std::cout << "VALID (counterexample request ignored)"; + SolverImpl::SolverRunStatus retCode = S->impl->getOperationStatusCode(); + if (SolverImpl::SOLVER_RUN_STATUS_TIMEOUT == retCode) { + std::cout << " FAIL (reason: " + << SolverImpl::getOperationStatusString(retCode) + << ")"; + } + else { + std::cout << "VALID (counterexample request ignored)"; + } } } |