Skip to content

Commit 54595bd

Browse files
new ways to spot unreachable code
1 parent f949136 commit 54595bd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/regression/77-lin2vareq/35-refinement.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ void main() {
1010
int d = 13*a+11;
1111
int e = a;
1212

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

1515
__goblint_check(1 == 1); //SUCCESS
1616
__goblint_check(a > -1); //SUCCESS
@@ -35,6 +35,11 @@ void main() {
3535
__goblint_check(c > 0); //SUCCESS
3636
__goblint_check(d < 24); //SUCCESS
3737

38+
if (b < 3) {
39+
__goblint_check(0); //NOWARN (unreachable)
40+
b = 1701;
41+
}
42+
3843
// in theory, if we knew about a being constant, we could infer the following:
3944
__goblint_check(b == 3); //UNKNOWN
4045
__goblint_check(c == 5); //UNKNOWN

0 commit comments

Comments
 (0)