File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
regression/cbmc/Array_operations1 Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,14 @@ void test_copy()
54
54
__CPROVER_array_copy (array1 , array3 );
55
55
__CPROVER_assert (array1 [10 ] == 11 , "array1[10] is OK" );
56
56
__CPROVER_assert (array1 [99 ] == 42 , "expected to fail" );
57
+
58
+ int a [1 ];
59
+ struct
60
+ {
61
+ int a [1 ];
62
+ } s ;
63
+ __CPROVER_array_copy (a , s .a );
64
+ __CPROVER_assert (a [0 ] == s .a [0 ], "array copied" );
57
65
}
58
66
59
67
void test_replace ()
Original file line number Diff line number Diff line change @@ -4786,7 +4786,17 @@ void smt2_convt::set_to(const exprt &expr, bool value)
4786
4786
{
4787
4787
out << " (define-fun " << smt2_identifier;
4788
4788
out << " () " ;
4789
- convert_type (equal_expr.lhs ().type ());
4789
+ if (
4790
+ equal_expr.lhs ().type ().id () != ID_array ||
4791
+ use_array_theory (prepared_rhs))
4792
+ {
4793
+ convert_type (equal_expr.lhs ().type ());
4794
+ }
4795
+ else
4796
+ {
4797
+ std::size_t width = boolbv_width (equal_expr.lhs ().type ());
4798
+ out << " (_ BitVec " << width << " )" ;
4799
+ }
4790
4800
out << ' ' ;
4791
4801
convert_expr (prepared_rhs);
4792
4802
out << ' )' << ' \n ' ;
You can’t perform that action at this time.
0 commit comments