Skip to content

Commit

Permalink
Tests for assume (#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
adpaco-aws authored and tedinski committed Apr 6, 2022
1 parent 670742e commit bae4849
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/kani/Intrinsics/Assume/assume_fail.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
// kani-verify-fail

// Check that `assume` fails if the condition is false (undefined behavior)
#![feature(core_intrinsics)]

#[kani::proof]
fn main() {
unsafe { core::intrinsics::assume(false) };
}
10 changes: 10 additions & 0 deletions tests/kani/Intrinsics/Assume/assume_ok.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

// Check that `assume` does not fail if the condition is true
#![feature(core_intrinsics)]

#[kani::proof]
fn main() {
unsafe { core::intrinsics::assume(true) };
}

0 comments on commit bae4849

Please sign in to comment.