40using namespace SVFUtil;
45 "symbolic abstraction test",
51 "abstract execution basic function test",
69 outs() <<
"hello print\n";
75 auto start_time = std::chrono::high_resolution_clock::now();
77 auto end_time = std::chrono::high_resolution_clock::now();
78 auto duration = std::chrono::duration_cast<std::chrono::microseconds>(
87 auto start_time = std::chrono::high_resolution_clock::now();
89 auto end_time = std::chrono::high_resolution_clock::now();
90 auto duration = std::chrono::duration_cast<std::chrono::microseconds>(
92 outs() <<
"running time of Bilateral: " <<
duration.count()
99 auto start_time = std::chrono::high_resolution_clock::now();
101 auto end_time = std::chrono::high_resolution_clock::now();
102 auto duration = std::chrono::duration_cast<std::chrono::microseconds>(
105 <<
" microseconds\n";
111 outs() <<
sucMsg(
"\t SUCCESS :") <<
"test1_1 start\n";
135 for (
auto r :
resRSY.getVarToVal())
137 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
145 outs() <<
"test1_2 start\n";
170 for (
auto r :
resRSY.getVarToVal())
172 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
180 outs() <<
"test2_1 start\n";
193 itv[2] =
itv[1].getInterval() -
itv[0].getInterval();
208 for (
auto r :
resRSY.getVarToVal())
210 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
222 outs() <<
"test2_2 start\n";
235 itv[2] =
itv[1].getInterval() -
itv[0].getInterval();
251 for (
auto r :
resRSY.getVarToVal())
253 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
265 outs() <<
"test2_3 start\n";
278 itv[2] =
itv[1].getInterval() -
itv[0].getInterval();
294 for (
auto r :
resRSY.getVarToVal())
296 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
308 outs() <<
"test2_4 start\n";
321 itv[2] =
itv[1].getInterval() -
itv[0].getInterval();
337 for (
auto r :
resRSY.getVarToVal())
339 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
351 outs() <<
"test2_5 start\n";
364 itv[2] =
itv[1].getInterval() -
itv[0].getInterval();
380 for (
auto r :
resRSY.getVarToVal())
382 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
394 outs() <<
"test3_1 start\n";
407 itv[2] =
itv[1].getInterval() /
itv[0].getInterval();
422 for (
auto r :
resRSY.getVarToVal())
424 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
436 outs() <<
"test3_2 start\n";
449 itv[2] =
itv[1].getInterval() /
itv[0].getInterval();
464 for (
auto r :
resRSY.getVarToVal())
466 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
478 outs() <<
"test3_3 start\n";
491 itv[2] =
itv[1].getInterval() /
itv[0].getInterval();
506 for (
auto r :
resRSY.getVarToVal())
508 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
519 outs() <<
"test3_4 start\n";
532 itv[2] =
itv[1].getInterval() /
itv[0].getInterval();
547 for (
auto r :
resRSY.getVarToVal())
549 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
561 outs() <<
"test4_1 start\n";
574 itv[2] =
itv[1].getInterval() /
itv[0].getInterval();
585 outs() <<
"rsy done\n";
587 outs() <<
"bilateral done\n";
589 outs() <<
"bs done\n";
592 for (
auto r :
resBS.getVarToVal())
594 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
608 saTest.testRelExeState1_2();
610 saTest.testRelExeState2_1();
611 saTest.testRelExeState2_2();
612 saTest.testRelExeState2_3();
616 saTest.testRelExeState3_1();
617 saTest.testRelExeState3_2();
621 outs() <<
"start top\n";
622 saTest.testRelExeState4_1();
839 as.printAbstractState();
866 arg_num,
arg_value,
"Static Symbolic Execution",
"[options] <input-bitcode...>"
893 ae.
addDetector(std::make_unique<BufOverflowDetector>());
895 ae.
addDetector(std::make_unique<NullptrDerefDetector>());
int main(int argc, char **argv)
static Option< bool > SYMABS("symabs", "symbolic abstraction test", false)
static Option< bool > AETEST("aetest", "abstract execution basic function test", false)
static std::vector< std::string > parseOptions(int argc, char *argv[], std::string description, std::string callFormat)
virtual void runOnModule()
void addDetector(std::unique_ptr< AEDetector > detector)
static AbstractInterpretation & getAEInstance()
Map< u32_t, AbstractValue > VarToAbsValMap
AbstractState sliceState(Set< u32_t > &sl)
Copy some values and return a new IntervalExeState.
void join_with(const AbstractValue &other)
static AndersenWaveDiff * createAndersenWaveDiff(SVFIR *_pag)
Create an singleton instance directly instead of invoking llvm pass manager.
static void releaseAndersenWaveDiff()
static BoundedInt minus_infinity()
Get minus infinity -inf.
static IntervalValue bottom()
Create the bottom IntervalValue [+inf, -inf].
static BoundedInt plus_infinity()
Get plus infinity +inf.
static IntervalValue top()
Create the IntervalValue [-inf, +inf].
static LLVMModuleSet * getLLVMModuleSet()
static void releaseLLVMModuleSet()
static void buildSVFModule(Module &mod)
static const Option< bool > NullDerefCheck
nullptr dereference checker, Default: false
static const Option< bool > BufferOverflowCheck
buffer overflow checker, Default: false
CallGraph * getCallGraph() const
Return call graph.
static z3::context & getContext()
Get z3 context, singleton design here to make sure we only have one context.
AbstractState BS_time(AbstractState &inv, const Z3Expr &phi, RelationSolver &rs)
void testRelExeState1_2()
SymblicAbstractionTest()=default
void testRelExeState2_4()
void testRelExeState2_1()
void testRelExeState2_2()
void testRelExeState3_2()
~SymblicAbstractionTest()=default
void testRelExeState2_3()
void testRelExeState3_3()
AbstractState RSY_time(AbstractState &inv, const Z3Expr &phi, RelationSolver &rs)
void testRelExeState4_1()
void testRelExeState2_5()
void testRelExeState3_1()
void testRelExeState1_1()
AbstractState Bilateral_time(AbstractState &inv, const Z3Expr &phi, RelationSolver &rs)
static z3::context & getContext()
void testRelExeState3_4()
std::string sucMsg(const std::string &msg)
Returns successful message by converting a string into green string output.
std::ostream & outs()
Overwrite llvm::outs()
llvm::IRBuilder IRBuilder