File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
regression/cbmc-incr-smt2/bitvector-arithmetic-operators Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ #include <limits.h>
2+ #include <stdlib.h>
3+
4+ int main ()
5+ {
6+ int a = INT_MAX ;
7+ int b = INT_MIN ;
8+
9+ __CPROVER_assert (
10+ a + 1 == INT_MIN , "Wrap-around to INT_MIN when adding to INT_MAX" );
11+ __CPROVER_assert (
12+ b - 1 == INT_MAX , "Wrap-around to INT_MAX when subtracting from INT_MIN" );
13+ __CPROVER_assert (a - b == -1 , "INT_MAX minus INT_MIN equals -1" );
14+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ overflow_behaviour.c
3+ --incremental-smt2-solver 'z3 --smt2 -in' --trace
4+ \[main\.assertion\.1\] line \d+ Wrap-around to INT_MIN when adding to INT_MAX: SUCCESS
5+ \[main\.assertion\.2\] line \d+ Wrap-around to INT_MAX when subtracting from INT_MIN: SUCCESS
6+ \[main\.assertion\.3\] line \d+ INT_MAX minus INT_MIN equals -1: SUCCESS
7+ ^VERIFICATION SUCCESSFUL$
8+ ^EXIT=0$
9+ ^SIGNAL=0$
10+ --
11+ --
12+ This test is designed to test wrap-around behaviour for boundary-values
13+ of the int domain.
You can’t perform that action at this time.
0 commit comments