File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
tests/regression/77-lin2vareq Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 22
33#include <goblint.h>
44
5+ // produces top value
56int 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+
926int SIZE = 1 ;
1027int 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+ }
You can’t perform that action at this time.
0 commit comments