File tree 2 files changed +29
-0
lines changed
regression/cbmc-incr-smt2/pointers-conversions 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ int main ()
2
+ {
3
+ int * p = (int * )4 ;
4
+ __CPROVER_allocated_memory (4 , sizeof (int ));
5
+
6
+ __CPROVER_assert (p == 4 , "p == 4: expected success" );
7
+ __CPROVER_assert (p != 0 , "p != 0: expected success" );
8
+
9
+ p = (int * )0x1020304 ;
10
+ __CPROVER_assert (p == 0x1020304 , "p == 0x1020304: expected success" );
11
+ __CPROVER_assert (p != 0 , "p != 0: expected success" );
12
+ __CPROVER_assert (p == 0 , "p != 0: expected failure" );
13
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ pointer_from_int.c
3
+ --trace
4
+ \[main\.assertion\.1\] line \d+ p == 4: expected success: SUCCESS
5
+ \[main\.assertion\.2\] line \d+ p != 0: expected success: SUCCESS
6
+ \[main\.assertion\.3\] line \d+ p == 0x1020304: expected success: SUCCESS
7
+ \[main\.assertion\.4\] line \d+ p != 0: expected success: SUCCESS
8
+ \[main\.assertion\.5\] line \d+ p != 0: expected failure: FAILURE
9
+ ^VERIFICATION FAILED$
10
+ ^EXIT=10$
11
+ ^SIGNAL=0$
12
+ --
13
+ --
14
+ This test is covering basic conversion of pointer values to integers.
15
+ It contains two such conversions, one of an integer in decimal form,
16
+ and one of an integer in a hexadecimal form.
You can’t perform that action at this time.
0 commit comments