File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
regression/cbmc-shadow-memory/memcpy1 Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+ #include <string.h>
3
+
4
+ int src [10 ];
5
+
6
+ int main ()
7
+ {
8
+ __CPROVER_field_decl_local ("field" , (_Bool )0 );
9
+ __CPROVER_field_decl_global ("field" , (_Bool )0 );
10
+
11
+ assert (src [9 ] == 0 );
12
+ assert (__CPROVER_get_field (& (src [9 ]), "field" ) == 0 );
13
+
14
+ int dest [10 ];
15
+ dest [9 ] = 1 ;
16
+ assert (__CPROVER_get_field (& (dest [9 ]), "field" ) == 0 );
17
+ __CPROVER_set_field (& (dest [9 ]), "field" , 1 );
18
+ assert (__CPROVER_get_field (& (dest [9 ]), "field" ) == 1 );
19
+
20
+ memcpy (dest , src , 10 * sizeof (int ));
21
+ assert (dest [9 ] == 0 );
22
+ assert (__CPROVER_get_field (& (src [9 ]), "field" ) == 0 );
23
+ assert (__CPROVER_get_field (& (dest [9 ]), "field" ) == 1 );
24
+ }
Original file line number Diff line number Diff line change
1
+ FUTURE
2
+ main.c
3
+
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ ^VERIFICATION SUCCESSFUL$
7
+ --
8
+ ^warning: ignoring
You can’t perform that action at this time.
0 commit comments