File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed
regression/cbmc-incr-smt2/bitvector-flag-tests Expand file tree Collapse file tree 3 files changed +41
-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.
You can’t perform that action at this time.
0 commit comments