File tree Expand file tree Collapse file tree 24 files changed +296
-0
lines changed
regression/cbmc-primitives Expand file tree Collapse file tree 24 files changed +296
-0
lines changed Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+ #include <stdlib.h>
3+
4+ void main ()
5+ {
6+ char * p = malloc (1 );
7+ free (p );
8+
9+ assert (__CPROVER_DYNAMIC_OBJECT (p ));
10+ assert (!__CPROVER_DYNAMIC_OBJECT (p ));
11+ }
Original file line number Diff line number Diff line change 1+ FUTURE
2+ main.c
3+ --no-simplify --no-propagation
4+ ^EXIT=10$
5+ ^SIGNAL=0$
6+ \[main.assertion.1\] line \d+ assertion __CPROVER_DYNAMIC_OBJECT\(p\): FAILURE
7+ \[main.assertion.2\] line \d+ assertion !__CPROVER_DYNAMIC_OBJECT\(p\): FAILURE
8+ --
9+ ^warning: ignoring
10+ --
11+ Check that the dynamic object property is havoc'd when dynamic objects are
12+ deallocated. We use --no-simplify and --no-propagation to ensure that the case
13+ is not solved by the constant propagation and thus tests the constraint
14+ encoding. Recorded as ADA-526.
Original file line number Diff line number Diff line change 1+ FUTURE
2+ main.c
3+
4+ ^EXIT=10$
5+ ^SIGNAL=0$
6+ \[main.assertion.1\] line \d+ assertion __CPROVER_DYNAMIC_OBJECT\(p\): FAILURE
7+ \[main.assertion.2\] line \d+ assertion !__CPROVER_DYNAMIC_OBJECT\(p\): FAILURE
8+ --
9+ ^warning: ignoring
10+ --
11+ Check that the dynamic object property is havoc'd when dynamic objects are
12+ deallocated. Recorded as ADA-526.
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+ #include <stdlib.h>
3+
4+ void main ()
5+ {
6+ char * p ;
7+
8+ assert (__CPROVER_DYNAMIC_OBJECT (p ));
9+ assert (!__CPROVER_DYNAMIC_OBJECT (p ));
10+ }
Original file line number Diff line number Diff line change 1+ FUTURE
2+ main.c
3+ --no-simplify --no-propagation
4+ ^EXIT=10$
5+ ^SIGNAL=0$
6+ \[main.assertion.1\] line \d+ assertion __CPROVER_DYNAMIC_OBJECT\(p\): FAILURE
7+ \[main.assertion.2\] line \d+ assertion !__CPROVER_DYNAMIC_OBJECT\(p\): FAILURE
8+ --
9+ ^warning: ignoring
10+ --
11+ Check that the dynamic object property is nondet for uninitialized pointers. We
12+ use --no-simplify and --no-propagation to ensure that the case is not solved by
13+ the constant propagation and thus tests the constraint encoding. Recorded as
14+ ADA-526.
Original file line number Diff line number Diff line change 1+ FUTURE
2+ main.c
3+
4+ ^EXIT=10$
5+ ^SIGNAL=0$
6+ \[main.assertion.1\] line \d+ assertion __CPROVER_DYNAMIC_OBJECT\(p\): FAILURE
7+ \[main.assertion.2\] line \d+ assertion !__CPROVER_DYNAMIC_OBJECT\(p\): FAILURE
8+ --
9+ ^warning: ignoring
10+ --
11+ Check that the dynamic object property is nondet for uninitialized pointers.
12+ Recorded as ADA-526.
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+ #include <stdlib.h>
3+
4+ void main ()
5+ {
6+ char * p = malloc (1 );
7+ free (p );
8+
9+ assert (__CPROVER_OBJECT_SIZE (p ) == 1 );
10+ assert (__CPROVER_OBJECT_SIZE (p ) != 1 );
11+
12+ {
13+ char c ;
14+ p = & c ;
15+ }
16+
17+ assert (__CPROVER_OBJECT_SIZE (p ) == 1 );
18+ assert (__CPROVER_OBJECT_SIZE (p ) != 1 );
19+ }
Original file line number Diff line number Diff line change 1+ FUTURE
2+ main.c
3+
4+ ^EXIT=10$
5+ ^SIGNAL=0$
6+ \[main.assertion.1\] line \d+ assertion __CPROVER_OBJECT_SIZE\(p\) == 1: FAILURE
7+ \[main.assertion.2\] line \d+ assertion __CPROVER_OBJECT_SIZE\(p\) != 1: FAILURE
8+ \[main.assertion.3\] line \d+ assertion __CPROVER_OBJECT_SIZE\(p\) == 1: FAILURE
9+ \[main.assertion.4\] line \d+ assertion __CPROVER_OBJECT_SIZE\(p\) != 1: FAILURE
10+ --
11+ ^warning: ignoring
12+ --
13+ Check that object size is havoc'd when objects are deallocated. We use
14+ --no-simplify and --no-propagation to ensure that the case is not solved by the
15+ constant propagation and thus tests the constraint encoding. Recorded as
16+ ADA-527.
Original file line number Diff line number Diff line change 1+ FUTURE
2+ main.c
3+
4+ ^EXIT=10$
5+ ^SIGNAL=0$
6+ \[main.assertion.1\] line \d+ assertion __CPROVER_OBJECT_SIZE\(p\) == 1: FAILURE
7+ \[main.assertion.2\] line \d+ assertion __CPROVER_OBJECT_SIZE\(p\) != 1: FAILURE
8+ \[main.assertion.3\] line \d+ assertion __CPROVER_OBJECT_SIZE\(p\) == 1: FAILURE
9+ \[main.assertion.4\] line \d+ assertion __CPROVER_OBJECT_SIZE\(p\) != 1: FAILURE
10+ --
11+ ^warning: ignoring
12+ --
13+ Check that object size is havoc'd when objects are deallocated. Recorded as
14+ ADA-527.
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ void main ()
4+ {
5+ char * p ;
6+ assert (__CPROVER_POINTER_OFFSET (p ) >= 0 );
7+ assert (__CPROVER_POINTER_OFFSET (p ) < 0 );
8+ }
You can’t perform that action at this time.
0 commit comments