File tree Expand file tree Collapse file tree 6 files changed +103
-0
lines changed
regression/cprover/contracts Expand file tree Collapse file tree 6 files changed +103
-0
lines changed Original file line number Diff line number Diff line change
1
+ struct S
2
+ {
3
+ int x , y ;
4
+ } global ;
5
+
6
+ void my_function1 (void )
7
+ __CPROVER_assigns (global ) // passes
8
+ {
9
+ global .x = 10 ;
10
+ global .y = 10 ;
11
+ }
12
+
13
+ void my_function2 (void )
14
+ __CPROVER_assigns (global .x ) // passes
15
+ {
16
+ global .x = 10 ;
17
+ }
18
+
19
+ void my_function3 (void )
20
+ __CPROVER_assigns (global .y ) // passes
21
+ {
22
+ global .y = 10 ;
23
+ }
24
+
25
+ void my_function4 (void )
26
+ __CPROVER_assigns (global .y ) // fails
27
+ {
28
+ global .x = 10 ;
29
+ }
Original file line number Diff line number Diff line change
1
+ KNOWNBUG
2
+ check_assigns4.c
3
+
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ ^\[my_function1\.assigns\.1\] line \d+ assigns clause: SUCCESS$
7
+ ^\[my_function1\.assigns\.2\] line \d+ assigns clause: SUCCESS$
8
+ ^\[my_function2\.assigns\.1\] line \d+ assigns clause: SUCCESS$
9
+ ^\[my_function3\.assigns\.1\] line \d+ assigns clause: SUCCESS$
10
+ ^\[my_function4\.assigns\.1\] line \d+ assigns clause: REFUTED$
11
+ --
Original file line number Diff line number Diff line change
1
+ struct S
2
+ {
3
+ int x , y ;
4
+ };
5
+
6
+ void my_function1 (struct S * s )
7
+ __CPROVER_assigns (* s ) // passes
8
+ {
9
+ s -> x = 10 ;
10
+ s -> y = 10 ;
11
+ }
12
+
13
+ void my_function2 (struct S * s )
14
+ __CPROVER_assigns (s - > x ) // passes
15
+ {
16
+ s -> x = 10 ;
17
+ }
18
+
19
+ void my_function3 (struct S * s )
20
+ __CPROVER_assigns (s - > y ) // passes
21
+ {
22
+ s -> y = 10 ;
23
+ }
24
+
25
+ void my_function4 (struct S * s )
26
+ __CPROVER_assigns (s - > y ) // fails
27
+ {
28
+ s -> x = 10 ;
29
+ }
Original file line number Diff line number Diff line change
1
+ KNOWNBUG
2
+ check_assigns5.c
3
+
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ ^\[my_function1\.assigns\.1\] line \d+ assigns clause: SUCCESS$
7
+ ^\[my_function1\.assigns\.2\] line \d+ assigns clause: SUCCESS$
8
+ ^\[my_function2\.assigns\.1\] line \d+ assigns clause: SUCCESS$
9
+ ^\[my_function3\.assigns\.1\] line \d+ assigns clause: SUCCESS$
10
+ ^\[my_function4\.assigns\.1\] line \d+ assigns clause: REFUTED$
11
+ --
Original file line number Diff line number Diff line change
1
+ int global ;
2
+ _Bool flag ;
3
+
4
+ void my_function1 ()
5
+ __CPROVER_assigns (flag : global ) // passes
6
+ {
7
+ if (flag )
8
+ global = 10 ;
9
+ }
10
+
11
+ void my_function2 ()
12
+ __CPROVER_assigns (flag : global ) // fails
13
+ {
14
+ global = 10 ;
15
+ }
Original file line number Diff line number Diff line change
1
+ KNOWNBUG
2
+ check_assigns6.c
3
+
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ ^\[my_function1\.assigns\.1\] line \d+ assigns clause: SUCCESS$
7
+ ^\[my_function2\.assigns\.1\] line \d+ assigns clause: REFUTED$
8
+ --
You can’t perform that action at this time.
0 commit comments