-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CONTRACTS: redirect checks to outer write set for loops that get skipped
- Loading branch information
Remi Delmas
committed
Aug 16, 2024
1 parent
a8b8f0f
commit 88bb4cc
Showing
5 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
regression/contracts-dfcc/skip_loop_instrumentation/harness.c
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,29 @@ | ||
int global; | ||
|
||
int harness(int argc) | ||
{ | ||
global = 0; | ||
argc = 1; | ||
do | ||
{ | ||
int local; | ||
global = 1; | ||
local = 1; | ||
for(int i = 0; i < 1; i++) | ||
{ | ||
local = 1; | ||
global = 2; | ||
int j = 0; | ||
while(j < 1) | ||
{ | ||
local = 1; | ||
global = 3; | ||
j++; | ||
} | ||
__CPROVER_assert(global == 3, "case3"); | ||
} | ||
__CPROVER_assert(global == 3, "case3"); | ||
} while(0); | ||
__CPROVER_assert(global == 3, "case1"); | ||
return 0; | ||
} |
11 changes: 11 additions & 0 deletions
11
regression/contracts-dfcc/skip_loop_instrumentation/test.desc
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,11 @@ | ||
CORE | ||
harness.c --function harness | ||
--dfcc harness --apply-loop-contracts | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
-- | ||
^warning: ignoring | ||
-- | ||
This test case checks that when the instrumentation of nested loops is skipped, we redirect the write set checks to the | ||
outer write set. |
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