Skip to content

Initial reworking of code contracts [depends-on: #3769, blocks: #2677] #2676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions regression/contracts/function_apply_01/test.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
KNOWNBUG
CORE
main.c
--apply-code-contracts
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
--
Applying code contracts currently also checks them.
5 changes: 1 addition & 4 deletions regression/contracts/function_check_01/test.desc
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
CORE
main.c
--apply-code-contracts
--check-code-contracts
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
--
--check-code-contracts not implemented yet.
--apply-code-contracts is the current name for the flag. This should be
updated as the flag changes.
5 changes: 1 addition & 4 deletions regression/contracts/function_check_04/test.desc
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
CORE
main.c
--apply-code-contracts
--check-code-contracts
^\[main.assertion.1\] assertion x == 0: SUCCESS$
^\[foo.1\] : FAILURE$
^VERIFICATION FAILED$
--
--
--check-code-contracts not implemented yet.
--apply-code-contracts is the current name for the flag. This should be
updated as the flag changes.
2 changes: 1 addition & 1 deletion regression/contracts/function_check_mem_01/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void foo(bar *x)
__CPROVER_requires(__CPROVER_VALID_MEM(x, sizeof(bar)))
{
x->x += 1;
return
return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little concerned about why this wasn't caught earlier. Were these tests just not run?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a test that was introduced as KNOWNBUG (and presumably copied poorly from the original piece of code that inspired it).

}

int main()
Expand Down
2 changes: 1 addition & 1 deletion regression/contracts/function_check_mem_01/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KNOWNBUG
CORE
main.c
--check-code-contracts
^EXIT=0$
Expand Down
5 changes: 1 addition & 4 deletions regression/contracts/invar_check_01/test.desc
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
CORE
main.c
--apply-code-contracts
--check-code-contracts
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
--
--check-code-contracts not implemented yet.
--apply-code-contracts is the current name for the flag. This should be
updated as the flag changes.
5 changes: 1 addition & 4 deletions regression/contracts/invar_check_02/test.desc
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
CORE
main.c
--apply-code-contracts
--check-code-contracts
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
--
--check-code-contracts not implemented yet.
--apply-code-contracts is the current name for the flag. This should be
updated as the flag changes.
5 changes: 1 addition & 4 deletions regression/contracts/invar_check_03/test.desc
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
CORE
main.c
--apply-code-contracts
--check-code-contracts
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
--
--check-code-contracts not implemented yet.
--apply-code-contracts is the current name for the flag. This should be
updated as the flag changes.
5 changes: 1 addition & 4 deletions regression/contracts/invar_check_04/test.desc
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
CORE
main.c
--apply-code-contracts
--check-code-contracts
^\[main.1\] Loop invariant violated before entry: SUCCESS$
^\[main.2\] Loop invariant not preserved: SUCCESS$
^\[main.assertion.1\] assertion r == 0: FAILURE$
^VERIFICATION FAILED$
--
--
--check-code-contracts not implemented yet.
--apply-code-contracts is the current name for the flag. This should be
updated as the flag changes.
Loading