forked from Generative-Program-Analysis/GenSym
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate open and openat syscall skeleton (Generative-Program-Analysi…
…s#29) * generate open and openat syscall skeleton * added parameters to specify symbolic files in FS * implement return status in sym_exit * added CI test for open * fs refactor - removed reference from get_fs, set_fs - replace manually with generated open * added effect to write_fs * added FS to remap * generated open passes tests * fix assert test * address comments * fixed sym_exit * fix impure header
- Loading branch information
1 parent
254f2b3
commit 88783e5
Showing
15 changed files
with
176 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifdef KLEE | ||
#include <klee/klee.h> | ||
#endif | ||
#include <fcntl.h> | ||
|
||
int main() | ||
{ | ||
char filename[] = "A"; | ||
int fd = open(filename, O_RDONLY); | ||
if (fd == -1) { | ||
// no parameter | ||
sym_exit(1); | ||
} else { | ||
// --add-sym-file A | ||
sym_exit(0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* LLSC - External utility functions and library modeling functions */ | ||
/* Generated by sai.llsc.TestGenerateExternal */ | ||
#ifndef LLSC_EXTERNAL_HEADERS_GEN | ||
#define LLSC_EXTERNAL_HEADERS_GEN | ||
|
||
/************* Function Declarations **************/ | ||
immer::flex_vector<std::pair<SS, PtrVal>> open(SS, immer::flex_vector<PtrVal>); | ||
|
||
/************* Functions **************/ | ||
inline immer::flex_vector<std::pair<SS, PtrVal>> open(SS x1, immer::flex_vector<PtrVal> x2) { | ||
PtrVal x3 = x2.at(0); | ||
FS x4 = x1.get_fs(); | ||
x1.set_fs(x4); | ||
return immer::flex_vector<std::pair<SS, PtrVal>>{std::make_pair(x1, make_IntV(x4.open_file(get_string(x3, x1), 0), 32))}; | ||
} | ||
#endif // LLSC_EXTERNAL_HEADERS_GEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.