-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an over-approximation model for sysconf
Signed-off-by: Felipe R. Monteiro <felisous@amazon.com>
- Loading branch information
1 parent
64bf1ca
commit 830a60f
Showing
3 changed files
with
70 additions
and
0 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,27 @@ | ||
#include <errno.h> | ||
#include <unistd.h> | ||
|
||
main() | ||
{ | ||
long result; | ||
int name; | ||
|
||
errno = 0; | ||
// Testing sysconf as an over-apporximation. | ||
// We expect to cover all branches, thus, all assertions should fail. | ||
if((result = sysconf(name)) == -1) | ||
{ | ||
if(errno == 0) | ||
{ | ||
__CPROVER_assert(0, "ARG_MAX is not supported"); | ||
} | ||
else | ||
{ | ||
__CPROVER_assert(0, "sysconf() error"); | ||
} | ||
} | ||
else | ||
{ | ||
__CPROVER_assert(0, "ARG_MAX is supported"); | ||
} | ||
} |
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,12 @@ | ||
CORE unix | ||
main.c | ||
|
||
^\[main.assertion.\d+\] line \d+ ARG\_MAX is not supported: FAILURE$ | ||
^\[main.assertion.\d+\] line \d+ sysconf\(\) error: FAILURE$ | ||
^\[main.assertion.\d+\] line \d+ ARG\_MAX is supported: FAILURE$ | ||
^\*\* 3 of 3 failed .*$ | ||
^VERIFICATION FAILED$ | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
-- | ||
^WARNING: no body for function sysconf |
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