-
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 #1519 from goblint/imaxabs
Partially support `imaxabs` for SV-COMP
- Loading branch information
Showing
9 changed files
with
111 additions
and
32 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
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,24 @@ | ||
//PARAM: --enable ana.int.interval --set ana.activated[+] tmpSpecial | ||
#include<stdlib.h> | ||
#include <stdint.h> | ||
#include <inttypes.h> | ||
int main() { | ||
int64_t data; | ||
if (data > (-0x7fffffffffffffff - 1)) | ||
{ | ||
if (imaxabs(data) < 100) | ||
{ | ||
__goblint_check(data < 100); | ||
__goblint_check(-100 < data); | ||
int64_t result = data * data; // NOWARN | ||
} | ||
|
||
if(imaxabs(data) <= 100) | ||
{ | ||
__goblint_check(data <= 100); | ||
__goblint_check(-100 <= data); | ||
int64_t result = data * data; // NOWARN | ||
} | ||
} | ||
return 8; | ||
} |
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,12 @@ | ||
//PARAM: --enable ana.int.interval --enable ana.float.interval --enable ana.float.evaluate_math_functions --set ana.activated[+] tmpSpecial | ||
#include<math.h> | ||
#include <stdint.h> | ||
#include <inttypes.h> | ||
int main() { | ||
int64_t data; | ||
if (data > (-0x7fffffffffffffff - 1) && imaxabs((intmax_t)data) <= sqrtl(0x7fffffffffffffffLL)) | ||
{ | ||
int64_t result = data * data; // TODO NOWARN | ||
} | ||
return 8; | ||
} |
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,25 @@ | ||
//PARAM: --enable ana.int.interval --set ana.activated[+] tmpSpecial | ||
// 39-signed-overflows/11-imaxabs, but with long long as int64_t instead (https://github.com/goblint/analyzer/pull/1519#issuecomment-2417032186). | ||
#include<stdlib.h> | ||
#include <stdint.h> | ||
#include <inttypes.h> | ||
int main() { | ||
long long data; | ||
if (data > (-0x7fffffffffffffff - 1)) | ||
{ | ||
if (imaxabs(data) < 100) | ||
{ | ||
__goblint_check(data < 100); | ||
__goblint_check(-100 < data); | ||
long long result = data * data; // NOWARN | ||
} | ||
|
||
if(imaxabs(data) <= 100) | ||
{ | ||
__goblint_check(data <= 100); | ||
__goblint_check(-100 <= data); | ||
long long result = data * data; // NOWARN | ||
} | ||
} | ||
return 8; | ||
} |