-
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.
Implemented oerflow handling and added corresponding tests
- Loading branch information
Showing
6 changed files
with
149 additions
and
62 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
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 @@ | ||
// SKIP PARAM: --set ana.activated[+] lin2vareq --set sem.int.signed_overflow assume_none | ||
|
||
#include <stdio.h> | ||
|
||
int main() { | ||
int x; | ||
int k; | ||
int y; | ||
|
||
x = k + 1; | ||
|
||
__goblint_check(x == k + 1); // SUCCESS | ||
|
||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SKIP PARAM: --set ana.activated[+] lin2vareq --enable ana.int.interval | ||
|
||
#include <stdio.h> | ||
|
||
int main() { | ||
int x; | ||
int k; | ||
int y; | ||
|
||
x = k + 1; | ||
//there might be an overflow | ||
__goblint_check(x == k + 1); // UNKNOWN! | ||
|
||
int unknown; | ||
|
||
if (unknown < 300 && unknown > 0) { | ||
x = unknown; | ||
// an overflow is not possible | ||
__goblint_check(x == unknown); // SUCCESS | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//SKIP PARAM: --set ana.activated[+] lin2vareq --set sem.int.signed_overflow assume_top --enable ana.int.interval | ||
// same test as 63-affeq/10-bounds_guards.ov.c | ||
int main() { | ||
int x, y; | ||
int p = 0; | ||
|
||
if (x - 2 == __INT32_MAX__) { | ||
__goblint_check(x == __INT32_MAX__ + 2); //UNKNOWN! | ||
p = 1; | ||
} | ||
|
||
__goblint_check(p == 0); //UNKNOWN! | ||
|
||
if (x + y == __INT32_MAX__) { | ||
__goblint_check(1); | ||
} | ||
|
||
} |