File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
regression/contracts/history-index
src/goto-instrument/contracts Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+
3
+ int main ()
4
+ {
5
+ int i , n , x [10 ];
6
+ __CPROVER_assume (x [0 ] == x [9 ]);
7
+ while (i < n )
8
+ __CPROVER_loop_invariant (x [0 ] == __CPROVER_loop_entry (x [0 ]))
9
+ {
10
+ x [0 ] = x [9 ] - 1 ;
11
+ x [0 ]++ ;
12
+ }
13
+ assert (x [0 ] == x [9 ]);
14
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --apply-loop-contracts
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ ^VERIFICATION SUCCESSFUL$
7
+ --
8
+ ^Tracking history of index expressions is not supported yet\.
9
+ --
10
+ This test checks that `ID_index` expressions are allowed within history variables.
Original file line number Diff line number Diff line change @@ -664,7 +664,8 @@ void code_contractst::replace_history_parameter(
664
664
const auto &id = parameter.id ();
665
665
if (
666
666
id == ID_dereference || id == ID_member || id == ID_symbol ||
667
- id == ID_ptrmember || id == ID_constant || id == ID_typecast)
667
+ id == ID_ptrmember || id == ID_constant || id == ID_typecast ||
668
+ id == ID_index)
668
669
{
669
670
auto it = parameter2history.find (parameter);
670
671
You can’t perform that action at this time.
0 commit comments