File tree 2 files changed +32
-0
lines changed
regression/cbmc-incr-smt2/arrays
2 files changed +32
-0
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 (foo != example_array1 || __CPROVER_OBJECT_SIZE (foo ) == 40000 , "Array condition 1" );
12
+ __CPROVER_assert (__CPROVER_OBJECT_SIZE (foo ) == 40000 , "Array condition 2" );
13
+ __CPROVER_assert (foo != example_array2 || __CPROVER_OBJECT_SIZE (foo ) == 20000 , "Array condition 3" );
14
+ __CPROVER_assert (__CPROVER_OBJECT_SIZE (foo ) == 20000 , "Array condition 4" );
15
+ }
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.
You can’t perform that action at this time.
0 commit comments