-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 27-inv_invariants/22-mine-tutorial-ex4.4 as test
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
tests/regression/27-inv_invariants/22-mine-tutorial-ex4.4.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,38 @@ | ||
// PARAM: --enable ana.int.interval | ||
#include <goblint.h> | ||
int main() { | ||
int x, y, z; | ||
__goblint_assume(0 <= x); | ||
__goblint_assume(x <= 10); | ||
__goblint_assume(5 <= y); | ||
__goblint_assume(y <= 15); | ||
__goblint_assume(-10 <= z); | ||
__goblint_assume(z <= 10); | ||
|
||
if (x >= y) { | ||
__goblint_check(5 <= x); | ||
__goblint_check(y <= 10); // why doesn't Miné refine this? | ||
} | ||
|
||
if (z >= x) { | ||
__goblint_check(0 <= z); | ||
} | ||
|
||
if (x >= y && z >= x) { // CIL transform does branches sequentially (good order) | ||
__goblint_check(5 <= x); | ||
__goblint_check(y <= 10); // why doesn't Miné refine this? | ||
__goblint_check(0 <= z); | ||
|
||
__goblint_check(5 <= z); | ||
} | ||
|
||
if (z >= x && x >= y) { // CIL transform does branches sequentially (bad order) | ||
__goblint_check(5 <= x); | ||
__goblint_check(y <= 10); // why doesn't Miné refine this? | ||
__goblint_check(0 <= z); | ||
|
||
__goblint_check(5 <= z); // TODO | ||
} | ||
|
||
return 0; | ||
} |