Skip to content

Commit 486fd49

Browse files
author
klaas
committed
Added another test.
1 parent 75331b6 commit 486fd49

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <assert.h>
2+
3+
int foo(int* x)
4+
__CPROVER_ensures(__CPROVER_return_value == 1)
5+
{
6+
*x = 1;
7+
return 1;
8+
}
9+
10+
int main() {
11+
int y = 0;
12+
int z = foo(&y);
13+
assert(y == 0);
14+
assert(z == 1);
15+
return 0;
16+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG # Contract checking does not properly havoc function calls
2+
main.c
3+
--check-code-contracts
4+
^\[main.assertion.1\] assertion x == 0: FAILURE$
5+
^\[main.assertion.2\] assertion y == 1: SUCCESS$
6+
^\[foo.1\] : SUCCESS$
7+
8+
^VERIFICATION SUCCESSFUL$

0 commit comments

Comments
 (0)