-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide --lib-c and add assume-false to unknown fns (#964)
- Support to --lib-c is not well tested. Keep it as experiemental. - Change how CBMC behaves when a function that is not defined is reachable. This mitigates issues #576. We should still add an unimplemented assertion so we can flip the results of other checks to undetermined.
- Loading branch information
Showing
5 changed files
with
29 additions
and
4 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Status: UNREACHABLE\ | ||
Description: "assertion failed: x == 5" | ||
|
||
VERIFICATION:- FAILED | ||
|
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,19 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
// kani-flags: --function harness | ||
|
||
// This test is to check Kani's error handling for missing functions. | ||
// TODO: Verify that this prints a compiler warning: | ||
// - https://github.com/model-checking/kani/issues/576 | ||
|
||
|
||
extern "C" { | ||
fn missing_function() -> u32; | ||
} | ||
|
||
#[kani::proof] | ||
fn harness() { | ||
let x = unsafe { missing_function() }; | ||
assert!(x == 5); | ||
} |