Skip to content

Commit

Permalink
new ways to spot unreachable code
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMichaelPetter committed Nov 29, 2024
1 parent f949136 commit 54595bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/regression/77-lin2vareq/35-refinement.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void main() {
int d = 13*a+11;
int e = a;

if (b < 5){ // a < 1
if (b < 5){ // a > -1

__goblint_check(1 == 1); //SUCCESS
__goblint_check(a > -1); //SUCCESS
Expand All @@ -35,6 +35,11 @@ void main() {
__goblint_check(c > 0); //SUCCESS
__goblint_check(d < 24); //SUCCESS

if (b < 3) {
__goblint_check(0); //NOWARN (unreachable)
b = 1701;
}

// in theory, if we knew about a being constant, we could infer the following:
__goblint_check(b == 3); //UNKNOWN
__goblint_check(c == 5); //UNKNOWN
Expand Down

0 comments on commit 54595bd

Please sign in to comment.