forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable deterministic playback for variables optimized out due t…
…o `--slice-formula` (rust-lang#1512) * initial slice-formula stuff * mark u8_2 as unused * fix: change parser to accept goto_symex_return lhs * docs: update comment * docs: allow unused test case vars to be anything * ui: improve leftover det vals error msg
- Loading branch information
1 parent
ccccda9
commit 0ae8eb0
Showing
5 changed files
with
53 additions
and
3 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,20 @@ | ||
VERIFICATION:- FAILED | ||
|
||
Executable trace | ||
``` | ||
#[test] | ||
fn kani_exe_trace_harness | ||
let det_vals: Vec<Vec<u8>> = vec![ | ||
// | ||
vec![ | ||
// 101 | ||
vec![101, 0], | ||
// | ||
vec![ | ||
// 102ul | ||
vec![102, 0, 0, 0, 0, 0, 0, 0] | ||
]; | ||
kani::exe_trace_run(det_vals, harness); | ||
} | ||
``` | ||
|
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,16 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
// kani-flags: --harness harness --enable-unstable --gen-exe-trace | ||
|
||
//! We explicitly don't check what concrete values are returned for `_u8_1` and `_u8_3` as they could be anything. | ||
//! In practice, though, they will likely be 0. | ||
#[kani::proof] | ||
pub fn harness() { | ||
let _u8_1: u8 = kani::any(); | ||
let u8_2: u16 = kani::any(); | ||
let _u8_3: u32 = kani::any(); | ||
let u8_4: u64 = kani::any(); | ||
assert!(!(u8_2 == 101 && u8_4 == 102)); | ||
} |