about summary refs log tree commit diff homepage
path: root/tools
diff options
context:
space:
mode:
authorCristian Cadar <cristic@cs.stanford.edu>2013-03-06 18:28:12 +0000
committerCristian Cadar <cristic@cs.stanford.edu>2013-03-06 18:28:12 +0000
commit508d56ea83774a2af65e27ce0635840ed9898b49 (patch)
tree45963d9bee3de401464dcf377bbfd0cd7dadca1f /tools
parentc7ffcff9f238448e19fafc6ab84d244a18d687f8 (diff)
downloadklee-508d56ea83774a2af65e27ce0635840ed9898b49.tar.gz
Patch by Tomek Kuchta which adds the --max-stp-time option to Kleaver.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@176571 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/kleaver/main.cpp24
1 files changed, 21 insertions, 3 deletions
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)";
+          }
         }
       }