-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8095 from tautschnig/bugfixes/contracts-loop-norm…
…alisation Code contracts: do not interleave checking and instrumenting
- Loading branch information
Showing
8 changed files
with
111 additions
and
45 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
16 changes: 16 additions & 0 deletions
16
regression/contracts-dfcc/loop_contracts_do_while/nested.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,16 @@ | ||
#include <assert.h> | ||
|
||
int main() | ||
{ | ||
int x = 0; | ||
|
||
do | ||
{ | ||
do | ||
{ | ||
x++; | ||
} while(0); | ||
} while(0); | ||
|
||
assert(x <= 10); | ||
} |
9 changes: 9 additions & 0 deletions
9
regression/contracts-dfcc/loop_contracts_do_while/nested.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,9 @@ | ||
KNOWNBUG | ||
nested.c | ||
--dfcc main --apply-loop-contracts | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
-- | ||
-- | ||
We spuriously report that x is not assignable. |
8 changes: 4 additions & 4 deletions
8
regression/contracts-dfcc/loop_contracts_reject_loops_two_latches/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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
CORE dfcc-only | ||
main.c | ||
--dfcc main --apply-loop-contracts | ||
^Found loop with more than one latch instruction$ | ||
^EXIT=(6|10)$ | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
-- | ||
^Found loop with more than one latch instruction$ | ||
-- | ||
This test checks that our loop contract instrumentation verifies that loops | ||
nested in loops with contracts also have contracts. | ||
This test checks that our loop contract instrumentation first transforms loops | ||
so as to only have a single loop latch. |
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