39using namespace SVFUtil;
44 "symbolic abstraction test",
50 "abstract execution basic function test",
68 outs() <<
"hello print\n";
74 auto start_time = std::chrono::high_resolution_clock::now();
76 auto end_time = std::chrono::high_resolution_clock::now();
77 auto duration = std::chrono::duration_cast<std::chrono::microseconds>(
86 auto start_time = std::chrono::high_resolution_clock::now();
88 auto end_time = std::chrono::high_resolution_clock::now();
89 auto duration = std::chrono::duration_cast<std::chrono::microseconds>(
91 outs() <<
"running time of Bilateral: " <<
duration.count()
98 auto start_time = std::chrono::high_resolution_clock::now();
100 auto end_time = std::chrono::high_resolution_clock::now();
101 auto duration = std::chrono::duration_cast<std::chrono::microseconds>(
104 <<
" microseconds\n";
110 outs() <<
sucMsg(
"\t SUCCESS :") <<
"test1_1 start\n";
134 for (
auto r :
resRSY.getVarToVal())
136 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
144 outs() <<
"test1_2 start\n";
169 for (
auto r :
resRSY.getVarToVal())
171 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
179 outs() <<
"test2_1 start\n";
192 itv[2] =
itv[1].getInterval() -
itv[0].getInterval();
207 for (
auto r :
resRSY.getVarToVal())
209 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
221 outs() <<
"test2_2 start\n";
234 itv[2] =
itv[1].getInterval() -
itv[0].getInterval();
250 for (
auto r :
resRSY.getVarToVal())
252 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
264 outs() <<
"test2_3 start\n";
277 itv[2] =
itv[1].getInterval() -
itv[0].getInterval();
293 for (
auto r :
resRSY.getVarToVal())
295 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
307 outs() <<
"test2_4 start\n";
320 itv[2] =
itv[1].getInterval() -
itv[0].getInterval();
336 for (
auto r :
resRSY.getVarToVal())
338 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
350 outs() <<
"test2_5 start\n";
363 itv[2] =
itv[1].getInterval() -
itv[0].getInterval();
379 for (
auto r :
resRSY.getVarToVal())
381 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
393 outs() <<
"test3_1 start\n";
406 itv[2] =
itv[1].getInterval() /
itv[0].getInterval();
421 for (
auto r :
resRSY.getVarToVal())
423 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
435 outs() <<
"test3_2 start\n";
448 itv[2] =
itv[1].getInterval() /
itv[0].getInterval();
463 for (
auto r :
resRSY.getVarToVal())
465 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
477 outs() <<
"test3_3 start\n";
490 itv[2] =
itv[1].getInterval() /
itv[0].getInterval();
505 for (
auto r :
resRSY.getVarToVal())
507 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
518 outs() <<
"test3_4 start\n";
531 itv[2] =
itv[1].getInterval() /
itv[0].getInterval();
546 for (
auto r :
resRSY.getVarToVal())
548 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
560 outs() <<
"test4_1 start\n";
573 itv[2] =
itv[1].getInterval() /
itv[0].getInterval();
584 outs() <<
"rsy done\n";
586 outs() <<
"bilateral done\n";
588 outs() <<
"bs done\n";
591 for (
auto r :
resBS.getVarToVal())
593 outs() <<
r.first <<
" " <<
r.second.getInterval() <<
"\n";
607 saTest.testRelExeState1_2();
609 saTest.testRelExeState2_1();
610 saTest.testRelExeState2_2();
611 saTest.testRelExeState2_3();
615 saTest.testRelExeState3_1();
616 saTest.testRelExeState3_2();
620 outs() <<
"start top\n";
621 saTest.testRelExeState4_1();
835 as.storeValue(3,
as[1]);
836 as.storeValue(4,
as[2]);
837 as.printAbstractState();
838 assert(
as.loadValue(3).equals(
as[1]) &&
as.loadValue(4).equals(
as[2]));
860 arg_num,
arg_value,
"Static Symbolic Execution",
"[options] <input-bitcode...>"
883 builder.updateCallGraph(callgraph);
887 ae.addDetector(std::make_unique<BufOverflowDetector>());
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)
AbstractInterpretation is same as Abstract Execution.
static AbstractInterpretation & getAEInstance()
Map< u32_t, AbstractValue > VarToAbsValMap
static bool eqVarToValMap(const VarToAbsValMap &lhs, const VarToAbsValMap &rhs)
AbstractState sliceState(Set< u32_t > &sl)
Copy some values and return a new IntervalExeState.
static AndersenWaveDiff * createAndersenWaveDiff(SVFIR *_pag)
Create an singleton instance directly instead of invoking llvm pass manager.
void updateCallGraph(PTACallGraph *callgraph)
update ICFG for indirect calls
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 SVFModule * buildSVFModule(Module &mod)
static const Option< bool > BufferOverflowCheck
buffer overflow checker, Default: false
PTACallGraph * 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