Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CBMC version to 5.79.0 #2301

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ impl<'tcx> GotocCtx<'tcx> {
unreachable!("ZST is no longer represented as a scalar")
}
(Scalar::Int(_), ty::RawPtr(tm)) => {
Expr::pointer_constant(s.to_u64().unwrap(), self.codegen_ty(tm.ty).to_pointer())
Expr::int_constant(s.to_u64().unwrap(), Type::unsigned_int(64))
.cast_to(self.codegen_ty(tm.ty).to_pointer())
}
// TODO: Removing this doesn't cause any regressions to fail.
// We need a regression for this case.
Expand Down
2 changes: 1 addition & 1 deletion kani-dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CBMC_VERSION="5.78.0"
CBMC_VERSION="5.79.0"
# If you update this version number, remember to bump it in `src/setup.rs` too
CBMC_VIEWER_VERSION="3.8"
KISSAT_VERSION="3.0.0"
2 changes: 1 addition & 1 deletion scripts/kani-regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ KANI_DIR=$SCRIPT_DIR/..
export KANI_FAIL_ON_UNEXPECTED_DESCRIPTION="true"

# Required dependencies
check-cbmc-version.py --major 5 --minor 78
check-cbmc-version.py --major 5 --minor 79
check-cbmc-viewer-version.py --major 3 --minor 8
check_kissat_version.sh

Expand Down
5 changes: 0 additions & 5 deletions tests/cargo-kani/mir-linker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
//! Dummy test to check --mir-linker runs on a cargo project.
use semver::{BuildMetadata, Prerelease, Version};

// Pre-CBMC 5.72.0, this test did not require an unwinding.
// TODO: figure out why it needs one now:
// https://github.com/model-checking/kani/issues/1978

#[kani::proof]
#[kani::unwind(2)]
fn check_version() {
let next_major: u64 = kani::any();
let next_minor: u64 = kani::any();
Expand Down
11 changes: 11 additions & 0 deletions tests/perf/misc/display_trait/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT

[package]
name = "display_trait"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
1 change: 1 addition & 0 deletions tests/perf/misc/display_trait/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Complete - 2 successfully verified harnesses, 0 failures, 2 total.
42 changes: 42 additions & 0 deletions tests/perf/misc/display_trait/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! This test checks the performance when adding in the Display trait.
//! The test is from https://github.com/model-checking/kani/issues/1996
//! With CBMC 5.79.0, all harnesses take ~3 seconds
use std::fmt::Display;

enum Foo {
A(String),
B(String),
}

impl Display for Foo {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let s = match self {
Foo::A(s) => format!("A.{s}"),
Foo::B(s) => format!("B.{s}"),
};
write!(f, "{s}")?;
Ok(())
}
}

#[kani::proof]
#[kani::unwind(6)]
fn fast() {
let a = Foo::A(String::from("foo"));
let s = match a {
Foo::A(s) => format!("A.{s}"),
Foo::B(s) => format!("B.{s}"),
};
assert_eq!(s, "A.foo");
}

#[kani::proof]
#[kani::unwind(6)]
fn slow() {
let a = Foo::A(String::from("foo"));
let s = a.to_string();
assert_eq!(s, "A.foo");
}