-
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.
Handle
bitand
in intervals and def_exc; Add test
- Loading branch information
1 parent
0193efa
commit 526e8e4
Showing
3 changed files
with
94 additions
and
9 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
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,41 @@ | ||
// PARAM: --enable ana.int.congruence --set sem.int.signed_overflow assume_none | ||
#include <goblint.h> | ||
|
||
int main() | ||
{ | ||
// Assuming modulo expression | ||
|
||
long x; | ||
__goblint_assume(x % 2 == 1); | ||
__goblint_check(x % 2 == 1); | ||
__goblint_check(x & 1); | ||
|
||
long y; | ||
__goblint_assume(y % 2 == 0); | ||
__goblint_check(y % 2 == 0); | ||
__goblint_check(y & 1); //FAIL | ||
|
||
long z; | ||
__goblint_check(z & 1); //UNKNOWN! | ||
__goblint_assume(z % 8 == 1); | ||
__goblint_check(z & 1); | ||
|
||
long xz; | ||
__goblint_assume(xz % 3 == 1); | ||
__goblint_check(xz & 1); //UNKNOWN! | ||
__goblint_assume(xz % 6 == 1); | ||
__goblint_check(xz & 1); | ||
|
||
// Assuming bitwise expression | ||
|
||
// For some reason does not work for longs yet | ||
long a; | ||
__goblint_assume(a & 1); | ||
__goblint_check(a % 2 == 1); | ||
__goblint_check(a & 1); | ||
|
||
int b; | ||
__goblint_assume(b & 1); | ||
__goblint_check(b % 2 == 1); | ||
__goblint_check(b & 1); | ||
} |