Skip to content

Commit 0a9f46d

Browse files
more regression
1 parent cb92439 commit 0a9f46d

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

tests/regression/77-lin2vareq/36-relations-overflow.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,33 @@
22

33
#include <goblint.h>
44

5+
// produces top value
56
int nondet() {
67
int x;
78
return x;
89
}
10+
11+
// check, that due to internal (apron-) representation via GEQ instead of LT we not by accident
12+
// impose -x>=-100 as a constraint, since this has a diffrent semantics then x<100
13+
int geqrep()
14+
{
15+
int a;
16+
int x=a;
17+
if(x<100)
18+
{
19+
__goblint_check(x<100); //SUCCESS
20+
x=x;
21+
}
22+
__goblint_check(x>=-2147483647); //UNKNOWN
23+
return 0;
24+
}
25+
926
int SIZE = 1;
1027
int rand;
1128

12-
int main() {
29+
// check, that we do not infer a wrong overflow warning, due to internally computing
30+
// with possibly overflowing signed values in sharedFunctions / texpr1_expr_of_cil_exp
31+
int overflow() {
1332
unsigned int n=2,i=8;
1433
n = i%(SIZE+2); //NOWARN
1534

@@ -19,6 +38,14 @@ int main() {
1938
n= i%(rand+2); //NOWARN
2039
}
2140

41+
2242
return 0;
2343
}
2444

45+
int main(){
46+
47+
geqrep();
48+
49+
overflow();
50+
51+
}

0 commit comments

Comments
 (0)