-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only fail for undetermined if there are unwinding failures; fix docs
- Loading branch information
1 parent
bdc574b
commit 1301123
Showing
8 changed files
with
63 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
tests/expected/function-contract/cover_contract/undetermined_postcondition.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
contract_cover.2\ | ||
- Status: UNDETERMINED\ | ||
- Description: "The contract's postcondition is reachable." | ||
|
||
unsupported_construct.1\ | ||
- Status: FAILURE | ||
|
||
VERIFICATION:- FAILED |
25 changes: 25 additions & 0 deletions
25
tests/expected/function-contract/cover_contract/undetermined_postcondition.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// kani-flags: -Zfunction-contracts | ||
|
||
// Test `cover_contract` functionality, which fails verification for a unsatisfiable precondition | ||
// or unreachable postcondition. | ||
// See https://github.com/model-checking/kani/issues/2793 | ||
|
||
// Undetermined whether we can reach the postcondition because we encounter an unsupported construct. | ||
|
||
#[kani::proof_for_contract(unsupp)] | ||
fn undetermined_example() { | ||
let mut x = 0; | ||
unsupp(&mut x); | ||
assert!(x == 0); | ||
} | ||
|
||
#[kani::requires(true)] | ||
#[kani::ensures(|res| *res == *x)] | ||
fn unsupp(x: &mut u8) -> u8 { | ||
unsafe { | ||
std::arch::asm!("nop"); | ||
} | ||
*x | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters