diff options
-rw-r--r-- | lib/Core/Executor.cpp | 14 | ||||
-rw-r--r-- | lib/Core/Executor.h | 3 | ||||
-rw-r--r-- | test/Feature/MaxStaticForkPct.c | 8 |
3 files changed, 10 insertions, 15 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 6891dc93..2f806aad 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -365,10 +365,10 @@ cl::opt<double> MaxStaticCPSolvePct( "instructions (default=1.0 (always))"), cl::cat(TerminationCat)); -cl::opt<std::string> MaxStaticPctCheckDelay( +cl::opt<unsigned> MaxStaticPctCheckDelay( "max-static-pct-check-delay", - cl::desc("Time after which the --max-static-*-pct checks are enforced (default=60s)"), - cl::init("60s"), + cl::desc("Number of forks after which the --max-static-*-pct checks are enforced (default=1000)"), + cl::init(1000), cl::cat(TerminationCat)); cl::opt<std::string> TimerInterval( @@ -491,8 +491,6 @@ Executor::Executor(LLVMContext &ctx, const InterpreterOptions &opts, this->solver = new TimingSolver(solver, EqualitySubstitution); memory = new MemoryManager(&arrayCache); - maxStaticPctCheckDelay = time::Span{MaxStaticPctCheckDelay}; - initializeSearchOptions(); if (OnlyOutputStatesCoveringNew && !StatsTracker::useIStats()) @@ -979,9 +977,9 @@ ref<Expr> Executor::maxStaticPctChecks(ExecutionState ¤t, MaxStaticCPForkPct == 1. && MaxStaticCPSolvePct == 1.) return condition; - // these checks are performed only after MaxStaticPctCheckDelay time has - // passed since execution started - if (statsTracker->elapsed() <= maxStaticPctCheckDelay) + // These checks are performed only after at least MaxStaticPctCheckDelay forks + // have been performed since execution started + if (stats::forks < MaxStaticPctCheckDelay) return condition; StatisticManager &sm = *theStatisticManager; diff --git a/lib/Core/Executor.h b/lib/Core/Executor.h index db8e508c..ae960731 100644 --- a/lib/Core/Executor.h +++ b/lib/Core/Executor.h @@ -205,9 +205,6 @@ private: /// Maximum time to allow for a single instruction. time::Span maxInstructionTime; - /// Time after which the --max-static-*-pct checks are enforced - time::Span maxStaticPctCheckDelay; - /// Assumes ownership of the created array objects ArrayCache arrayCache; diff --git a/test/Feature/MaxStaticForkPct.c b/test/Feature/MaxStaticForkPct.c index 8ea5c674..e59edd1d 100644 --- a/test/Feature/MaxStaticForkPct.c +++ b/test/Feature/MaxStaticForkPct.c @@ -1,12 +1,12 @@ // RUN: %clang %s -emit-llvm %O0opt -c -g -o %t1.bc // RUN: rm -rf %t.klee-out -// RUN: %klee -max-static-fork-pct=0.2 -max-static-pct-check-delay=0s --output-dir=%t.klee-out %t1.bc 2>&1 | FileCheck --check-prefix=CHECK-pt2 %s +// RUN: %klee -max-static-fork-pct=0.2 -max-static-pct-check-delay=1 --output-dir=%t.klee-out %t1.bc 2>&1 | FileCheck --check-prefix=CHECK-pt2 %s // RUN: rm -rf %t.klee-out -// RUN: %klee -max-static-fork-pct=0.5 -max-static-pct-check-delay=0s --output-dir=%t.klee-out %t1.bc 2>&1 | FileCheck --check-prefix=CHECK-pt5 %s +// RUN: %klee -max-static-fork-pct=0.5 -max-static-pct-check-delay=1 --output-dir=%t.klee-out %t1.bc 2>&1 | FileCheck --check-prefix=CHECK-pt5 %s // RUN: rm -rf %t.klee-out -// RUN: %klee -max-static-fork-pct=0.8 -max-static-pct-check-delay=0s --output-dir=%t.klee-out %t1.bc 2>&1 | FileCheck --check-prefix=CHECK-pt8 %s +// RUN: %klee -max-static-fork-pct=0.8 -max-static-pct-check-delay=1 --output-dir=%t.klee-out %t1.bc 2>&1 | FileCheck --check-prefix=CHECK-pt8 %s // RUN: rm -rf %t.klee-out -// RUN: %klee -max-static-cpfork-pct=0.5 -max-static-pct-check-delay=0s --output-dir=%t.klee-out %t1.bc 2>&1 | FileCheck --check-prefix=CHECK-cppt5 %s +// RUN: %klee -max-static-cpfork-pct=0.5 -max-static-pct-check-delay=1 --output-dir=%t.klee-out %t1.bc 2>&1 | FileCheck --check-prefix=CHECK-cppt5 %s #include "klee/klee.h" #include <stdio.h> |