-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A few tests adjustments including a new fixme test
- Loading branch information
Showing
3 changed files
with
47 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
FAILURE\ | ||
assertion failed: high_offset == wrapped_offset.try_into().unwrap() | ||
Checking harness check_wrap_around_ptr... | ||
VERIFICATION:- SUCCESSFUL | ||
|
||
Checking harness harness_without_ub... | ||
VERIFICATION:- SUCCESSFUL | ||
|
||
Checking harness original_harness... | ||
Failed Checks: assertion failed: high_offset == wrapped_offset.try_into().unwrap() | ||
VERIFICATION:- FAILED | ||
|
||
Verification failed for - original_harness | ||
Complete - 2 successfully verified harnesses, 1 failures, 3 total. |
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,18 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
//! Testcase for issue [#1150](https://github.com/model-checking/kani/issues/1150) that shows | ||
//! bug with wrapping offset operations in Kani. | ||
/// This harness shows the issue with the current implementation of wrapping offset. | ||
/// | ||
/// Invoking `wrapping_byte_offset` should return a pointer that is different from the original | ||
/// pointer if the offset value is not 0. | ||
/// See issue [#1150](https://github.com/model-checking/kani/issues/1150). | ||
#[kani::proof] | ||
fn fixme_incorrect_wrapping_offset() { | ||
let ptr: *const u8 = &0u8; | ||
let offset = kani::any_where(|v: &isize| *v != 0); | ||
let new_ptr = ptr.wrapping_byte_offset(offset); | ||
assert_ne!(ptr, new_ptr, "Expected new_ptr to be different than ptr"); | ||
} |