-
Notifications
You must be signed in to change notification settings - Fork 84
Incremental analysis: Eagerly analyze functions in force-reanalyze, even when reluctant is on
#600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a240454
Add test case for precision refinement with reluctant destabilization
jerhard 7601be8
Set incremental.verify to false for test case, so that fix-point not …
jerhard 3cff7e1
Destabilize the entry points of force-reanalyzed functions, even when…
jerhard d2ff7fe
Reluctant analysis: For functions in force-analyze, destabilize entry…
jerhard 870ddff
Fix indentation
jerhard 176be87
Add test for reluctant analysis with changing in-code precision annot…
jerhard 625818a
Add unkowns from partially changed functions to obsolete_prim when re…
jerhard 433b646
Query option incremental.reluctant.on only once in td3 and store it i…
jerhard 2b465c3
Add tests case for adding in-code precision annotation for a dynamica…
jerhard dc01a29
Add comment on why we can ommit check whether partially changed funct…
jerhard 2e05e88
Add force-reanalyze as field to change_info
jerhard a24dd86
Add additional field for functions to be force-reanalyzed in change i…
jerhard 610d548
Fix typo in test case annotation
jerhard b47e01d
Collect varinfos of force-reanalyze functions in set, instead of fund…
jerhard fbe16e9
Fix comments in compareCIL.
jerhard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,17 @@ | ||
| #include<assert.h> | ||
|
|
||
| int f(int in){ | ||
| while(in < 17) { | ||
| in++; | ||
| } | ||
| assert(in == 17); //UNKNOWN | ||
| return in; | ||
| } | ||
|
|
||
| int main() { | ||
| int a = 0; | ||
| assert(a); // FAIL! | ||
| a = f(a); | ||
| assert(a == 17); //UNKNOWN | ||
| return 0; | ||
| } |
21 changes: 21 additions & 0 deletions
21
tests/incremental/01-force-reanalyze/01-int-reluctant.json
This file contains hidden or 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,21 @@ | ||
| { | ||
| "annotation" : { | ||
| "int" : { | ||
| "enabled" : true | ||
| } | ||
| }, | ||
| "ana" : { | ||
| "int" : { | ||
| "refinement" : "fixpoint" | ||
| } | ||
| }, | ||
| "incremental" : { | ||
| "force-reanalyze" : { | ||
| "funs": ["f"] | ||
| }, | ||
| "reluctant" : { | ||
| "on": true | ||
| }, | ||
| "verify": false | ||
| } | ||
| } |
37 changes: 37 additions & 0 deletions
37
tests/incremental/01-force-reanalyze/01-int-reluctant.patch
This file contains hidden or 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,37 @@ | ||
| diff --git tests/incremental/01-force-reanalyze/01-int-reluctant.c tests/incremental/01-force-reanalyze/01-int-reluctant.c | ||
| index 38187f1c0..6126fe8cf 100644 | ||
| --- tests/incremental/01-force-reanalyze/01-int-reluctant.c | ||
| +++ tests/incremental/01-force-reanalyze/01-int-reluctant.c | ||
| @@ -4,7 +4,7 @@ int f(int in){ | ||
| while(in < 17) { | ||
| in++; | ||
| } | ||
| - assert(in == 17); //UNKNOWN | ||
| + assert(in == 17); | ||
| return in; | ||
| } | ||
|
|
||
| @@ -12,6 +12,6 @@ int main() { | ||
| int a = 0; | ||
| assert(a); // FAIL! | ||
| a = f(a); | ||
| - assert(a == 17); //UNKNOWN | ||
| + assert(a == 17); | ||
| return 0; | ||
| } | ||
| diff --git tests/incremental/01-force-reanalyze/01-int-reluctant.json tests/incremental/01-force-reanalyze/01-int-reluctant.json | ||
| index d58c2254b..8834d182d 100644 | ||
| --- tests/incremental/01-force-reanalyze/01-int-reluctant.json | ||
| +++ tests/incremental/01-force-reanalyze/01-int-reluctant.json | ||
| @@ -2,6 +2,11 @@ | ||
| "annotation" : { | ||
| "int" : { | ||
| "enabled" : true | ||
| + }, | ||
| + "goblint_precision": { | ||
| + "interval": [ | ||
| + "f" | ||
| + ] | ||
| } | ||
| }, | ||
| "ana" : { |
17 changes: 17 additions & 0 deletions
17
tests/incremental/03-precision-annotation/02-reluctant-int-annotation.c
This file contains hidden or 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,17 @@ | ||
| #include<assert.h> | ||
|
|
||
| int f(int in){ | ||
| while(in < 17) { | ||
| in++; | ||
| } | ||
| assert(in == 17); //UNKNOWN | ||
| return in; | ||
| } | ||
|
|
||
| int main() { | ||
| int a = 0; | ||
| assert(a); // FAIL! | ||
| a = f(a); | ||
| assert(a == 17); //UNKNOWN | ||
| return 0; | ||
| } |
18 changes: 18 additions & 0 deletions
18
tests/incremental/03-precision-annotation/02-reluctant-int-annotation.json
This file contains hidden or 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 @@ | ||
| { | ||
| "annotation": { | ||
| "int": { | ||
| "enabled": true | ||
| } | ||
| }, | ||
| "ana": { | ||
| "int": { | ||
| "refinement": "fixpoint" | ||
| } | ||
| }, | ||
| "incremental": { | ||
| "reluctant": { | ||
| "on": true | ||
| }, | ||
| "verify": false | ||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
tests/incremental/03-precision-annotation/02-reluctant-int-annotation.patch
This file contains hidden or 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 @@ | ||
| diff --git tests/incremental/03-precision-annotation/02-reluctant-int-annotation.c tests/incremental/03-precision-annotation/02-reluctant-int-annotation.c | ||
| index 38187f1c0..698e45b62 100644 | ||
| --- tests/incremental/03-precision-annotation/02-reluctant-int-annotation.c | ||
| +++ tests/incremental/03-precision-annotation/02-reluctant-int-annotation.c | ||
| @@ -1,10 +1,11 @@ | ||
| #include<assert.h> | ||
|
|
||
| +int f(int in) __attribute__ ((goblint_precision("def_exc", "interval"))); | ||
| int f(int in){ | ||
| while(in < 17) { | ||
| in++; | ||
| } | ||
| - assert(in == 17); //UNKNOWN | ||
| + assert(in == 17); | ||
| return in; | ||
| } | ||
|
|
||
| @@ -12,6 +13,6 @@ int main() { | ||
| int a = 0; | ||
| assert(a); // FAIL! | ||
| a = f(a); | ||
| - assert(a == 17); //UNKNOWN | ||
| + assert(a == 17); | ||
| return 0; | ||
| } |
24 changes: 24 additions & 0 deletions
24
tests/incremental/03-precision-annotation/03-reluctant-int-annotation-dyn.c
This file contains hidden or 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 @@ | ||
| #include<assert.h> | ||
|
|
||
| typedef int int_to_int_fun (int); | ||
|
|
||
| int f(int in){ | ||
| while(in < 17) { | ||
| in++; | ||
| } | ||
| assert(in == 17); //UNKNOWN | ||
| return in; | ||
| } | ||
|
|
||
| int_to_int_fun *get_fun(){ | ||
| return &f; | ||
| } | ||
|
|
||
| int main() { | ||
| int_to_int_fun *fun = get_fun(); | ||
| int a = 0; | ||
| assert(a); // FAIL! | ||
| a = fun(a); | ||
| assert(a == 17); //UNKNOWN | ||
| return 0; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.