├── tests ├── kani-docs ├── kani-fixme ├── llbc │ ├── enum │ │ └── expected │ ├── generic │ │ └── expected │ ├── option │ │ └── expected │ ├── struct │ │ └── expected │ ├── tuple │ │ └── expected │ ├── projection │ │ └── expected │ ├── traitimpl │ │ └── expected │ └── basic0 │ │ └── expected ├── expected │ ├── panic │ │ ├── expected │ │ └── arg-error │ │ │ └── expected │ ├── one-assert │ │ ├── expected │ │ └── test.rs │ ├── loop-backedge │ │ └── expected │ ├── function-contract │ │ ├── history │ │ │ ├── ui │ │ │ │ ├── statement.expected │ │ │ │ ├── no_args.expected │ │ │ │ ├── noncopy_ignore.expected │ │ │ │ └── old_result.expected │ │ │ ├── side_effect.expected │ │ │ ├── old_old.expected │ │ │ ├── simple_pass.expected │ │ │ ├── copy_pass.expected │ │ │ ├── clone_pass.expected │ │ │ ├── respects-preconditions │ │ │ │ ├── modifies.expected │ │ │ │ ├── ensures_before_requires.expected │ │ │ │ └── requires_before_ensures.expected │ │ │ ├── function_call.expected │ │ │ ├── block.expected │ │ │ ├── simple_fail.expected │ │ │ └── no_modifies.expected │ │ ├── attribute_no_complain.expected │ │ ├── modifies │ │ │ ├── expr_pass.expected │ │ │ ├── field_pass.expected │ │ │ ├── global_pass.expected │ │ │ ├── simple_pass.expected │ │ │ ├── stmt_expr.expected │ │ │ ├── check_only_verification.expected │ │ │ ├── fail_missing_recursion_attr.expected │ │ │ ├── simple_only_verification.expected │ │ │ ├── simple_only_verification_modifies.expected │ │ │ ├── zst_pass.expected │ │ │ ├── mistake_condition_return.expected │ │ │ ├── expr_replace_pass.expected │ │ │ ├── global_replace_pass.expected │ │ │ ├── expr_replace_fail.expected │ │ │ ├── field_replace_fail.expected │ │ │ ├── global_replace_fail.expected │ │ │ ├── simple_fail.expected │ │ │ ├── field_replace_pass.expected │ │ │ └── unique_arguments.expected │ │ ├── multiple_replace_pass.expected │ │ ├── generic_infinity_recursion.expected │ │ ├── prohibit-pointers │ │ │ ├── hidden.expected │ │ │ ├── allowed_ref.expected │ │ │ ├── plain_pointer.expected │ │ │ ├── allowed_const_ptr.expected │ │ │ ├── allowed_mut_ref.expected │ │ │ ├── return_pointer.expected │ │ │ └── allowed_mut_return_ref.expected │ │ ├── type_annotation_needed.expected │ │ ├── const_fn.expected │ │ ├── const_fn_with_effect.expected │ │ ├── multiple_replace_fail.expected │ │ ├── const_generic_function.expected │ │ ├── diverging_loop.expected │ │ ├── pattern_use.expected │ │ ├── simple_replace_fail.expected │ │ ├── attribute_complain.expected │ │ ├── gcd_rec_code_fail.expected │ │ ├── gcd_rec_contract_fail.expected │ │ ├── arbitrary_requires_fail.expected │ │ ├── mutable-references │ │ │ └── ensures_with_two_mut_refs_fail.expected │ │ ├── arbitrary_ensures_fail.expected │ │ ├── interior-mutability │ │ │ ├── api │ │ │ │ ├── cell.expected │ │ │ │ └── unsafecell.expected │ │ │ └── whole-struct │ │ │ │ ├── cell.expected │ │ │ │ ├── oncecell.expected │ │ │ │ ├── refcell.expected │ │ │ │ └── unsafecell.expected │ │ ├── arbitrary_requires_pass.expected │ │ ├── checking_from_external_mod.expected │ │ ├── modifies_fat_pointer │ │ │ ├── u32slice.expected │ │ │ ├── u8slice.expected │ │ │ ├── slice_of_array.expected │ │ │ └── nondeterministic_size.expected │ │ ├── checking_in_impl.expected │ │ ├── simple_ensures_pass.expected │ │ ├── arbitrary_ensures_pass.expected │ │ ├── simple_ensures_pass_no_annotation.expected │ │ ├── gcd_success.expected │ │ ├── attribute_no_complain.rs │ │ ├── simple_ensures_fail.expected │ │ ├── trait_impls │ │ │ ├── impl_contract_precedence.expected │ │ │ └── associated_fn.expected │ │ └── simple_replace_pass.expected │ ├── report │ │ ├── verification-time │ │ │ └── expected │ │ ├── unsupported │ │ │ └── unreachable │ │ │ │ └── expected │ │ └── uncolor │ │ │ └── expected │ ├── arith-offset-overflow │ │ └── expected │ ├── coroutines │ │ └── as_parameter │ │ │ └── expected │ ├── empty │ │ ├── expected │ │ └── main.rs │ ├── intrinsics │ │ ├── unreachable │ │ │ └── expected │ │ ├── breakpoint │ │ │ └── expected │ │ ├── simd-div-div-zero │ │ │ └── expected │ │ ├── simd-rem-div-zero │ │ │ └── expected │ │ ├── copy-nonoverlapping │ │ │ ├── copy-overlapping │ │ │ │ └── expected │ │ │ ├── copy-unaligned-dst │ │ │ │ └── expected │ │ │ ├── copy-unaligned-src │ │ │ │ └── expected │ │ │ ├── copy-unreadable-src │ │ │ │ └── expected │ │ │ ├── copy-unwritable-dst │ │ │ │ └── expected │ │ │ └── copy-overflow │ │ │ │ └── expected │ │ ├── copy │ │ │ ├── copy-unaligned-dst │ │ │ │ └── expected │ │ │ ├── copy-unaligned-src │ │ │ │ └── expected │ │ │ ├── copy-unreadable-src │ │ │ │ └── expected │ │ │ ├── copy-unwritable-dst │ │ │ │ └── expected │ │ │ └── copy-overflow │ │ │ │ └── expected │ │ ├── volatile_load │ │ │ └── unaligned │ │ │ │ └── expected │ │ ├── write_bytes │ │ │ ├── unaligned │ │ │ │ └── expected │ │ │ ├── out-of-bounds │ │ │ │ └── expected │ │ │ └── overflow │ │ │ │ └── expected │ │ ├── sub_with_overflow_ice_fixme │ │ │ └── expected │ │ ├── simd-shl-shift-negative │ │ │ └── expected │ │ ├── simd-shl-shift-too-large │ │ │ └── expected │ │ ├── simd-shr-shift-negative │ │ │ └── expected │ │ ├── simd-shr-shift-too-large │ │ │ └── expected │ │ ├── ptr_offset_from_unsigned │ │ │ └── expected │ │ ├── offset-same-object │ │ │ └── expected │ │ ├── simd-shuffle-indexes-out │ │ │ └── expected │ │ ├── simd-extract-wrong-type │ │ │ └── expected │ │ ├── simd-insert-wrong-type │ │ │ └── expected │ │ ├── simd-shuffle-result-type-is-diff-size │ │ │ └── expected │ │ ├── simd-result-type-is-float │ │ │ └── expected │ │ ├── transmute_diff_size.expected │ │ ├── simd-cmp-result-type-is-diff-size │ │ │ └── expected │ │ ├── simd-shuffle-result-type-is-diff-type │ │ │ └── expected │ │ ├── simd-arith-overflows │ │ │ └── expected │ │ └── align_of_dst.expected │ ├── loop-contract │ │ ├── count_zero.expected │ │ ├── memchar_naive.expected │ │ ├── small_slice_eq.expected │ │ ├── simple_while_loop.expected │ │ ├── count_zero_loop_contracts_disable.expected │ │ ├── simple_while_loop_not_enabled.expected │ │ ├── multiple_loops.expected │ │ ├── array_incr_for_loop_fixme.expected │ │ ├── loop_with_prev_break_first_iter.expected │ │ ├── fixme_box.expected │ │ ├── loop_with_true_invariant.expected │ │ ├── loop_with_old.expected │ │ ├── loop_with_prev.expected │ │ ├── simple_loop_loop.expected │ │ ├── loop_assigns_for_ref_fail.expected │ │ ├── loop_assigns_for_fat_ptr_fail.expected │ │ ├── loop_with_old_and_prev.expected │ │ └── function_with_loop_no_assertion.expected │ ├── references │ │ └── expected │ ├── stubbing-const-generics │ │ └── expected │ ├── assert-arg-error │ │ └── expected │ ├── derive-arbitrary │ │ ├── phantom_data │ │ │ └── expected │ │ └── phantom_pinned │ │ │ └── expected │ ├── reach │ │ ├── turned-off │ │ │ └── expected │ │ ├── assert_eq │ │ │ └── unreachable │ │ │ │ └── expected │ │ ├── assert_ne │ │ │ └── unreachable │ │ │ │ └── expected │ │ ├── div-zero │ │ │ ├── reachable_pass │ │ │ │ └── expected │ │ │ ├── unreachable │ │ │ │ └── expected │ │ │ └── reachable_fail │ │ │ │ └── expected │ │ ├── debug-assert-eq │ │ │ ├── reachable_pass │ │ │ │ └── expected │ │ │ ├── unreachable │ │ │ │ └── expected │ │ │ └── reachable_fail │ │ │ │ └── expected │ │ ├── debug-assert-ne │ │ │ ├── reachable_pass │ │ │ │ └── expected │ │ │ ├── unreachable │ │ │ │ └── expected │ │ │ └── reachable_fail │ │ │ │ └── expected │ │ ├── debug-assert │ │ │ ├── reachable_pass │ │ │ │ └── expected │ │ │ ├── unreachable │ │ │ │ └── expected │ │ │ └── reachable_fail │ │ │ │ └── expected │ │ ├── overflow-neg │ │ │ ├── reachable_pass │ │ │ │ └── expected │ │ │ ├── unreachable │ │ │ │ └── expected │ │ │ └── reachable_fail │ │ │ │ └── expected │ │ ├── overflow │ │ │ ├── reachable_pass │ │ │ │ └── expected │ │ │ ├── unreachable │ │ │ │ └── expected │ │ │ └── reachable_fail │ │ │ │ └── expected │ │ ├── assert │ │ │ ├── reachable_pass │ │ │ │ ├── expected │ │ │ │ └── test.rs │ │ │ ├── unreachable │ │ │ │ └── expected │ │ │ └── reachable_fail │ │ │ │ ├── expected │ │ │ │ └── test.rs │ │ ├── rem-zero │ │ │ ├── reachable_pass │ │ │ │ └── expected │ │ │ ├── unreachable │ │ │ │ └── expected │ │ │ └── reachable_fail │ │ │ │ └── expected │ │ └── bounds │ │ │ ├── reachable_pass │ │ │ └── expected │ │ │ ├── unreachable │ │ │ └── expected │ │ │ └── reachable_fail │ │ │ └── expected │ ├── shadow │ │ ├── slices │ │ │ ├── slice_of_array │ │ │ │ └── expected │ │ │ ├── slice_reverse │ │ │ │ └── expected │ │ │ └── slice_split │ │ │ │ └── expected │ │ └── uninit_array │ │ │ └── expected │ ├── wrapping-offset-bytes-overflow │ │ └── expected │ ├── arith_checks │ │ └── expected │ ├── offset-invalid-args │ │ ├── non_ptr_arg.expected │ │ └── invalid_offset_ty.expected │ ├── pointer-overflow │ │ └── expected │ ├── offset-i32-fail │ │ └── expected │ ├── offset-u8-fail │ │ └── expected │ ├── arith-offset-i32-fail │ │ └── expected │ ├── arith-offset-u8-fail │ │ └── expected │ ├── associated-fn │ │ └── expected │ ├── dead-invalid-access-via-raw │ │ ├── value.expected │ │ └── main.expected │ ├── function-stubbing-no-harness │ │ └── expected │ ├── MemPredicates │ │ └── ptr_size_validity.expected │ ├── uninit │ │ ├── delayed-ub-overapprox.expected │ │ ├── copy │ │ │ ├── copy_without_padding.expected │ │ │ └── non_byte_copy_without_padding.expected │ │ ├── transmute-padding │ │ │ └── expected │ │ ├── alloc-to-slice │ │ │ └── expected │ │ ├── vec-read-bad-len │ │ │ └── expected │ │ ├── vec-read-semi-init │ │ │ └── expected │ │ ├── vec-read-uninit │ │ │ └── expected │ │ ├── access-padding-via-cast │ │ │ └── expected │ │ ├── delayed-ub │ │ │ └── slices_fixme.expected │ │ └── access-padding-uninit │ │ │ └── access-padding-uninit.expected │ ├── generics │ │ └── expected │ ├── static │ │ └── expected │ ├── unwind-flags-conflict │ │ ├── expected │ │ └── main.rs │ ├── allocation │ │ └── expected │ ├── test6 │ │ └── expected │ ├── transmute │ │ └── expected │ ├── verbose-cmds │ │ └── expected │ ├── zst │ │ └── expected │ ├── dynamic-error-trait │ │ └── expected │ ├── dealloc │ │ └── stack │ │ │ └── expected │ ├── derive-invariant │ │ ├── generic_struct │ │ │ └── expected │ │ ├── named_struct │ │ │ └── expected │ │ ├── unnamed_struct │ │ │ └── expected │ │ └── safety_invariant_fail │ │ │ └── expected │ ├── dynamic-trait-static-dispatch │ │ └── expected │ ├── nondet-slice-i32-oob │ │ └── expected │ ├── nondet-slice-u8-oob │ │ └── expected │ ├── quantifiers │ │ ├── assert_with_exists_fail.expected │ │ ├── assume_with_exists_fail.expected │ │ ├── assert_with_forall_fail.expected │ │ ├── assert_with_exists_pass.expected │ │ ├── assert_with_forall_pass.expected │ │ ├── quantifier_with_no_external_variable.expected │ │ └── multiple_quantifiers.expected │ ├── iterator │ │ ├── expected │ │ └── main.rs │ ├── niche │ │ └── expected │ ├── realloc │ │ ├── null │ │ │ └── expected │ │ ├── shrink │ │ │ └── expected │ │ └── zero_size │ │ │ └── expected │ ├── assert-eq │ │ └── expected │ ├── assert-location │ │ ├── debug-assert │ │ │ └── expected │ │ └── assert-false │ │ │ └── expected │ ├── closure3 │ │ └── expected │ ├── issue-2239 │ │ └── issue_2239.expected │ ├── per-harness │ │ └── expected │ ├── valid-value-checks │ │ ├── can_dereference.expected │ │ ├── write_bytes.expected │ │ └── maybe_uninit.expected │ ├── issue-3022 │ │ └── issue_3022.expected │ ├── async_proof │ │ └── expected │ ├── derive-bounded-arbitrary │ │ ├── generic_default.expected │ │ ├── boxed_slice.expected │ │ ├── enum.expected │ │ ├── struct.expected │ │ └── enum_one_variant.expected │ ├── union │ │ └── union_transmute.expected │ ├── issue-2589 │ │ └── issue_2589.expected │ ├── niche2 │ │ └── expected │ ├── offset-from-distance-check │ │ └── expected │ ├── ptr-offset-overflow-bytes │ │ └── expected │ ├── ptr_to_ref_cast │ │ ├── str │ │ │ └── expected │ │ └── alignment │ │ │ └── expected │ ├── array │ │ └── expected │ ├── bounded-arbitrary │ │ ├── option │ │ │ └── option.expected │ │ ├── result │ │ │ └── result.expected │ │ └── string │ │ │ └── string.expected │ ├── offset-from-bytes-overflow │ │ └── expected │ ├── closure2 │ │ └── expected │ ├── slice-pattern-array │ │ └── expected │ ├── offset-bytes-overflow │ │ └── expected │ ├── string-repeat │ │ └── 2235.expected │ ├── test5 │ │ └── expected │ ├── unwind_tip │ │ └── expected │ ├── static-mutable │ │ └── expected │ ├── cover │ │ └── cover-fail │ │ │ └── expected │ ├── object-bits │ │ └── insufficient │ │ │ └── expected │ ├── slice │ │ └── expected │ ├── slice_c_str │ │ └── expected │ ├── any_vec │ │ └── out_bounds.expected │ ├── enum │ │ └── expected │ ├── offset-bounds-check │ │ └── start_from_oob.expected │ ├── stubbing-ambiguous-path │ │ └── expected │ └── test1 │ │ └── expected ├── cargo-kani │ ├── symlink │ │ ├── target │ │ └── expected │ ├── .gitignore │ ├── iss2857 │ │ ├── expected │ │ └── Cargo.toml │ ├── dev-depends │ │ └── expected │ ├── cargo-tests-dir │ │ ├── expected │ │ └── src │ │ │ └── lib.rs │ ├── chrono_dep │ │ └── main.expected │ ├── unexpected_cfgs │ │ ├── expected │ │ └── Cargo.toml │ ├── ws-flag │ │ ├── expected │ │ ├── src │ │ │ └── lib.rs │ │ └── libcrate │ │ │ └── src │ │ │ └── lib.rs │ ├── feature-flag │ │ └── expected │ ├── cbmc-unknown-lang-mode │ │ ├── test.expected │ │ └── src │ │ │ └── lib.rs │ ├── stubbing-extern-path │ │ ├── harness.expected │ │ └── other_crate │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── lib.rs │ ├── stubbing-foreign-method │ │ ├── main.expected │ │ └── other_crate │ │ │ └── Cargo.toml │ ├── stubbing-use-as-foreign │ │ ├── harness.expected │ │ └── other_crate │ │ │ └── Cargo.toml │ ├── stubbing-use-foreign │ │ ├── harness.expected │ │ └── other_crate │ │ │ └── Cargo.toml │ ├── stubbing-use-in-foreign │ │ ├── harness.expected │ │ └── other_crate │ │ │ └── Cargo.toml │ ├── ws-crate-type-bin │ │ ├── expected │ │ └── Cargo.toml │ ├── stubbing-public-foreign-function │ │ ├── main.expected │ │ └── other_crate │ │ │ └── Cargo.toml │ ├── stubbing-use-glob-foreign │ │ ├── harness.expected │ │ └── other_crate │ │ │ └── Cargo.toml │ ├── stubbing-validate-random │ │ └── main.expected │ ├── cargo-features-flag │ │ └── trivial_success.expected │ ├── dependencies │ │ ├── check_dummy.expected │ │ └── src │ │ │ └── lib.rs │ ├── dependency-test │ │ └── diamond-dependency │ │ │ ├── harness.expected │ │ │ └── Cargo.toml │ ├── output-format │ │ ├── main.expected │ │ └── src │ │ │ └── main.rs │ ├── simple-proof-annotation │ │ ├── expected │ │ ├── main.expected │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ ├── stubbing-private-foreign-function │ │ ├── main.expected │ │ └── other_crate │ │ │ └── Cargo.toml │ ├── stubbing-resolve-extern-crate-as │ │ └── harness.expected │ ├── firecracker-block-example │ │ ├── requirement_2642.expected │ │ ├── Cargo.toml │ │ └── src │ │ │ └── virtio_defs.rs │ ├── no-std │ │ ├── expected │ │ └── Cargo.toml │ ├── simple-extern │ │ └── test_sum.expected │ ├── simple-unwind-annotation │ │ ├── expected │ │ ├── harness_1.expected │ │ └── Cargo.toml │ ├── simple-lib │ │ ├── test_one_plus_two.expected │ │ ├── test_sum.expected │ │ └── Cargo.toml │ ├── vecdeque-cve │ │ ├── minimal_example_with_cve_fixed.expected │ │ ├── minimal_example_with_cve_should_fail.expected │ │ ├── abstract_remove_maintains_invariant.expected │ │ ├── abstract_reserve_maintains_invariant_with_cve.expected │ │ └── abstract_reserve_maintains_invariant_with_cve_fixed.expected │ ├── assert-reach │ │ ├── test.expected │ │ └── src │ │ │ └── lib.rs │ ├── mir-linker │ │ └── expected │ ├── rectangle-example │ │ ├── stretched_rectangle_can_hold_original.expected │ │ ├── stretched_rectangle_can_hold_original_fixed.expected │ │ └── src │ │ │ └── lib.rs │ ├── simple-kissat │ │ └── expected │ ├── simple-config-toml │ │ ├── test_one_plus_two.expected │ │ └── test_sum.expected │ ├── simple-main │ │ ├── main.expected │ │ ├── src │ │ │ └── main.rs │ │ └── Cargo.toml │ ├── ws-specified │ │ ├── expected │ │ └── src │ │ │ └── lib.rs │ ├── default-members │ │ ├── main.expected │ │ ├── src │ │ │ └── main.rs │ │ ├── builds-ok │ │ │ ├── src │ │ │ │ └── main.rs │ │ │ └── Cargo.toml │ │ └── dont-build-me │ │ │ ├── src │ │ │ └── main.rs │ │ │ └── Cargo.toml │ ├── zero-harnesses-is-success │ │ ├── expected │ │ ├── src │ │ │ └── lib.rs │ │ └── Cargo.toml │ ├── asm │ │ └── global │ │ │ ├── calls_crate_with_global_asm.expected │ │ │ └── reads_static_var_in_crate_with_global_asm.expected │ ├── nested-dirs │ │ ├── crate1 │ │ │ ├── a_check.expected │ │ │ └── src │ │ │ │ └── lib.rs │ │ ├── crate2 │ │ │ ├── another_check.expected │ │ │ ├── nested_crate │ │ │ │ └── yet_another_check.expected │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── Cargo.toml │ ├── libc │ │ └── src │ │ │ └── lib.rs │ ├── codegen-scalar-with-zsts │ │ └── check_zst.expected │ ├── itoa_dep │ │ └── check_unsigned.expected │ ├── codegen-scalar-with-phantom │ │ └── check_phantom_data.expected │ ├── stubbing-do-not-resolve │ │ ├── other_crate1 │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── other_crate2 │ │ │ └── src │ │ │ └── lib.rs │ ├── small-vec │ │ ├── check_vec.expected │ │ └── Cargo.toml │ ├── storage-markers │ │ ├── crate-with-harness │ │ │ └── call_fn_with_bug.expected │ │ ├── Cargo.toml │ │ └── crate-with-bug │ │ │ └── Cargo.toml │ ├── build-rs-works │ │ ├── build.rs │ │ ├── src │ │ │ └── lib.rs │ │ └── Cargo.toml │ ├── demos │ │ └── non-empty-range │ │ │ └── check_range.expected │ ├── build-rs-plus-host-with-kani-proofs │ │ ├── README.md │ │ └── constants │ │ │ └── Cargo.toml │ ├── stubbing-double-extern-path │ │ ├── crate_a │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── harness │ │ │ └── expected │ └── type-mismatch │ │ └── uses_std │ │ └── src │ │ └── lib.rs ├── ui │ ├── logging │ │ ├── debug │ │ │ └── expected │ │ └── warning │ │ │ └── expected │ ├── stub-attribute │ │ └── expected │ ├── terse-output-format-pass │ │ ├── expected │ │ └── main.rs │ ├── code-location │ │ ├── module │ │ │ └── expected │ │ └── expected │ ├── harness-timeout │ │ ├── hours.expected │ │ ├── minutes.expected │ │ ├── no_timeout.expected │ │ ├── invalid.expected │ │ └── timeout.expected │ ├── stubbing │ │ ├── stubbing-flag │ │ │ └── expected │ │ └── invalid-path │ │ │ └── invalid_mod.expected │ ├── loop-contracts-synthesis │ │ ├── main_signed │ │ │ └── expected │ │ └── main_unsigned │ │ │ └── expected │ ├── cbmc_checks │ │ ├── float-overflow │ │ │ └── check_message_overflow.expected │ │ └── pointer │ │ │ └── expected │ ├── solver-attribute │ │ ├── cadical │ │ │ └── expected │ │ ├── not-found │ │ │ └── expected │ │ ├── no-arg │ │ │ ├── test.rs │ │ │ └── expected │ │ ├── invalid │ │ │ └── test.rs │ │ ├── unknown │ │ │ ├── test.rs │ │ │ └── expected │ │ ├── multiple-args │ │ │ └── test.rs │ │ └── multiple-attrs │ │ │ ├── test.rs │ │ │ └── expected │ ├── solver-option │ │ ├── cadical │ │ │ └── expected │ │ ├── invalid │ │ │ └── expected │ │ ├── minisat │ │ │ └── expected │ │ ├── bin │ │ │ └── expected │ │ └── kissat │ │ │ └── expected │ ├── invalid-cbmc-function-arg │ │ └── expected │ ├── entry-fn │ │ ├── non-main │ │ │ └── expected │ │ └── main │ │ │ └── expected │ ├── std-override │ │ └── format_panic.expected │ ├── terse-output-format-fail │ │ ├── expected │ │ └── fail.rs │ ├── unwind-multiple-arguments │ │ └── expected │ ├── unwind-without-proof │ │ └── expected │ ├── derive-arbitrary │ │ ├── empty_struct │ │ │ └── expected │ │ ├── generic_struct │ │ │ └── expected │ │ ├── named_struct │ │ │ └── expected │ │ ├── unnamed_struct │ │ │ └── expected │ │ └── empty_enum │ │ │ └── expected │ ├── save-coverage-results │ │ └── expected │ ├── unsupported-annotation │ │ └── expected │ ├── mir-linker │ │ └── generic-harness │ │ │ └── expected │ ├── arguments-proof │ │ ├── missing-unstable-flag │ │ │ └── expected │ │ └── expected │ ├── multiple-harnesses │ │ ├── no_matching_harness │ │ │ └── expected │ │ ├── stop_at_single_fail │ │ │ ├── fail_fast_test.expected │ │ │ └── fail_fast_test_parallel.expected │ │ ├── check_all │ │ │ └── expected │ │ ├── check_some │ │ │ └── expected │ │ └── some_matching_harnesses │ │ │ └── expected │ ├── should-panic-attribute │ │ ├── multiple-harnesses-panic │ │ │ └── expected │ │ ├── multiple-attrs │ │ │ └── expected │ │ ├── no-panics │ │ │ └── expected │ │ ├── with-args │ │ │ └── expected │ │ └── expected-panics │ │ │ └── expected │ ├── function-contracts │ │ └── mutating_ensures_error.expected │ ├── regular-output-format-fail │ │ ├── expected │ │ └── fail.rs │ ├── check_summary_for_single_harness │ │ └── expected │ ├── concrete-playback │ │ ├── README.md │ │ └── unsupported │ │ │ └── expected │ ├── cover-property-class │ │ └── expected │ ├── regular-output-format-pass │ │ ├── expected │ │ └── main.rs │ ├── exact-harness │ │ ├── fail_on_missing │ │ │ └── expected │ │ ├── incomplete-harness-name │ │ │ └── expected │ │ ├── check-qualified-name │ │ │ └── expected │ │ ├── check_some │ │ │ └── expected │ │ ├── check_substring_not_matching │ │ │ └── expected │ │ └── multiple_matches │ │ │ └── expected │ ├── multiple-proof-attributes │ │ └── expected │ ├── Property-Class-UI │ │ └── cover │ │ │ ├── expected │ │ │ └── main.rs │ ├── compiler-stats │ │ └── expected │ ├── missing-function │ │ └── extern_c │ │ │ └── expected │ └── safety-constraint-attribute │ │ ├── double-attribute │ │ └── expected │ │ ├── no-struct-error │ │ └── expected │ │ └── mixed-attributes │ │ └── expected ├── script-based-pre │ ├── kani_lib_dep │ │ ├── expected │ │ └── config.yml │ ├── kani_list_md │ │ ├── .gitignore │ │ └── config.yml │ ├── cargo_list_md │ │ ├── .gitignore │ │ └── config.yml │ ├── error-code │ │ ├── exit-one.expected │ │ ├── exit-one.sh │ │ └── config.yml │ ├── check-output │ │ ├── .gitignore │ │ ├── config.yml │ │ └── multifile │ │ │ └── Cargo.toml │ ├── check-quiet │ │ ├── check-quiet.expected │ │ └── config.yml │ ├── no_codegen_error │ │ ├── expected │ │ ├── config.yml │ │ └── Cargo.toml │ ├── crate-name │ │ ├── crate-name.expected │ │ ├── config.yml │ │ ├── a │ │ │ └── src │ │ │ │ └── lib.rs │ │ ├── my-code.rs │ │ ├── b │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── c │ │ │ └── src │ │ │ └── lib.rs │ ├── cargo_manifest_test │ │ ├── manifest_test.expected │ │ ├── config.yml │ │ └── add │ │ │ ├── src │ │ │ └── main.rs │ │ │ └── Cargo.toml │ ├── kani-version-flag-version │ │ ├── kani-version-flag-version.expected │ │ └── config.yml │ ├── mem-init-reinstrumentation │ │ ├── mem-init-reinstrumentation.expected │ │ └── config.yml │ ├── individual_file_output │ │ └── config.yml │ ├── kani_autoharness_exclude_precedence │ │ └── config.yml │ ├── std_codegen │ │ ├── codegen_std.expected │ │ ├── config.yml │ │ └── dummy │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── lib.rs │ ├── ambiguous_crate │ │ └── config.yml │ ├── cargo-kani-version-flag-version │ │ ├── cargo-kani-version-flag-version.expected │ │ └── config.yml │ ├── cargo_list_json │ │ └── config.yml │ ├── kani_list_json │ │ └── config.yml │ ├── playback_expected │ │ └── config.yml │ ├── build-cache-dirty │ │ └── config.yml │ ├── build-rs-conditional │ │ └── config.yml │ ├── cargo_autoharness_list │ │ ├── config.yml │ │ └── list.sh │ ├── no_codegen │ │ ├── config.yml │ │ ├── expected │ │ └── Cargo.toml │ ├── playback_print │ │ └── config.yml │ ├── cargo_autoharness_filter │ │ ├── config.yml │ │ └── filter.sh │ ├── mir_stub_panic │ │ ├── config.yml │ │ └── panic.rs │ ├── playback_zero_size │ │ ├── playback_zst.expected │ │ └── config.yml │ ├── tool-scanner │ │ └── config.yml │ ├── verify_std_cmd │ │ └── config.yml │ ├── build-cache-bin │ │ ├── config.yml │ │ └── bin │ │ │ └── Cargo.toml │ ├── build-cache-fresh │ │ └── config.yml │ ├── cargo_autoharness_exclude │ │ ├── config.yml │ │ └── exclude.sh │ ├── cargo_autoharness_include │ │ ├── config.yml │ │ └── include.sh │ ├── playback_opts │ │ └── config.yml │ ├── cargo_playback_opts │ │ ├── config.yml │ │ └── playback_opts.expected │ ├── concrete_playback_e2e │ │ └── config.yml │ ├── playback_array │ │ └── config.yml │ ├── autoderive_arbitrary_enums │ │ ├── config.yml │ │ └── enums.sh │ ├── autoharness-refs_mutable │ │ ├── config.yml │ │ └── run.sh │ ├── cargo_playback_target │ │ └── config.yml │ ├── playback_already_existing │ │ └── config.yml │ ├── autoderive_arbitrary_structs │ │ ├── config.yml │ │ └── structs.sh │ ├── autoharness-refs_immutable │ │ ├── config.yml │ │ └── run.sh │ ├── cargo_autoharness_dependencies │ │ ├── config.yml │ │ ├── dependencies.sh │ │ └── other_crate │ │ │ ├── src │ │ │ └── lib.rs │ │ │ └── Cargo.toml │ ├── cargo_autoharness_contracts │ │ ├── config.yml │ │ └── contracts.sh │ ├── cargo_playback_build │ │ └── config.yml │ ├── playback_multi_harness_multi_inject │ │ └── config.yml │ ├── playback_no_rustfmt │ │ ├── config.yml │ │ └── playback_no_rustfmt.expected │ ├── cargo_autoharness_harnesses_fail │ │ ├── harnesses_fail.sh │ │ └── config.yml │ ├── playback_with_cfg_kani │ │ ├── config.yml │ │ └── playback_with_cfg_kani.expected │ ├── cargo_autoharness_type_invariant │ │ ├── type-invariant.sh │ │ └── config.yml │ ├── cargo_autoharness_termination_timeout │ │ ├── termination_timeout.sh │ │ └── config.yml │ └── cargo_autoharness_termination_unwind │ │ └── config.yml ├── cargo-ui │ ├── verbose │ │ └── expected │ ├── stubbing-flag │ │ └── expected │ ├── debug │ │ ├── expected │ │ └── Cargo.toml │ ├── unsupported-lib-types │ │ ├── rlib-pmacro │ │ │ └── expected │ │ └── proc-macro │ │ │ └── expected │ ├── supported-lib-types │ │ ├── cdylib │ │ │ └── expected │ │ ├── dylib │ │ │ └── expected │ │ ├── lib │ │ │ └── expected │ │ ├── rlib │ │ │ └── expected │ │ ├── cdylib-rlib │ │ │ └── expected │ │ ├── lib-rlib │ │ │ └── expected │ │ └── staticlib │ │ │ └── expected │ ├── target-selection │ │ ├── lib-target │ │ │ └── expected │ │ ├── bin-target │ │ │ └── expected │ │ └── non-test-targets │ │ │ └── expected │ ├── unstable-attr │ │ └── enabled │ │ │ └── expected │ ├── multiple-harnesses │ │ └── expected │ ├── verbose-cmds │ │ └── expected │ ├── ws-package-exclude-unknown │ │ ├── expected │ │ ├── src │ │ │ └── main.rs │ │ ├── bin_package │ │ │ └── src │ │ │ │ └── main.rs │ │ └── lib_package │ │ │ └── src │ │ │ └── lib.rs │ ├── ws-package-select-unknown │ │ ├── expected │ │ ├── src │ │ │ └── main.rs │ │ ├── bin_package │ │ │ └── src │ │ │ │ └── main.rs │ │ └── lib_package │ │ │ └── src │ │ │ └── lib.rs │ ├── ws-package-exclude │ │ ├── expected │ │ ├── src │ │ │ └── main.rs │ │ ├── bin_package │ │ │ └── src │ │ │ │ └── main.rs │ │ └── lib_package │ │ │ └── src │ │ │ └── lib.rs │ ├── ws-package-select │ │ ├── expected │ │ ├── src │ │ │ └── main.rs │ │ ├── bin_package │ │ │ └── src │ │ │ │ └── main.rs │ │ └── lib_package │ │ │ └── src │ │ │ └── lib.rs │ └── no-std-no-kani │ │ ├── Cargo.toml │ │ └── expected ├── perf │ ├── vec │ │ ├── box_dyn │ │ │ └── expected │ │ ├── string │ │ │ └── expected │ │ └── vec │ │ │ └── expected │ ├── btreeset │ │ ├── insert_any │ │ │ └── expected │ │ ├── insert_same │ │ │ └── expected │ │ └── insert_multi │ │ │ └── expected │ ├── hashset │ │ └── expected │ ├── format │ │ └── expected │ ├── overlays │ │ └── s2n-quic │ │ │ ├── common │ │ │ └── s2n-codec │ │ │ │ └── expected │ │ │ └── quic │ │ │ ├── s2n-quic-core │ │ │ └── expected │ │ │ └── s2n-quic-platform │ │ │ └── expected │ ├── misc │ │ ├── array_fold │ │ │ └── expected │ │ ├── struct_defs │ │ │ └── expected │ │ └── display_trait │ │ │ └── expected │ ├── string │ │ └── expected │ └── smol_str │ │ └── expected ├── slow │ └── tokio-proofs │ │ ├── expected │ │ └── src │ │ ├── tokio_stream │ │ └── support │ │ │ └── mod.rs │ │ ├── tokio │ │ └── support │ │ │ └── mod.rs │ │ ├── tokio_test │ │ └── mod.rs │ │ ├── tokio_util │ │ └── mod.rs │ │ └── lib.rs ├── std-checks │ ├── core │ │ ├── slice.expected │ │ ├── mem.expected │ │ └── ptr.expected │ └── std │ │ ├── atomic.expected │ │ ├── boxed.expected │ │ └── src │ │ ├── sync │ │ └── mod.rs │ │ └── lib.rs ├── .gitignore ├── kani │ ├── Cast │ │ └── path.rs │ ├── Strings │ │ └── boxed_str.rs │ ├── Asm │ │ └── main_fixme.rs │ ├── Slice │ │ ├── slice.rs │ │ ├── main.rs │ │ └── codegen.rs │ ├── Pointers_Basic │ │ └── main.rs │ ├── FileNameWithSpace │ │ └── my src │ │ │ └── hi.rs │ └── FunctionSymbols │ │ └── fixme_main.rs ├── README.md ├── cargo-coverage │ └── simple-lib │ │ └── Cargo.toml └── coverage │ └── div-zero │ └── test.rs ├── scripts ├── setup │ ├── macos-11 │ ├── macos-12 │ ├── macos-13 │ ├── macos-14 │ ├── macos-15 │ ├── macos-10.15 │ ├── macos-15-intel │ ├── ubuntu-22.04 │ ├── ubuntu-24.04 │ └── ubuntu-24.04-arm └── pyproject.toml ├── tools └── benchcomp │ ├── requirements.txt │ ├── .gitignore │ ├── test │ ├── unit │ │ └── __init__.py │ └── README.md │ ├── benchcomp │ └── entry │ │ ├── __init__.py │ │ └── README.md │ └── configs │ └── README.md ├── favicon.ico ├── kani-logo.png ├── .dockerignore ├── docs └── src │ ├── tutorial │ ├── arbitrary-variables │ │ ├── check_rating.expected │ │ ├── src │ │ │ └── lib.rs │ │ └── safe_update.expected │ ├── first-steps-v2 │ │ ├── will_fail.expected │ │ └── verify_success.expected │ ├── kinds-of-failure │ │ ├── add_overflow.expected │ │ ├── midpoint_overflow.expected │ │ ├── bound_check.expected │ │ └── src │ │ │ └── lib.rs │ ├── first-steps-v1 │ │ └── check_estimate_size.expected │ └── loops-unwinding │ │ ├── check_initialize_prefix.expected │ │ └── Cargo.toml │ ├── cargo-kani.md │ ├── kani-single-file.md │ ├── getting-started │ └── verification-results │ │ ├── success_example.expected │ │ ├── failure_example.expected │ │ ├── undetermined_example.expected │ │ └── unreachable_example.expected │ └── reference.md ├── kani-dependencies ├── .github └── CODEOWNERS ├── kani-driver └── src │ ├── coverage │ └── mod.rs │ └── concrete_playback │ └── mod.rs ├── src └── bin │ ├── kani.rs │ └── cargo_kani.rs ├── kani-compiler └── Cargo.lock ├── rust-toolchain.toml ├── library ├── kani │ └── build.rs └── kani_macros │ └── build.rs └── rustfmt.toml /tests/kani-docs: -------------------------------------------------------------------------------- 1 | ../docs/ -------------------------------------------------------------------------------- /tests/kani-fixme: -------------------------------------------------------------------------------- 1 | kani -------------------------------------------------------------------------------- /scripts/setup/macos-11: -------------------------------------------------------------------------------- 1 | macos -------------------------------------------------------------------------------- /scripts/setup/macos-12: -------------------------------------------------------------------------------- 1 | macos -------------------------------------------------------------------------------- /scripts/setup/macos-13: -------------------------------------------------------------------------------- 1 | macos -------------------------------------------------------------------------------- /scripts/setup/macos-14: -------------------------------------------------------------------------------- 1 | macos -------------------------------------------------------------------------------- /scripts/setup/macos-15: -------------------------------------------------------------------------------- 1 | macos -------------------------------------------------------------------------------- /tests/llbc/enum/expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/llbc/generic/expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/llbc/option/expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/llbc/struct/expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/llbc/tuple/expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scripts/setup/macos-10.15: -------------------------------------------------------------------------------- 1 | macos -------------------------------------------------------------------------------- /scripts/setup/macos-15-intel: -------------------------------------------------------------------------------- 1 | macos -------------------------------------------------------------------------------- /scripts/setup/ubuntu-22.04: -------------------------------------------------------------------------------- 1 | ubuntu -------------------------------------------------------------------------------- /scripts/setup/ubuntu-24.04: -------------------------------------------------------------------------------- 1 | ubuntu -------------------------------------------------------------------------------- /tests/expected/panic/expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/llbc/projection/expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/llbc/traitimpl/expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scripts/setup/ubuntu-24.04-arm: -------------------------------------------------------------------------------- 1 | ubuntu -------------------------------------------------------------------------------- /tests/cargo-kani/symlink/target: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /tests/ui/logging/debug/expected: -------------------------------------------------------------------------------- 1 | DEBUG 2 | -------------------------------------------------------------------------------- /tests/script-based-pre/kani_lib_dep/expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-ui/verbose/expected: -------------------------------------------------------------------------------- 1 | goto-cc 2 | cbmc 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /tests/expected/one-assert/expected: -------------------------------------------------------------------------------- 1 | ** 0 of 1 failed 2 | -------------------------------------------------------------------------------- /tests/ui/stub-attribute/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tools/benchcomp/requirements.txt: -------------------------------------------------------------------------------- 1 | cerberus 2 | pyyaml 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/iss2857/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/symlink/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/perf/vec/box_dyn/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/perf/vec/string/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/script-based-pre/kani_list_md/.gitignore: -------------------------------------------------------------------------------- 1 | kani-list.md 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/dev-depends/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-ui/stubbing-flag/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/loop-backedge/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_list_md/.gitignore: -------------------------------------------------------------------------------- 1 | kani-list.md 2 | -------------------------------------------------------------------------------- /tests/ui/terse-output-format-pass/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION RESULT: 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/cargo-tests-dir/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/chrono_dep/main.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/unexpected_cfgs/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/ws-flag/expected: -------------------------------------------------------------------------------- 1 | 2 successfully verified harnesses 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/ui/statement.expected: -------------------------------------------------------------------------------- 1 | error 2 | -------------------------------------------------------------------------------- /tests/expected/report/verification-time/expected: -------------------------------------------------------------------------------- 1 | Verification Time: 2 | -------------------------------------------------------------------------------- /tests/perf/btreeset/insert_any/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/perf/btreeset/insert_same/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/script-based-pre/error-code/exit-one.expected: -------------------------------------------------------------------------------- 1 | Exiting with code 1! -------------------------------------------------------------------------------- /tests/ui/code-location/module/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | 3 | -------------------------------------------------------------------------------- /tests/ui/harness-timeout/hours.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/ui/harness-timeout/minutes.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/ui/stubbing/stubbing-flag/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/model-checking/kani/HEAD/favicon.ico -------------------------------------------------------------------------------- /tests/cargo-kani/feature-flag/expected: -------------------------------------------------------------------------------- 1 | 3 successfully verified harnesses 2 | -------------------------------------------------------------------------------- /tests/cargo-ui/debug/expected: -------------------------------------------------------------------------------- 1 | DEBUG kani_compiler 2 | goto-cc 3 | cbmc 4 | -------------------------------------------------------------------------------- /tests/expected/arith-offset-overflow/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/coroutines/as_parameter/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/empty/expected: -------------------------------------------------------------------------------- 1 | 0 of 0 failed 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/unreachable/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | "unreachable code" -------------------------------------------------------------------------------- /tests/expected/loop-contract/count_zero.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/references/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: z == 2 3 | -------------------------------------------------------------------------------- /tests/expected/stubbing-const-generics/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/ui/harness-timeout/no_timeout.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /kani-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/model-checking/kani/HEAD/kani-logo.png -------------------------------------------------------------------------------- /tests/cargo-kani/cbmc-unknown-lang-mode/test.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-extern-path/harness.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-foreign-method/main.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-use-as-foreign/harness.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-use-foreign/harness.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-use-in-foreign/harness.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/cargo-kani/ws-crate-type-bin/expected: -------------------------------------------------------------------------------- 1 | 2 successfully verified harnesses 2 | -------------------------------------------------------------------------------- /tests/expected/assert-arg-error/expected: -------------------------------------------------------------------------------- 1 | cannot find value `foo` in this scope 2 | -------------------------------------------------------------------------------- /tests/expected/derive-arbitrary/phantom_data/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/breakpoint/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: true -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-div-div-zero/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | division by zero -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-rem-div-zero/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | division by zero -------------------------------------------------------------------------------- /tests/expected/loop-contract/memchar_naive.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/small_slice_eq.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/reach/turned-off/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: x != 11 3 | -------------------------------------------------------------------------------- /tests/expected/shadow/slices/slice_of_array/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/shadow/slices/slice_reverse/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/shadow/slices/slice_split/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | firecracker 3 | target/debug 4 | target/release 5 | build 6 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-public-foreign-function/main.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-use-glob-foreign/harness.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-validate-random/main.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/derive-arbitrary/phantom_pinned/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/simple_while_loop.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/wrapping-offset-bytes-overflow/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/perf/hashset/expected: -------------------------------------------------------------------------------- 1 | 2 successfully verified harnesses, 0 failures, 2 total 2 | -------------------------------------------------------------------------------- /tests/ui/loop-contracts-synthesis/main_signed/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/ui/loop-contracts-synthesis/main_unsigned/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /docs/src/tutorial/arbitrary-variables/check_rating.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/cargo-features-flag/trivial_success.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/dependencies/check_dummy.expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: x > 2 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/dependency-test/diamond-dependency/harness.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/cargo-kani/output-format/main.expected: -------------------------------------------------------------------------------- 1 | Description: "assertion failed: 1 + 1 == 2" 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-proof-annotation/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | assertion failed: 3 == 4 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-private-foreign-function/main.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-resolve-extern-crate-as/harness.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/expected/arith_checks/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: attempt to subtract with overflow 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/attribute_no_complain.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/expr_pass.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/field_pass.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/global_pass.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/simple_pass.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/stmt_expr.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/multiple_replace_pass.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/copy-nonoverlapping/copy-overlapping/expected: -------------------------------------------------------------------------------- 1 | memcpy src/dst overlap -------------------------------------------------------------------------------- /tests/expected/offset-invalid-args/non_ptr_arg.expected: -------------------------------------------------------------------------------- 1 | Cannot offset non-pointer type 2 | -------------------------------------------------------------------------------- /tests/expected/pointer-overflow/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Offset in bytes overflows isize 2 | -------------------------------------------------------------------------------- /tests/script-based-pre/check-output/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock 3 | *.c 4 | build/ 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/check-quiet/check-quiet.expected: -------------------------------------------------------------------------------- 1 | success: `--quiet` produced NO output -------------------------------------------------------------------------------- /tests/script-based-pre/no_codegen_error/expected: -------------------------------------------------------------------------------- 1 | could not compile `no_codegen_error` 2 | -------------------------------------------------------------------------------- /tests/ui/cbmc_checks/float-overflow/check_message_overflow.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /docs/src/cargo-kani.md: -------------------------------------------------------------------------------- 1 | # Usage on a package 2 | 3 | [See here](./usage.md#usage-on-a-package) 4 | -------------------------------------------------------------------------------- /docs/src/tutorial/first-steps-v2/will_fail.expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | assertion failed: x < 4096 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/firecracker-block-example/requirement_2642.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/no-std/expected: -------------------------------------------------------------------------------- 1 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. -------------------------------------------------------------------------------- /tests/cargo-kani/simple-extern/test_sum.expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion rust_add1(x) == x + 1 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-unwind-annotation/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | assertion failed: counter < 10 3 | -------------------------------------------------------------------------------- /tests/expected/function-contract/generic_infinity_recursion.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/ui/no_args.expected: -------------------------------------------------------------------------------- 1 | Failed assertion args.len() == 1 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/ui/noncopy_ignore.expected: -------------------------------------------------------------------------------- 1 | use of moved value: `ptr` 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/prohibit-pointers/hidden.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/type_annotation_needed.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/perf/format/expected: -------------------------------------------------------------------------------- 1 | Complete - 2 successfully verified harnesses, 0 failures, 2 total 2 | -------------------------------------------------------------------------------- /tests/ui/solver-attribute/cadical/expected: -------------------------------------------------------------------------------- 1 | Solving with CaDiCaL 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/ui/solver-option/cadical/expected: -------------------------------------------------------------------------------- 1 | Solving with CaDiCaL 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/ui/solver-option/invalid/expected: -------------------------------------------------------------------------------- 1 | error: invalid value 'foo=bar' for '--solver ' 2 | -------------------------------------------------------------------------------- /tests/ui/solver-option/minisat/expected: -------------------------------------------------------------------------------- 1 | Solving with MiniSAT 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /docs/src/tutorial/kinds-of-failure/add_overflow.expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | attempt to add with overflow 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-lib/test_one_plus_two.expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: p.sum() == 3 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/vecdeque-cve/minimal_example_with_cve_fixed.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/vecdeque-cve/minimal_example_with_cve_should_fail.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- FAILED 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/prohibit-pointers/allowed_ref.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/prohibit-pointers/plain_pointer.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/copy/copy-unaligned-dst/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | `dst` must be properly aligned -------------------------------------------------------------------------------- /tests/expected/intrinsics/copy/copy-unaligned-src/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | `src` must be properly aligned -------------------------------------------------------------------------------- /tests/expected/intrinsics/copy/copy-unreadable-src/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | memmove source region readable -------------------------------------------------------------------------------- /tests/expected/intrinsics/volatile_load/unaligned/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | `src` must be properly aligned -------------------------------------------------------------------------------- /tests/expected/intrinsics/write_bytes/unaligned/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | `dst` must be properly aligned -------------------------------------------------------------------------------- /tests/expected/loop-contract/count_zero_loop_contracts_disable.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/offset-i32-fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | dereference failure: pointer outside object bounds -------------------------------------------------------------------------------- /tests/expected/offset-invalid-args/invalid_offset_ty.expected: -------------------------------------------------------------------------------- 1 | Cannot offset by non-isize type u32 2 | -------------------------------------------------------------------------------- /tests/expected/offset-u8-fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | dereference failure: pointer outside object bounds -------------------------------------------------------------------------------- /tests/perf/overlays/s2n-quic/common/s2n-codec/expected: -------------------------------------------------------------------------------- 1 | successfully verified harnesses, 0 failures 2 | -------------------------------------------------------------------------------- /tests/ui/solver-option/bin/expected: -------------------------------------------------------------------------------- 1 | Solving with External SAT solver 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /docs/src/tutorial/first-steps-v1/check_estimate_size.expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | Oh no, a failing corner case! 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/assert-reach/test.expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "assertion failed: z == x - 1" 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/mir-linker/expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Next is greater\ 3 | in function check_version 4 | -------------------------------------------------------------------------------- /tests/cargo-kani/rectangle-example/stretched_rectangle_can_hold_original.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- FAILED 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-kissat/expected: -------------------------------------------------------------------------------- 1 | Solving with External SAT solver 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/vecdeque-cve/abstract_remove_maintains_invariant.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-ui/unsupported-lib-types/rlib-pmacro/expected: -------------------------------------------------------------------------------- 1 | error: could not compile `unsupported-lib` 2 | -------------------------------------------------------------------------------- /tests/expected/arith-offset-i32-fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | dereference failure: pointer outside object bounds -------------------------------------------------------------------------------- /tests/expected/arith-offset-u8-fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | dereference failure: pointer outside object bounds -------------------------------------------------------------------------------- /tests/expected/associated-fn/expected: -------------------------------------------------------------------------------- 1 | Checking harness Dummy::new... 2 | VERIFICATION:- SUCCESSFUL 3 | 4 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/ui/old_result.expected: -------------------------------------------------------------------------------- 1 | cannot find value `result` in this scope 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/check_only_verification.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/fail_missing_recursion_attr.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- FAILED 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/simple_only_verification.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/prohibit-pointers/allowed_const_ptr.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/prohibit-pointers/allowed_mut_ref.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/prohibit-pointers/return_pointer.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/copy/copy-unwritable-dst/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | memmove destination region writeable -------------------------------------------------------------------------------- /tests/expected/intrinsics/write_bytes/out-of-bounds/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | memset destination region writeable -------------------------------------------------------------------------------- /tests/perf/misc/array_fold/expected: -------------------------------------------------------------------------------- 1 | Complete - 0 successfully verified harnesses, 2 failures, 2 total. 2 | -------------------------------------------------------------------------------- /tests/perf/misc/struct_defs/expected: -------------------------------------------------------------------------------- 1 | Complete - 3 successfully verified harnesses, 0 failures, 3 total. 2 | -------------------------------------------------------------------------------- /tests/perf/overlays/s2n-quic/quic/s2n-quic-core/expected: -------------------------------------------------------------------------------- 1 | successfully verified harnesses, 0 failures 2 | -------------------------------------------------------------------------------- /tests/perf/overlays/s2n-quic/quic/s2n-quic-platform/expected: -------------------------------------------------------------------------------- 1 | successfully verified harnesses, 0 failures 2 | -------------------------------------------------------------------------------- /tests/slow/tokio-proofs/expected: -------------------------------------------------------------------------------- 1 | Complete - 27 successfully verified harnesses, 0 failures, 27 total. 2 | -------------------------------------------------------------------------------- /tests/std-checks/core/slice.expected: -------------------------------------------------------------------------------- 1 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 2 | -------------------------------------------------------------------------------- /tests/std-checks/std/atomic.expected: -------------------------------------------------------------------------------- 1 | Complete - 5 successfully verified harnesses, 0 failures, 5 total. 2 | -------------------------------------------------------------------------------- /tests/std-checks/std/boxed.expected: -------------------------------------------------------------------------------- 1 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 2 | -------------------------------------------------------------------------------- /tests/ui/invalid-cbmc-function-arg/expected: -------------------------------------------------------------------------------- 1 | error: Invalid flag: --function is not supported in Kani. 2 | -------------------------------------------------------------------------------- /tests/ui/solver-option/kissat/expected: -------------------------------------------------------------------------------- 1 | Solving with External SAT solver 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /docs/src/kani-single-file.md: -------------------------------------------------------------------------------- 1 | # Usage on a single file 2 | 3 | [See here](./usage.md#usage-on-a-single-crate) 4 | -------------------------------------------------------------------------------- /kani-dependencies: -------------------------------------------------------------------------------- 1 | CBMC_MAJOR="6" 2 | CBMC_MINOR="8" 3 | CBMC_VERSION="6.8.0" 4 | 5 | KISSAT_VERSION="4.0.1" 6 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-config-toml/test_one_plus_two.expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: p.sum() == 3 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-lib/test_sum.expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: p.sum() == a.wrapping_add(b) 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-main/main.expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | assertion failed: 1 == 2 3 | VERIFICATION:- FAILED 4 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-proof-annotation/main.expected: -------------------------------------------------------------------------------- 1 | error: no harnesses matched the harness filter: `main` 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-unwind-annotation/harness_1.expected: -------------------------------------------------------------------------------- 1 | UNDETERMINED\ 2 | assertion failed: counter < 10 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/vecdeque-cve/abstract_reserve_maintains_invariant_with_cve.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- FAILED 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/ws-specified/expected: -------------------------------------------------------------------------------- 1 | Complete - 1 successfully verified harnesses, 1 failures, 2 total. 2 | -------------------------------------------------------------------------------- /tests/cargo-ui/supported-lib-types/cdylib/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_ok... 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/cargo-ui/supported-lib-types/dylib/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_ok... 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/cargo-ui/supported-lib-types/lib/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_ok... 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/cargo-ui/supported-lib-types/rlib/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_ok... 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/expected/dead-invalid-access-via-raw/value.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: dereference failure: dead object 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/const_fn.expected: -------------------------------------------------------------------------------- 1 | Checking harness check... 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/expected/function-contract/prohibit-pointers/allowed_mut_return_ref.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/function-stubbing-no-harness/expected: -------------------------------------------------------------------------------- 1 | error: no harnesses matched the harness filter: `foo` 2 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/sub_with_overflow_ice_fixme/expected: -------------------------------------------------------------------------------- 1 | Kani unexpectedly panicked during compilation. 2 | -------------------------------------------------------------------------------- /tests/expected/reach/assert_eq/unreachable/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "assertion failed: y == 55" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/assert_ne/unreachable/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "assertion failed: y != 1" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/div-zero/reachable_pass/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | Description: "attempt to divide by zero" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/div-zero/unreachable/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "attempt to divide by zero" 3 | -------------------------------------------------------------------------------- /tests/perf/btreeset/insert_multi/expected: -------------------------------------------------------------------------------- 1 | ** 2 of 2 cover properties satisfied 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/perf/misc/display_trait/expected: -------------------------------------------------------------------------------- 1 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/default-members/main.expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | assertion failed: 1 == 2 3 | VERIFICATION:- FAILED 4 | -------------------------------------------------------------------------------- /tests/cargo-kani/rectangle-example/stretched_rectangle_can_hold_original_fixed.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-config-toml/test_sum.expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: p.sum() == a.wrapping_add(b) 3 | -------------------------------------------------------------------------------- /tests/cargo-ui/supported-lib-types/cdylib-rlib/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_ok... 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/cargo-ui/supported-lib-types/lib-rlib/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_ok... 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/cargo-ui/supported-lib-types/staticlib/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_ok... 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/simple_only_verification_modifies.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/copy-nonoverlapping/copy-unaligned-dst/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | `dst` must be properly aligned -------------------------------------------------------------------------------- /tests/expected/intrinsics/copy-nonoverlapping/copy-unaligned-src/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | `src` must be properly aligned -------------------------------------------------------------------------------- /tests/expected/intrinsics/copy-nonoverlapping/copy-unreadable-src/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | memcpy source region readable -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-shl-shift-negative/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | attempt simd_shl with negative shift distance -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-shl-shift-too-large/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | attempt simd_shl with excessive shift distance -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-shr-shift-negative/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | attempt simd_shr with negative shift distance -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-shr-shift-too-large/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | attempt simd_shr with excessive shift distance -------------------------------------------------------------------------------- /tests/expected/loop-contract/simple_while_loop_not_enabled.expected: -------------------------------------------------------------------------------- 1 | Unwinding loop 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/expected/reach/debug-assert-eq/reachable_pass/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | Description: "assertion failed: x == 10" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/debug-assert-ne/reachable_pass/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | Description: "assertion failed: x != 17" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/debug-assert/reachable_pass/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | Description: "assertion failed: x != -10" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/debug-assert/unreachable/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "assertion failed: x != -10" 3 | -------------------------------------------------------------------------------- /tests/ui/entry-fn/non-main/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: pos != 0 3 | 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/ui/std-override/format_panic.expected: -------------------------------------------------------------------------------- 1 | Complete - 0 successfully verified harnesses, 2 failures, 2 total. 2 | -------------------------------------------------------------------------------- /tests/ui/terse-output-format-fail/expected: -------------------------------------------------------------------------------- 1 | VERIFICATION RESULT: 2 | Failed Checks: assertion failed: 1 + 1 == 3 3 | -------------------------------------------------------------------------------- /tests/ui/unwind-multiple-arguments/expected: -------------------------------------------------------------------------------- 1 | error: invalid argument for `unwind` attribute, expected an integer 2 | -------------------------------------------------------------------------------- /tests/ui/unwind-without-proof/expected: -------------------------------------------------------------------------------- 1 | error: the `unwind` attribute also requires the `#[kani::proof]` attribute 2 | -------------------------------------------------------------------------------- /tools/benchcomp/.gitignore: -------------------------------------------------------------------------------- 1 | # the regression tests write result.yaml files into their directories 2 | result.yaml 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/vecdeque-cve/abstract_reserve_maintains_invariant_with_cve_fixed.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | -------------------------------------------------------------------------------- /tests/expected/MemPredicates/ptr_size_validity.expected: -------------------------------------------------------------------------------- 1 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. -------------------------------------------------------------------------------- /tests/expected/function-contract/const_fn_with_effect.expected: -------------------------------------------------------------------------------- 1 | Checking harness check... 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/expected/function-contract/multiple_replace_fail.expected: -------------------------------------------------------------------------------- 1 | warning: Multiple occurrences of `stub_verified(one)`. 2 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/copy-nonoverlapping/copy-unwritable-dst/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | memcpy destination region writeable -------------------------------------------------------------------------------- /tests/expected/reach/debug-assert-eq/unreachable/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "assertion failed: x == 10" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/debug-assert-ne/unreachable/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "assertion failed: x != 17" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/overflow-neg/reachable_pass/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | Description: "attempt to negate with overflow" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/overflow-neg/unreachable/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "attempt to negate with overflow" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/overflow/reachable_pass/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | Description: "attempt to subtract with overflow" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/overflow/unreachable/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "attempt to subtract with overflow" 3 | -------------------------------------------------------------------------------- /tests/expected/uninit/delayed-ub-overapprox.expected: -------------------------------------------------------------------------------- 1 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. 2 | -------------------------------------------------------------------------------- /tests/ui/derive-arbitrary/empty_struct/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_arbitrary_point... 2 | VERIFICATION:- SUCCESSFUL 3 | -------------------------------------------------------------------------------- /tests/ui/save-coverage-results/expected: -------------------------------------------------------------------------------- 1 | Source-based code coverage results: 2 | 3 | [info] Coverage results saved to 4 | -------------------------------------------------------------------------------- /tests/ui/solver-attribute/not-found/expected: -------------------------------------------------------------------------------- 1 | error: the specified solver "non_existing_solver" was not found in path 2 | -------------------------------------------------------------------------------- /tests/ui/unsupported-annotation/expected: -------------------------------------------------------------------------------- 1 | error[E0433]: failed to resolve: could not find `test_annotation` in `kani` 2 | -------------------------------------------------------------------------------- /tools/benchcomp/test/unit/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/zero-harnesses-is-success/expected: -------------------------------------------------------------------------------- 1 | No proof harnesses (functions with #[kani::proof]) were found to verify. 2 | -------------------------------------------------------------------------------- /tests/expected/function-contract/const_generic_function.expected: -------------------------------------------------------------------------------- 1 | ** 1 of 2 | Failed Checks: Check that *dst is assignable 3 | -------------------------------------------------------------------------------- /tests/expected/generics/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: x == y.data 3 | SUCCESS\ 4 | assertion failed: z == w.data 5 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/copy/copy-overflow/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | copy: attempt to compute number in bytes which would overflow -------------------------------------------------------------------------------- /tests/expected/intrinsics/ptr_offset_from_unsigned/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Expected non-negative distance between pointers 2 | -------------------------------------------------------------------------------- /tests/expected/static/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | assertion failed: 10 == foo() 3 | UNREACHABLE\ 4 | assertion failed: 12 == foo() 5 | -------------------------------------------------------------------------------- /tests/expected/uninit/copy/copy_without_padding.expected: -------------------------------------------------------------------------------- 1 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. 2 | -------------------------------------------------------------------------------- /tests/expected/unwind-flags-conflict/expected: -------------------------------------------------------------------------------- 1 | error: Conflicting flags: unwind flags provided to kani and in --cbmc-args. 2 | -------------------------------------------------------------------------------- /tests/ui/mir-linker/generic-harness/expected: -------------------------------------------------------------------------------- 1 | error: the '#[kani::proof]' attribute cannot be applied to generic functions 2 | -------------------------------------------------------------------------------- /tools/benchcomp/benchcomp/entry/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | -------------------------------------------------------------------------------- /docs/src/getting-started/verification-results/success_example.expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | Description: "assertion failed: sum == 6" 3 | -------------------------------------------------------------------------------- /docs/src/tutorial/kinds-of-failure/midpoint_overflow.expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | attempt to add with overflow 3 | VERIFICATION:- FAILED 4 | -------------------------------------------------------------------------------- /tests/expected/allocation/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: foo() == None 3 | SUCCESS\ 4 | assertion failed: foo() == y 5 | -------------------------------------------------------------------------------- /tests/expected/function-contract/diverging_loop.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: unwinding assertion loop 0 2 | 3 | VERIFICATION:- FAILED 4 | -------------------------------------------------------------------------------- /tests/script-based-pre/crate-name/crate-name.expected: -------------------------------------------------------------------------------- 1 | No proof harnesses (functions with #[kani::proof]) were found to verify. 2 | -------------------------------------------------------------------------------- /tests/ui/arguments-proof/missing-unstable-flag/expected: -------------------------------------------------------------------------------- 1 | error: Use of unstable feature `async-lib`: experimental async support 2 | -------------------------------------------------------------------------------- /tests/ui/derive-arbitrary/generic_struct/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_arbitrary_point... 2 | 6 of 6 cover properties satisfied 3 | -------------------------------------------------------------------------------- /tests/ui/derive-arbitrary/named_struct/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_arbitrary_point... 2 | 4 of 4 cover properties satisfied 3 | -------------------------------------------------------------------------------- /tests/ui/derive-arbitrary/unnamed_struct/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_arbitrary_point... 2 | 6 of 6 cover properties satisfied 3 | -------------------------------------------------------------------------------- /docs/src/getting-started/verification-results/failure_example.expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | Description: "assertion failed: arr.len() != 3" 3 | -------------------------------------------------------------------------------- /docs/src/getting-started/verification-results/undetermined_example.expected: -------------------------------------------------------------------------------- 1 | UNDETERMINED\ 2 | Description: "assertion failed: x == 0" 3 | -------------------------------------------------------------------------------- /docs/src/getting-started/verification-results/unreachable_example.expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "assertion failed: x < 8" 3 | -------------------------------------------------------------------------------- /docs/src/tutorial/loops-unwinding/check_initialize_prefix.expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | unwinding assertion loop 3 | VERIFICATION:- FAILED 4 | -------------------------------------------------------------------------------- /tests/cargo-kani/asm/global/calls_crate_with_global_asm.expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "assertion failed: x * y == 33" 3 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/write_bytes/overflow/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | write_bytes: attempt to compute number in bytes which would overflow -------------------------------------------------------------------------------- /tests/expected/reach/assert/reachable_pass/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | Description: "assertion failed: x > 4" 3 | VERIFICATION:- SUCCESSFUL 4 | -------------------------------------------------------------------------------- /tests/expected/test6/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: add2(1, 1) == 2.0 3 | FAILURE\ 4 | assertion failed: add2(2, 1) == 2.0 5 | -------------------------------------------------------------------------------- /tests/expected/transmute/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: bitpattern == 0x3F800000 3 | SUCCESS\ 4 | assertion failed: f == 1.0 5 | -------------------------------------------------------------------------------- /tests/expected/uninit/copy/non_byte_copy_without_padding.expected: -------------------------------------------------------------------------------- 1 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. 2 | -------------------------------------------------------------------------------- /tests/expected/verbose-cmds/expected: -------------------------------------------------------------------------------- 1 | Running: `goto-cc 2 | Running: `goto-instrument 3 | Running: `cbmc 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/expected/zst/expected: -------------------------------------------------------------------------------- 1 | - Status: FAILURE\ 2 | - Description: "null pointer dereference occurred" 3 | 4 | VERIFICATION:- FAILED 5 | -------------------------------------------------------------------------------- /tests/perf/vec/vec/expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "assertion failed: v2 == vec![1]" 3 | 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_manifest_test/manifest_test.expected: -------------------------------------------------------------------------------- 1 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. 2 | -------------------------------------------------------------------------------- /tests/ui/multiple-harnesses/no_matching_harness/expected: -------------------------------------------------------------------------------- 1 | error: no harnesses matched the harness filters: `non_existing`, `invalid` 2 | -------------------------------------------------------------------------------- /tests/ui/multiple-harnesses/stop_at_single_fail/fail_fast_test.expected: -------------------------------------------------------------------------------- 1 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. -------------------------------------------------------------------------------- /tests/ui/should-panic-attribute/multiple-harnesses-panic/expected: -------------------------------------------------------------------------------- 1 | Complete - 3 successfully verified harnesses, 0 failures, 3 total. 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | * @model-checking/kani-devs 5 | -------------------------------------------------------------------------------- /docs/src/tutorial/first-steps-v2/verify_success.expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: x < 4096 3 | SUCCESS\ 4 | assertion failed: y < 10 5 | -------------------------------------------------------------------------------- /tests/expected/dynamic-error-trait/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: mm.size == 2 3 | FAILURE\ 4 | assertion failed: mm.size == 3 5 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/zst_pass.expected: -------------------------------------------------------------------------------- 1 | __CPROVER_contracts_\ 2 | - Status: SUCCESS\ 3 | 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/expected/function-contract/pattern_use.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: FAILURE\ 3 | - Description: "attempt to divide by zero"\ 4 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/offset-same-object/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Offset result and original pointer should point to the same allocation 2 | -------------------------------------------------------------------------------- /tests/expected/reach/rem-zero/reachable_pass/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | Description: "attempt to calculate the remainder with a divisor of zero" 3 | -------------------------------------------------------------------------------- /tests/expected/report/unsupported/unreachable/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | Description: "assertion failed: x == 0" 3 | VERIFICATION:- SUCCESSFUL 4 | -------------------------------------------------------------------------------- /tests/perf/string/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Function `alloc::string::String::from_utf8_lossy` with missing definition is unreachable 2 | 3 | -------------------------------------------------------------------------------- /tests/std-checks/std/src/sync/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | mod atomic; 5 | -------------------------------------------------------------------------------- /tests/ui/function-contracts/mutating_ensures_error.expected: -------------------------------------------------------------------------------- 1 | cannot assign to `*_x`, as `Fn` closures cannot mutate their captured variables 2 | -------------------------------------------------------------------------------- /tests/ui/regular-output-format-fail/expected: -------------------------------------------------------------------------------- 1 | Description: "assertion failed: 1 + 1 == 3" 2 | Failed Checks: assertion failed: 1 + 1 == 3 3 | -------------------------------------------------------------------------------- /tools/benchcomp/test/README.md: -------------------------------------------------------------------------------- 1 | # Benchcomp unit & regression tests 2 | 3 | To run, invoke `./test/run` from the tools/benchcomp directory. 4 | -------------------------------------------------------------------------------- /tests/cargo-kani/asm/global/reads_static_var_in_crate_with_global_asm.expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "assertion failed: x == 98" 3 | -------------------------------------------------------------------------------- /tests/expected/dealloc/stack/expected: -------------------------------------------------------------------------------- 1 | Status: FAILURE\ 2 | Description: "free argument must be dynamic object" 3 | 4 | VERIFICATION:- FAILED 5 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/side_effect.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: |result| old({*ptr+=1; *ptr}) == _val 2 | VERIFICATION:- FAILED 3 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-shuffle-indexes-out/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | index out of bounds: the length is less than or equal to the given index -------------------------------------------------------------------------------- /tests/expected/reach/assert/unreachable/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "assertion failed: x == 2" 3 | ** 1 of 3 failed (1 unreachable) 4 | -------------------------------------------------------------------------------- /tests/expected/reach/rem-zero/unreachable/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "attempt to calculate the remainder with a divisor of zero" 3 | -------------------------------------------------------------------------------- /tests/ui/multiple-harnesses/stop_at_single_fail/fail_fast_test_parallel.expected: -------------------------------------------------------------------------------- 1 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. -------------------------------------------------------------------------------- /tests/cargo-kani/nested-dirs/crate1/a_check.expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "assertion failed: v.len() == 3" 3 | VERIFICATION:- SUCCESSFUL 4 | -------------------------------------------------------------------------------- /tests/cargo-ui/target-selection/lib-target/expected: -------------------------------------------------------------------------------- 1 | Checking harness verify::lib_harness... 2 | Status: SATISFIED\ 3 | Description: "Cover lib" 4 | 5 | -------------------------------------------------------------------------------- /tests/cargo-ui/unstable-attr/enabled/expected: -------------------------------------------------------------------------------- 1 | Checking harness harness... 2 | defs::no_op.cover\ 3 | Status: SATISFIED 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/expected/derive-invariant/generic_struct/expected: -------------------------------------------------------------------------------- 1 | - Status: SUCCESS\ 2 | - Description: "assertion failed: point.is_safe()" 3 | -------------------------------------------------------------------------------- /tests/expected/derive-invariant/named_struct/expected: -------------------------------------------------------------------------------- 1 | - Status: SUCCESS\ 2 | - Description: "assertion failed: point.is_safe()" 3 | -------------------------------------------------------------------------------- /tests/expected/derive-invariant/unnamed_struct/expected: -------------------------------------------------------------------------------- 1 | - Status: SUCCESS\ 2 | - Description: "assertion failed: point.is_safe()" 3 | -------------------------------------------------------------------------------- /tests/expected/dynamic-trait-static-dispatch/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: bar.a() == 3 3 | SUCCESS\ 4 | assertion failed: bar.b() == 5 5 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/multiple_loops.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- SUCCESSFUL 2 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 3 | -------------------------------------------------------------------------------- /tests/expected/reach/assert/reachable_fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | Description: "assertion failed: x != 5" 3 | Failed Checks: assertion failed: x != 5 4 | -------------------------------------------------------------------------------- /tests/cargo-kani/libc/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub mod pthread_key_create; 5 | -------------------------------------------------------------------------------- /tests/cargo-kani/nested-dirs/crate2/another_check.expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "assertion failed: result == 4" 3 | VERIFICATION:- SUCCESSFUL 4 | -------------------------------------------------------------------------------- /tests/cargo-kani/rectangle-example/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub mod rectangle; 5 | -------------------------------------------------------------------------------- /tests/cargo-kani/zero-harnesses-is-success/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | pub fn nop() {} 4 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/mistake_condition_return.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: assertion failed: res == 100 2 | 3 | VERIFICATION:- FAILED 4 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/copy-nonoverlapping/copy-overflow/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | copy_nonoverlapping: attempt to compute number in bytes which would overflow -------------------------------------------------------------------------------- /tests/expected/nondet-slice-i32-oob/expected: -------------------------------------------------------------------------------- 1 | Status: FAILURE\ 2 | dereference failure: pointer outside object bounds\ 3 | in function check_out_of_bounds 4 | -------------------------------------------------------------------------------- /tests/expected/nondet-slice-u8-oob/expected: -------------------------------------------------------------------------------- 1 | Status: FAILURE\ 2 | dereference failure: pointer outside object bounds\ 3 | in function check_out_of_bounds 4 | -------------------------------------------------------------------------------- /tests/expected/quantifiers/assert_with_exists_fail.expected: -------------------------------------------------------------------------------- 1 | - Status: FAILURE\ 2 | - Description: "assertion with exists"\ 3 | 4 | VERIFICATION:- FAILED 5 | -------------------------------------------------------------------------------- /tests/expected/quantifiers/assume_with_exists_fail.expected: -------------------------------------------------------------------------------- 1 | - Status: FAILURE\ 2 | - Description: "assume with exists"\ 3 | 4 | VERIFICATION:- FAILED 5 | -------------------------------------------------------------------------------- /tests/expected/reach/bounds/reachable_pass/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | Description: "index out of bounds: the length is less than or equal to the given index" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/bounds/unreachable/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | Description: "index out of bounds: the length is less than or equal to the given index" 3 | -------------------------------------------------------------------------------- /tests/expected/reach/div-zero/reachable_fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | Description: "attempt to divide by zero" 3 | Failed Checks: attempt to divide by zero 4 | -------------------------------------------------------------------------------- /tests/script-based-pre/check-output/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: check-output.sh 4 | -------------------------------------------------------------------------------- /tests/ui/check_summary_for_single_harness/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_foo... 2 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. 3 | -------------------------------------------------------------------------------- /tests/ui/concrete-playback/README.md: -------------------------------------------------------------------------------- 1 | These tests check that the correct concrete values are read and formatted into a concrete playback unit test case. 2 | -------------------------------------------------------------------------------- /docs/src/reference.md: -------------------------------------------------------------------------------- 1 | # Reference 2 | 3 | This section is the main reference for Kani. 4 | It contains sections that informally describe its main features. 5 | -------------------------------------------------------------------------------- /tests/cargo-kani/cargo-tests-dir/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub const ONE: u32 = 1; 5 | -------------------------------------------------------------------------------- /tests/cargo-kani/codegen-scalar-with-zsts/check_zst.expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "assertion failed: C.x == 0" 3 | 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/cargo-kani/itoa_dep/check_unsigned.expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "assertion failed: result == &output" 3 | 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/old_old.expected: -------------------------------------------------------------------------------- 1 | error: Nested calls to `old` are prohibited 2 | #[kani::ensures(|result| old(*ptr + old(1)) == *ptr)] 3 | -------------------------------------------------------------------------------- /tests/expected/function-contract/simple_replace_fail.expected: -------------------------------------------------------------------------------- 1 | main.assertion\ 2 | - Status: FAILURE\ 3 | - Description: ""contract doesn't guarantee equality"" 4 | -------------------------------------------------------------------------------- /tests/expected/iterator/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | unreachable code 3 | SUCCESS\ 4 | attempt to multiply with overflow 5 | SUCCESS\ 6 | assertion failed: z == 6 7 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/array_incr_for_loop_fixme.expected: -------------------------------------------------------------------------------- 1 | Running SMT2 QF_AUFBV using Z3\ 2 | SMT2 solver returned non-constant value for variable B296 3 | -------------------------------------------------------------------------------- /tests/expected/niche/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | assertion failed: false 3 | UNREACHABLE\ 4 | assertion failed: false 5 | SUCCESS\ 6 | assertion failed: a == *b 7 | -------------------------------------------------------------------------------- /tests/expected/panic/arg-error/expected: -------------------------------------------------------------------------------- 1 | error: 1 positional argument in format string, but no arguments were given 2 | error: aborting due to 1 previous error 3 | -------------------------------------------------------------------------------- /tests/expected/quantifiers/assert_with_forall_fail.expected: -------------------------------------------------------------------------------- 1 | - Status: FAILURE\ 2 | - Description: "assertion with forall"\ 3 | 4 | VERIFICATION:- FAILED 5 | 6 | -------------------------------------------------------------------------------- /tests/expected/reach/debug-assert-eq/reachable_fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | Description: "assertion failed: x == 10" 3 | Failed Checks: assertion failed: x == 10 4 | -------------------------------------------------------------------------------- /tests/expected/reach/debug-assert-ne/reachable_fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | Description: "assertion failed: x != 17" 3 | Failed Checks: assertion failed: x != 17 4 | -------------------------------------------------------------------------------- /tests/expected/reach/debug-assert/reachable_fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | Description: "assertion failed: x != -10" 3 | Failed Checks: assertion failed: x != -10 4 | -------------------------------------------------------------------------------- /tests/expected/realloc/null/expected: -------------------------------------------------------------------------------- 1 | Status: FAILURE\ 2 | Description: "rust_realloc must be called with a non-null pointer" 3 | 4 | VERIFICATION:- FAILED 5 | -------------------------------------------------------------------------------- /tests/expected/realloc/shrink/expected: -------------------------------------------------------------------------------- 1 | Status: FAILURE\ 2 | Description: "dereference failure: pointer outside object bounds" 3 | 4 | VERIFICATION:- FAILED 5 | -------------------------------------------------------------------------------- /tests/slow/tokio-proofs/src/tokio_stream/support/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub mod mpsc; 5 | -------------------------------------------------------------------------------- /tests/std-checks/core/mem.expected: -------------------------------------------------------------------------------- 1 | Checking harness mem::verify::check_swap_unit... 2 | 3 | Complete - 7 successfully verified harnesses, 0 failures, 7 total. 4 | -------------------------------------------------------------------------------- /tests/expected/assert-eq/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: x + 1 == y 3 | FAILURE\ 4 | assertion failed: x == y 5 | UNREACHABLE\ 6 | assertion failed: x != y 7 | -------------------------------------------------------------------------------- /tests/expected/assert-location/debug-assert/expected: -------------------------------------------------------------------------------- 1 | line 13 "This should fail and stop the execution": FAILURE 2 | line 14 "This should be unreachable": SUCCESS 3 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-extract-wrong-type/expected: -------------------------------------------------------------------------------- 1 | expected return type `i64` (element of input `i64x2`), found `i32` 2 | error: aborting due to 1 previous error -------------------------------------------------------------------------------- /tests/expected/quantifiers/assert_with_exists_pass.expected: -------------------------------------------------------------------------------- 1 | - Status: SUCCESS\ 2 | - Description: "assertion with exists"\ 3 | 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/expected/quantifiers/assert_with_forall_pass.expected: -------------------------------------------------------------------------------- 1 | - Status: SUCCESS\ 2 | - Description: "assertion with forall"\ 3 | 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/expected/realloc/zero_size/expected: -------------------------------------------------------------------------------- 1 | Status: FAILURE\ 2 | Description: "rust_realloc must be called with a size greater than 0" 3 | 4 | VERIFICATION:- FAILED 5 | -------------------------------------------------------------------------------- /tests/perf/smol_str/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_new... 2 | VERIFICATION:- SUCCESSFUL 3 | 4 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/kani-version-flag-version/kani-version-flag-version.expected: -------------------------------------------------------------------------------- 1 | success: version printed agrees 2 | success: `(standalone)` appears in version line -------------------------------------------------------------------------------- /tests/script-based-pre/mem-init-reinstrumentation/mem-init-reinstrumentation.expected: -------------------------------------------------------------------------------- 1 | success: no pointer checks are detected in initialized memory instrumentaiton 2 | -------------------------------------------------------------------------------- /tests/slow/tokio-proofs/src/tokio/support/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub mod leaked_buffers; 5 | -------------------------------------------------------------------------------- /tests/slow/tokio-proofs/src/tokio_test/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | mod block_on; 5 | mod io; 6 | -------------------------------------------------------------------------------- /tests/ui/cover-property-class/expected: -------------------------------------------------------------------------------- 1 | Check 1: main.cover.\ 2 | Status: SATISFIED\ 3 | Description: "i may be greater than 20"\ 4 | main.rs:9:5 in function main 5 | -------------------------------------------------------------------------------- /docs/src/tutorial/kinds-of-failure/bound_check.expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | index out of bounds: the length is less than or equal to the given index 3 | VERIFICATION:- FAILED 4 | -------------------------------------------------------------------------------- /kani-driver/src/coverage/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub mod cov_results; 5 | pub mod cov_session; 6 | -------------------------------------------------------------------------------- /tests/cargo-kani/ws-specified/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | //! empty lib for toplevel directory 5 | -------------------------------------------------------------------------------- /tests/cargo-ui/multiple-harnesses/expected: -------------------------------------------------------------------------------- 1 | Checking harness bar... 2 | Checking harness foo... 3 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 4 | -------------------------------------------------------------------------------- /tests/cargo-ui/unsupported-lib-types/proc-macro/expected: -------------------------------------------------------------------------------- 1 | Skipped verification of the following unsupported targets: 'lib'. 2 | error: No supported targets were found. 3 | -------------------------------------------------------------------------------- /tests/expected/closure3/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | attempt to add with overflow 3 | SUCCESS\ 4 | attempt to add with overflow 5 | SUCCESS\ 6 | assertion failed: num + 10 == y 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/attribute_complain.expected: -------------------------------------------------------------------------------- 1 | error: Using the proof_for_contract attribute requires activating the unstable `function-contracts` feature 2 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-insert-wrong-type/expected: -------------------------------------------------------------------------------- 1 | expected inserted type `i64` (element of input `i64x2`), found `i32` 2 | error: aborting due to 1 previous error -------------------------------------------------------------------------------- /tests/expected/issue-2239/issue_2239.expected: -------------------------------------------------------------------------------- 1 | test_trivial_bounds.unreachable.1\ 2 | - Status: FAILURE\ 3 | - Description: "unreachable code" 4 | 5 | VERIFICATION:- FAILED -------------------------------------------------------------------------------- /tests/expected/per-harness/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_drop_foo... 2 | 3 | Status: SATISFIED\ 4 | Description: "DropFoo" 5 | 6 | 1 of 1 cover properties satisfied 7 | -------------------------------------------------------------------------------- /tests/expected/reach/overflow-neg/reachable_fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | Description: "attempt to negate with overflow" 3 | Failed Checks: attempt to negate with overflow 4 | -------------------------------------------------------------------------------- /tests/expected/reach/overflow/reachable_fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | Description: "attempt to subtract with overflow" 3 | Failed Checks: attempt to subtract with overflow 4 | -------------------------------------------------------------------------------- /tests/expected/valid-value-checks/can_dereference.expected: -------------------------------------------------------------------------------- 1 | 2 of 2 cover properties satisfied 2 | 3 | Complete - 3 successfully verified harnesses, 0 failures, 3 total. 4 | -------------------------------------------------------------------------------- /tests/script-based-pre/error-code/exit-one.sh: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | echo "Exiting with code 1!" 5 | exit 1 -------------------------------------------------------------------------------- /tests/ui/entry-fn/main/expected: -------------------------------------------------------------------------------- 1 | main.assertion\ 2 | SUCCESS\ 3 | Some(10).and_then(|v| Some(v * 2)) == Some(20)\ 4 | in function main 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/cargo-kani/codegen-scalar-with-phantom/check_phantom_data.expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "assertion failed: C.x == 0" 3 | 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-do-not-resolve/other_crate1/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub fn mock() {} 5 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-do-not-resolve/other_crate2/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub fn mock() {} 5 | -------------------------------------------------------------------------------- /tests/expected/function-contract/gcd_rec_code_fail.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: |result : &T| *result != 0 && x % *result == 0 && y % *result == 0 2 | 3 | VERIFICATION:- FAILED 4 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/expr_replace_pass.expected: -------------------------------------------------------------------------------- 1 | main.assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "Increment"\ 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-shuffle-result-type-is-diff-size/expected: -------------------------------------------------------------------------------- 1 | expected return type of length 4, found `i64x2` with length 2 2 | error: aborting due to 1 previous error -------------------------------------------------------------------------------- /tests/expected/issue-3022/issue_3022.expected: -------------------------------------------------------------------------------- 1 | main.assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "assertion failed: inner == func2.inner" 4 | 5 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_list_md/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: list.sh 4 | expected: list.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/individual_file_output/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: individual_file_output.sh 4 | -------------------------------------------------------------------------------- /tests/script-based-pre/kani_autoharness_exclude_precedence/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: precedence.sh 4 | -------------------------------------------------------------------------------- /tests/script-based-pre/kani_list_md/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: list.sh 4 | expected: list.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/std_codegen/codegen_std.expected: -------------------------------------------------------------------------------- 1 | [TEST] Copy standard library from the current toolchain 2 | [TEST] Modify library 3 | ------ Build succeeded ------- 4 | -------------------------------------------------------------------------------- /tests/ui/regular-output-format-pass/expected: -------------------------------------------------------------------------------- 1 | Description: "assertion failed: 1 + 1 == 2"\ 2 | Location: 3 | tests/ui/regular-output-format-pass/main.rs:7:5 in function main 4 | -------------------------------------------------------------------------------- /tests/ui/should-panic-attribute/multiple-attrs/expected: -------------------------------------------------------------------------------- 1 | error: only one '#[kani::should_panic]' attribute is allowed per harness 2 | error: aborting due to 1 previous error 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/nested-dirs/crate2/nested_crate/yet_another_check.expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "assertion failed: y - x == 0" 3 | 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/cargo-kani/small-vec/check_vec.expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "assertion failed: c < char::MAX"\ 3 | in function check_vec 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/assert-location/assert-false/expected: -------------------------------------------------------------------------------- 1 | line 18 assertion failed: false: FAILURE 2 | line 23 "{}", s: FAILURE 3 | line 27 "Fail with custom static message": FAILURE 4 | -------------------------------------------------------------------------------- /tests/expected/async_proof/expected: -------------------------------------------------------------------------------- 1 | `foo` is not a valid option for `#[kani::proof]`. 2 | 3 | `#[kani::proof]` cannot be applied to async functions that take arguments for now 4 | -------------------------------------------------------------------------------- /tests/expected/derive-bounded-arbitrary/generic_default.expected: -------------------------------------------------------------------------------- 1 | Checking harness check_my_vec... 2 | 3 | ** 2 of 2 cover properties satisfied 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/function-contract/gcd_rec_contract_fail.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: |result : &T| *result != 0 && x % *result == 1 && y % *result == 0 2 | 3 | VERIFICATION:- FAILED 4 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/loop_with_prev_break_first_iter.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: assertion failed: (i >= 2) && (i <= 100) && (__kani_prev_var_ 2 | 3 | VERIFICATION:- FAILED 4 | -------------------------------------------------------------------------------- /tests/expected/quantifiers/quantifier_with_no_external_variable.expected: -------------------------------------------------------------------------------- 1 | - Status: SUCCESS\ 2 | - Description: "assertion failed: quan" 3 | 4 | VERIFICATION:- SUCCESSFUL 5 | 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/ambiguous_crate/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: ambiguous.sh 4 | expected: expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo-kani-version-flag-version/cargo-kani-version-flag-version.expected: -------------------------------------------------------------------------------- 1 | success: version printed agrees 2 | success: `(cargo plugin)` appears in version line -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_list_json/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: list.sh 4 | expected: list.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/kani_list_json/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: list.sh 4 | expected: list.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/playback_expected/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback.sh 4 | expected: expected 5 | -------------------------------------------------------------------------------- /tests/std-checks/core/ptr.expected: -------------------------------------------------------------------------------- 1 | Summary: 2 | Verification failed for - ptr::verify::check_as_ref_dangling 3 | Complete - 5 successfully verified harnesses, 1 failures, 6 total. 4 | -------------------------------------------------------------------------------- /tests/ui/arguments-proof/expected: -------------------------------------------------------------------------------- 1 | `some` is not a valid option for `#[kani::proof]`. 2 | 3 | the trait bound `NotASchedule: kani::futures::SchedulingStrategy` is not satisfied 4 | -------------------------------------------------------------------------------- /tests/cargo-kani/default-members/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | fn main() { 4 | println!("Hello, world!"); 5 | } 6 | -------------------------------------------------------------------------------- /tests/cargo-ui/verbose-cmds/expected: -------------------------------------------------------------------------------- 1 | CARGO_ENCODED_RUSTFLAGS= 2 | cargo + 3 | Running: `goto-cc 4 | Running: `goto-instrument 5 | Checking harness dummy_harness... 6 | Running: `cbmc 7 | -------------------------------------------------------------------------------- /tests/expected/derive-bounded-arbitrary/boxed_slice.expected: -------------------------------------------------------------------------------- 1 | Checking harness check_my_boxed_array... 2 | 3 | ** 6 of 6 cover properties satisfied 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/function-contract/arbitrary_requires_fail.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: FAILURE\ 3 | - Description: "attempt to divide by zero"\ 4 | arbitrary_requires_fail.rs:7:5 5 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/simple_pass.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|result| old(*ptr + 1) == *ptr"\ 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-result-type-is-float/expected: -------------------------------------------------------------------------------- 1 | expected return type with integer elements, found `f32x2` with non-integer `f32` 2 | error: aborting due to 1 previous error -------------------------------------------------------------------------------- /tests/script-based-pre/build-cache-dirty/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: rebuild.sh 4 | expected: rebuild.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/build-rs-conditional/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: build_rs.sh 4 | expected: expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_list/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: list.sh 4 | expected: list.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/crate-name/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: crate-name.sh 4 | expected: crate-name.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/no_codegen/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: run.sh 4 | expected: expected 5 | exit_code: 0 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/playback_print/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_print.sh 4 | expected: expected 5 | -------------------------------------------------------------------------------- /tests/slow/tokio-proofs/src/tokio_util/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | mod io_reader_stream; 5 | mod io_stream_reader; 6 | -------------------------------------------------------------------------------- /tests/ui/exact-harness/fail_on_missing/expected: -------------------------------------------------------------------------------- 1 | error: Failed to match the following harness(es): 2 | check_blah`, `check_foo 3 | Please specify the fully-qualified name of a harness. 4 | -------------------------------------------------------------------------------- /tests/ui/harness-timeout/invalid.expected: -------------------------------------------------------------------------------- 1 | error: invalid value '5k' for '--harness-timeout ': Invalid time unit. Use 's' for seconds, 'm' for minutes, or 'h' for hours 2 | -------------------------------------------------------------------------------- /tests/ui/multiple-proof-attributes/expected: -------------------------------------------------------------------------------- 1 | error: only one '#[kani::proof]' attribute is allowed per harness\ 2 | main.rs\ 3 | |\ 4 | | #[kani::proof]\ 5 | | ^^^^^^^^^^^^^^\ 6 | |\ 7 | -------------------------------------------------------------------------------- /tests/ui/solver-attribute/no-arg/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | #[kani::solver] 6 | fn check() {} 7 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-main/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | #[kani::proof] 4 | fn main() { 5 | assert!(1 == 2); 6 | } 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/copy_pass.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|result| old(ptr.0) + 1 == ptr.0"\ 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/function-contract/mutable-references/ensures_with_two_mut_refs_fail.expected: -------------------------------------------------------------------------------- 1 | error[E0501]: cannot borrow value as immutable because previous closure requires unique access 2 | -------------------------------------------------------------------------------- /tests/expected/union/union_transmute.expected: -------------------------------------------------------------------------------- 1 | main.assertion.1\ 2 | - Status: SUCCESS\ 3 | - Description: "assertion failed: y == 256" 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_filter/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: filter.sh 4 | expected: filter.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/check-quiet/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: check-quiet.sh 4 | expected: check-quiet.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/kani_lib_dep/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: build.sh 4 | expected: expected 5 | exit_code: 0 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/mir_stub_panic/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: run.sh 4 | expected: expected 5 | exit_code: 0 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/no_codegen/expected: -------------------------------------------------------------------------------- 1 | info: Compilation succeeded up until codegen. Skipping codegen because of `--no-codegen` option. Rerun without `--no-codegen` to perform codegen. 2 | -------------------------------------------------------------------------------- /tests/script-based-pre/no_codegen_error/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: run.sh 4 | expected: expected 5 | exit_code: 1 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/playback_zero_size/playback_zst.expected: -------------------------------------------------------------------------------- 1 | [TEST] Generate test... 2 | Checking harness any_is_ok 3 | 4 | [TEST] Run test... 5 | test result: ok. 1 passed; 0 failed; 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/std_codegen/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: codegen_std.sh 4 | expected: codegen_std.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/tool-scanner/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: scanner-test.sh 4 | expected: scanner-test.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/verify_std_cmd/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: verify_std.sh 4 | expected: verify_std.expected 5 | -------------------------------------------------------------------------------- /tests/ui/derive-arbitrary/empty_enum/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_no_variants... 2 | Failed Checks: Cannot create symbolic enum `Empty`. Enums with zero-variants cannot be instantiated 3 | -------------------------------------------------------------------------------- /tests/ui/exact-harness/incomplete-harness-name/expected: -------------------------------------------------------------------------------- 1 | error: Failed to match the following harness(es): 2 | ignore_third_harness 3 | Please specify the fully-qualified name of a harness. 4 | -------------------------------------------------------------------------------- /tests/ui/solver-attribute/invalid/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | #[kani::solver(123)] 6 | fn check() {} 7 | -------------------------------------------------------------------------------- /tests/ui/solver-attribute/unknown/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | #[kani::solver(foo)] 6 | fn check() {} 7 | -------------------------------------------------------------------------------- /tools/benchcomp/configs/README.md: -------------------------------------------------------------------------------- 1 | Example Benchcomp Configurations 2 | ================================ 3 | 4 | The files in this directory can be passed to benchcomp's -c/--config flag. 5 | -------------------------------------------------------------------------------- /tests/cargo-kani/storage-markers/crate-with-harness/call_fn_with_bug.expected: -------------------------------------------------------------------------------- 1 | Status: FAILURE\ 2 | Description: "dereference failure: dead object"\ 3 | in function crate_with_bug::fn_with_bug 4 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-exclude-unknown/expected: -------------------------------------------------------------------------------- 1 | error: package ID specification `unknown_package` did not match any packages 2 | error: Failed to retrieve information for `unknown_package` 3 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-select-unknown/expected: -------------------------------------------------------------------------------- 1 | error: package ID specification `unknown_package` did not match any packages 2 | error: Failed to retrieve information for `unknown_package` 3 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/transmute_diff_size.expected: -------------------------------------------------------------------------------- 1 | error[E0512]: cannot transmute between types of different sizes, or dependently-sized types 2 | error: aborting due to 3 previous errors 3 | -------------------------------------------------------------------------------- /tests/script-based-pre/build-cache-bin/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: cache_works.sh 4 | expected: cache_works.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/build-cache-fresh/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: cache_works.sh 4 | expected: cache_works.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_exclude/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: exclude.sh 4 | expected: exclude.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_include/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: include.sh 4 | expected: include.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/error-code/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: exit-one.sh 4 | expected: exit-one.expected 5 | exit_code: 1 -------------------------------------------------------------------------------- /tests/script-based-pre/playback_opts/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_opts.sh 4 | expected: playback_opts.expected 5 | -------------------------------------------------------------------------------- /tests/ui/cbmc_checks/pointer/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: misaligned pointer dereference: address must be a multiple of its type's alignment 2 | Failed Checks: assertion failed: unsafe { *p1 != 0 } 3 | -------------------------------------------------------------------------------- /tests/ui/exact-harness/check-qualified-name/expected: -------------------------------------------------------------------------------- 1 | Checking harness first::check_foo... 2 | VERIFICATION:- SUCCESSFUL 3 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. 4 | -------------------------------------------------------------------------------- /tests/ui/solver-attribute/unknown/expected: -------------------------------------------------------------------------------- 1 | error: unknown solver `foo`\ 2 | test.rs:\ 3 | |\ 4 | | #[kani::solver(foo)]\ 5 | | ^^^^^^^^^^^^^^^^^^^^ 6 | error: aborting due to 1 previous error 7 | -------------------------------------------------------------------------------- /tests/cargo-kani/output-format/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn main() { 6 | assert!(1 + 1 == 2); 7 | } 8 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/clone_pass.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|result| old(ptr.clone()).0 + 1 == ptr.0"\ 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/respects-preconditions/modifies.expected: -------------------------------------------------------------------------------- 1 | modify\ 2 | - Status: SUCCESS\ 3 | - Description: "attempt to add with overflow" 4 | 5 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/global_replace_pass.expected: -------------------------------------------------------------------------------- 1 | main.assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "replaced"\ 4 | in function main 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_manifest_test/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: manifest_test.sh 4 | expected: manifest_test.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_playback_opts/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_opts.sh 4 | expected: playback_opts.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/concrete_playback_e2e/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_e2e.sh 4 | expected: playback_e2e.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/playback_array/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_array.sh 4 | expected: playback_array.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/playback_zero_size/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_zst.sh 4 | expected: playback_zst.expected 5 | -------------------------------------------------------------------------------- /tests/slow/tokio-proofs/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | mod tokio; 5 | mod tokio_stream; 6 | mod tokio_test; 7 | mod tokio_util; 8 | -------------------------------------------------------------------------------- /tests/ui/exact-harness/check_some/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_second_harness... 2 | Checking harness check_first_harness... 3 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 4 | -------------------------------------------------------------------------------- /tests/ui/should-panic-attribute/no-panics/expected: -------------------------------------------------------------------------------- 1 | check.assertion\ 2 | SUCCESS\ 3 | assertion failed: 1 + 1 == 2 4 | 5 | VERIFICATION:- FAILED (encountered no panics, but at least one was expected) 6 | -------------------------------------------------------------------------------- /docs/src/tutorial/arbitrary-variables/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | mod exercise_solution; 5 | pub mod inventory; 6 | pub mod rating; 7 | -------------------------------------------------------------------------------- /src/bin/kani.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | use anyhow::Result; 5 | 6 | fn main() -> Result<()> { 7 | kani_verifier::proxy("kani") 8 | } 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/build-rs-works/build.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() { 5 | println!("cargo:rustc-env=SET_IN_BUILD_RS=Y"); 6 | } 7 | -------------------------------------------------------------------------------- /tests/cargo-kani/default-members/builds-ok/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | #[kani::proof] 4 | fn main() { 5 | assert!(1 == 2); 6 | } 7 | -------------------------------------------------------------------------------- /tests/cargo-kani/default-members/dont-build-me/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | fn main() { 4 | this - is - not - valid - rust; 5 | } 6 | -------------------------------------------------------------------------------- /tests/cargo-kani/demos/non-empty-range/check_range.expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "assertion failed: range.is_none() || !range.as_ref().unwrap().is_empty()" 3 | 4 | VERIFICATION:- SUCCESSFUL 5 | -------------------------------------------------------------------------------- /tests/cargo-kani/ws-crate-type-bin/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [workspace] 5 | members = [ 6 | "libcrate", 7 | "bincrate", 8 | ] 9 | -------------------------------------------------------------------------------- /tests/cargo-ui/target-selection/bin-target/expected: -------------------------------------------------------------------------------- 1 | Checking harness verify::foo_harness... 2 | 3 | Status: SATISFIED\ 4 | Description: "Cover `foo`" 5 | 6 | ** 1 of 1 cover properties satisfied 7 | 8 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-exclude/expected: -------------------------------------------------------------------------------- 1 | Checking harness harness_in_bin_package... 2 | Checking harness harness_in_lib_package... 3 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 4 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-select/expected: -------------------------------------------------------------------------------- 1 | Checking harness harness_in_bin_package... 2 | Checking harness harness_in_lib_package... 3 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 4 | -------------------------------------------------------------------------------- /tests/expected/derive-bounded-arbitrary/enum.expected: -------------------------------------------------------------------------------- 1 | Checking harness check_enum... 2 | 3 | ** 15 of 15 cover properties satisfied 4 | 5 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. -------------------------------------------------------------------------------- /tests/expected/function-contract/arbitrary_ensures_fail.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: FAILURE\ 3 | - Description: "|result : &u32| *result == x"\ 4 | in function max 5 | 6 | VERIFICATION:- FAILED 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/function_call.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|result| old(add1(dereference(ptr))) == *ptr"\ 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-cmp-result-type-is-diff-size/expected: -------------------------------------------------------------------------------- 1 | expected return type with length 2 (same as input type `u64x2`), found `u32x4` with length 4 2 | error: aborting due to 1 previous error -------------------------------------------------------------------------------- /tests/expected/issue-2589/issue_2589.expected: -------------------------------------------------------------------------------- 1 | error: Type `std::string::String` does not implement trait `Dummy`. This is likely because `stub` is used as a stub but its generic bounds are not being met. 2 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/fixme_box.expected: -------------------------------------------------------------------------------- 1 | internal error: entered unreachable code: The loop invariant support only reference of user variables. The provided invariants contain unsupported dereference.\ -------------------------------------------------------------------------------- /tests/expected/niche2/expected: -------------------------------------------------------------------------------- 1 | UNREACHABLE\ 2 | assertion failed: false 3 | SUCCESS\ 4 | assertion failed: x == 10 5 | UNREACHABLE\ 6 | assertion failed: false 7 | UNREACHABLE\ 8 | assertion failed: false 9 | -------------------------------------------------------------------------------- /tests/expected/offset-from-distance-check/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Expected the distance between the pointers, in bytes, to be a 2 | multiple of the size of `T` 3 | VERIFICATION:- FAILED -------------------------------------------------------------------------------- /tests/expected/ptr-offset-overflow-bytes/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Offset in bytes overflows isize 2 | Verification failed for - main 3 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. 4 | -------------------------------------------------------------------------------- /tests/expected/ptr_to_ref_cast/str/expected: -------------------------------------------------------------------------------- 1 | Status: FAILURE\ 2 | Description: "dereference failure: pointer invalid"\ 3 | 4 | VERIFICATION:- FAILED 5 | Verification failed for - check_with_metadata_fail 6 | -------------------------------------------------------------------------------- /tests/expected/report/uncolor/expected: -------------------------------------------------------------------------------- 1 | - Status: SUCCESS\ 2 | Description: "assertion failed: 1 + 1 == 2" 3 | - Status: FAILURE\ 4 | - Description: "assertion failed: 2 + 2 == 3" 5 | VERIFICATION:- FAILED 6 | -------------------------------------------------------------------------------- /tests/expected/shadow/uninit_array/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: assertion failed: SM.get(p) 2 | Verification failed for - check_init_any 3 | Complete - 1 successfully verified harnesses, 1 failures, 2 total. 4 | -------------------------------------------------------------------------------- /tests/script-based-pre/autoderive_arbitrary_enums/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: enums.sh 4 | expected: enums.expected 5 | exit_code: 1 -------------------------------------------------------------------------------- /tests/script-based-pre/autoharness-refs_mutable/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: run.sh 4 | expected: mutable.expected 5 | exit_code: 1 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_manifest_test/add/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn main() { 6 | 1 + 1; 7 | } 8 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_playback_target/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_target.sh 4 | expected: playback_target.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/playback_already_existing/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_opts.sh 4 | expected: playback_opts.expected 5 | -------------------------------------------------------------------------------- /tests/ui/exact-harness/check_substring_not_matching/expected: -------------------------------------------------------------------------------- 1 | Checking harness first::harness... 2 | VERIFICATION:- SUCCESSFUL 3 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. 4 | 5 | -------------------------------------------------------------------------------- /tests/ui/exact-harness/multiple_matches/expected: -------------------------------------------------------------------------------- 1 | Checking harness second::verify_foo... 2 | Checking harness first::check_blah... 3 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 4 | -------------------------------------------------------------------------------- /tests/ui/logging/warning/expected: -------------------------------------------------------------------------------- 1 | warning: Found the following unsupported constructs: 2 | - TerminatorKind::InlineAsm (1) 3 | Verification will fail if one or more of these constructs is reachable. 4 | 5 | -------------------------------------------------------------------------------- /tests/ui/multiple-harnesses/check_all/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_first_harness... 2 | Checking harness check_second_harness... 3 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 4 | -------------------------------------------------------------------------------- /tests/ui/multiple-harnesses/check_some/expected: -------------------------------------------------------------------------------- 1 | Checking harness check_first_harness... 2 | Checking harness check_second_harness... 3 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 4 | -------------------------------------------------------------------------------- /tests/ui/multiple-harnesses/some_matching_harnesses/expected: -------------------------------------------------------------------------------- 1 | Checking harness existing_harness... 2 | Checking harness existing... 3 | Complete - 2 successfully verified harnesses, 0 failures, 2 total. 4 | -------------------------------------------------------------------------------- /docs/src/tutorial/kinds-of-failure/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | pub mod bounds_check; 4 | pub mod overflow; 5 | pub mod overflow_quicksort; 6 | -------------------------------------------------------------------------------- /kani-compiler/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "kani-compiler" 7 | version = "0.1.0" 8 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | # Temporary files and folders 2 | *.json 3 | kani_concrete_playback 4 | rmet*/ 5 | target/ 6 | 7 | # Binary artifacts 8 | *.goto 9 | *.out 10 | smoke 11 | check_tests 12 | function 13 | -------------------------------------------------------------------------------- /tests/cargo-kani/cbmc-unknown-lang-mode/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn test() { 6 | assert!(1 + 1 == 2); 7 | } 8 | -------------------------------------------------------------------------------- /tests/expected/array/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: y[0] == 1 3 | SUCCESS\ 4 | assertion failed: y[1] == 2 5 | FAILURE\ 6 | index out of bounds: the length is less than or equal to the given index 7 | -------------------------------------------------------------------------------- /tests/expected/bounded-arbitrary/option/option.expected: -------------------------------------------------------------------------------- 1 | Checking harness check_option... 2 | 3 | ** 6 of 6 cover properties satisfied 4 | 5 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. -------------------------------------------------------------------------------- /tests/expected/bounded-arbitrary/result/result.expected: -------------------------------------------------------------------------------- 1 | Checking harness check_result... 2 | 3 | ** 10 of 10 cover properties satisfied 4 | 5 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. -------------------------------------------------------------------------------- /tests/expected/derive-bounded-arbitrary/struct.expected: -------------------------------------------------------------------------------- 1 | Checking harness check_my_vec... 2 | 3 | ** 5 of 5 cover properties satisfied 4 | 5 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. -------------------------------------------------------------------------------- /tests/expected/function-contract/history/block.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|result| old({let x = &ptr; let y = **x; y + 1}) == *ptr"\ 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/function-contract/interior-mutability/api/cell.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|_| im.x.get() < 101"\ 4 | in function modify 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/expr_replace_fail.expected: -------------------------------------------------------------------------------- 1 | main.assertion\ 2 | - Status: FAILURE\ 3 | - Description: ""Increment"" 4 | 5 | Failed Checks: "Increment" 6 | 7 | VERIFICATION:- FAILED 8 | -------------------------------------------------------------------------------- /tests/expected/offset-from-bytes-overflow/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Offset in bytes overflows isize 2 | Verification failed for - main 3 | 4 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. 5 | -------------------------------------------------------------------------------- /tests/llbc/basic0/expected: -------------------------------------------------------------------------------- 1 | fn test::is_zero(@1: i32) -> bool\ 2 | {\ 3 | let @0: bool; // return\ 4 | let i@1: i32; // arg #1\ 5 | 6 | @0 := copy (i@1) == const (0 : i32)\ 7 | return\ 8 | } 9 | -------------------------------------------------------------------------------- /tests/script-based-pre/autoderive_arbitrary_enums/enums.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | cargo kani autoharness -Z autoharness 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/autoderive_arbitrary_structs/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: structs.sh 4 | expected: structs.expected 5 | exit_code: 1 -------------------------------------------------------------------------------- /tests/script-based-pre/autoharness-refs_immutable/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: run.sh 4 | expected: immutable.expected 5 | exit_code: 1 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/autoharness-refs_mutable/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | kani autoharness -Z autoharness mutable.rs 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/build-cache-bin/bin/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "bin" 5 | version = "0.1.0" 6 | edition = "2021" 7 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_dependencies/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: dependencies.sh 4 | expected: dependencies.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_filter/filter.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | cargo kani autoharness -Z autoharness 6 | -------------------------------------------------------------------------------- /tests/ui/should-panic-attribute/with-args/expected: -------------------------------------------------------------------------------- 1 | error: custom attribute panicked 2 | help: message: `#[kani::should_panic]` does not take any arguments currently 3 | error: aborting due to 1 previous error 4 | -------------------------------------------------------------------------------- /tests/ui/solver-attribute/multiple-args/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | #[kani::solver(kissat, minisat)] 6 | fn check() {} 7 | -------------------------------------------------------------------------------- /tests/cargo-kani/storage-markers/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [workspace] 4 | members = ["crate-with-bug", "crate-with-harness"] 5 | resolver = "2" 6 | -------------------------------------------------------------------------------- /tests/expected/closure2/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | attempt to add with overflow 3 | SUCCESS\ 4 | attempt to add with overflow 5 | SUCCESS\ 6 | assertion failed: z == 102 7 | SUCCESS\ 8 | assertion failed: g(z) == 206 9 | -------------------------------------------------------------------------------- /tests/expected/derive-invariant/safety_invariant_fail/expected: -------------------------------------------------------------------------------- 1 | - Status: FAILURE\ 2 | - Description: "assertion failed: wrapper.is_safe()" 3 | 4 | Verification failed for - check_invariant_fail 5 | -------------------------------------------------------------------------------- /tests/expected/function-contract/arbitrary_requires_pass.expected: -------------------------------------------------------------------------------- 1 | arithmetic_overflow\ 2 | - Status: SUCCESS\ 3 | - Description: "attempt to divide by zero"\ 4 | in function div 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/checking_from_external_mod.expected: -------------------------------------------------------------------------------- 1 | - Status: SUCCESS\ 2 | - Description: "|result : &u32| (*result == x) | (*result == y)"\ 3 | in function max 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/respects-preconditions/ensures_before_requires.expected: -------------------------------------------------------------------------------- 1 | next\ 2 | - Status: SUCCESS\ 3 | - Description: "attempt to add with overflow" 4 | 5 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/expected/function-contract/history/respects-preconditions/requires_before_ensures.expected: -------------------------------------------------------------------------------- 1 | next\ 2 | - Status: SUCCESS\ 3 | - Description: "attempt to add with overflow" 4 | 5 | VERIFICATION:- SUCCESSFUL -------------------------------------------------------------------------------- /tests/expected/function-contract/interior-mutability/whole-struct/cell.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|_| im.x.get() < 101"\ 4 | in function modify 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies_fat_pointer/u32slice.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|_| x.iter().map(|v| *v == 0).fold(true,|a,b|a&b)"\ 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies_fat_pointer/u8slice.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|_| x.iter().map(|v| *v == 0).fold(true,|a,b|a&b)"\ 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-shuffle-result-type-is-diff-type/expected: -------------------------------------------------------------------------------- 1 | expected return element type `i64` (element of input `i64x2`), found `f64x2` with element type `f64` 2 | error: aborting due to 1 previous error -------------------------------------------------------------------------------- /tests/expected/slice-pattern-array/expected: -------------------------------------------------------------------------------- 1 | Status: FAILURE\ 2 | Description: "Sub-array binding is not currently supported by Kani. Please post your example at https://github.com/model-checking/kani/issues/707" 3 | -------------------------------------------------------------------------------- /tests/script-based-pre/autoderive_arbitrary_structs/structs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | cargo kani autoharness -Z autoharness 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/autoharness-refs_immutable/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | kani autoharness -Z autoharness immutable.rs 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_contracts/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: contracts.sh 4 | expected: contracts.expected 5 | exit_code: 1 -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_contracts/contracts.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | cargo kani autoharness -Z autoharness 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_dependencies/dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | cargo kani autoharness -Z autoharness -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_list/list.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | cargo kani autoharness -Z autoharness --list 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_playback_build/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_with_build.sh 4 | expected: playback_with_build.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/crate-name/a/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub fn add_a(left: usize, right: usize) -> usize { 5 | left + right 6 | } 7 | -------------------------------------------------------------------------------- /tests/script-based-pre/crate-name/my-code.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub fn add_a(left: usize, right: usize) -> usize { 5 | left + right 6 | } 7 | -------------------------------------------------------------------------------- /tests/script-based-pre/playback_multi_harness_multi_inject/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_opts.sh 4 | expected: playback_opts.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/playback_no_rustfmt/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_no_rustfmt.sh 4 | expected: playback_no_rustfmt.expected 5 | -------------------------------------------------------------------------------- /src/bin/cargo_kani.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | use anyhow::Result; 5 | 6 | fn main() -> Result<()> { 7 | kani_verifier::proxy("cargo-kani") 8 | } 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/build-rs-plus-host-with-kani-proofs/README.md: -------------------------------------------------------------------------------- 1 | This repo contains contains a minimal example that used to break compilation 2 | when using Kani. See https://github.com/model-checking/kani/issues/3101. 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/build-rs-works/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn check() { 6 | assert!(env!("SET_IN_BUILD_RS") == "Y"); 7 | } 8 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/simple_fail.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: FAILURE\ 3 | - Description: "|_| old(*ptr) == *ptr" 4 | 5 | Failed Checks: |_| old(*ptr) == *ptr 6 | 7 | VERIFICATION:- FAILED 8 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/loop_with_true_invariant.expected: -------------------------------------------------------------------------------- 1 | main.loop_invariant_base.1\ 2 | - Status: SUCCESS\ 3 | - Description: "Check invariant before entry for loop main.0" 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/offset-bytes-overflow/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Offset in bytes overflows isize 2 | Verification failed for - check_wrap_offset 3 | 4 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. 5 | -------------------------------------------------------------------------------- /tests/expected/reach/rem-zero/reachable_fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | Description: "attempt to calculate the remainder with a divisor of zero" 3 | Failed Checks: attempt to calculate the remainder with a divisor of zero 4 | -------------------------------------------------------------------------------- /tests/expected/string-repeat/2235.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: called `Option::unwrap()` on a `None` value 2 | Verification failed for - repeat_panic 3 | Complete - 1 successfully verified harnesses, 1 failures, 2 total. 4 | -------------------------------------------------------------------------------- /tests/expected/test5/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: div(4, 2) == 2 3 | FAILURE\ 4 | assertion failed: div(6, 2) == 2 5 | SUCCESS\ 6 | attempt to divide by zero 7 | SUCCESS\ 8 | attempt to divide with overflow 9 | -------------------------------------------------------------------------------- /tests/expected/uninit/transmute-padding/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Transmuting between types of incompatible layouts. 2 | 3 | VERIFICATION:- FAILED 4 | 5 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. -------------------------------------------------------------------------------- /tests/expected/unwind_tip/expected: -------------------------------------------------------------------------------- 1 | UNDETERMINED 2 | [Kani] info: Verification output shows one or more unwinding failures. 3 | [Kani] tip: Consider increasing the unwinding value or disabling `--unwinding-assertions`. 4 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_dependencies/other_crate/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn no_harness(x: u8) -> u8 { 5 | x + 1 6 | } 7 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_harnesses_fail/harnesses_fail.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | cargo kani autoharness -Z autoharness -------------------------------------------------------------------------------- /tests/script-based-pre/playback_with_cfg_kani/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: playback_with_cfg_kani.sh 4 | expected: playback_with_cfg_kani.expected 5 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [toolchain] 5 | channel = "nightly-2025-11-20" 6 | components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"] 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/checking_in_impl.expected: -------------------------------------------------------------------------------- 1 | - Status: SUCCESS\ 2 | - Description: "|result : &WrappedInt| (*result == self) | (*result == y)"\ 3 | in function WrappedInt::max 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/function-contract/interior-mutability/api/unsafecell.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|_| unsafe{*im.x.get()} < 101"\ 4 | in function modify 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/interior-mutability/whole-struct/oncecell.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|_| im.x.get().is_some()"\ 4 | in function modify 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/field_replace_fail.expected: -------------------------------------------------------------------------------- 1 | main.assertion\ 2 | - Status: FAILURE\ 3 | - Description: "Increment havocked" 4 | 5 | Failed Checks: Increment havocked 6 | 7 | VERIFICATION:- FAILED 8 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies_fat_pointer/slice_of_array.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|_| x[0..3].iter().map(|v| *v == 0).fold(true,|a,b|a&b)"\ 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/function-contract/simple_ensures_pass.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|result : &u32| (*result == x) | (*result == y)"\ 4 | in function max 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/static-mutable/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | assertion failed: 10 == foo() 3 | SUCCESS\ 4 | assertion failed: 12 == foo() 5 | SUCCESS\ 6 | assertion failed: 10 == foo() 7 | FAILURE\ 8 | assertion failed: 12 == foo() 9 | -------------------------------------------------------------------------------- /tests/kani/Cast/path.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | use std::path::Path; 4 | 5 | #[kani::proof] 6 | fn main() { 7 | let path = Path::new("./foo/bar.txt"); 8 | } 9 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_type_invariant/type-invariant.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | cargo kani autoharness -Z autoharness 6 | -------------------------------------------------------------------------------- /docs/src/tutorial/loops-unwinding/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "loops-unwinding" 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [workspace] -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # Kani Test Suites 2 | 3 | You can see more details about each test suite in this folder in the 4 | [Kani testing suites](https://model-checking.github.io/kani/regression-testing.html#kani-testing-suites). 5 | 6 | -------------------------------------------------------------------------------- /tests/cargo-kani/no-std/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [package] 5 | name = "no-std" 6 | version = "0.1.0" 7 | edition = "2024" 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/expected/cover/cover-fail/expected: -------------------------------------------------------------------------------- 1 | Status: UNSATISFIABLE\ 2 | Description: "cover condition: x != 0"\ 3 | in function cover_overconstrained 4 | 5 | ** 0 of 1 cover properties satisfied 6 | 7 | VERIFICATION:- SUCCESSFUL 8 | -------------------------------------------------------------------------------- /tests/expected/function-contract/arbitrary_ensures_pass.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|result : &u32| *result == x || *result == y"\ 4 | in function max 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/history/no_modifies.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|result : &u32| old(val) == val && old(val.wrapping_add(1)) == *result"\ 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/function-contract/interior-mutability/whole-struct/refcell.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|_| unsafe{*im.x.as_ptr()} < 101"\ 4 | in function modify 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/interior-mutability/whole-struct/unsafecell.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|_| unsafe{*im.x.get()} < 101"\ 4 | in function modify 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies_fat_pointer/nondeterministic_size.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|_| x.iter().map(|v| *v == 0).fold(true,|a,b|a&b)"\ 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/function-contract/simple_ensures_pass_no_annotation.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|result| (*result == x) | (*result == y)"\ 4 | in function max 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/loop_with_old.expected: -------------------------------------------------------------------------------- 1 | loop_with_old.loop_invariant_base.1\ 2 | - Status: SUCCESS\ 3 | - Description: "Check invariant before entry for loop loop_with_old.0" 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/loop_with_prev.expected: -------------------------------------------------------------------------------- 1 | loop_with_prev.loop_invariant_step.1\ 2 | - Status: SUCCESS\ 3 | - Description: "Check invariant after step for loop loop_with_prev.0" 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/expected/object-bits/insufficient/expected: -------------------------------------------------------------------------------- 1 | too many addressed objects: maximum number of objects is set to 2^n=32 (with n=5); use the `-Z unstable-options --cbmc-args --object-bits n` option to increase the maximum number 2 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_harnesses_fail/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: harnesses_fail.sh 4 | expected: harnesses_fail.expected 5 | exit_code: 1 -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_type_invariant/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: type-invariant.sh 4 | expected: type-invariant.expected 5 | exit_code: 1 -------------------------------------------------------------------------------- /tests/script-based-pre/kani-version-flag-version/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: kani-version-flag-version.sh 4 | expected: kani-version-flag-version.expected 5 | -------------------------------------------------------------------------------- /tests/ui/Property-Class-UI/cover/expected: -------------------------------------------------------------------------------- 1 | main.cover.\ 2 | Status: SATISFIED\ 3 | Description: "i may be negative"\ 4 | main.rs:7:5 in function main 5 | 6 | ** 1 of 1 cover properties satisfied 7 | 8 | VERIFICATION:- SUCCESSFUL 9 | -------------------------------------------------------------------------------- /tests/ui/compiler-stats/expected: -------------------------------------------------------------------------------- 1 | Reachability Analysis Result 2 | Total # items: 3 | Total # statements: 4 | Total # expressions: 5 | 6 | Reachable Items: 7 | - function: 8 | Statements: 9 | - Call: 10 | Expressions: 11 | -------------------------------------------------------------------------------- /tests/ui/solver-attribute/multiple-attrs/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | #[kani::solver(kissat)] 6 | #[kani::solver(kissat)] 7 | fn check() {} 8 | -------------------------------------------------------------------------------- /kani-driver/src/concrete_playback/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | //! Implements the logic related to concrete playback 4 | 5 | pub mod playback; 6 | pub mod test_generator; 7 | -------------------------------------------------------------------------------- /tests/cargo-kani/build-rs-works/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "build-rs-works" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/dependency-test/diamond-dependency/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [workspace] 5 | members = ["main", "dependency1", "dependency2", "dependency3"] 6 | -------------------------------------------------------------------------------- /tests/cargo-kani/firecracker-block-example/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [package] 5 | name = "firecracker-block-example" 6 | version = "0.1.0" 7 | edition = "2018" 8 | -------------------------------------------------------------------------------- /tests/expected/bounded-arbitrary/string/string.expected: -------------------------------------------------------------------------------- 1 | Checking harness check_string... 2 | 3 | ** 6 of 6 cover properties satisfied 4 | 5 | Manual Harness Summary: 6 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. -------------------------------------------------------------------------------- /tests/expected/function-contract/gcd_success.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "|result : &T| *result != 0 && x % *result == 0 && y % *result == 0"\ 4 | in function gcd 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/global_replace_fail.expected: -------------------------------------------------------------------------------- 1 | main.assertion\ 2 | - Status: FAILURE\ 3 | - Description: "not havocked"\ 4 | in function main 5 | 6 | Failed Checks: not havocked 7 | 8 | VERIFICATION:- FAILED 9 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/simple_fail.expected: -------------------------------------------------------------------------------- 1 | assigns\ 2 | - Status: FAILURE\ 3 | - Description: "Check that *var_6 is assignable" 4 | 5 | Failed Checks: Check that *var_6 is assignable 6 | 7 | VERIFICATION:- FAILED 8 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/simple_loop_loop.expected: -------------------------------------------------------------------------------- 1 | main.loop_invariant_base.1\ 2 | - Status: SUCCESS\ 3 | - Description: "Check invariant before entry for loop main.0"\ 4 | in function main 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/kani/Strings/boxed_str.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn main() { 6 | let s = String::from("hello"); 7 | let _b = s.into_boxed_str(); 8 | } 9 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_termination_timeout/termination_timeout.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | cargo kani autoharness -Z autoharness 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/mem-init-reinstrumentation/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: mem-init-reinstrumentation.sh 4 | expected: mem-init-reinstrumentation.expected 5 | -------------------------------------------------------------------------------- /docs/src/tutorial/arbitrary-variables/safe_update.expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | "NonZeroU32 is internally a u32 but it should never be 0." 3 | SUCCESS\ 4 | assertion failed: inventory.get(&id).unwrap() == quantity 5 | VERIFICATION:- SUCCESSFUL 6 | -------------------------------------------------------------------------------- /tests/cargo-kani/default-members/builds-ok/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "builds-ok" 5 | version = "0.1.0" 6 | edition = "2024" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/firecracker-block-example/src/virtio_defs.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub const VIRTQ_DESC_F_NEXT: u16 = 0x1; 5 | pub const VIRTQ_DESC_F_WRITE: u16 = 0x2; 6 | -------------------------------------------------------------------------------- /tests/cargo-kani/nested-dirs/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [workspace] 4 | 5 | members = [ 6 | "crate1", 7 | "crate2", 8 | "crate2/nested_crate", 9 | ] 10 | -------------------------------------------------------------------------------- /tests/cargo-kani/nested-dirs/crate1/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn a_check() { 6 | let v = vec![1, 2, 3]; 7 | assert_eq!(v.len(), 3); 8 | } 9 | -------------------------------------------------------------------------------- /tests/expected/empty/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | /// This test checks that zero checks are reported for an empty test 5 | 6 | #[kani::proof] 7 | fn check_nothing() {} 8 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/loop_assigns_for_ref_fail.expected: -------------------------------------------------------------------------------- 1 | main.assigns.3\ 2 | - Status: FAILURE\ 3 | - Description: "Check that j is assignable" 4 | 5 | Failed Checks: Check that j is assignable 6 | 7 | VERIFICATION:- FAILED 8 | -------------------------------------------------------------------------------- /tests/kani/Asm/main_fixme.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | #![feature(asm)] 4 | 5 | #[kani::proof] 6 | fn main() { 7 | unsafe { 8 | asm!("nop"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_exclude/exclude.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | cargo kani autoharness -Z autoharness --exclude-pattern exclude 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_termination_unwind/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: termination_unwind.sh 4 | expected: termination_unwind.expected 5 | exit_code: 1 -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_playback_opts/playback_opts.expected: -------------------------------------------------------------------------------- 1 | [TEST] Only codegen test... 2 | Executable unittests src/lib.rs 3 | [TEST] Only codegen test... 4 | Finished `test` 5 | [TEST] Executable 6 | debug/deps/sample_crate- 7 | -------------------------------------------------------------------------------- /tests/ui/solver-attribute/no-arg/expected: -------------------------------------------------------------------------------- 1 | error: the `#[kani::solver]` attribute expects a single argument. Got 0 arguments.\ 2 | test.rs:\ 3 | |\ 4 | | #[kani::solver]\ 5 | | ^^^^^^^^^^^^^^^ 6 | error: aborting due to 1 previous error 7 | -------------------------------------------------------------------------------- /tests/ui/terse-output-format-fail/fail.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | // kani-flags: --output-format terse 5 | #[kani::proof] 6 | fn main() { 7 | assert!(1 + 1 == 3); 8 | } 9 | -------------------------------------------------------------------------------- /tests/ui/terse-output-format-pass/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | // kani-flags: --output-format terse 5 | #[kani::proof] 6 | fn main() { 7 | assert!(1 + 1 == 2); 8 | } 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/default-members/dont-build-me/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "dont-build-me" 5 | version = "0.1.0" 6 | edition = "2024" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/nested-dirs/crate2/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn another_check() { 6 | let result = 2 + 2; 7 | assert_eq!(result, 4); 8 | } 9 | -------------------------------------------------------------------------------- /tests/cargo-ui/no-std-no-kani/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [package] 5 | name = "no-std-help" 6 | version = "0.1.0" 7 | edition = "2024" 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/cargo-ui/no-std-no-kani/expected: -------------------------------------------------------------------------------- 1 | error: Failed to detect Kani functions.\ 2 | |\ 3 | = help: This project seems to be using #[no_std] but does not import Kani. Try adding `crate extern kani` to the crate root to explicitly import Kani. -------------------------------------------------------------------------------- /tests/expected/intrinsics/simd-arith-overflows/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | attempt to compute simd_add which would overflow 3 | FAILURE\ 4 | attempt to compute simd_sub which would overflow 5 | FAILURE\ 6 | attempt to compute simd_mul which would overflow -------------------------------------------------------------------------------- /tests/expected/reach/bounds/reachable_fail/expected: -------------------------------------------------------------------------------- 1 | FAILURE\ 2 | Description: "index out of bounds: the length is less than or equal to the given index" 3 | Failed Checks: index out of bounds: the length is less than or equal to the given index 4 | -------------------------------------------------------------------------------- /tests/expected/uninit/alloc-to-slice/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Undefined Behavior: Reading from an uninitialized pointer of type `*const [u8]` 2 | 3 | VERIFICATION:- FAILED 4 | 5 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. -------------------------------------------------------------------------------- /tests/expected/uninit/vec-read-bad-len/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Undefined Behavior: Reading from an uninitialized pointer of type `*const [u8]` 2 | 3 | VERIFICATION:- FAILED 4 | 5 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. -------------------------------------------------------------------------------- /tests/expected/uninit/vec-read-semi-init/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Undefined Behavior: Reading from an uninitialized pointer of type `*const u8` 2 | 3 | VERIFICATION:- FAILED 4 | 5 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. -------------------------------------------------------------------------------- /tests/expected/uninit/vec-read-uninit/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Undefined Behavior: Reading from an uninitialized pointer of type `*const u8` 2 | 3 | VERIFICATION:- FAILED 4 | 5 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. -------------------------------------------------------------------------------- /tests/expected/valid-value-checks/write_bytes.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Undefined Behavior: Invalid value of type `char` 2 | 3 | Verification failed for - check_invalid_write 4 | Complete - 1 successfully verified harnesses, 1 failures, 2 total. 5 | -------------------------------------------------------------------------------- /tests/kani/Slice/slice.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | #[kani::proof] 4 | fn main() { 5 | let list = [1, 2, 3]; 6 | let slice = &list[1..2]; 7 | assert!(slice.len() > 0); 8 | } 9 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_termination_timeout/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: termination_timeout.sh 4 | expected: termination_timeout.expected 5 | exit_code: 1 -------------------------------------------------------------------------------- /tests/script-based-pre/crate-name/b/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | extern crate a; 4 | 5 | pub fn add_b(left: usize, right: usize) -> usize { 6 | a::add_a(left, right) 7 | } 8 | -------------------------------------------------------------------------------- /tests/script-based-pre/no_codegen/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [package] 5 | name = "no_codegen" 6 | version = "0.1.0" 7 | edition = "2024" 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/script-based-pre/std_codegen/dummy/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [package] 5 | name = "dummy" 6 | version = "0.1.0" 7 | edition = "2021" 8 | 9 | [workspace] 10 | -------------------------------------------------------------------------------- /tests/ui/missing-function/extern_c/expected: -------------------------------------------------------------------------------- 1 | Status: UNDETERMINED\ 2 | Description: "assertion failed: x == 5" 3 | Status: FAILURE\ 4 | Description: "Function `missing_function` with missing definition is unreachable" 5 | VERIFICATION:- FAILED 6 | -------------------------------------------------------------------------------- /tests/ui/regular-output-format-pass/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | // kani-flags: --output-format regular 5 | #[kani::proof] 6 | fn main() { 7 | assert!(1 + 1 == 2); 8 | } 9 | -------------------------------------------------------------------------------- /tests/ui/solver-attribute/multiple-attrs/expected: -------------------------------------------------------------------------------- 1 | error: only one '#[kani::solver]' attribute is allowed per harness\ 2 | test.rs:\ 3 | |\ 4 | | #[kani::solver(kissat)]\ 5 | | ^^^^^^^^^^^^^^^^^^^^^^^ 6 | error: aborting due to 1 previous error 7 | -------------------------------------------------------------------------------- /tests/cargo-kani/iss2857/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "iss2857" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | sec1 = "0.7.3" 10 | -------------------------------------------------------------------------------- /tests/cargo-kani/storage-markers/crate-with-bug/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "crate-with-bug" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-double-extern-path/crate_a/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | //! Define `assert_true` function. 4 | 5 | pub fn assert_true(b: bool) { 6 | assert!(b); 7 | } 8 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-extern-path/other_crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "other_crate" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-foreign-method/other_crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "other_crate" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-use-as-foreign/other_crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "other_crate" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-use-foreign/other_crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "other_crate" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-use-in-foreign/other_crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "other_crate" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/unexpected_cfgs/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [package] 5 | name = "unexpected_cfgs" 6 | version = "0.1.0" 7 | edition = "2021" 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/cargo-kani/ws-flag/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | //! test in top crate. 5 | 6 | #[kani::proof] 7 | fn check_toplevel_proof() { 8 | assert!(1 == 1); 9 | } 10 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-select/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_ws_package() { 8 | assert!(1 + 1 == 3); 9 | } 10 | -------------------------------------------------------------------------------- /tests/expected/function-contract/attribute_no_complain.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::ensures(|result| true)] 5 | fn always() {} 6 | 7 | #[kani::proof] 8 | fn random_harness() {} 9 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo-kani-version-flag-version/config.yml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | script: cargo-kani-version-flag-version.sh 4 | expected: cargo-kani-version-flag-version.expected 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_manifest_test/add/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [package] 5 | name = "add" 6 | version = "0.1.0" 7 | edition = "2021" 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/script-based-pre/playback_with_cfg_kani/playback_with_cfg_kani.expected: -------------------------------------------------------------------------------- 1 | failures: 2 | harnesses::kani_concrete_playback_harness_15598097466099501582 3 | 4 | test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; 5 | -------------------------------------------------------------------------------- /tests/ui/concrete-playback/unsupported/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: unwinding assertion loop 0 2 | WARNING: Kani could not produce a concrete playback for `check_unwind_fail` because there were no failing panic checks or satisfiable cover statements. 3 | -------------------------------------------------------------------------------- /tests/ui/safety-constraint-attribute/double-attribute/expected: -------------------------------------------------------------------------------- 1 | error: Cannot derive `Invariant` for `Point` 2 | | 3 | | #[derive(Invariant)] 4 | | ^^^^^^^^^ 5 | | 6 | note: `#[safety_constraint(...)]` cannot be used more than once. 7 | -------------------------------------------------------------------------------- /tests/ui/should-panic-attribute/expected-panics/expected: -------------------------------------------------------------------------------- 1 | ** 2 of 2 failed 2 | Failed Checks: panicked on the `if` branch! 3 | Failed Checks: panicked on the `else` branch! 4 | VERIFICATION:- SUCCESSFUL (encountered one or more panics as expected) 5 | -------------------------------------------------------------------------------- /library/kani/build.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() { 5 | // Make sure `kani_sysroot` is a recognized config 6 | println!("cargo::rustc-check-cfg=cfg(kani_sysroot)"); 7 | } 8 | -------------------------------------------------------------------------------- /tests/cargo-kani/assert-reach/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn test() { 6 | let x = 4; 7 | let y = foo::foo(x); 8 | assert!(y == x); 9 | } 10 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-lib/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "simple-lib" 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | 10 | [workspace] 11 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-use-glob-foreign/other_crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "other_crate" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/ws-flag/libcrate/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | //! test in sub-crate. 5 | 6 | #[kani::proof] 7 | fn check_libcrate_proof() { 8 | assert!(1 == 1); 9 | } 10 | -------------------------------------------------------------------------------- /tests/cargo-kani/zero-harnesses-is-success/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "zero-harnesses-is-success" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-exclude/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_ws_package() { 8 | assert!(1 + 1 == 2); 9 | } 10 | -------------------------------------------------------------------------------- /tests/expected/derive-bounded-arbitrary/enum_one_variant.expected: -------------------------------------------------------------------------------- 1 | Checking harness check_enum... 2 | 3 | ** 5 of 5 cover properties satisfied 4 | 5 | VERIFICATION:- SUCCESSFUL 6 | 7 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. 8 | -------------------------------------------------------------------------------- /tests/expected/function-contract/simple_ensures_fail.expected: -------------------------------------------------------------------------------- 1 | assertion\ 2 | - Status: FAILURE\ 3 | - Description: "|result : &u32| *result == x"\ 4 | in function max 5 | 6 | Failed Checks: |result : &u32| *result == x 7 | 8 | VERIFICATION:- FAILED 9 | -------------------------------------------------------------------------------- /tests/expected/uninit/access-padding-via-cast/expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Undefined Behavior: Reading from an uninitialized pointer of type `*mut [u8; 4]` 2 | 3 | VERIFICATION:- FAILED 4 | 5 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. -------------------------------------------------------------------------------- /tests/kani/Slice/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | #[kani::unwind(6)] 6 | fn main() { 7 | let name: &str = "hello"; 8 | assert!(name == "hello"); 9 | } 10 | -------------------------------------------------------------------------------- /tests/script-based-pre/std_codegen/dummy/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | //! Just a dummy file. We are interested in the standard library only 4 | 5 | pub fn void() { 6 | todo!() 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui/Property-Class-UI/cover/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn main() { 6 | let i: i32 = kani::any(); 7 | kani::cover!(i < 0, "i may be negative"); 8 | } 9 | -------------------------------------------------------------------------------- /tools/benchcomp/benchcomp/entry/README.md: -------------------------------------------------------------------------------- 1 | Each file X.py in this directory contains a `main` method, which 2 | bin/benchcomp will call when you run `benchcomp X`. Running `benchcomp` 3 | with no arguments will invoke the `main` method in `benchcomp.py`. 4 | -------------------------------------------------------------------------------- /library/kani_macros/build.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() { 5 | // Make sure `kani_sysroot` is a recognized config 6 | println!("cargo::rustc-check-cfg=cfg(kani_sysroot)"); 7 | } 8 | -------------------------------------------------------------------------------- /tests/cargo-coverage/simple-lib/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "simple-lib" 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | 10 | [workspace] 11 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-main/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "empty-main" 5 | version = "0.1.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | 10 | [workspace] 11 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-extern-path/other_crate/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn magic_number() -> u32 { 5 | 42 6 | } 7 | 8 | pub fn twelve() -> u32 { 9 | 12 10 | } 11 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-private-foreign-function/other_crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "other_crate" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-public-foreign-function/other_crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "other_crate" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-exclude-unknown/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_ws_package() { 8 | assert!(1 + 1 == 3); 9 | } 10 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-select-unknown/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_ws_package() { 8 | assert!(1 + 1 == 2); 9 | } 10 | -------------------------------------------------------------------------------- /tests/expected/function-contract/trait_impls/impl_contract_precedence.expected: -------------------------------------------------------------------------------- 1 | Status: SUCCESS\ 2 | Description: "|result| *result == 100"\ 3 | in function ::get_value 4 | 5 | Complete - 1 successfully verified harnesses, 0 failures, 1 total. -------------------------------------------------------------------------------- /tests/expected/loop-contract/loop_assigns_for_fat_ptr_fail.expected: -------------------------------------------------------------------------------- 1 | main.assigns.1\ 2 | - Status: FAILURE\ 3 | - Description: "Check that a[var_15] is assignable" 4 | 5 | Failed Checks: Check that a[var_15] is assignable 6 | 7 | VERIFICATION:- FAILED 8 | -------------------------------------------------------------------------------- /tests/expected/loop-contract/loop_with_old_and_prev.expected: -------------------------------------------------------------------------------- 1 | loop_with_old_and_prev.loop_invariant_base.1\ 2 | - Status: SUCCESS\ 3 | - Description: "Check invariant before entry for loop loop_with_old_and_prev.0"\ 4 | 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/one-assert/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | pub fn check_assert() { 6 | let x: u8 = kani::any(); 7 | let y = x; 8 | assert!(x == y); 9 | } 10 | -------------------------------------------------------------------------------- /tests/expected/slice/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: y.len() == 5 3 | SUCCESS\ 4 | index out of bounds: the length is less than or equal to the given index 5 | SUCCESS\ 6 | assertion failed: y[1] == 2 7 | SUCCESS\ 8 | assertion failed: z.len() == 3 9 | -------------------------------------------------------------------------------- /tests/expected/slice_c_str/expected: -------------------------------------------------------------------------------- 1 | warning: Found the following unsupported constructs: 2 | - C string literal 3 | 4 | Checking harness check_c_str... 5 | Failed Checks: C string literal is not currently supported by Kani. 6 | 7 | VERIFICATION:- FAILED 8 | -------------------------------------------------------------------------------- /tests/expected/unwind-flags-conflict/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | // kani-flags: --default-unwind 2 -Z unstable-options --cbmc-args --unwindset 2 5 | 6 | #[kani::proof] 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/kani/Pointers_Basic/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | #[kani::proof] 4 | fn main() { 5 | let x = 3; 6 | let y = &x; 7 | let mut z = *y; 8 | 9 | assert!(z == 3); 10 | } 11 | -------------------------------------------------------------------------------- /tests/script-based-pre/mir_stub_panic/panic.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | // Ensure that the panic!() macro itself gets stubbed. 5 | #[kani::proof] 6 | fn main() { 7 | panic!("hello!"); 8 | } 9 | -------------------------------------------------------------------------------- /tests/script-based-pre/no_codegen_error/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [package] 5 | name = "no_codegen_error" 6 | version = "0.1.0" 7 | edition = "2024" 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui/code-location/expected: -------------------------------------------------------------------------------- 1 | module/mod.rs:10:5 in function module::not_empty 2 | main.rs:13:5 in function same_file 3 | /toolchains/ 4 | alloc/src/vec/mod.rs: 5 | in function as std::ops::Drop>::drop 6 | 7 | VERIFICATION:- SUCCESSFUL 8 | -------------------------------------------------------------------------------- /tests/ui/regular-output-format-fail/fail.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | // kani-flags: --output-format regular 5 | 6 | #[kani::proof] 7 | fn main() { 8 | assert!(1 + 1 == 3); 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/safety-constraint-attribute/no-struct-error/expected: -------------------------------------------------------------------------------- 1 | error: Cannot derive `Invariant` for `MyEnum` 2 | | 3 | | #[derive(kani::Invariant)] 4 | | ^^^^^^^^^^^^^^^ 5 | | 6 | note: `#[safety_constraint(...)]` can only be used in structs 7 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-proof-annotation/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [package] 5 | name = "simple-proof-annotation" 6 | version = "0.1.0" 7 | edition = "2021" 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/cargo-ui/target-selection/non-test-targets/expected: -------------------------------------------------------------------------------- 1 | Checking harness verify::bar_harness... 2 | Checking harness verify::foo_harness... 3 | Checking harness verify::lib_harness... 4 | 5 | Complete - 3 successfully verified harnesses, 0 failures, 3 total. 6 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-exclude/bin_package/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_bin_package() { 8 | assert!(1 + 1 == 2); 9 | } 10 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-select/bin_package/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_bin_package() { 8 | assert!(1 + 1 == 2); 9 | } 10 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-select/lib_package/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub fn api() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_lib_package() { 8 | assert!(1 + 1 == 2); 9 | } 10 | -------------------------------------------------------------------------------- /tests/expected/any_vec/out_bounds.expected: -------------------------------------------------------------------------------- 1 | Checking harness check_always_out_bounds... 2 | 3 | Failed Checks: Rust intrinsic assumption failed 4 | in >::get_unchecked 5 | 6 | Verification failed for - check_always_out_bounds 7 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/field_replace_pass.expected: -------------------------------------------------------------------------------- 1 | main.assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "Increment"\ 4 | 5 | main.assertion\ 6 | - Status: SUCCESS\ 7 | - Description: "Unchanged" 8 | 9 | VERIFICATION:- SUCCESSFUL 10 | -------------------------------------------------------------------------------- /tests/expected/reach/assert/reachable_pass/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn main() { 6 | let x = 5; 7 | if x > 3 { 8 | assert!(x > 4); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/expected/uninit/delayed-ub/slices_fixme.expected: -------------------------------------------------------------------------------- 1 | delayed_ub_slices.assertion.\ 2 | - Status: FAILURE\ 3 | - Description: "Undefined Behavior: Reading from an uninitialized pointer of type `[u128; 4]`" 4 | 5 | Verification failed for - delayed_ub_slices 6 | -------------------------------------------------------------------------------- /tests/expected/valid-value-checks/maybe_uninit.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Undefined Behavior: Invalid value of type `std::num::NonZero` 2 | 3 | Verification failed for - check_invalid_zeroed 4 | Complete - 1 successfully verified harnesses, 1 failures, 2 total. 5 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_dependencies/other_crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "other_crate" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/script-based-pre/cargo_autoharness_include/include.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Kani Contributors 3 | # SPDX-License-Identifier: Apache-2.0 OR MIT 4 | 5 | cargo kani autoharness -Z autoharness --include-pattern cargo_autoharness_include::include 6 | -------------------------------------------------------------------------------- /tests/script-based-pre/crate-name/c/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | extern crate a; 4 | extern crate b; 5 | 6 | pub fn add_c(left: usize, right: usize) -> usize { 7 | b::add_b(left, right) 8 | } 9 | -------------------------------------------------------------------------------- /tests/std-checks/std/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | //! Top file that includes all sub-modules mimicking std structure. 5 | 6 | extern crate kani; 7 | 8 | mod boxed; 9 | mod sync; 10 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-unwind-annotation/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [package] 5 | name = "simple-unwind-annotation" 6 | version = "0.1.0" 7 | edition = "2021" 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/cargo-kani/small-vec/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "check_stack_vec" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | 9 | [dependencies] 10 | smallvec = "1.8.0" 11 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-exclude/lib_package/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub fn api() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_lib_package() { 8 | assert!(1 + 1 == 2); 9 | } 10 | -------------------------------------------------------------------------------- /tests/expected/dead-invalid-access-via-raw/main.expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | address must be a multiple of its type's alignment 3 | SUCCESS\ 4 | pointer NULL 5 | SUCCESS\ 6 | pointer invalid 7 | SUCCESS\ 8 | deallocated dynamic object 9 | FAILURE\ 10 | dead object 11 | -------------------------------------------------------------------------------- /tests/expected/enum/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | assertion failed: x == 10 3 | UNREACHABLE\ 4 | assertion failed: false 5 | UNREACHABLE\ 6 | assertion failed: false 7 | SUCCESS\ 8 | assertion failed: x == 30 && y == 60.0 9 | FAILURE\ 10 | assertion failed: x == 31 11 | -------------------------------------------------------------------------------- /tests/expected/intrinsics/align_of_dst.expected: -------------------------------------------------------------------------------- 1 | Checking harness check_zst1024... 2 | Checking harness check_large... 3 | Checking harness check_1char_tup... 4 | Checking harness check_1zst_usize... 5 | 6 | Complete - 4 successfully verified harnesses, 0 failures, 4 total -------------------------------------------------------------------------------- /tests/expected/loop-contract/function_with_loop_no_assertion.expected: -------------------------------------------------------------------------------- 1 | has_loop.loop_invariant_base.1\ 2 | - Status: SUCCESS\ 3 | - Description: "Check invariant before entry for loop has_loop.0"\ 4 | in function has_loop 5 | 6 | 7 | 8 | VERIFICATION:- SUCCESSFUL 9 | -------------------------------------------------------------------------------- /tests/expected/offset-bounds-check/start_from_oob.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Offset result and original pointer must point to the same allocation 2 | Verification failed for - check_add_to_oob 3 | 4 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. 5 | -------------------------------------------------------------------------------- /tests/expected/ptr_to_ref_cast/alignment/expected: -------------------------------------------------------------------------------- 1 | check_misaligned_ptr_cast_fail.safety_check\ 2 | Status: FAILURE\ 3 | Description: "misaligned pointer dereference: address must be a multiple of its type's alignment"\ 4 | in function check_misaligned_ptr_cast_fail 5 | -------------------------------------------------------------------------------- /tests/expected/quantifiers/multiple_quantifiers.expected: -------------------------------------------------------------------------------- 1 | main.assertion.2\ 2 | - Status: SUCCESS\ 3 | - Description: "assertion failed: kani::exists!(| i in (0, len) |\ 4 | *rebuilt_ptr.wrapping_byte_offset(4*i as isize) == 0)" 5 | 6 | VERIFICATION:- SUCCESSFUL 7 | -------------------------------------------------------------------------------- /tests/expected/uninit/access-padding-uninit/access-padding-uninit.expected: -------------------------------------------------------------------------------- 1 | Failed Checks: Undefined Behavior: Reading from an uninitialized pointer of type `*const u8` 2 | 3 | VERIFICATION:- FAILED 4 | 5 | Complete - 0 successfully verified harnesses, 1 failures, 1 total. -------------------------------------------------------------------------------- /tests/kani/FileNameWithSpace/my src/hi.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn main() { 6 | let cond: bool = kani::any(); 7 | kani::assume(cond); 8 | assert!(cond); 9 | } 10 | -------------------------------------------------------------------------------- /tests/kani/FunctionSymbols/fixme_main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | // size_of is not supported yet: 5 | #[kani::proof] 6 | fn assert_fndef_zst() { 7 | assert_eq!(std::mem::size_of_val(&h), 0); 8 | } 9 | -------------------------------------------------------------------------------- /tests/kani/Slice/codegen.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | #[kani::proof] 4 | fn main() { 5 | let name = String::from("Mark"); 6 | let name_str = name.as_str(); 7 | assert!(name_str.len() > 0); 8 | } 9 | -------------------------------------------------------------------------------- /tests/script-based-pre/playback_no_rustfmt/playback_no_rustfmt.expected: -------------------------------------------------------------------------------- 1 | [TEST] Generate test... 2 | Checking harness verify::try_nz_u8 3 | 4 | WARNING: Failed to rustfmt modified source code 5 | 6 | [TEST] Run test... 7 | test result: ok. 2 passed; 0 failed; 8 | 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/build-rs-plus-host-with-kani-proofs/constants/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "constants" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/cargo-kani/simple-proof-annotation/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() { 5 | assert!(1 == 2); 6 | } 7 | 8 | #[kani::proof] 9 | fn harness() { 10 | assert!(3 == 4); 11 | } 12 | -------------------------------------------------------------------------------- /tests/cargo-kani/stubbing-double-extern-path/harness/expected: -------------------------------------------------------------------------------- 1 | error: Cannot stub `crate_b::assert_false`. Stub configuration for harness `check_inverted` has a cycle 2 | error: Cannot stub `crate_b::assert_true`. Stub configuration for harness `check_inverted` has a cycle 3 | -------------------------------------------------------------------------------- /tests/cargo-kani/type-mismatch/uses_std/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | pub fn bar(r: std::ops::Range) -> std::ops::Range { 4 | std::ops::Range { start: r.start + 5, end: r.end + 5 } 5 | } 6 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-exclude-unknown/bin_package/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_bin_package() { 8 | assert!(1 + 1 == 2); 9 | } 10 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-exclude-unknown/lib_package/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub fn api() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_lib_package() { 8 | assert!(1 + 1 == 2); 9 | } 10 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-select-unknown/bin_package/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn main() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_bin_package() { 8 | assert!(1 + 1 == 2); 9 | } 10 | -------------------------------------------------------------------------------- /tests/cargo-ui/ws-package-select-unknown/lib_package/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | pub fn api() {} 5 | 6 | #[kani::proof] 7 | fn harness_in_lib_package() { 8 | assert!(1 + 1 == 2); 9 | } 10 | -------------------------------------------------------------------------------- /tests/expected/function-contract/modifies/unique_arguments.expected: -------------------------------------------------------------------------------- 1 | test_stubbing.assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "a is 1" 4 | 5 | test_stubbing.assertion\ 6 | - Status: SUCCESS\ 7 | - Description: "b is 2" 8 | 9 | VERIFICATION:- SUCCESSFUL 10 | -------------------------------------------------------------------------------- /tests/expected/iterator/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn main() { 6 | let mut z = 1; 7 | for i in 1..4 { 8 | z *= i; 9 | } 10 | assert!(z == 6); 11 | } 12 | -------------------------------------------------------------------------------- /tests/expected/reach/assert/reachable_fail/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | fn main() { 6 | let x = 5; 7 | if kani::any() { 8 | assert!(x != 5); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/expected/stubbing-ambiguous-path/expected: -------------------------------------------------------------------------------- 1 | error: failed to resolve `foo`: `foo` is ambiguous because of multiple glob imports in module `main`. Found: 2 | mod2::foo\ 3 | mod1::foo 4 | | 5 | | #[kani::stub(foo, stub)] 6 | | ^^^^^^^^^^^^^^^^^^^^^^^^ 7 | | 8 | -------------------------------------------------------------------------------- /tests/expected/test1/expected: -------------------------------------------------------------------------------- 1 | SUCCESS\ 2 | attempt to add with overflow 3 | SUCCESS\ 4 | attempt to subtract with overflow 5 | FAILURE\ 6 | assertion failed: a == 54 7 | UNREACHABLE\ 8 | assertion failed: a == 55 9 | UNREACHABLE\ 10 | assertion failed: a >= 55 11 | -------------------------------------------------------------------------------- /tests/ui/harness-timeout/timeout.expected: -------------------------------------------------------------------------------- 1 | VERIFICATION:- FAILED 2 | CBMC timed out. You may want to rerun your proof with a larger timeout or use stubbing to reduce the size of the code the verifier reasons about. 3 | 4 | Verification failed for - check_harness_timeout 5 | -------------------------------------------------------------------------------- /tests/ui/safety-constraint-attribute/mixed-attributes/expected: -------------------------------------------------------------------------------- 1 | error: Cannot derive `Invariant` for `Point` 2 | | 3 | | #[derive(Invariant)] 4 | | ^^^^^^^^^ 5 | | 6 | note: `#[safety_constraint(...)]` cannot be used in struct and its fields simultaneously 7 | -------------------------------------------------------------------------------- /tests/ui/stubbing/invalid-path/invalid_mod.expected: -------------------------------------------------------------------------------- 1 | error: failed to resolve `crate::mod_a::method_a::invalid`: expected module, found function `mod_a::method_a`\ 2 | invalid_mod.rs:\ 3 | |\ 4 | | #[cfg_attr(kani, kani::stub(crate::mod_a::method_a::invalid, noop))]\ 5 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | # Run rustfmt with this config (it should be picked up automatically). 5 | edition = "2024" 6 | style_edition = "2024" 7 | use_small_heuristics = "Max" 8 | merge_derives = false 9 | -------------------------------------------------------------------------------- /scripts/pyproject.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [tool.autopep8] 5 | max_line_length = 120 6 | recursive = true 7 | aggressive = 3 8 | ignore = "E302" # Ignore 2 spaces before functions until we fix fn docstrings 9 | -------------------------------------------------------------------------------- /tests/cargo-kani/dependencies/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | #[kani::proof] 5 | pub fn check_dummy() { 6 | let x = kani::any::(); 7 | kani::assume(x > 10); 8 | assert!(x > 2); 9 | } 10 | -------------------------------------------------------------------------------- /tests/cargo-ui/debug/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | [package] 4 | name = "debug" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | 10 | [package.metadata.kani.flags] 11 | debug=true 12 | -------------------------------------------------------------------------------- /tests/coverage/div-zero/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright Kani Contributors 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | fn div(x: u16, y: u16) -> u16 { 5 | if y != 0 { x / y } else { 0 } 6 | } 7 | 8 | #[kani::proof] 9 | fn main() { 10 | div(11, 3); 11 | } 12 | -------------------------------------------------------------------------------- /tests/expected/function-contract/simple_replace_pass.expected: -------------------------------------------------------------------------------- 1 | .assertion\ 2 | - Status: SUCCESS\ 3 | - Description: "divisor != 0" 4 | 5 | main.assertion\ 6 | - Status: SUCCESS\ 7 | - Description: ""contract guarantees smallness"" 8 | 9 | VERIFICATION:- SUCCESSFUL 10 | -------------------------------------------------------------------------------- /tests/expected/function-contract/trait_impls/associated_fn.expected: -------------------------------------------------------------------------------- 1 | Checking harness check_foo_b... 2 | VERIFICATION:- SUCCESSFUL 3 | 4 | Checking harness check_foo_a... 5 | VERIFICATION:- SUCCESSFUL 6 | 7 | Complete - 2 successfully verified harnesses, 0 failures, 2 total 8 | -------------------------------------------------------------------------------- /tests/script-based-pre/check-output/multifile/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright Kani Contributors 2 | # SPDX-License-Identifier: Apache-2.0 OR MIT 3 | 4 | [package] 5 | name = "multifile" 6 | version = "0.1.0" 7 | edition = "2021" 8 | 9 | [workspace] 10 | 11 | [dependencies] 12 | --------------------------------------------------------------------------------