File tree Expand file tree Collapse file tree 5 files changed +62
-0
lines changed
regression/cbmc-incr-smt2/bitvector-flag-tests Expand file tree Collapse file tree 5 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 1+ int main ()
2+ {
3+ int x = 5 ;
4+ int y ;
5+ int z = 8 ;
6+
7+ // Negative case
8+ __CPROVER_assert (x / y != 0 , "This assertion is falsifiable" );
9+
10+ // Positive case
11+ __CPROVER_assert (
12+ x / z != 0 , "This assertion is valid under all interpretations" );
13+
14+ return 0 ;
15+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ div_by_zero.c
3+ --incremental-smt2-solver 'z3 --smt2 -in' --div-by-zero-check --trace
4+ \[main\.division-by-zero\.1\] line \d division by zero in x / y: FAILURE
5+ \[main\.division-by-zero\.2\] line \d+ division by zero in x / z: SUCCESS
6+ y=0
7+ ^VERIFICATION FAILED$
8+ ^EXIT=10$
9+ ^SIGNAL=0$
10+ --
11+ --
12+ This test is designed to drive the `--div-by-zero-check` in both the positive
13+ and the negative case, and show that it's working for our current implementation-in-progress
14+ of the new SMT backend.
Original file line number Diff line number Diff line change 1+ # Flag tests
2+
3+ Up until this point, the tests we have for the new SMT backend focus on getting
4+ simple arithmetic or relational operator verification runs done.
5+
6+ This folder contains a couple of tests that are being run with CBMC flags, adding
7+ extra assertions such as ` --div-by-zero ` or ` --signed-overflow-check ` .
8+
9+ Long term the plan is for this folder to be deleted, and the tests that are being
10+ run as part of the old SMT backend (or maybe even the whole of CBMC's regression
11+ test suite) to be run through a label or a flag. But for now, this should do well
12+ enough to allow us to track the progress of our completion of the new backend.
Original file line number Diff line number Diff line change 1+ #include <limits.h>
2+
3+ int main ()
4+ {
5+ int x = INT_MAX ;
6+ int y ;
7+ int z = x + y ;
8+
9+ __CPROVER_assert (z < INT_MIN , "This assertion is falsifiable" );
10+ }
Original file line number Diff line number Diff line change 1+ KNOWNBUG
2+ signed_overflow.c
3+ --incremental-smt2-solver 'z3 --smt2 -in' --signed-overflow-check --trace
4+ ^VERIFICATION FAILED$
5+ ^EXIT=10$
6+ ^SIGNAL=0$
7+ --
8+ Invariant check failed
9+ Reason: Reached unimplemented Generation of SMT formula for unknown kind of expression: overflow-\+
10+ --
11+ This tests exercise the driving of the `--signed-overflow-check` flag.
You can’t perform that action at this time.
0 commit comments