forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Annotate loop unwinding bounds via pragma
Enable users to specify loop unwinding information directly in source code via `#pragma CPROVER unwind N` with some number `N`. This should be less susceptible to code changes than unwindsets that use loop numbers: those loop numbers may change when code outside the named loop is modified, e.g., when adding or removing other loops.
- Loading branch information
1 parent
6752c40
commit ae74413
Showing
7 changed files
with
110 additions
and
20 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,26 @@ | ||
int main() | ||
{ | ||
#pragma CPROVER unwind 2 | ||
for(int i = 0; i < 5; ++i) | ||
{ | ||
if(i < 2) | ||
continue; | ||
|
||
for(int j = 0; j < 10; ++j) | ||
++j; | ||
} | ||
|
||
#pragma CPROVER unwind 1 | ||
do | ||
{ | ||
int x = 42; | ||
} while(0); | ||
|
||
#pragma CPROVER unwind 10 | ||
while(1) | ||
{ | ||
int x = 42; | ||
} | ||
|
||
__CPROVER_assert(0, "false"); | ||
} |
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,8 @@ | ||
CORE | ||
main.c | ||
|
||
^VERIFICATION FAILED$ | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
-- | ||
^warning: ignoring |
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