File tree Expand file tree Collapse file tree 4 files changed +49
-6
lines changed
regression/cbmc-incr-smt2/arrays Expand file tree Collapse file tree 4 files changed +49
-6
lines changed Original file line number Diff line number Diff line change 1+ int main ()
2+ {
3+ int example_array1 [10000 ];
4+ char example_array2 [20000 ];
5+ void * foo ;
6+ __CPROVER_bool choice = nondet___CPROVER_bool ();
7+ if (choice )
8+ foo = example_array1 ;
9+ else
10+ foo = example_array2 ;
11+ __CPROVER_assert (
12+ foo != example_array1 || __CPROVER_OBJECT_SIZE (foo ) == 40000 ,
13+ "Array condition 1" );
14+ __CPROVER_assert (__CPROVER_OBJECT_SIZE (foo ) == 40000 , "Array condition 2" );
15+ __CPROVER_assert (
16+ foo != example_array2 || __CPROVER_OBJECT_SIZE (foo ) == 20000 ,
17+ "Array condition 3" );
18+ __CPROVER_assert (__CPROVER_OBJECT_SIZE (foo ) == 20000 , "Array condition 4" );
19+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ address_of_two_array_sizes.c
3+ --verbosity 10
4+ Passing problem to incremental SMT2 solving
5+ address_of\(main\:\:1\:\:example_array1\!0\@1\[0\]\)
6+ address_of\(main\:\:1\:\:example_array2\!0\@1\[0\]\)
7+ line \d+ Array condition 1: SUCCESS
8+ line \d+ Array condition 2: FAILURE
9+ line \d+ Array condition 3: SUCCESS
10+ line \d+ Array condition 4: FAILURE
11+ ^EXIT=10$
12+ ^SIGNAL=0$
13+ --
14+ --
15+ Test that __CPROVER_OBJECT_SIZE returns the expected results in the case where
16+ the pointer passed to it may point to one of 2 arrays, where each array has a
17+ different size.
Original file line number Diff line number Diff line change 11int main ()
22{
3- int example_array [10000 ];
4- __CPROVER_assert (
5- __CPROVER_OBJECT_SIZE (example_array ) == 40000 , "Array condition 1" );
6- __CPROVER_assert (
7- __CPROVER_OBJECT_SIZE (example_array ) == 40001 , "Array condition 2" );
3+ int example_array1 [10000 ];
4+ int example_array2 [10000 ];
5+ int * foo ;
6+ int choice ;
7+ if (choice )
8+ foo = example_array1 ;
9+ else
10+ foo = example_array2 ;
11+ __CPROVER_assert (__CPROVER_OBJECT_SIZE (foo ) == 40000 , "Array condition 1" );
12+ __CPROVER_assert (__CPROVER_OBJECT_SIZE (foo ) == 40001 , "Array condition 2" );
813}
Original file line number Diff line number Diff line change 11CORE
22array_address_of.c
3-
3+ --verbosity 10
44Passing problem to incremental SMT2 solving
5+ address_of\(main\:\:1\:\:example_array1\!0\@1\[0\]\)
6+ address_of\(main\:\:1\:\:example_array2\!0\@1\[0\]\)
57line \d+ Array condition 1: SUCCESS
68line \d+ Array condition 2: FAILURE
79^EXIT=10$
You can’t perform that action at this time.
0 commit comments