-
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.
Merge pull request #1387 from goblint/issue-1373
Fix test for relational unassume with strengthening
- Loading branch information
Showing
4 changed files
with
50 additions
and
7 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
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
15 changes: 12 additions & 3 deletions
15
tests/regression/56-witness/25-apron-unassume-strengthening.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 |
---|---|---|
@@ -1,13 +1,22 @@ | ||
// SKIP PARAM: --set ana.activated[+] apron --set ana.activated[+] unassume --set witness.yaml.unassume 25-apron-unassume-strengthening.yml --enable ana.apron.strengthening --set sem.int.signed_overflow assume_none | ||
// SKIP PARAM: --set ana.activated[+] apron --set ana.activated[+] unassume --set witness.yaml.unassume 25-apron-unassume-strengthening.yml --enable ana.apron.strengthening --set sem.int.signed_overflow assume_none --set ana.apron.domain octagon | ||
#include <goblint.h> | ||
|
||
int main() { | ||
int x, y; | ||
x = 0; | ||
if (x < y) { | ||
if (x <= y) { | ||
__goblint_check(x == 0); // UNKNOWN (intentional by unassume) | ||
__goblint_check(x >= 0); | ||
__goblint_check(x < y); // TODO: https://github.com/goblint/analyzer/issues/1373 | ||
__goblint_check(x <= y); | ||
} | ||
|
||
// With type bounds we have y <= 2147483647. | ||
if (x < y) { // Assuming this implies x <= 2147483646 in closure. | ||
// Unassuming 0 <= x actually unassumes 0 <= x <= 2147483647. | ||
// Thus, strengthening cannot add x < y back. | ||
__goblint_check(x == 0); // UNKNOWN (intentional by unassume) | ||
__goblint_check(x >= 0); | ||
__goblint_check(x < y); // TODO? Used to work without type bounds: https://github.com/goblint/analyzer/issues/1373. | ||
} | ||
return 0; | ||
} |
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