File tree 5 files changed +34
-6
lines changed
regression/cbmc-primitives 5 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 5
5
int main () {
6
6
char * a = malloc (1 );
7
7
8
- // lots of errors with `--pointer-check` enabled
9
8
assert (* a == * a );
10
9
11
- // no errors even with `--pointer-check` enabled
10
+ // BUG: no errors even with `--pointer-check` enabled -- now fixed.
12
11
assert (
13
12
__CPROVER_forall {
14
13
int i ; (0 <= i && i < 1 ) == > * (a + i ) == * (a + i )
Original file line number Diff line number Diff line change 9
9
int main () {
10
10
char * a = malloc (10 );
11
11
12
- // lots of errors with `--pointer-check` enabled
13
12
assert (* a == * a );
14
13
15
- // no errors even with `--pointer-check` enabled
14
+ // BUG: no errors even with `--pointer-check` enabled -- now fixed.
16
15
assert (
17
16
__CPROVER_forall {
18
17
int i ; (0 <= i && i < 10 ) == > * (a + i ) == * (a + i )
Original file line number Diff line number Diff line change 9
9
int main () {
10
10
char * a = malloc (4 );
11
11
12
- // lots of errors with `--pointer-check` enabled
13
12
assert (* a == * a );
14
13
15
- // no errors even with `--pointer-check` enabled
14
+ // BUG: no errors even with `--pointer-check` enabled -- now fixed.
16
15
assert (
17
16
__CPROVER_forall {
18
17
int i ; (0 <= i && i < 10 ) == > * (a + i ) == * (a + i )
Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+ #include <stdlib.h>
3
+
4
+ // Similar to the previous tests in forall_6231_1 but this one aims to check
5
+ // the antecedent of the forall expression to make sure that checks are being
6
+ // generated correctly for it.
7
+
8
+ // clang-format off
9
+ int main () {
10
+ char * a = malloc (10 );
11
+ int n ;
12
+
13
+ assert (
14
+ __CPROVER_forall {
15
+ int i ; (0 <= i && i < (n / 0 )) /* (n / 0) should be caught by --div-by-zero-check */
16
+ == > * (a + i ) == * (a + i )
17
+ }
18
+ );
19
+ }
20
+ // clang-format on
Original file line number Diff line number Diff line change
1
+ CORE
2
+ test.c
3
+ --div-by-zero-check
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ \[main\.division-by-zero\.1] line \d+ division by zero in n / 0: FAILURE
7
+ ^VERIFICATION FAILED$
8
+ --
9
+ --
10
+ --div-by-zero-check should catch the failure in the antecedent.
11
+ --pointer-check doesn't but gives an pointer outside object bounds issue.
You can’t perform that action at this time.
0 commit comments