Skip to content

Commit b7265e7

Browse files
Add more intricate example (with TODO for refinement of both sides)
1 parent dc2a9c3 commit b7265e7

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/regression/27-inv_invariants/22-meet-ptrs.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,32 @@
33
#include <stdlib.h>
44
#include <time.h>
55

6+
int more_intricate() {
7+
int arr[20];
8+
9+
int top;
10+
11+
int i = 2;
12+
int j = 8;
13+
if(top) {
14+
i = 8;
15+
j = 9;
16+
}
17+
18+
int* imprecise1 = &arr[i]; // &arr[2..8]
19+
int* imprecise2 = &arr[j]; // &arr[8..9]
20+
21+
if(imprecise1 == imprecise2) {
22+
__goblint_check(imprecise1 == &arr[8]);
23+
__goblint_check(imprecise2 == &arr[8]); //TODO (Refinement should happen in both directions!)
24+
}
25+
26+
if(imprecise1 == &arr[j]) {
27+
__goblint_check(imprecise1 == &arr[8]);
28+
}
29+
30+
}
31+
632

733
int main() {
834
int arr[20];
@@ -20,5 +46,6 @@ int main() {
2046
__goblint_check(imprecise == &arr[2]);
2147
}
2248

49+
more_intricate();
2350
return 0;
2451
}

0 commit comments

Comments
 (0)