forked from model-checking/kani
-
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.
- Loading branch information
1 parent
59a7277
commit c4dc1f8
Showing
5 changed files
with
33 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
Status: SUCCESS\ | ||
Description: "assertion failed: result == &output" | ||
|
||
Status: FAILURE\ | ||
Description: "memcpy source region readable" | ||
|
||
VERIFICATION:- FAILED | ||
VERIFICATION:- SUCCESSFUL |
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,14 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
//! This test checks that byte slices are codegen correctly. This used to fail | ||
//! in the past (see https://github.com/model-checking/kani/issues/2656). | ||
|
||
#[kani::proof] | ||
fn main() { | ||
const MY_CONSTANT: &[u8] = &[147, 211]; | ||
let x: u8 = MY_CONSTANT[0]; | ||
let y: u8 = MY_CONSTANT[1]; | ||
assert_eq!(x, 147); | ||
assert_eq!(y, 211); | ||
} |
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,15 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
//! Check that we propertly handle `Vec::extend` with a constant byte slice. | ||
//! This used to fail previously (see | ||
//! https://github.com/model-checking/kani/issues/2656). | ||
|
||
#[kani::proof] | ||
fn check_extend_const_byte_slice() { | ||
const MY_CONSTANT: &[u8] = b"Hi"; | ||
|
||
let mut my_vec: Vec<u8> = Vec::new(); | ||
my_vec.extend(MY_CONSTANT); | ||
assert_eq!(my_vec, [72, 105]); | ||
} |