Path: blob/main/cranelift/isle/veri/veri_engine/tests/veri.rs
1693 views
mod utils;1use utils::{all_failure_result, all_success_result};2use utils::{3test_aarch64_rule_with_lhs_termname_simple, test_aarch64_with_config_simple,4test_concrete_aarch64_rule_with_lhs_termname, test_concrete_input_from_file_with_lhs_termname,5test_from_file_with_config_simple, test_from_file_with_lhs_termname,6test_from_file_with_lhs_termname_simple, test_x64_rule_with_lhs_termname_simple, Bitwidth,7TestResult,8};9use veri_engine_lib::Config;10use veri_ir::{ConcreteInput, ConcreteTest, Counterexample, VerificationResult};1112#[test]13fn test_named_iadd_base_concrete() {14test_concrete_aarch64_rule_with_lhs_termname(15"iadd_base_case",16"iadd",17ConcreteTest {18termname: "iadd".to_string(),19args: vec![20ConcreteInput {21literal: "#b00000001".to_string(),22ty: veri_ir::Type::BitVector(Some(8)),23},24ConcreteInput {25literal: "#b00000001".to_string(),26ty: veri_ir::Type::BitVector(Some(8)),27},28],29output: ConcreteInput {30literal: "#b00000010".to_string(),31ty: veri_ir::Type::BitVector(Some(8)),32},33},34)35}3637#[test]38fn test_named_iadd_base() {39test_aarch64_rule_with_lhs_termname_simple("iadd_base_case", "iadd", all_success_result())40}4142#[test]43fn test_named_iadd_imm12_right() {44test_aarch64_rule_with_lhs_termname_simple("iadd_imm12_right", "iadd", all_success_result())45}4647#[test]48fn test_named_iadd_imm12_left() {49test_aarch64_rule_with_lhs_termname_simple("iadd_imm12_left", "iadd", all_success_result())50}5152#[test]53fn test_named_iadd_imm12_neg_left() {54test_aarch64_rule_with_lhs_termname_simple(55"iadd_imm12_neg_left",56"iadd",57vec![58(Bitwidth::I8, VerificationResult::Success),59(Bitwidth::I16, VerificationResult::Success),60(Bitwidth::I32, VerificationResult::Success),61(Bitwidth::I64, VerificationResult::Success),62],63)64}6566#[test]67fn test_named_iadd_imm12_neg_right() {68test_aarch64_rule_with_lhs_termname_simple(69"iadd_imm12_neg_right",70"iadd",71vec![72(Bitwidth::I8, VerificationResult::Success),73(Bitwidth::I16, VerificationResult::Success),74(Bitwidth::I32, VerificationResult::Success),75(Bitwidth::I64, VerificationResult::Success),76],77)78}7980// Need a file test because this is a change on top of our latest rebase81#[test]82fn test_named_imm12_from_negated_value() {83test_aarch64_rule_with_lhs_termname_simple(84"imm12_from_negated_value",85"imm12_from_negated_value",86vec![87(Bitwidth::I8, VerificationResult::Success),88(Bitwidth::I16, VerificationResult::Success),89(Bitwidth::I32, VerificationResult::Success),90(Bitwidth::I64, VerificationResult::Success),91],92)93}9495// Need a file test because this is a change on top of our latest rebase96#[test]97fn test_updated_iadd_imm12neg_right() {98test_from_file_with_lhs_termname_simple(99"./examples/iadd/updated_iadd_imm12neg_right.isle",100"iadd".to_string(),101all_success_result(),102)103}104105// Need a file test because this is a change on top of our latest rebase106#[test]107fn test_updated_iadd_imm12neg_left() {108test_from_file_with_lhs_termname_simple(109"./examples/iadd/updated_iadd_imm12neg_left.isle",110"iadd".to_string(),111all_success_result(),112)113}114115#[test]116fn test_named_iadd_extend_right() {117test_aarch64_rule_with_lhs_termname_simple(118"iadd_extend_right",119"iadd",120vec![121(Bitwidth::I8, VerificationResult::Success),122(Bitwidth::I16, VerificationResult::Success),123(Bitwidth::I32, VerificationResult::Success),124(Bitwidth::I64, VerificationResult::InapplicableRule),125],126)127}128129#[test]130fn test_named_iadd_extend_right_concrete() {131test_concrete_aarch64_rule_with_lhs_termname(132"iadd_extend_right",133"iadd",134ConcreteTest {135termname: "iadd".to_string(),136args: vec![137ConcreteInput {138literal: "#b0000000000000001".to_string(),139ty: veri_ir::Type::BitVector(Some(16)),140},141ConcreteInput {142literal: "#b1111111111111111".to_string(),143ty: veri_ir::Type::BitVector(Some(16)),144},145],146output: ConcreteInput {147literal: "#b0000000000000000".to_string(),148ty: veri_ir::Type::BitVector(Some(16)),149},150},151);152test_concrete_aarch64_rule_with_lhs_termname(153"iadd_extend_right",154"iadd",155ConcreteTest {156termname: "iadd".to_string(),157args: vec![158ConcreteInput {159literal: "#b01000000000000000000000000000000".to_string(),160ty: veri_ir::Type::BitVector(Some(32)),161},162ConcreteInput {163literal: "#b00000000000000001111111111111111".to_string(),164ty: veri_ir::Type::BitVector(Some(32)),165},166],167output: ConcreteInput {168literal: "#b01000000000000001111111111111111".to_string(),169ty: veri_ir::Type::BitVector(Some(32)),170},171},172)173}174175#[test]176fn test_named_iadd_extend_left() {177test_aarch64_rule_with_lhs_termname_simple(178"iadd_extend_left",179"iadd",180vec![181(Bitwidth::I8, VerificationResult::Success),182(Bitwidth::I16, VerificationResult::Success),183(Bitwidth::I32, VerificationResult::Success),184(Bitwidth::I64, VerificationResult::InapplicableRule),185],186)187}188189#[test]190fn test_broken_iadd_extend() {191test_from_file_with_lhs_termname_simple(192"./examples/broken/iadd/broken_add_extend.isle",193"iadd".to_string(),194vec![195// The type of the iadd is the destination type, so for i8 there is no bad extend-to196(Bitwidth::I8, VerificationResult::Success),197(198Bitwidth::I16,199VerificationResult::Failure(Counterexample {}),200),201(202Bitwidth::I32,203VerificationResult::Failure(Counterexample {}),204),205(Bitwidth::I64, VerificationResult::InapplicableRule),206],207)208}209210#[test]211fn test_named_iadd_ishl_left() {212test_aarch64_rule_with_lhs_termname_simple("iadd_ishl_left", "iadd", all_success_result())213}214215#[test]216fn test_named_iadd_ishl_right() {217test_aarch64_rule_with_lhs_termname_simple("iadd_ishl_right", "iadd", all_success_result())218}219220#[test]221fn test_named_iadd_imul_right() {222test_aarch64_rule_with_lhs_termname_simple(223"iadd_imul_right",224"iadd",225vec![226(Bitwidth::I8, VerificationResult::Success),227// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36228// (Bitwidth::I16, VerificationResult::Success),229// (Bitwidth::I32, VerificationResult::Success),230// (Bitwidth::I64, VerificationResult::Success),231],232)233}234235#[test]236#[ignore]237fn test_named_slow_iadd_imul_right() {238test_aarch64_rule_with_lhs_termname_simple(239"iadd_imul_right",240"iadd",241vec![242(Bitwidth::I16, VerificationResult::Unknown),243(Bitwidth::I32, VerificationResult::Unknown),244(Bitwidth::I64, VerificationResult::Unknown),245],246)247}248249#[test]250fn test_named_iadd_imul_left() {251test_aarch64_rule_with_lhs_termname_simple(252"iadd_imul_left",253"iadd",254vec![255(Bitwidth::I8, VerificationResult::Success),256// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36257// (Bitwidth::I16, VerificationResult::Success),258// (Bitwidth::I32, VerificationResult::Success),259// (Bitwidth::I64, VerificationResult::Success),260],261)262}263264#[test]265#[ignore]266fn test_named_slow_iadd_imul_left() {267test_aarch64_rule_with_lhs_termname_simple(268"iadd_imul_left",269"iadd",270vec![271(Bitwidth::I16, VerificationResult::Unknown),272(Bitwidth::I32, VerificationResult::Unknown),273(Bitwidth::I64, VerificationResult::Unknown),274],275)276}277278#[test]279fn test_named_isub_imul() {280test_aarch64_rule_with_lhs_termname_simple(281"isub_imul",282"isub",283vec![284(Bitwidth::I8, VerificationResult::Success),285// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36286// (Bitwidth::I16, VerificationResult::Success),287// (Bitwidth::I32, VerificationResult::Success),288// (Bitwidth::I64, VerificationResult::Success),289],290)291}292293#[test]294#[ignore]295fn test_named_slow_isub_imul() {296test_aarch64_rule_with_lhs_termname_simple(297"isub_imul",298"isub",299vec![300// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36301(Bitwidth::I16, VerificationResult::Unknown),302(Bitwidth::I32, VerificationResult::Unknown),303(Bitwidth::I64, VerificationResult::Unknown),304],305)306}307308#[test]309fn test_broken_iadd_base_case() {310test_from_file_with_lhs_termname_simple(311"./examples/broken/iadd/broken_base_case.isle",312"iadd".to_string(),313all_failure_result(),314)315}316317#[test]318fn test_broken_iadd_imm12() {319test_from_file_with_lhs_termname_simple(320"./examples/broken/iadd/broken_imm12.isle",321"iadd".to_string(),322vec![323(Bitwidth::I8, VerificationResult::Success),324(325Bitwidth::I16,326VerificationResult::Failure(Counterexample {}),327),328(329Bitwidth::I32,330VerificationResult::Failure(Counterexample {}),331),332(333Bitwidth::I64,334VerificationResult::Failure(Counterexample {}),335),336],337)338}339340#[test]341fn test_broken_iadd_imm12_2() {342test_from_file_with_lhs_termname_simple(343"./examples/broken/iadd/broken_imm12_2.isle",344"iadd".to_string(),345vec![346(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),347(348Bitwidth::I16,349VerificationResult::Failure(Counterexample {}),350),351(352Bitwidth::I32,353VerificationResult::Failure(Counterexample {}),354),355(356Bitwidth::I64,357VerificationResult::Failure(Counterexample {}),358),359],360)361}362363#[test]364fn test_broken_iadd_imm12neg_not_distinct() {365test_from_file_with_lhs_termname_simple(366"./examples/broken/iadd/broken_imm12neg.isle",367"iadd".to_string(),368vec![369(Bitwidth::I8, VerificationResult::NoDistinctModels),370(Bitwidth::I16, VerificationResult::NoDistinctModels),371(Bitwidth::I32, VerificationResult::NoDistinctModels),372(373Bitwidth::I64,374VerificationResult::Failure(Counterexample {}),375),376],377)378}379380#[test]381fn test_broken_iadd_imm12neg_2_not_distinct() {382test_from_file_with_lhs_termname_simple(383"./examples/broken/iadd/broken_imm12neg2.isle",384"iadd".to_string(),385vec![386(Bitwidth::I8, VerificationResult::NoDistinctModels),387(Bitwidth::I16, VerificationResult::NoDistinctModels),388(Bitwidth::I32, VerificationResult::NoDistinctModels),389(390Bitwidth::I64,391VerificationResult::Failure(Counterexample {}),392),393],394)395}396397#[test]398fn test_broken_iadd_imul_right() {399test_from_file_with_lhs_termname_simple(400"./examples/broken/iadd/broken_madd.isle",401"iadd".to_string(),402all_failure_result(),403)404}405406#[test]407fn test_broken_iadd_imul_left() {408test_from_file_with_lhs_termname_simple(409"./examples/broken/iadd/broken_madd2.isle",410"iadd".to_string(),411all_failure_result(),412)413}414415#[test]416fn test_broken_iadd_msub() {417test_from_file_with_lhs_termname_simple(418"./examples/broken/iadd/broken_msub.isle",419"isub".to_string(),420vec![421(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),422(423Bitwidth::I16,424VerificationResult::Failure(Counterexample {}),425),426(427Bitwidth::I32,428VerificationResult::Failure(Counterexample {}),429),430(431Bitwidth::I64,432VerificationResult::Failure(Counterexample {}),433),434],435)436}437438#[test]439fn test_broken_iadd_shift() {440test_from_file_with_lhs_termname_simple(441"./examples/broken/iadd/broken_shift.isle",442"iadd".to_string(),443all_failure_result(),444)445}446447#[test]448fn test_broken_iadd_shift2() {449test_from_file_with_lhs_termname_simple(450"./examples/broken/iadd/broken_shift2.isle",451"iadd".to_string(),452all_failure_result(),453)454}455456#[test]457fn test_named_isub_base_case() {458test_aarch64_rule_with_lhs_termname_simple("isub_base_case", "isub", all_success_result())459}460461#[test]462fn test_named_isub_imm12() {463test_aarch64_rule_with_lhs_termname_simple("isub_imm12", "isub", all_success_result())464}465466#[test]467fn test_named_isub_imm12_concrete() {468test_concrete_aarch64_rule_with_lhs_termname(469"isub_imm12",470"isub",471ConcreteTest {472termname: "isub".to_string(),473args: vec![474ConcreteInput {475literal: "#b00000001".to_string(),476ty: veri_ir::Type::BitVector(Some(8)),477},478ConcreteInput {479literal: "#b11111111".to_string(),480ty: veri_ir::Type::BitVector(Some(8)),481},482],483output: ConcreteInput {484literal: "#b00000010".to_string(),485ty: veri_ir::Type::BitVector(Some(8)),486},487},488)489}490491#[test]492fn test_named_isub_imm12_neg() {493test_aarch64_rule_with_lhs_termname_simple(494"isub_imm12_neg",495"isub",496vec![497(Bitwidth::I8, VerificationResult::Success),498(Bitwidth::I16, VerificationResult::Success),499(Bitwidth::I32, VerificationResult::Success),500(Bitwidth::I64, VerificationResult::Success),501],502);503}504505// The older version, which did not have distinct models for i8, i16, or i32.506#[test]507fn test_isub_imm12_neg_not_distinct() {508test_from_file_with_lhs_termname_simple(509"./examples/broken/isub/broken_imm12neg_not_distinct.isle",510"isub".to_string(),511vec![512(Bitwidth::I8, VerificationResult::NoDistinctModels),513(Bitwidth::I16, VerificationResult::NoDistinctModels),514(Bitwidth::I32, VerificationResult::NoDistinctModels),515(Bitwidth::I64, VerificationResult::Success),516],517);518}519520#[test]521fn test_isub_imm12_neg_not_distinct_16_32() {522test_from_file_with_lhs_termname_simple(523"./examples/broken/isub/broken_imm12neg_not_distinct.isle",524"isub".to_string(),525vec![526(Bitwidth::I16, VerificationResult::NoDistinctModels),527(Bitwidth::I32, VerificationResult::NoDistinctModels),528],529);530}531532// Need a file test because this is a change on top of our latest rebase533#[test]534fn test_isub_imm12neg_new() {535test_from_file_with_lhs_termname_simple(536"./examples/isub/imm12neg_new.isle",537"isub".to_string(),538all_success_result(),539);540}541542#[test]543fn test_named_isub_imm12_neg_concrete32() {544test_concrete_aarch64_rule_with_lhs_termname(545"isub_imm12_neg",546"isub",547ConcreteTest {548termname: "isub".to_string(),549args: vec![550ConcreteInput {551literal: "#b0000000000000000000000000000000000000000000000000000000000000001"552.to_string(),553ty: veri_ir::Type::BitVector(Some(64)),554},555ConcreteInput {556literal: "#b1111111111111111111111111111111111111111111111111111111111111111"557.to_string(),558ty: veri_ir::Type::BitVector(Some(64)),559},560],561output: ConcreteInput {562literal: "#b0000000000000000000000000000000000000000000000000000000000000010"563.to_string(),564ty: veri_ir::Type::BitVector(Some(64)),565},566},567)568}569570#[test]571fn test_named_isub_imm12_neg_concrete64() {572test_concrete_aarch64_rule_with_lhs_termname(573"isub_imm12_neg",574"isub",575ConcreteTest {576termname: "isub".to_string(),577args: vec![578ConcreteInput {579literal: "#b0000000000000000000000000000000000000000000000000000000000000001"580.to_string(),581ty: veri_ir::Type::BitVector(Some(64)),582},583ConcreteInput {584literal: "#b1111111111111111111111111111111111111111111111111111111111111111"585.to_string(),586ty: veri_ir::Type::BitVector(Some(64)),587},588],589output: ConcreteInput {590literal: "#b0000000000000000000000000000000000000000000000000000000000000010"591.to_string(),592ty: veri_ir::Type::BitVector(Some(64)),593},594},595)596}597598#[test]599fn test_named_isub_extend() {600test_aarch64_rule_with_lhs_termname_simple(601"isub_extend",602"isub",603vec![604(Bitwidth::I8, VerificationResult::Success),605(Bitwidth::I16, VerificationResult::Success),606(Bitwidth::I32, VerificationResult::Success),607(Bitwidth::I64, VerificationResult::InapplicableRule),608],609)610}611612#[test]613fn test_named_isub_ishl() {614test_aarch64_rule_with_lhs_termname_simple("isub_ishl", "isub", all_success_result())615}616617#[test]618fn test_broken_isub_base_case() {619test_from_file_with_lhs_termname_simple(620"./examples/broken/isub/broken_base_case.isle",621"isub".to_string(),622vec![623(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),624(625Bitwidth::I16,626VerificationResult::Failure(Counterexample {}),627),628(629Bitwidth::I32,630VerificationResult::Failure(Counterexample {}),631),632(633Bitwidth::I64,634VerificationResult::Failure(Counterexample {}),635),636],637);638}639640#[test]641fn test_broken_isub_imm12() {642test_from_file_with_lhs_termname_simple(643"./examples/broken/isub/broken_imm12.isle",644"isub".to_string(),645vec![646(Bitwidth::I8, VerificationResult::Success),647(648Bitwidth::I16,649VerificationResult::Failure(Counterexample {}),650),651(652Bitwidth::I32,653VerificationResult::Failure(Counterexample {}),654),655(656Bitwidth::I64,657VerificationResult::Failure(Counterexample {}),658),659],660);661}662663#[test]664fn test_broken_isub_imm12neg_not_distinct() {665test_from_file_with_lhs_termname_simple(666"./examples/broken/isub/broken_imm12neg.isle",667"isub".to_string(),668vec![669(Bitwidth::I8, VerificationResult::NoDistinctModels),670(Bitwidth::I16, VerificationResult::NoDistinctModels),671(Bitwidth::I32, VerificationResult::NoDistinctModels),672(673Bitwidth::I64,674VerificationResult::Failure(Counterexample {}),675),676],677);678}679680#[test]681fn test_broken_isub_shift() {682test_from_file_with_lhs_termname_simple(683"./examples/broken/isub/broken_shift.isle",684"isub".to_string(),685all_failure_result(),686);687}688689#[test]690fn test_named_ineg_base_case() {691test_aarch64_rule_with_lhs_termname_simple("ineg_base_case", "ineg", all_success_result())692}693694#[test]695fn test_named_imul_base_case() {696test_aarch64_rule_with_lhs_termname_simple(697"imul_base_case",698"imul",699// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36700vec![701(Bitwidth::I8, VerificationResult::Success),702// (Bitwidth::I16, VerificationResult::Success),703// (Bitwidth::I32, VerificationResult::Success),704// (Bitwidth::I64, VerificationResult::Success),705],706)707}708709#[test]710#[ignore]711fn test_named_slow_imul_base_case() {712test_aarch64_rule_with_lhs_termname_simple(713"imul_base_case",714"imul",715// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36716vec![717// (Bitwidth::I8, VerificationResult::Success),718(Bitwidth::I16, VerificationResult::Unknown),719(Bitwidth::I32, VerificationResult::Unknown),720(Bitwidth::I64, VerificationResult::Unknown),721],722)723}724725// TODO traps https://github.com/avanhatt/wasmtime/issues/31726#[test]727fn test_named_udiv() {728test_aarch64_rule_with_lhs_termname_simple(729"udiv",730"udiv",731// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36732vec![733(Bitwidth::I8, VerificationResult::Success),734// (Bitwidth::I16, VerificationResult::Success),735// (Bitwidth::I32, VerificationResult::Success),736// (Bitwidth::I64, VerificationResult::Success),737],738)739}740741#[test]742#[ignore]743fn test_named_slow_udiv() {744test_aarch64_rule_with_lhs_termname_simple(745"udiv",746"udiv",747// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36748vec![749// (Bitwidth::I8, VerificationResult::Success),750(Bitwidth::I16, VerificationResult::Unknown),751(Bitwidth::I32, VerificationResult::Unknown),752(Bitwidth::I64, VerificationResult::Unknown),753],754)755}756757#[test]758fn test_broken_udiv() {759test_from_file_with_lhs_termname_simple(760"./examples/broken/udiv/broken_udiv.isle",761"udiv".to_string(),762vec![763(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),764(765Bitwidth::I16,766VerificationResult::Failure(Counterexample {}),767),768(769Bitwidth::I32,770VerificationResult::Failure(Counterexample {}),771),772(Bitwidth::I64, VerificationResult::Success),773],774)775}776777#[test]778fn test_named_sdiv_base_case() {779test_aarch64_rule_with_lhs_termname_simple(780"sdiv_base_case",781"sdiv",782vec![783(Bitwidth::I8, VerificationResult::Success),784// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36785// (Bitwidth::I16, VerificationResult::Success),786// (Bitwidth::I32, VerificationResult::Success),787// (Bitwidth::I64, VerificationResult::Success),788],789)790}791792#[test]793#[ignore]794fn test_named_slow_sdiv_base_case() {795test_aarch64_rule_with_lhs_termname_simple(796"sdiv_base_case",797"sdiv",798vec![799// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36800(Bitwidth::I16, VerificationResult::Unknown),801(Bitwidth::I32, VerificationResult::Unknown),802(Bitwidth::I64, VerificationResult::Unknown),803],804)805}806807#[test]808fn test_named_sdiv_safe_divisor() {809test_aarch64_rule_with_lhs_termname_simple(810"sdiv_safe_divisor",811"sdiv",812vec![813(Bitwidth::I8, VerificationResult::Success),814// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36815// (Bitwidth::I16, VerificationResult::Success),816// (Bitwidth::I32, VerificationResult::Success),817// (Bitwidth::I64, VerificationResult::Success),818],819)820}821822#[test]823#[ignore]824fn test_named_slow_sdiv_safe_divisor() {825test_aarch64_rule_with_lhs_termname_simple(826"sdiv_safe_divisor",827"sdiv",828vec![829// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36830(Bitwidth::I16, VerificationResult::Unknown),831(Bitwidth::I32, VerificationResult::Unknown),832(Bitwidth::I64, VerificationResult::Unknown),833],834)835}836837#[test]838fn test_broken_sdiv_safe_const() {839test_from_file_with_lhs_termname_simple(840"./examples/broken/sdiv/broken_sdiv_safe_const.isle",841"sdiv".to_string(),842vec![843(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),844(845Bitwidth::I16,846VerificationResult::Failure(Counterexample {}),847),848(849Bitwidth::I32,850VerificationResult::Failure(Counterexample {}),851),852(853Bitwidth::I64,854VerificationResult::Failure(Counterexample {}),855),856],857)858}859860#[test]861fn test_broken_sdiv() {862test_from_file_with_lhs_termname_simple(863"./examples/broken/sdiv/broken_sdiv.isle",864"sdiv".to_string(),865vec![866(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),867(868Bitwidth::I16,869VerificationResult::Failure(Counterexample {}),870),871(872Bitwidth::I32,873VerificationResult::Failure(Counterexample {}),874),875(Bitwidth::I64, VerificationResult::Success),876],877)878}879880#[test]881fn test_named_srem() {882test_aarch64_rule_with_lhs_termname_simple(883"srem",884"srem",885vec![886(Bitwidth::I8, VerificationResult::Success),887// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36888// (Bitwidth::I16, VerificationResult::Success),889// (Bitwidth::I32, VerificationResult::Success),890// (Bitwidth::I64, VerificationResult::Success),891],892)893}894895#[test]896#[ignore]897fn test_named_slow_srem() {898test_aarch64_rule_with_lhs_termname_simple(899"srem",900"srem",901vec![902(Bitwidth::I16, VerificationResult::Unknown),903(Bitwidth::I32, VerificationResult::Unknown),904(Bitwidth::I64, VerificationResult::Unknown),905],906)907}908909#[test]910fn test_named_urem() {911test_aarch64_rule_with_lhs_termname_simple(912"urem",913"urem",914vec![915(Bitwidth::I8, VerificationResult::Success),916// Too slow right now: https://github.com/avanhatt/wasmtime/issues/36917// (Bitwidth::I16, VerificationResult::Success),918// (Bitwidth::I32, VerificationResult::Success),919// (Bitwidth::I64, VerificationResult::Success),920],921)922}923924#[test]925#[ignore]926fn test_named_slow_urem() {927test_aarch64_rule_with_lhs_termname_simple(928"urem",929"urem",930vec![931(Bitwidth::I16, VerificationResult::Unknown),932(Bitwidth::I32, VerificationResult::Unknown),933(Bitwidth::I64, VerificationResult::Unknown),934],935)936}937938#[test]939fn test_named_urem_concrete() {940test_concrete_aarch64_rule_with_lhs_termname(941"urem",942"urem",943ConcreteTest {944termname: "urem".to_string(),945args: vec![946ConcreteInput {947literal: "#b11111110".to_string(),948ty: veri_ir::Type::BitVector(Some(8)),949},950ConcreteInput {951literal: "#b00110001".to_string(),952ty: veri_ir::Type::BitVector(Some(8)),953},954],955output: ConcreteInput {956literal: "#b00001001".to_string(),957ty: veri_ir::Type::BitVector(Some(8)),958},959},960)961}962963#[test]964fn test_named_uextend() {965test_aarch64_rule_with_lhs_termname_simple("uextend", "uextend", all_success_result())966}967968#[test]969fn test_named_sextend() {970test_aarch64_rule_with_lhs_termname_simple("sextend", "sextend", all_success_result())971}972973#[test]974fn test_broken_uextend() {975test_from_file_with_lhs_termname(976"./examples/broken/broken_uextend.isle",977"uextend".to_string(),978TestResult::Expect(|sig| {979// In the spec for extend, zero_extend and sign_extend are swapped.980// However, this should still succeed if the input and output981// widths are the same982if sig.args[0] == sig.ret {983VerificationResult::Success984} else {985VerificationResult::Failure(Counterexample {})986}987}),988);989}990991// AVH TODO: this rule requires priorities to be correct for narrow cases992// https://github.com/avanhatt/wasmtime/issues/32993#[test]994fn test_named_clz_32_64() {995test_aarch64_rule_with_lhs_termname_simple(996"clz_32_64",997"clz",998vec![999// (Bitwidth::I8, VerificationResult::InapplicableRule),1000// (Bitwidth::I16, VerificationResult::InapplicableRule),1001(Bitwidth::I32, VerificationResult::Success),1002(Bitwidth::I64, VerificationResult::Success),1003],1004)1005}10061007#[test]1008fn test_named_clz_8() {1009test_aarch64_rule_with_lhs_termname_simple(1010"clz_8",1011"clz",1012vec![1013(Bitwidth::I8, VerificationResult::Success),1014(Bitwidth::I16, VerificationResult::InapplicableRule),1015(Bitwidth::I32, VerificationResult::InapplicableRule),1016(Bitwidth::I64, VerificationResult::InapplicableRule),1017],1018)1019}10201021#[test]1022fn test_named_clz_16() {1023test_aarch64_rule_with_lhs_termname_simple(1024"clz_16",1025"clz",1026vec![1027(Bitwidth::I8, VerificationResult::InapplicableRule),1028(Bitwidth::I16, VerificationResult::Success),1029(Bitwidth::I32, VerificationResult::InapplicableRule),1030(Bitwidth::I64, VerificationResult::InapplicableRule),1031],1032)1033}10341035#[test]1036fn test_broken_clz() {1037test_from_file_with_lhs_termname_simple(1038"./examples/broken/clz/broken_clz.isle",1039"clz".to_string(),1040vec![1041(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),1042(1043Bitwidth::I16,1044VerificationResult::Failure(Counterexample {}),1045),1046(1047Bitwidth::I32,1048VerificationResult::Failure(Counterexample {}),1049),1050(Bitwidth::I64, VerificationResult::Success),1051],1052)1053}10541055#[test]1056fn test_broken_clz8() {1057test_from_file_with_lhs_termname_simple(1058"./examples/broken/clz/broken_clz8.isle",1059"clz".to_string(),1060vec![1061(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),1062(Bitwidth::I16, VerificationResult::InapplicableRule),1063(Bitwidth::I32, VerificationResult::InapplicableRule),1064(Bitwidth::I64, VerificationResult::InapplicableRule),1065],1066)1067}10681069#[test]1070fn test_broken_clz_n6() {1071test_from_file_with_lhs_termname_simple(1072"./examples/broken/clz/broken_clz16.isle",1073"clz".to_string(),1074vec![1075(Bitwidth::I8, VerificationResult::InapplicableRule),1076(1077Bitwidth::I16,1078VerificationResult::Failure(Counterexample {}),1079),1080(Bitwidth::I32, VerificationResult::InapplicableRule),1081(Bitwidth::I64, VerificationResult::InapplicableRule),1082],1083)1084}10851086// AVH TODO: this rule requires priorities to be correct for narrow cases1087// https://github.com/avanhatt/wasmtime/issues/321088#[test]1089fn test_named_cls_32_64() {1090test_aarch64_rule_with_lhs_termname_simple(1091"cls_32_64",1092"cls",1093vec![1094// (Bitwidth::I8, VerificationResult::InapplicableRule),1095// (Bitwidth::I16, VerificationResult::InapplicableRule),1096(Bitwidth::I32, VerificationResult::Success),1097(Bitwidth::I64, VerificationResult::Success),1098],1099)1100}11011102#[test]1103fn test_named_cls_8() {1104test_aarch64_rule_with_lhs_termname_simple(1105"cls_8",1106"cls",1107vec![1108(Bitwidth::I8, VerificationResult::Success),1109(Bitwidth::I16, VerificationResult::InapplicableRule),1110(Bitwidth::I32, VerificationResult::InapplicableRule),1111(Bitwidth::I64, VerificationResult::InapplicableRule),1112],1113)1114}11151116#[test]1117fn test_named_cls_16() {1118test_aarch64_rule_with_lhs_termname_simple(1119"cls_16",1120"cls",1121vec![1122(Bitwidth::I8, VerificationResult::InapplicableRule),1123(Bitwidth::I16, VerificationResult::Success),1124(Bitwidth::I32, VerificationResult::InapplicableRule),1125(Bitwidth::I64, VerificationResult::InapplicableRule),1126],1127)1128}11291130#[test]1131fn test_broken_cls_32_64() {1132test_from_file_with_lhs_termname_simple(1133"./examples/broken/cls/broken_cls.isle",1134"cls".to_string(),1135vec![1136(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),1137(1138Bitwidth::I16,1139VerificationResult::Failure(Counterexample {}),1140),1141(Bitwidth::I32, VerificationResult::Success),1142(Bitwidth::I64, VerificationResult::Success),1143],1144)1145}11461147#[test]1148fn test_broken_cls_8() {1149test_from_file_with_lhs_termname_simple(1150"./examples/broken/cls/broken_cls8.isle",1151"cls".to_string(),1152vec![(Bitwidth::I8, VerificationResult::Failure(Counterexample {}))],1153)1154}11551156#[test]1157fn test_broken_cls_16() {1158test_from_file_with_lhs_termname_simple(1159"./examples/broken/cls/broken_cls16.isle",1160"cls".to_string(),1161vec![1162(Bitwidth::I8, VerificationResult::InapplicableRule),1163(1164Bitwidth::I16,1165VerificationResult::Failure(Counterexample {}),1166),1167(Bitwidth::I32, VerificationResult::InapplicableRule),1168(Bitwidth::I64, VerificationResult::InapplicableRule),1169],1170)1171}11721173#[test]1174fn test_named_ctz_32_64() {1175test_aarch64_rule_with_lhs_termname_simple(1176"ctz_32_64",1177"ctz",1178vec![1179// (Bitwidth::I8, VerificationResult::InapplicableRule),1180// (Bitwidth::I16, VerificationResult::InapplicableRule),1181(Bitwidth::I32, VerificationResult::Success),1182(Bitwidth::I64, VerificationResult::Success),1183],1184)1185}11861187#[test]1188fn test_named_ctz_8() {1189test_aarch64_rule_with_lhs_termname_simple(1190"ctz_8",1191"ctz",1192vec![1193(Bitwidth::I8, VerificationResult::Success),1194(Bitwidth::I16, VerificationResult::InapplicableRule),1195(Bitwidth::I32, VerificationResult::InapplicableRule),1196(Bitwidth::I64, VerificationResult::InapplicableRule),1197],1198)1199}12001201#[test]1202fn test_named_ctz_16() {1203test_aarch64_rule_with_lhs_termname_simple(1204"ctz_16",1205"ctz",1206vec![1207(Bitwidth::I8, VerificationResult::InapplicableRule),1208(Bitwidth::I16, VerificationResult::Success),1209(Bitwidth::I32, VerificationResult::InapplicableRule),1210(Bitwidth::I64, VerificationResult::InapplicableRule),1211],1212)1213}12141215#[test]1216fn test_broken_ctz_32_64() {1217test_from_file_with_lhs_termname_simple(1218"./examples/broken/ctz/broken_ctz.isle",1219"clz".to_string(),1220vec![1221(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),1222(1223Bitwidth::I16,1224VerificationResult::Failure(Counterexample {}),1225),1226(1227Bitwidth::I32,1228VerificationResult::Failure(Counterexample {}),1229),1230(1231Bitwidth::I64,1232VerificationResult::Failure(Counterexample {}),1233),1234],1235)1236}12371238#[test]1239fn test_broken_ctz_8() {1240test_from_file_with_lhs_termname_simple(1241"./examples/broken/ctz/broken_ctz8.isle",1242"ctz".to_string(),1243vec![1244(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),1245(Bitwidth::I16, VerificationResult::InapplicableRule),1246(Bitwidth::I32, VerificationResult::InapplicableRule),1247(Bitwidth::I64, VerificationResult::InapplicableRule),1248],1249)1250}12511252#[test]1253fn test_broken_ctz_16() {1254test_from_file_with_lhs_termname_simple(1255"./examples/broken/ctz/broken_ctz16.isle",1256"ctz".to_string(),1257vec![1258(Bitwidth::I8, VerificationResult::InapplicableRule),1259(1260Bitwidth::I16,1261VerificationResult::Failure(Counterexample {}),1262),1263(Bitwidth::I32, VerificationResult::InapplicableRule),1264(Bitwidth::I64, VerificationResult::InapplicableRule),1265],1266)1267}12681269#[test]1270fn test_named_small_rotr() {1271let config = Config {1272term: "small_rotr".to_string(),1273distinct_check: true,1274custom_assumptions: None,1275custom_verification_condition: Some(Box::new(|smt, args, lhs, rhs| {1276let ty_arg = *args.first().unwrap();1277let lower_8_bits_eq = {1278let mask = smt.atom("#x00000000000000FF");1279smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))1280};1281let lower_16_bits_eq = {1282let mask = smt.atom("#x000000000000FFFF");1283smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))1284};1285smt.ite(1286smt.eq(ty_arg, smt.atom("8")),1287lower_8_bits_eq,1288lower_16_bits_eq,1289)1290})),1291names: Some(vec!["small_rotr".to_string()]),1292};1293test_aarch64_with_config_simple(config, vec![(Bitwidth::I64, VerificationResult::Success)]);1294}12951296#[test]1297fn test_broken_small_rotr_to_shifts() {1298let config = Config {1299term: "small_rotr".to_string(),1300distinct_check: true,1301custom_assumptions: None,1302custom_verification_condition: Some(Box::new(|smt, args, lhs, rhs| {1303let ty_arg = *args.first().unwrap();1304let lower_8_bits_eq = {1305let mask = smt.atom("#x00000000000000FF");1306smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))1307};1308let lower_16_bits_eq = {1309let mask = smt.atom("#x000000000000FFFF");1310smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))1311};1312smt.ite(1313smt.eq(ty_arg, smt.atom("8")),1314lower_8_bits_eq,1315lower_16_bits_eq,1316)1317})),1318names: None,1319};1320test_from_file_with_config_simple(1321"./examples/broken/broken_mask_small_rotr.isle",1322config,1323vec![(1324Bitwidth::I64,1325VerificationResult::Failure(Counterexample {}),1326)],1327);1328}13291330#[test]1331fn test_broken_small_rotr_to_shifts_2() {1332let config = Config {1333term: "small_rotr".to_string(),1334distinct_check: true,1335custom_assumptions: None,1336custom_verification_condition: Some(Box::new(|smt, args, lhs, rhs| {1337let ty_arg = *args.first().unwrap();1338let lower_8_bits_eq = {1339let mask = smt.atom("#x00000000000000FF");1340smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))1341};1342let lower_16_bits_eq = {1343let mask = smt.atom("#x000000000000FFFF");1344smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))1345};1346smt.ite(1347smt.eq(ty_arg, smt.atom("8")),1348lower_8_bits_eq,1349lower_16_bits_eq,1350)1351})),1352names: None,1353};1354test_from_file_with_config_simple(1355"./examples/broken/broken_rule_or_small_rotr.isle",1356config,1357vec![(1358Bitwidth::I64,1359VerificationResult::Failure(Counterexample {}),1360)],1361);1362}13631364#[test]1365fn test_named_small_rotr_imm() {1366let config = Config {1367term: "small_rotr_imm".to_string(),1368distinct_check: true,1369custom_assumptions: None,1370custom_verification_condition: Some(Box::new(|smt, args, lhs, rhs| {1371let ty_arg = *args.first().unwrap();1372let lower_8_bits_eq = {1373let mask = smt.atom("#x00000000000000FF");1374smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))1375};1376let lower_16_bits_eq = {1377let mask = smt.atom("#x000000000000FFFF");1378smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))1379};1380smt.ite(1381smt.eq(ty_arg, smt.atom("8")),1382lower_8_bits_eq,1383lower_16_bits_eq,1384)1385})),1386names: Some(vec!["small_rotr_imm".to_string()]),1387};1388test_aarch64_with_config_simple(config, vec![(Bitwidth::I64, VerificationResult::Success)]);1389}13901391#[test]1392fn test_named_rotl_fits_in_16() {1393test_aarch64_rule_with_lhs_termname_simple(1394"rotl_fits_in_16",1395"rotl",1396vec![1397(Bitwidth::I8, VerificationResult::Success),1398(Bitwidth::I16, VerificationResult::Success),1399(Bitwidth::I32, VerificationResult::InapplicableRule),1400(Bitwidth::I64, VerificationResult::InapplicableRule),1401],1402)1403}14041405#[test]1406fn test_named_rotl_32_base_case() {1407test_aarch64_rule_with_lhs_termname_simple(1408"rotl_32_base_case",1409"rotl",1410vec![1411(Bitwidth::I8, VerificationResult::InapplicableRule),1412(Bitwidth::I16, VerificationResult::InapplicableRule),1413(Bitwidth::I32, VerificationResult::Success),1414(Bitwidth::I64, VerificationResult::InapplicableRule),1415],1416)1417}14181419#[test]1420fn test_broken_32_general_rotl_to_rotr() {1421test_from_file_with_lhs_termname_simple(1422"./examples/broken/broken_32_general_rotl_to_rotr.isle",1423"rotl".to_string(),1424vec![1425(Bitwidth::I8, VerificationResult::InapplicableRule),1426(Bitwidth::I16, VerificationResult::InapplicableRule),1427(1428Bitwidth::I32,1429VerificationResult::Failure(Counterexample {}),1430),1431(Bitwidth::I64, VerificationResult::InapplicableRule),1432],1433)1434}14351436#[test]1437fn test_named_rotl_64_base_case() {1438test_aarch64_rule_with_lhs_termname_simple(1439"rotl_64_base_case",1440"rotl",1441vec![1442(Bitwidth::I8, VerificationResult::InapplicableRule),1443(Bitwidth::I16, VerificationResult::InapplicableRule),1444(Bitwidth::I32, VerificationResult::InapplicableRule),1445(Bitwidth::I64, VerificationResult::Success),1446],1447)1448}14491450#[test]1451fn test_broken_fits_in_16_rotl_to_rotr() {1452test_from_file_with_lhs_termname_simple(1453"./examples/broken/broken_fits_in_16_rotl_to_rotr.isle",1454"rotl".to_string(),1455vec![1456(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),1457(1458Bitwidth::I16,1459VerificationResult::Failure(Counterexample {}),1460),1461(Bitwidth::I32, VerificationResult::InapplicableRule),1462(Bitwidth::I64, VerificationResult::InapplicableRule),1463],1464)1465}14661467#[test]1468fn test_named_rotl_fits_in_16_imm() {1469test_aarch64_rule_with_lhs_termname_simple(1470"rotl_fits_in_16_imm",1471"rotl",1472vec![1473(Bitwidth::I8, VerificationResult::Success),1474(Bitwidth::I16, VerificationResult::Success),1475(Bitwidth::I32, VerificationResult::InapplicableRule),1476(Bitwidth::I64, VerificationResult::InapplicableRule),1477],1478)1479}14801481#[test]1482fn test_named_rotl_64_imm() {1483test_aarch64_rule_with_lhs_termname_simple(1484"rotl_64_imm",1485"rotl",1486vec![1487(Bitwidth::I8, VerificationResult::InapplicableRule),1488(Bitwidth::I16, VerificationResult::InapplicableRule),1489(Bitwidth::I32, VerificationResult::InapplicableRule),1490(Bitwidth::I64, VerificationResult::Success),1491],1492)1493}14941495#[test]1496fn test_named_rotl_32_imm() {1497test_aarch64_rule_with_lhs_termname_simple(1498"rotl_32_imm",1499"rotl",1500vec![1501(Bitwidth::I8, VerificationResult::InapplicableRule),1502(Bitwidth::I16, VerificationResult::InapplicableRule),1503(Bitwidth::I32, VerificationResult::Success),1504(Bitwidth::I64, VerificationResult::InapplicableRule),1505],1506)1507}15081509#[test]1510fn test_broken_fits_in_16_with_imm_rotl_to_rotr() {1511test_from_file_with_lhs_termname_simple(1512"./examples/broken/broken_fits_in_16_with_imm_rotl_to_rotr.isle",1513"rotl".to_string(),1514vec![1515(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),1516(1517Bitwidth::I16,1518VerificationResult::Failure(Counterexample {}),1519),1520(Bitwidth::I32, VerificationResult::InapplicableRule),1521(Bitwidth::I64, VerificationResult::InapplicableRule),1522],1523)1524}15251526#[test]1527fn test_named_rotr_fits_in_16() {1528test_aarch64_rule_with_lhs_termname_simple(1529"rotr_fits_in_16",1530"rotr",1531vec![1532(Bitwidth::I8, VerificationResult::Success),1533(Bitwidth::I16, VerificationResult::Success),1534(Bitwidth::I32, VerificationResult::InapplicableRule),1535(Bitwidth::I64, VerificationResult::InapplicableRule),1536],1537)1538}15391540#[test]1541fn test_named_rotr_fits_in_16_imm() {1542test_aarch64_rule_with_lhs_termname_simple(1543"rotr_fits_in_16_imm",1544"rotr",1545vec![1546(Bitwidth::I8, VerificationResult::Success),1547(Bitwidth::I16, VerificationResult::Success),1548(Bitwidth::I32, VerificationResult::InapplicableRule),1549(Bitwidth::I64, VerificationResult::InapplicableRule),1550],1551)1552}15531554#[test]1555fn test_named_rotr_32_base_case() {1556test_aarch64_rule_with_lhs_termname_simple(1557"rotr_32_base_case",1558"rotr",1559vec![1560(Bitwidth::I8, VerificationResult::InapplicableRule),1561(Bitwidth::I16, VerificationResult::InapplicableRule),1562(Bitwidth::I32, VerificationResult::Success),1563(Bitwidth::I64, VerificationResult::InapplicableRule),1564],1565)1566}15671568#[test]1569fn test_named_rotr_32_imm() {1570test_aarch64_rule_with_lhs_termname_simple(1571"rotr_32_imm",1572"rotr",1573vec![1574(Bitwidth::I8, VerificationResult::InapplicableRule),1575(Bitwidth::I16, VerificationResult::InapplicableRule),1576(Bitwidth::I32, VerificationResult::Success),1577(Bitwidth::I64, VerificationResult::InapplicableRule),1578],1579)1580}15811582#[test]1583fn test_named_rotr_64_base_case() {1584test_aarch64_rule_with_lhs_termname_simple(1585"rotr_64_base_case",1586"rotr",1587vec![1588(Bitwidth::I8, VerificationResult::InapplicableRule),1589(Bitwidth::I16, VerificationResult::InapplicableRule),1590(Bitwidth::I32, VerificationResult::InapplicableRule),1591(Bitwidth::I64, VerificationResult::Success),1592],1593)1594}15951596#[test]1597fn test_named_rotr_64_imm() {1598test_aarch64_rule_with_lhs_termname_simple(1599"rotr_64_imm",1600"rotr",1601vec![1602(Bitwidth::I8, VerificationResult::InapplicableRule),1603(Bitwidth::I16, VerificationResult::InapplicableRule),1604(Bitwidth::I32, VerificationResult::InapplicableRule),1605(Bitwidth::I64, VerificationResult::Success),1606],1607)1608}16091610#[test]1611fn test_named_band_fits_in_64() {1612test_aarch64_rule_with_lhs_termname_simple(1613"band_fits_in_64",1614"band",1615vec![1616(Bitwidth::I8, VerificationResult::Success),1617(Bitwidth::I16, VerificationResult::Success),1618(Bitwidth::I32, VerificationResult::Success),1619(Bitwidth::I64, VerificationResult::Success),1620],1621)1622}16231624#[test]1625fn test_broken_band_fits_in_32() {1626test_from_file_with_lhs_termname_simple(1627"./examples/broken/broken_fits_in_32_band.isle",1628"band".to_string(),1629vec![1630(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),1631(1632Bitwidth::I16,1633VerificationResult::Failure(Counterexample {}),1634),1635(1636Bitwidth::I32,1637VerificationResult::Failure(Counterexample {}),1638),1639(Bitwidth::I64, VerificationResult::InapplicableRule),1640],1641)1642}16431644#[test]1645fn test_named_bor_fits_in_64() {1646test_aarch64_rule_with_lhs_termname_simple(1647"bor_fits_in_64",1648"bor",1649vec![1650(Bitwidth::I8, VerificationResult::Success),1651(Bitwidth::I16, VerificationResult::Success),1652(Bitwidth::I32, VerificationResult::Success),1653(Bitwidth::I64, VerificationResult::Success),1654],1655)1656}16571658#[test]1659fn test_broken_bor_fits_in_32() {1660test_from_file_with_lhs_termname_simple(1661"./examples/broken/broken_fits_in_32_bor.isle",1662"bor".to_string(),1663vec![1664(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),1665(1666Bitwidth::I16,1667VerificationResult::Failure(Counterexample {}),1668),1669(1670Bitwidth::I32,1671VerificationResult::Failure(Counterexample {}),1672),1673(Bitwidth::I64, VerificationResult::InapplicableRule),1674],1675)1676}16771678#[test]1679fn test_named_bxor_fits_in_64() {1680test_aarch64_rule_with_lhs_termname_simple(1681"bxor_fits_in_64",1682"bxor",1683vec![1684(Bitwidth::I8, VerificationResult::Success),1685(Bitwidth::I16, VerificationResult::Success),1686(Bitwidth::I32, VerificationResult::Success),1687(Bitwidth::I64, VerificationResult::Success),1688],1689)1690}16911692#[test]1693fn test_named_band_not_right() {1694test_aarch64_rule_with_lhs_termname_simple(1695"band_not_right",1696"band",1697vec![1698(Bitwidth::I8, VerificationResult::Success),1699(Bitwidth::I16, VerificationResult::Success),1700(Bitwidth::I32, VerificationResult::Success),1701(Bitwidth::I64, VerificationResult::Success),1702],1703)1704}17051706#[test]1707fn test_named_band_not_left() {1708test_aarch64_rule_with_lhs_termname_simple(1709"band_not_left",1710"band",1711vec![1712(Bitwidth::I8, VerificationResult::Success),1713(Bitwidth::I16, VerificationResult::Success),1714(Bitwidth::I32, VerificationResult::Success),1715(Bitwidth::I64, VerificationResult::Success),1716],1717)1718}17191720#[test]1721fn test_named_bor_not_right() {1722test_aarch64_rule_with_lhs_termname_simple(1723"bor_not_right",1724"bor",1725vec![1726(Bitwidth::I8, VerificationResult::Success),1727(Bitwidth::I16, VerificationResult::Success),1728(Bitwidth::I32, VerificationResult::Success),1729(Bitwidth::I64, VerificationResult::Success),1730],1731)1732}17331734#[test]1735fn test_named_bor_not_left() {1736test_aarch64_rule_with_lhs_termname_simple(1737"bor_not_left",1738"bor",1739vec![1740(Bitwidth::I8, VerificationResult::Success),1741(Bitwidth::I16, VerificationResult::Success),1742(Bitwidth::I32, VerificationResult::Success),1743(Bitwidth::I64, VerificationResult::Success),1744],1745)1746}17471748#[test]1749fn test_named_bxor_not_right() {1750test_aarch64_rule_with_lhs_termname_simple(1751"bxor_not_right",1752"bxor",1753vec![1754(Bitwidth::I8, VerificationResult::Success),1755(Bitwidth::I16, VerificationResult::Success),1756(Bitwidth::I32, VerificationResult::Success),1757(Bitwidth::I64, VerificationResult::Success),1758],1759)1760}17611762#[test]1763fn test_named_bxor_not_left() {1764test_aarch64_rule_with_lhs_termname_simple(1765"bxor_not_left",1766"bxor",1767vec![1768(Bitwidth::I8, VerificationResult::Success),1769(Bitwidth::I16, VerificationResult::Success),1770(Bitwidth::I32, VerificationResult::Success),1771(Bitwidth::I64, VerificationResult::Success),1772],1773)1774}17751776#[test]1777fn test_named_bnot() {1778test_aarch64_rule_with_lhs_termname_simple("bnot_base_case", "bnot", all_success_result())1779}17801781#[test]1782fn test_named_bnot_ishl() {1783test_aarch64_rule_with_lhs_termname_simple("bnot_ishl", "bnot", all_success_result())1784}17851786#[test]1787fn test_named_ishl_64() {1788test_aarch64_rule_with_lhs_termname_simple(1789"ishl_64",1790"ishl",1791vec![1792(Bitwidth::I8, VerificationResult::InapplicableRule),1793(Bitwidth::I16, VerificationResult::InapplicableRule),1794(Bitwidth::I32, VerificationResult::InapplicableRule),1795(Bitwidth::I64, VerificationResult::Success),1796],1797)1798}17991800#[test]1801fn test_named_ishl_64_concrete() {1802test_concrete_aarch64_rule_with_lhs_termname(1803"ishl_64",1804"ishl",1805ConcreteTest {1806termname: "ishl".to_string(),1807args: vec![1808ConcreteInput {1809literal: "#b0000000000000000000000000000000000000000000000000000000000000001"1810.to_string(),1811ty: veri_ir::Type::BitVector(Some(64)),1812},1813ConcreteInput {1814literal: "#b0000000000000000000000000000000000000000000000000000000000000010"1815.to_string(),1816ty: veri_ir::Type::BitVector(Some(64)),1817},1818],1819output: ConcreteInput {1820literal: "#b0000000000000000000000000000000000000000000000000000000000000100"1821.to_string(),1822ty: veri_ir::Type::BitVector(Some(64)),1823},1824},1825)1826}18271828#[test]1829fn test_named_ishl_fits_in_32() {1830test_aarch64_rule_with_lhs_termname_simple(1831"ishl_fits_in_32",1832"ishl",1833vec![1834(Bitwidth::I8, VerificationResult::Success),1835(Bitwidth::I16, VerificationResult::Success),1836(Bitwidth::I32, VerificationResult::Success),1837(Bitwidth::I64, VerificationResult::InapplicableRule),1838],1839)1840}18411842#[test]1843fn test_named_ishl_fits_in_32_concrete() {1844test_concrete_aarch64_rule_with_lhs_termname(1845"ishl_fits_in_32",1846"ishl",1847ConcreteTest {1848termname: "ishl".to_string(),1849args: vec![1850ConcreteInput {1851literal: "#b00000001".to_string(),1852ty: veri_ir::Type::BitVector(Some(8)),1853},1854ConcreteInput {1855literal: "#b00000010".to_string(),1856ty: veri_ir::Type::BitVector(Some(8)),1857},1858],1859output: ConcreteInput {1860literal: "#b00000100".to_string(),1861ty: veri_ir::Type::BitVector(Some(8)),1862},1863},1864)1865}18661867#[test]1868fn test_named_sshr_64() {1869test_aarch64_rule_with_lhs_termname_simple(1870"sshr_64",1871"sshr",1872vec![1873(Bitwidth::I8, VerificationResult::InapplicableRule),1874(Bitwidth::I16, VerificationResult::InapplicableRule),1875(Bitwidth::I32, VerificationResult::InapplicableRule),1876(Bitwidth::I64, VerificationResult::Success),1877],1878)1879}18801881#[test]1882fn test_named_sshr_fits_in_32() {1883test_aarch64_rule_with_lhs_termname_simple(1884"sshr_fits_in_32",1885"sshr",1886vec![1887(Bitwidth::I8, VerificationResult::Success),1888(Bitwidth::I16, VerificationResult::Success),1889(Bitwidth::I32, VerificationResult::Success),1890(Bitwidth::I64, VerificationResult::InapplicableRule),1891],1892)1893}18941895#[test]1896fn test_named_sshr_fits_in_32_concrete() {1897test_concrete_aarch64_rule_with_lhs_termname(1898"sshr_fits_in_32",1899"sshr",1900ConcreteTest {1901termname: "sshr".to_string(),1902args: vec![1903ConcreteInput {1904literal: "#b10100000".to_string(),1905ty: veri_ir::Type::BitVector(Some(8)),1906},1907ConcreteInput {1908literal: "#b00000001".to_string(),1909ty: veri_ir::Type::BitVector(Some(8)),1910},1911],1912output: ConcreteInput {1913literal: "#b11010000".to_string(),1914ty: veri_ir::Type::BitVector(Some(8)),1915},1916},1917)1918}19191920#[test]1921fn test_named_ushr_64() {1922test_aarch64_rule_with_lhs_termname_simple(1923"ushr_64",1924"ushr",1925vec![1926(Bitwidth::I8, VerificationResult::InapplicableRule),1927(Bitwidth::I16, VerificationResult::InapplicableRule),1928(Bitwidth::I32, VerificationResult::InapplicableRule),1929(Bitwidth::I64, VerificationResult::Success),1930],1931)1932}19331934#[test]1935fn test_named_ushr_fits_in_32() {1936test_aarch64_rule_with_lhs_termname_simple(1937"ushr_fits_in_32",1938"ushr",1939vec![1940(Bitwidth::I8, VerificationResult::Success),1941(Bitwidth::I16, VerificationResult::Success),1942(Bitwidth::I32, VerificationResult::Success),1943(Bitwidth::I64, VerificationResult::InapplicableRule),1944],1945)1946}19471948#[test]1949fn test_named_ushr_fits_in_32_concrete() {1950test_concrete_aarch64_rule_with_lhs_termname(1951"ushr_fits_in_32",1952"ushr",1953ConcreteTest {1954termname: "ushr".to_string(),1955args: vec![1956ConcreteInput {1957literal: "#b10100000".to_string(),1958ty: veri_ir::Type::BitVector(Some(8)),1959},1960ConcreteInput {1961literal: "#b00000001".to_string(),1962ty: veri_ir::Type::BitVector(Some(8)),1963},1964],1965output: ConcreteInput {1966literal: "#b01010000".to_string(),1967ty: veri_ir::Type::BitVector(Some(8)),1968},1969},1970)1971}19721973#[test]1974fn test_named_do_shift_64_base_case() {1975test_aarch64_rule_with_lhs_termname_simple(1976"do_shift_64_base_case",1977"do_shift",1978vec![1979(Bitwidth::I8, VerificationResult::InapplicableRule),1980(Bitwidth::I16, VerificationResult::InapplicableRule),1981(Bitwidth::I32, VerificationResult::InapplicableRule),1982(Bitwidth::I64, VerificationResult::Success),1983],1984)1985}19861987#[test]1988fn test_named_do_shift_imm() {1989let config = Config {1990term: "do_shift".to_string(),1991distinct_check: true,1992custom_assumptions: None,1993custom_verification_condition: Some(Box::new(|smt, _args, lhs, rhs| {1994let mask = smt.atom("#x00000000000000FF");1995smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))1996})),1997names: Some(vec!["do_shift_imm".to_string()]),1998};1999test_aarch64_with_config_simple(config, vec![(Bitwidth::I8, VerificationResult::Success)]);2000let config = Config {2001term: "do_shift".to_string(),2002distinct_check: true,2003custom_assumptions: None,2004custom_verification_condition: Some(Box::new(|smt, _args, lhs, rhs| {2005let mask = smt.atom("#x000000000000FFFF");2006smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))2007})),2008names: Some(vec!["do_shift_imm".to_string()]),2009};2010test_aarch64_with_config_simple(config, vec![(Bitwidth::I16, VerificationResult::Success)]);2011let config = Config {2012term: "do_shift".to_string(),2013distinct_check: true,2014custom_assumptions: None,2015custom_verification_condition: Some(Box::new(|smt, _args, lhs, rhs| {2016let mask = smt.atom("#x00000000FFFFFFFF");2017smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))2018})),2019names: Some(vec!["do_shift_imm".to_string()]),2020};2021test_aarch64_with_config_simple(config, vec![(Bitwidth::I32, VerificationResult::Success)]);2022test_aarch64_rule_with_lhs_termname_simple(2023"do_shift_imm",2024"do_shift",2025vec![(Bitwidth::I64, VerificationResult::Success)],2026)2027}20282029#[test]2030fn test_named_do_shift_fits_in_16() {2031let config = Config {2032term: "do_shift".to_string(),2033distinct_check: true,2034custom_assumptions: None,2035custom_verification_condition: Some(Box::new(|smt, args, lhs, rhs| {2036let ty_arg = args[1];2037let lower_8_bits_eq = {2038let mask = smt.atom("#x00000000000000FF");2039smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))2040};2041let lower_16_bits_eq = {2042let mask = smt.atom("#x000000000000FFFF");2043smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))2044};2045smt.ite(2046smt.eq(ty_arg, smt.atom("8")),2047lower_8_bits_eq,2048lower_16_bits_eq,2049)2050})),2051names: Some(vec!["do_shift_fits_in_16".to_string()]),2052};2053test_aarch64_with_config_simple(2054config,2055vec![2056(Bitwidth::I8, VerificationResult::Success),2057(Bitwidth::I16, VerificationResult::Success),2058],2059);20602061test_aarch64_rule_with_lhs_termname_simple(2062"do_shift_fits_in_16",2063"do_shift",2064vec![2065(Bitwidth::I32, VerificationResult::InapplicableRule),2066(Bitwidth::I64, VerificationResult::InapplicableRule),2067],2068)2069}20702071#[test]2072fn test_named_do_shift_fits_in_16_concrete() {2073// (decl do_shift (ALUOp Type Reg Value) Reg)20742075test_concrete_aarch64_rule_with_lhs_termname(2076"do_shift_fits_in_16",2077"do_shift",2078ConcreteTest {2079termname: "do_shift".to_string(),2080args: vec![2081ConcreteInput {2082literal: "#x0e".to_string(),2083ty: veri_ir::Type::BitVector(Some(8)),2084},2085ConcreteInput {2086literal: "16".to_string(),2087ty: veri_ir::Type::Int,2088},2089ConcreteInput {2090literal: "#b0000000000000000000000000000000000000000000000000000000000000001"2091.to_string(),2092ty: veri_ir::Type::BitVector(Some(64)),2093},2094ConcreteInput {2095literal: "#b0000000000000001".to_string(),2096ty: veri_ir::Type::BitVector(Some(16)),2097},2098],2099output: ConcreteInput {2100literal: "#b0000000000000000000000000000000000000000000000000000000000000010"2101.to_string(),2102ty: veri_ir::Type::BitVector(Some(64)),2103},2104},2105)2106}21072108#[test]2109fn test_named_do_shift_32_base_case() {2110test_aarch64_rule_with_lhs_termname_simple(2111"do_shift_32_base_case",2112"do_shift",2113vec![2114(Bitwidth::I8, VerificationResult::InapplicableRule),2115(Bitwidth::I16, VerificationResult::InapplicableRule),2116(Bitwidth::I64, VerificationResult::InapplicableRule),2117],2118);2119let config = Config {2120term: "do_shift".to_string(),2121distinct_check: true,2122custom_assumptions: None,2123custom_verification_condition: Some(Box::new(|smt, _args, lhs, rhs| {2124let mask = smt.atom("#x00000000FFFFFFFF");2125smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))2126})),2127names: Some(vec!["do_shift_32_base_case".to_string()]),2128};2129test_aarch64_with_config_simple(config, vec![(Bitwidth::I32, VerificationResult::Success)]);2130}21312132#[test]2133fn test_broken_do_shift_32() {2134test_from_file_with_lhs_termname_simple(2135"./examples/broken/shifts/broken_do_shift_32.isle",2136"do_shift".to_string(),2137vec![2138(Bitwidth::I8, VerificationResult::InapplicableRule),2139(Bitwidth::I16, VerificationResult::InapplicableRule),2140(Bitwidth::I64, VerificationResult::InapplicableRule),2141],2142);2143let config = Config {2144term: "do_shift".to_string(),2145distinct_check: true,2146custom_assumptions: None,2147custom_verification_condition: Some(Box::new(|smt, _args, lhs, rhs| {2148let mask = smt.atom("#x00000000FFFFFFFF");2149smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))2150})),2151names: None,2152};2153test_from_file_with_config_simple(2154"./examples/broken/shifts/broken_do_shift_32.isle",2155config,2156vec![(2157Bitwidth::I32,2158VerificationResult::Failure(Counterexample {}),2159)],2160);2161}21622163#[test]2164fn test_broken_ishl_to_do_shift_64() {2165test_from_file_with_lhs_termname_simple(2166"./examples/broken/shifts/broken_ishl_to_do_shift_64.isle",2167"ishl".to_string(),2168vec![2169(Bitwidth::I8, VerificationResult::InapplicableRule),2170(Bitwidth::I16, VerificationResult::InapplicableRule),2171(Bitwidth::I32, VerificationResult::InapplicableRule),2172(2173Bitwidth::I64,2174VerificationResult::Failure(Counterexample {}),2175),2176],2177)2178}21792180#[test]2181fn test_broken_sshr_to_do_shift_fits_in_32() {2182test_from_file_with_lhs_termname_simple(2183"./examples/broken/shifts/broken_sshr_to_do_shift_fits_in_32.isle",2184"sshr".to_string(),2185vec![2186(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),2187(2188Bitwidth::I16,2189VerificationResult::Failure(Counterexample {}),2190),2191(2192Bitwidth::I32,2193VerificationResult::Failure(Counterexample {}),2194),2195(Bitwidth::I64, VerificationResult::InapplicableRule),2196],2197)2198}21992200#[test]2201fn test_broken_sshr_to_do_shift_fits_in_32_concrete() {2202test_concrete_input_from_file_with_lhs_termname(2203"./examples/broken/shifts/broken_sshr_to_do_shift_fits_in_32.isle",2204"sshr".to_string(),2205ConcreteTest {2206termname: "sshr".to_string(),2207args: vec![2208ConcreteInput {2209literal: "#b10100000".to_string(),2210ty: veri_ir::Type::BitVector(Some(8)),2211},2212ConcreteInput {2213literal: "#b00000001".to_string(),2214ty: veri_ir::Type::BitVector(Some(8)),2215},2216],2217// Wrong output:2218output: ConcreteInput {2219literal: "#b01010000".to_string(),2220ty: veri_ir::Type::BitVector(Some(8)),2221},2222},2223)2224}22252226#[test]2227fn test_broken_ushr_to_do_shift_fits_in_32() {2228test_from_file_with_lhs_termname_simple(2229"./examples/broken/shifts/broken_ushr_to_do_shift_fits_in_32.isle",2230"ushr".to_string(),2231vec![2232(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),2233(2234Bitwidth::I16,2235VerificationResult::Failure(Counterexample {}),2236),2237(2238Bitwidth::I32,2239VerificationResult::Failure(Counterexample {}),2240),2241(Bitwidth::I64, VerificationResult::InapplicableRule),2242],2243)2244}22452246#[test]2247fn test_if_let() {2248test_from_file_with_lhs_termname_simple(2249"./examples/constructs/if-let.isle",2250"iadd".to_string(),2251all_success_result(),2252);2253}22542255#[test]2256fn test_named_icmp_8_16_32_64() {2257test_aarch64_rule_with_lhs_termname_simple(2258"icmp_8_16_32_64",2259"icmp",2260vec![2261(Bitwidth::I8, VerificationResult::Success),2262(Bitwidth::I16, VerificationResult::Success),2263(Bitwidth::I32, VerificationResult::Success),2264(Bitwidth::I64, VerificationResult::Success),2265],2266)2267}22682269#[test]2270fn test_named_lower_icmp_into_reg_8_16_32_64() {2271test_aarch64_rule_with_lhs_termname_simple(2272"lower_icmp_into_reg_8_16_32_64",2273"lower_icmp_into_reg",2274vec![2275(Bitwidth::I8, VerificationResult::Success),2276(Bitwidth::I16, VerificationResult::Success),2277(Bitwidth::I32, VerificationResult::Success),2278(Bitwidth::I64, VerificationResult::Success),2279],2280)2281}22822283#[test]2284fn test_named_lower_icmp_into_reg_8_16_32_64_concrete_1() {2285test_concrete_aarch64_rule_with_lhs_termname(2286"lower_icmp_into_reg_8_16_32_64",2287"lower_icmp_into_reg",2288ConcreteTest {2289termname: "lower_icmp_into_reg".to_string(),2290args: vec![2291ConcreteInput {2292literal: "#b00000000".to_string(),2293ty: veri_ir::Type::BitVector(Some(8)),2294},2295ConcreteInput {2296literal: "#b00000000".to_string(),2297ty: veri_ir::Type::BitVector(Some(8)),2298},2299ConcreteInput {2300literal: "#b00000001".to_string(),2301ty: veri_ir::Type::BitVector(Some(8)),2302},2303ConcreteInput {2304literal: "8".to_string(),2305ty: veri_ir::Type::Int,2306},2307ConcreteInput {2308literal: "8".to_string(),2309ty: veri_ir::Type::Int,2310},2311],2312output: ConcreteInput {2313literal: "#b00000000".to_string(),2314ty: veri_ir::Type::BitVector(Some(8)),2315},2316},2317)2318}23192320#[test]2321fn test_named_lower_icmp_into_reg_8_16_32_64_concrete_2() {2322test_concrete_aarch64_rule_with_lhs_termname(2323"lower_icmp_into_reg_8_16_32_64",2324"lower_icmp_into_reg",2325ConcreteTest {2326termname: "lower_icmp_into_reg".to_string(),2327args: vec![2328ConcreteInput {2329literal: "#b00000000".to_string(),2330ty: veri_ir::Type::BitVector(Some(8)),2331},2332ConcreteInput {2333literal: "#b00000000".to_string(),2334ty: veri_ir::Type::BitVector(Some(8)),2335},2336ConcreteInput {2337literal: "#b00000000".to_string(),2338ty: veri_ir::Type::BitVector(Some(8)),2339},2340ConcreteInput {2341literal: "8".to_string(),2342ty: veri_ir::Type::Int,2343},2344ConcreteInput {2345literal: "8".to_string(),2346ty: veri_ir::Type::Int,2347},2348],2349output: ConcreteInput {2350literal: "#b00000001".to_string(),2351ty: veri_ir::Type::BitVector(Some(8)),2352},2353},2354)2355}23562357// Narrow types fail because of rule priorities2358// https://github.com/avanhatt/wasmtime/issues/322359#[test]2360fn test_named_lower_icmp_32_64() {2361test_aarch64_rule_with_lhs_termname_simple(2362"lower_icmp_32_64",2363"lower_icmp",2364vec![2365// (Bitwidth::I8, VerificationResult::Failure(Counterexample {})),2366// (2367// Bitwidth::I16,2368// VerificationResult::Failure(Counterexample {}),2369// ),2370(Bitwidth::I32, VerificationResult::Success),2371(Bitwidth::I64, VerificationResult::Success),2372],2373)2374}23752376#[test]2377fn test_named_lower_icmp_8_16_signed() {2378test_aarch64_rule_with_lhs_termname_simple(2379"lower_icmp_8_16_signed",2380"lower_icmp",2381vec![2382(Bitwidth::I8, VerificationResult::Success),2383(Bitwidth::I16, VerificationResult::Success),2384(Bitwidth::I32, VerificationResult::InapplicableRule),2385(Bitwidth::I64, VerificationResult::InapplicableRule),2386],2387)2388}23892390// TODO AVH: Currently fails because needs priorities to show this2391// only applies to unsigned cond codes2392// https://github.com/avanhatt/wasmtime/issues/322393#[test]2394fn test_named_lower_icmp_8_16_unsigned_imm() {2395test_aarch64_rule_with_lhs_termname_simple(2396"lower_icmp_8_16_unsigned_imm",2397"lower_icmp",2398vec![2399// (Bitwidth::I8, VerificationResult::Success),2400// (Bitwidth::I16, VerificationResult::Success),2401(Bitwidth::I32, VerificationResult::InapplicableRule),2402(Bitwidth::I64, VerificationResult::InapplicableRule),2403],2404)2405}24062407// TODO AVH: Currently fails because needs priorities to show this2408// only applies to unsigned cond codes2409// https://github.com/avanhatt/wasmtime/issues/322410#[test]2411fn test_named_lower_icmp_8_16_unsigned() {2412test_aarch64_rule_with_lhs_termname_simple(2413"lower_icmp_8_16_unsigned",2414"lower_icmp",2415vec![2416// (Bitwidth::I8, VerificationResult::Success),2417// (Bitwidth::I16, VerificationResult::Success),2418(Bitwidth::I32, VerificationResult::InapplicableRule),2419(Bitwidth::I64, VerificationResult::InapplicableRule),2420],2421)2422}24232424// AVH TODO: this rule requires priorities to be correct for narrow cases2425// https://github.com/avanhatt/wasmtime/issues/322426#[test]2427fn test_named_lower_icmp_32_64_const() {2428test_aarch64_rule_with_lhs_termname_simple(2429"lower_icmp_32_64_const",2430"lower_icmp",2431vec![2432// (Bitwidth::I8, VerificationResult::InapplicableRule),2433// (Bitwidth::I16, VerificationResult::InapplicableRule),2434(Bitwidth::I32, VerificationResult::Success),2435(Bitwidth::I64, VerificationResult::Success),2436],2437)2438}24392440#[test]2441fn test_named_lower_icmp_const_32_64_imm() {2442test_aarch64_rule_with_lhs_termname_simple(2443"lower_icmp_const_32_64_imm",2444"lower_icmp_const",2445vec![2446(Bitwidth::I8, VerificationResult::InapplicableRule),2447(Bitwidth::I16, VerificationResult::InapplicableRule),2448(Bitwidth::I32, VerificationResult::Success),2449(Bitwidth::I64, VerificationResult::Success),2450],2451)2452}24532454// AVH TODO: this rule requires priorities and a custom verification condition2455// https://github.com/avanhatt/wasmtime/issues/322456#[test]2457fn test_named_lower_icmp_const_32_64_sgte() {2458// Note: only one distinct condition code is matched on, so need to disable2459// distinctness check24602461let config = Config {2462term: "lower_icmp_const".to_string(),2463distinct_check: false,2464custom_verification_condition: None,2465custom_assumptions: None,2466names: Some(vec!["lower_icmp_const_32_64_sgte".to_string()]),2467};2468test_aarch64_with_config_simple(2469config,2470vec![2471(Bitwidth::I8, VerificationResult::InapplicableRule),2472(Bitwidth::I16, VerificationResult::InapplicableRule),2473// Currently fails! The rewrite is not semantics-preserving2474(2475Bitwidth::I32,2476VerificationResult::Failure(Counterexample {}),2477),2478(2479Bitwidth::I64,2480VerificationResult::Failure(Counterexample {}),2481),2482],2483)2484}24852486// AVH TODO: this rule requires priorities and a custom verification condition2487// https://github.com/avanhatt/wasmtime/issues/322488#[test]2489fn test_named_lower_icmp_const_32_64_ugte() {2490// Note: only one distinct condition code is matched on, so need to disable2491// distinctness check24922493let config = Config {2494term: "lower_icmp_const".to_string(),2495distinct_check: false,2496custom_verification_condition: None,2497custom_assumptions: None,2498names: Some(vec!["lower_icmp_const_32_64_ugte".to_string()]),2499};2500test_aarch64_with_config_simple(2501config,2502vec![2503(Bitwidth::I8, VerificationResult::InapplicableRule),2504(Bitwidth::I16, VerificationResult::InapplicableRule),2505// Currently fails! The rewrite is not semantics-preserving2506(2507Bitwidth::I32,2508VerificationResult::Failure(Counterexample {}),2509),2510(2511Bitwidth::I64,2512VerificationResult::Failure(Counterexample {}),2513),2514],2515)2516}25172518#[test]2519fn test_named_lower_icmp_const_32_64() {2520test_aarch64_rule_with_lhs_termname_simple(2521"lower_icmp_const_32_64",2522"lower_icmp_const",2523vec![2524(Bitwidth::I8, VerificationResult::InapplicableRule),2525(Bitwidth::I16, VerificationResult::InapplicableRule),2526(Bitwidth::I32, VerificationResult::Success),2527(Bitwidth::I64, VerificationResult::Success),2528],2529)2530}25312532#[test]2533fn test_named_umax() {2534test_aarch64_rule_with_lhs_termname_simple(2535"umax",2536"umax",2537vec![2538(Bitwidth::I8, VerificationResult::Success),2539(Bitwidth::I16, VerificationResult::Success),2540(Bitwidth::I32, VerificationResult::Success),2541(Bitwidth::I64, VerificationResult::Success),2542],2543)2544}25452546#[test]2547fn test_named_smax() {2548test_aarch64_rule_with_lhs_termname_simple(2549"smax",2550"smax",2551vec![2552(Bitwidth::I8, VerificationResult::Success),2553(Bitwidth::I16, VerificationResult::Success),2554(Bitwidth::I32, VerificationResult::Success),2555(Bitwidth::I64, VerificationResult::Success),2556],2557)2558}25592560#[test]2561fn test_named_umin() {2562test_aarch64_rule_with_lhs_termname_simple(2563"umin",2564"umin",2565vec![2566(Bitwidth::I8, VerificationResult::Success),2567(Bitwidth::I16, VerificationResult::Success),2568(Bitwidth::I32, VerificationResult::Success),2569(Bitwidth::I64, VerificationResult::Success),2570],2571)2572}25732574#[test]2575fn test_named_smin() {2576test_aarch64_rule_with_lhs_termname_simple(2577"smin",2578"smin",2579vec![2580(Bitwidth::I8, VerificationResult::Success),2581(Bitwidth::I16, VerificationResult::Success),2582(Bitwidth::I32, VerificationResult::Success),2583(Bitwidth::I64, VerificationResult::Success),2584],2585)2586}25872588#[test]2589fn test_named_iabs_64() {2590test_aarch64_rule_with_lhs_termname_simple(2591"iabs_64",2592"iabs",2593vec![2594(Bitwidth::I8, VerificationResult::InapplicableRule),2595(Bitwidth::I16, VerificationResult::InapplicableRule),2596(Bitwidth::I32, VerificationResult::InapplicableRule),2597(Bitwidth::I64, VerificationResult::Success),2598],2599)2600}26012602#[test]2603fn test_named_iabs_8_16_32() {2604test_aarch64_rule_with_lhs_termname_simple(2605"iabs_8_16_32",2606"iabs",2607vec![2608(Bitwidth::I8, VerificationResult::Success),2609(Bitwidth::I16, VerificationResult::Success),2610(Bitwidth::I32, VerificationResult::Success),2611(Bitwidth::I64, VerificationResult::InapplicableRule),2612],2613)2614}26152616#[test]2617fn test_named_bitselect() {2618test_aarch64_rule_with_lhs_termname_simple("bitselect", "bitselect", all_success_result())2619}26202621#[test]2622fn test_named_iconst() {2623test_aarch64_rule_with_lhs_termname_simple("iconst", "iconst", all_success_result())2624}26252626// Can't currently verify because ConsumesFlags requires a non-functional2627// interpretation2628// #[test]2629// fn test_named_cmp_and_choose_8_16() {2630//2631// let config = Config {2632// dyn_width: false,2633// term: "cmp_and_choose".to_string(),2634// distinct_check: true,2635// custom_verification_condition: Some(Box::new(|smt, args, lhs, rhs| {2636// let ty_arg = *args.first().unwrap();2637// let lower_8_bits_eq = {2638// let mask = smt.atom("#x00000000000000FF");2639// smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))2640// };2641// let lower_16_bits_eq = {2642// let mask = smt.atom("#x000000000000FFFF");2643// smt.eq(smt.bvand(mask, lhs), smt.bvand(mask, rhs))2644// };2645// smt.ite(2646// smt.eq(ty_arg, smt.atom("8")),2647// lower_8_bits_eq,2648// lower_16_bits_eq,2649// )2650// })),2651// names: Some(vec!["cmp_and_choose_8_16".to_string()]),2652// };2653// test_aarch64_with_config_simple(2654// config,2655// vec![2656// (Bitwidth::I8, VerificationResult::Failure(Counterexample { })),2657// (Bitwidth::I16, VerificationResult::Failure(Counterexample { })),2658// (Bitwidth::I32, VerificationResult::InapplicableRule),2659// (Bitwidth::I64, VerificationResult::InapplicableRule),2660// ],2661// );2662// })2663// }26642665#[test]2666fn test_named_popcnt_8() {2667test_aarch64_rule_with_lhs_termname_simple(2668"popcnt_8",2669"popcnt",2670vec![2671(Bitwidth::I8, VerificationResult::Success),2672(Bitwidth::I16, VerificationResult::InapplicableRule),2673(Bitwidth::I32, VerificationResult::InapplicableRule),2674(Bitwidth::I64, VerificationResult::InapplicableRule),2675],2676)2677}26782679#[test]2680fn test_named_popcnt_16() {2681test_aarch64_rule_with_lhs_termname_simple(2682"popcnt_16",2683"popcnt",2684vec![2685(Bitwidth::I8, VerificationResult::InapplicableRule),2686(Bitwidth::I16, VerificationResult::Success),2687(Bitwidth::I32, VerificationResult::InapplicableRule),2688(Bitwidth::I64, VerificationResult::InapplicableRule),2689],2690)2691}26922693#[test]2694fn test_named_popcnt_32() {2695test_aarch64_rule_with_lhs_termname_simple(2696"popcnt_32",2697"popcnt",2698vec![2699(Bitwidth::I8, VerificationResult::InapplicableRule),2700(Bitwidth::I16, VerificationResult::InapplicableRule),2701(Bitwidth::I32, VerificationResult::Success),2702(Bitwidth::I64, VerificationResult::InapplicableRule),2703],2704)2705}27062707// Currently too slow2708// https://github.com/avanhatt/wasmtime/issues/362709#[test]2710fn test_named_popcnt_64() {2711test_aarch64_rule_with_lhs_termname_simple(2712"popcnt_64",2713"popcnt",2714vec![2715(Bitwidth::I8, VerificationResult::InapplicableRule),2716(Bitwidth::I16, VerificationResult::InapplicableRule),2717(Bitwidth::I32, VerificationResult::InapplicableRule),2718// (Bitwidth::I64, VerificationResult::Success),2719],2720)2721}27222723// Currently too slow2724// https://github.com/avanhatt/wasmtime/issues/362725#[test]2726#[ignore]2727fn test_named_slow_popcnt_64() {2728test_aarch64_rule_with_lhs_termname_simple(2729"popcnt_64",2730"popcnt",2731vec![(Bitwidth::I64, VerificationResult::Unknown)],2732)2733}27342735#[test]2736fn test_named_operand_size_32() {2737// Since there are no bitvectors in the signature, need a custom assumption2738// hook to pass through the value of the type argument27392740static EXPECTED: [(Bitwidth, VerificationResult); 4] = [2741(Bitwidth::I8, VerificationResult::Success),2742(Bitwidth::I16, VerificationResult::Success),2743(Bitwidth::I32, VerificationResult::Success),2744(Bitwidth::I64, VerificationResult::InapplicableRule),2745];2746for (ty, result) in &EXPECTED {2747let config = Config {2748term: "operand_size".to_string(),2749distinct_check: true,2750custom_verification_condition: None,2751custom_assumptions: Some(Box::new(|smt, args| {2752let ty_arg = *args.first().unwrap();2753smt.eq(ty_arg, smt.numeral(*ty as usize))2754})),2755names: Some(vec!["operand_size_32".to_string()]),2756};2757test_aarch64_with_config_simple(config, vec![(*ty, result.clone())]);2758}2759}27602761#[test]2762fn test_named_operand_size_64() {2763// Since there are no bitvectors in the signature, need a custom assumption2764// hook to pass through the value of the type argument27652766// Lower types precluded by priorities2767static EXPECTED: [(Bitwidth, VerificationResult); 1] = [2768// (Bitwidth::I8, VerificationResult::Success),2769// (Bitwidth::I16, VerificationResult::Success),2770// (Bitwidth::I32, VerificationResult::Success),2771(Bitwidth::I64, VerificationResult::Success),2772];2773for (ty, result) in &EXPECTED {2774let config = Config {2775term: "operand_size".to_string(),2776distinct_check: true,2777custom_verification_condition: None,2778custom_assumptions: Some(Box::new(|smt, args| {2779let ty_arg = *args.first().unwrap();2780smt.eq(ty_arg, smt.numeral(*ty as usize))2781})),2782names: Some(vec!["operand_size_64".to_string()]),2783};2784test_aarch64_with_config_simple(config, vec![(*ty, result.clone())]);2785}2786}27872788#[test]2789fn test_named_output_reg() {2790test_aarch64_rule_with_lhs_termname_simple(2791"output_reg",2792"output_reg",2793vec![2794(Bitwidth::I8, VerificationResult::Success),2795(Bitwidth::I16, VerificationResult::Success),2796(Bitwidth::I32, VerificationResult::Success),2797(Bitwidth::I64, VerificationResult::Success),2798],2799)2800}28012802#[test]2803fn test_broken_imm_udiv_cve_underlying() {2804// Since there are no bitvectors in the signature, need a custom assumption2805// hook to pass through the value of the type argument28062807static EXPECTED: [(Bitwidth, VerificationResult); 4] = [2808(Bitwidth::I8, VerificationResult::Failure(Counterexample {})),2809(2810Bitwidth::I16,2811VerificationResult::Failure(Counterexample {}),2812),2813(2814Bitwidth::I32,2815VerificationResult::Failure(Counterexample {}),2816),2817(Bitwidth::I64, VerificationResult::Success),2818];2819for (ty, result) in &EXPECTED {2820let config = Config {2821term: "imm".to_string(),2822distinct_check: true,2823custom_verification_condition: None,2824custom_assumptions: Some(Box::new(|smt, args| {2825let ty_arg = *args.first().unwrap();2826smt.eq(ty_arg, smt.numeral(*ty as usize))2827})),2828names: None,2829};2830test_from_file_with_config_simple(2831"./examples/broken/udiv/udiv_cve_underlying.isle",2832config,2833vec![(*ty, result.clone())],2834);2835}2836}28372838#[test]2839fn test_broken_imm_udiv_cve_underlying_32() {2840// Since there are no bitvectors in the signature, need a custom assumption2841// hook to pass through the value of the type argument28422843static EXPECTED: [(Bitwidth, VerificationResult); 1] = [(2844Bitwidth::I32,2845VerificationResult::Failure(Counterexample {}),2846)];2847for (ty, result) in &EXPECTED {2848let config = Config {2849term: "imm".to_string(),2850distinct_check: true,2851custom_verification_condition: None,2852custom_assumptions: Some(Box::new(|smt, args| {2853let ty_arg = *args.first().unwrap();2854smt.eq(ty_arg, smt.numeral(*ty as usize))2855})),2856names: None,2857};2858test_from_file_with_config_simple(2859"./examples/broken/udiv/udiv_cve_underlying.isle",2860config,2861vec![(*ty, result.clone())],2862);2863}2864}28652866// x6428672868#[test]2869fn test_named_x64_iadd_base_case_32_or_64_lea() {2870test_x64_rule_with_lhs_termname_simple(2871"iadd_base_case_32_or_64_lea",2872"iadd",2873vec![2874(Bitwidth::I8, VerificationResult::InapplicableRule),2875(Bitwidth::I16, VerificationResult::InapplicableRule),2876(Bitwidth::I32, VerificationResult::Success),2877(Bitwidth::I64, VerificationResult::Success),2878],2879)2880}28812882#[test]2883fn test_named_x64_to_amode_add_base_case() {2884test_x64_rule_with_lhs_termname_simple(2885"to_amode_add_base_case",2886"to_amode_add",2887vec![(Bitwidth::I64, VerificationResult::Success)],2888)2889}28902891#[test]2892fn test_named_x64_to_amode_add_const_rhs() {2893test_x64_rule_with_lhs_termname_simple(2894"to_amode_add_const_rhs",2895"to_amode_add",2896vec![2897// TODO: make this work for I322898// (Bitwidth::I32, VerificationResult::Success),2899(Bitwidth::I64, VerificationResult::Success),2900],2901)2902}29032904#[test]2905fn test_named_x64_to_amode_add_const_lhs() {2906test_x64_rule_with_lhs_termname_simple(2907"to_amode_add_const_lhs",2908"to_amode_add",2909vec![(Bitwidth::I64, VerificationResult::Success)],2910)2911}29122913#[test]2914fn test_named_x64_to_amode_add_const_fold_iadd_lhs_rhs() {2915test_x64_rule_with_lhs_termname_simple(2916"to_amode_add_const_fold_iadd_lhs_rhs",2917"to_amode_add",2918vec![(Bitwidth::I64, VerificationResult::Success)],2919)2920}29212922#[test]2923fn test_named_x64_to_amode_add_const_fold_iadd_lhs_lhs() {2924test_x64_rule_with_lhs_termname_simple(2925"to_amode_add_const_fold_iadd_lhs_lhs",2926"to_amode_add",2927vec![(Bitwidth::I64, VerificationResult::Success)],2928)2929}29302931#[test]2932fn test_named_x64_to_amode_add_const_fold_iadd_rhs_rhs() {2933test_x64_rule_with_lhs_termname_simple(2934"to_amode_add_const_fold_iadd_rhs_rhs",2935"to_amode_add",2936vec![(Bitwidth::I64, VerificationResult::Success)],2937)2938}29392940#[test]2941fn test_named_x64_to_amode_add_const_fold_iadd_rhs_lhs() {2942test_x64_rule_with_lhs_termname_simple(2943"to_amode_add_const_fold_iadd_rhs_lhs",2944"to_amode_add",2945vec![(Bitwidth::I64, VerificationResult::Success)],2946)2947}29482949#[test]2950fn test_named_x64_amode_imm_reg_base() {2951test_x64_rule_with_lhs_termname_simple(2952"amode_imm_reg_base",2953"amode_imm_reg",2954vec![(Bitwidth::I64, VerificationResult::Success)],2955)2956}29572958#[test]2959fn test_named_x64_amode_imm_reg_iadd() {2960test_x64_rule_with_lhs_termname_simple(2961"amode_imm_reg_iadd",2962"amode_imm_reg",2963vec![(Bitwidth::I64, VerificationResult::Success)],2964)2965}29662967#[test]2968fn test_named_x64_amode_imm_reg_reg_shift_no_shift() {2969test_x64_rule_with_lhs_termname_simple(2970"amode_imm_reg_reg_shift_no_shift",2971"amode_imm_reg_reg_shift",2972vec![(Bitwidth::I64, VerificationResult::Success)],2973)2974}29752976#[test]2977fn test_named_x64_amode_imm_reg_reg_shift_shl_rhs() {2978test_x64_rule_with_lhs_termname_simple(2979"amode_imm_reg_reg_shift_shl_rhs",2980"amode_imm_reg_reg_shift",2981vec![(Bitwidth::I64, VerificationResult::Success)],2982)2983}29842985#[test]2986fn test_named_x64_amode_imm_reg_reg_shift_shl_lhs() {2987test_x64_rule_with_lhs_termname_simple(2988"amode_imm_reg_reg_shift_shl_lhs",2989"amode_imm_reg_reg_shift",2990vec![(Bitwidth::I64, VerificationResult::Success)],2991)2992}29932994#[test]2995fn test_named_load_i8_aarch64_uload8() {2996test_aarch64_rule_with_lhs_termname_simple(2997"load_i8_aarch64_uload8",2998"load",2999vec![3000(Bitwidth::I8, VerificationResult::Success),3001(Bitwidth::I16, VerificationResult::InapplicableRule),3002(Bitwidth::I32, VerificationResult::InapplicableRule),3003(Bitwidth::I64, VerificationResult::InapplicableRule),3004],3005)3006}30073008#[test]3009fn test_named_load_i16_aarch64_uload16() {3010test_aarch64_rule_with_lhs_termname_simple(3011"load_i16_aarch64_uload16",3012"load",3013vec![3014(Bitwidth::I8, VerificationResult::InapplicableRule),3015(Bitwidth::I16, VerificationResult::Success),3016(Bitwidth::I32, VerificationResult::InapplicableRule),3017(Bitwidth::I64, VerificationResult::InapplicableRule),3018],3019)3020}30213022#[test]3023fn test_named_load_i32_aarch64_uload32() {3024test_aarch64_rule_with_lhs_termname_simple(3025"load_i32_aarch64_uload32",3026"load",3027vec![3028(Bitwidth::I8, VerificationResult::InapplicableRule),3029(Bitwidth::I16, VerificationResult::InapplicableRule),3030(Bitwidth::I32, VerificationResult::Success),3031(Bitwidth::I64, VerificationResult::InapplicableRule),3032],3033)3034}30353036#[test]3037fn test_named_load_i64_aarch64_uload64() {3038test_aarch64_rule_with_lhs_termname_simple(3039"load_i64_aarch64_uload64",3040"load",3041vec![3042(Bitwidth::I8, VerificationResult::InapplicableRule),3043(Bitwidth::I16, VerificationResult::InapplicableRule),3044(Bitwidth::I32, VerificationResult::InapplicableRule),3045(Bitwidth::I64, VerificationResult::Success),3046],3047)3048}30493050#[test]3051fn test_named_store_i8_aarch64_store8() {3052test_aarch64_rule_with_lhs_termname_simple(3053"store_i8_aarch64_store8",3054"store",3055vec![3056(Bitwidth::I8, VerificationResult::Success),3057(Bitwidth::I16, VerificationResult::InapplicableRule),3058(Bitwidth::I32, VerificationResult::InapplicableRule),3059(Bitwidth::I64, VerificationResult::InapplicableRule),3060],3061)3062}30633064#[test]3065fn test_named_store_i16_aarch64_store16() {3066test_aarch64_rule_with_lhs_termname_simple(3067"store_i16_aarch64_store16",3068"store",3069vec![3070(Bitwidth::I8, VerificationResult::InapplicableRule),3071(Bitwidth::I16, VerificationResult::Success),3072(Bitwidth::I32, VerificationResult::InapplicableRule),3073(Bitwidth::I64, VerificationResult::InapplicableRule),3074],3075)3076}30773078#[test]3079fn test_named_store_i32_aarch64_store32() {3080test_aarch64_rule_with_lhs_termname_simple(3081"store_i32_aarch64_store32",3082"store",3083vec![3084(Bitwidth::I8, VerificationResult::InapplicableRule),3085(Bitwidth::I16, VerificationResult::InapplicableRule),3086(Bitwidth::I32, VerificationResult::Success),3087(Bitwidth::I64, VerificationResult::InapplicableRule),3088],3089)3090}30913092#[test]3093fn test_named_store_i64_aarch64_store64() {3094test_aarch64_rule_with_lhs_termname_simple(3095"store_i64_aarch64_store64",3096"store",3097vec![3098(Bitwidth::I8, VerificationResult::InapplicableRule),3099(Bitwidth::I16, VerificationResult::InapplicableRule),3100(Bitwidth::I32, VerificationResult::InapplicableRule),3101(Bitwidth::I64, VerificationResult::Success),3102],3103)3104}31053106#[test]3107fn test_named_load_sub64_x64_movzx() {3108test_x64_rule_with_lhs_termname_simple(3109"load_sub64_x64_movzx",3110"load",3111vec![3112(Bitwidth::I8, VerificationResult::Success),3113(Bitwidth::I16, VerificationResult::Success),3114(Bitwidth::I32, VerificationResult::Success),3115(Bitwidth::I64, VerificationResult::InapplicableRule),3116],3117)3118}31193120#[test]3121fn test_named_store_x64_add_mem() {3122test_x64_rule_with_lhs_termname_simple(3123"store_x64_add_mem",3124"store",3125vec![3126(Bitwidth::I8, VerificationResult::InapplicableRule),3127(Bitwidth::I16, VerificationResult::InapplicableRule),3128(Bitwidth::I32, VerificationResult::Success),3129(Bitwidth::I64, VerificationResult::Success),3130],3131)3132}3133#[test]3134fn test_named_store_x64_movrm() {3135test_x64_rule_with_lhs_termname_simple(3136"store_x64_movrm",3137"store",3138vec![3139(Bitwidth::I8, VerificationResult::Success),3140(Bitwidth::I16, VerificationResult::Success),3141(Bitwidth::I32, VerificationResult::Success),3142(Bitwidth::I64, VerificationResult::Success),3143],3144)3145}31463147#[test]3148fn test_load_conditional() {3149test_from_file_with_lhs_termname_simple(3150"./examples/load/load_conditional.isle",3151"lhs".to_string(),3152vec![3153(Bitwidth::I8, VerificationResult::Success),3154(Bitwidth::I16, VerificationResult::Success),3155(Bitwidth::I32, VerificationResult::Success),3156(Bitwidth::I64, VerificationResult::Success),3157],3158);3159}31603161#[test]3162fn test_store_switch() {3163test_from_file_with_lhs_termname_simple(3164"./examples/store/store_switch.isle",3165"lhs".to_string(),3166vec![3167(Bitwidth::I8, VerificationResult::Success),3168(Bitwidth::I16, VerificationResult::Success),3169(Bitwidth::I32, VerificationResult::Success),3170(Bitwidth::I64, VerificationResult::Success),3171],3172);3173}31743175#[test]3176#[should_panic]3177fn test_load_add_panic() {3178test_from_file_with_lhs_termname_simple(3179"./examples/load/load_add_panic.isle",3180"lhs".to_string(),3181all_failure_result(),3182);3183}31843185#[test]3186fn test_broken_isub_store_with_load() {3187test_from_file_with_lhs_termname_simple(3188"./examples/store/broken_isub_store_with_load.isle",3189"store".to_string(),3190vec![3191(Bitwidth::I8, VerificationResult::InapplicableRule),3192(Bitwidth::I16, VerificationResult::InapplicableRule),3193(3194Bitwidth::I32,3195VerificationResult::Failure(Counterexample {}),3196),3197(3198Bitwidth::I64,3199VerificationResult::Failure(Counterexample {}),3200),3201],3202);3203}32043205#[test]3206fn test_broken_bvsub_store_with_load() {3207test_from_file_with_lhs_termname_simple(3208"./examples/store/broken_bvsub_store_with_load.isle",3209"store".to_string(),3210vec![3211(Bitwidth::I8, VerificationResult::InapplicableRule),3212(Bitwidth::I16, VerificationResult::InapplicableRule),3213(3214Bitwidth::I32,3215VerificationResult::Failure(Counterexample {}),3216),3217(3218Bitwidth::I64,3219VerificationResult::Failure(Counterexample {}),3220),3221],3222);3223}322432253226