Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion kani-driver/src/call_cbmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ impl KaniSession {
args.push("--no-pointer-check".into());
}
if self.args.checks.overflow_on() {
args.push("--float-overflow-check".into());
args.push("--nan-check".into());

// TODO: Implement conversion checks as an optional check.
Expand Down
1 change: 1 addition & 0 deletions tests/ui/cbmc_checks/float-overflow/check_message.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// kani-flags: --enable-unstable --cbmc-args --float-overflow-check
// Check we don't print temporary variables as part of CBMC messages.
extern crate kani;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERIFICATION:- SUCCESSFUL
23 changes: 23 additions & 0 deletions tests/ui/cbmc_checks/float-overflow/check_message_overflow.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Check we don't print temporary variables as part of CBMC messages.
extern crate kani;

use kani::any;

// Use the result so rustc doesn't optimize them away.
fn dummy(result: f32) -> f32 {
result
}

#[kani::proof]
fn main() {
let a = kani::any_where(|&x: &f32| x.is_finite() && x.abs() < 1e20);
let b = kani::any_where(|&x: &f32| x.is_finite() && x.abs() < 1e20);

dummy(a + b);
dummy(a - b);
dummy(a * b);
dummy(-a);
}
Loading