diff --git a/tests/machine_build.rs b/tests/machine_build.rs index 74e0c9b2..ff73ab71 100644 --- a/tests/machine_build.rs +++ b/tests/machine_build.rs @@ -29,47 +29,6 @@ impl Syscalls for SleepSyscall { } } -#[cfg(has_asm)] -pub fn asm_v1_imcb(path: &str) -> AsmMachine { - let buffer: Bytes = std::fs::read(path).unwrap().into(); - let asm_core = AsmCoreMachine::new(ISA_IMC | ISA_B, VERSION1, u64::MAX); - let core = DefaultMachineBuilder::>::new(asm_core) - .instruction_cycle_func(Box::new(constant_cycles)) - .syscall(Box::new(SleepSyscall {})) - .build(); - let mut machine = AsmMachine::new(core); - machine - .load_program(&buffer, &vec![Bytes::from("main")]) - .unwrap(); - machine -} - -pub fn int_v1_imcb( - path: &str, -) -> TraceMachine>>> { - let buffer: Bytes = std::fs::read(path).unwrap().into(); - let core_machine = DefaultCoreMachine::>>::new( - ISA_IMC | ISA_B, - VERSION1, - u64::MAX, - ); - let mut machine = TraceMachine::new( - DefaultMachineBuilder::new(core_machine) - .instruction_cycle_func(Box::new(constant_cycles)) - .syscall(Box::new(SleepSyscall {})) - .build(), - ); - machine - .load_program(&buffer, &vec![Bytes::from("main")]) - .unwrap(); - machine -} - -#[cfg(has_asm)] -pub fn asm_v1_mop(path: &str, args: Vec) -> AsmMachine { - asm_mop(path, args, VERSION1) -} - #[cfg(has_asm)] pub fn asm_mop(path: &str, args: Vec, version: u32) -> AsmMachine { let buffer: Bytes = std::fs::read(path).unwrap().into(); @@ -150,3 +109,39 @@ pub fn int_v2_imacb( .unwrap(); machine } + +#[cfg(has_asm)] +pub fn asm(path: &str, args: Vec, version: u32, isa: u8) -> AsmMachine { + let buffer: Bytes = std::fs::read(path).unwrap().into(); + let asm_core = AsmCoreMachine::new(isa, version, u64::MAX); + let core = DefaultMachineBuilder::>::new(asm_core) + .instruction_cycle_func(Box::new(constant_cycles)) + .syscall(Box::new(SleepSyscall {})) + .build(); + let mut machine = AsmMachine::new(core); + let mut argv = vec![Bytes::from("main")]; + argv.extend_from_slice(&args); + machine.load_program(&buffer, &argv).unwrap(); + machine +} + +pub fn int( + path: &str, + args: Vec, + version: u32, + isa: u8, +) -> TraceMachine>>> { + let buffer: Bytes = std::fs::read(path).unwrap().into(); + let core_machine = + DefaultCoreMachine::>>::new(isa, version, u64::MAX); + let mut machine = TraceMachine::new( + DefaultMachineBuilder::new(core_machine) + .instruction_cycle_func(Box::new(constant_cycles)) + .syscall(Box::new(SleepSyscall {})) + .build(), + ); + let mut argv = vec![Bytes::from("main")]; + argv.extend_from_slice(&args); + machine.load_program(&buffer, &argv).unwrap(); + machine +} diff --git a/tests/test_b_extension.rs b/tests/test_b_extension.rs index 24a2a4ea..bab7d931 100644 --- a/tests/test_b_extension.rs +++ b/tests/test_b_extension.rs @@ -1,15 +1,19 @@ +use ckb_vm::{machine::VERSION1, ISA_B, ISA_IMC}; + pub mod machine_build; #[test] pub fn test_clzw_bug() { - let mut machine = machine_build::int_v1_imcb("tests/programs/clzw_bug"); + let mut machine = + machine_build::int("tests/programs/clzw_bug", vec![], VERSION1, ISA_IMC | ISA_B); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_imcb("tests/programs/clzw_bug"); + let mut machine_asm = + machine_build::asm("tests/programs/clzw_bug", vec![], VERSION1, ISA_IMC | ISA_B); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -18,14 +22,24 @@ pub fn test_clzw_bug() { #[test] pub fn test_sbinvi_aot_load_imm_bug() { - let mut machine = machine_build::int_v1_imcb("tests/programs/sbinvi_aot_load_imm_bug"); + let mut machine = machine_build::int( + "tests/programs/sbinvi_aot_load_imm_bug", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_imcb("tests/programs/sbinvi_aot_load_imm_bug"); + let mut machine_asm = machine_build::asm( + "tests/programs/sbinvi_aot_load_imm_bug", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -35,14 +49,24 @@ pub fn test_sbinvi_aot_load_imm_bug() { #[test] pub fn test_rorw_in_end_of_aot_block() { // The 1024th instruction will use one more temporary register than normal. - let mut machine = machine_build::int_v1_imcb("tests/programs/rorw_in_end_of_aot_block"); + let mut machine = machine_build::int( + "tests/programs/rorw_in_end_of_aot_block", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_imcb("tests/programs/rorw_in_end_of_aot_block"); + let mut machine_asm = machine_build::asm( + "tests/programs/rorw_in_end_of_aot_block", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -51,14 +75,15 @@ pub fn test_rorw_in_end_of_aot_block() { #[test] pub fn test_pcnt() { - let mut machine = machine_build::int_v1_imcb("tests/programs/pcnt"); + let mut machine = machine_build::int("tests/programs/pcnt", vec![], VERSION1, ISA_IMC | ISA_B); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_imcb("tests/programs/pcnt"); + let mut machine_asm = + machine_build::asm("tests/programs/pcnt", vec![], VERSION1, ISA_IMC | ISA_B); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -67,14 +92,24 @@ pub fn test_pcnt() { #[test] pub fn test_clmul_bug() { - let mut machine = machine_build::int_v1_imcb("tests/programs/clmul_bug"); + let mut machine = machine_build::int( + "tests/programs/clmul_bug", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_imcb("tests/programs/clmul_bug"); + let mut machine_asm = machine_build::asm( + "tests/programs/clmul_bug", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -83,14 +118,16 @@ pub fn test_clmul_bug() { #[test] pub fn test_orc_bug() { - let mut machine = machine_build::int_v1_imcb("tests/programs/orc_bug"); + let mut machine = + machine_build::int("tests/programs/orc_bug", vec![], VERSION1, ISA_IMC | ISA_B); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_imcb("tests/programs/orc_bug"); + let mut machine_asm = + machine_build::asm("tests/programs/orc_bug", vec![], VERSION1, ISA_IMC | ISA_B); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); diff --git a/tests/test_dy_memory.rs b/tests/test_dy_memory.rs index 92d99c40..732f60ac 100644 --- a/tests/test_dy_memory.rs +++ b/tests/test_dy_memory.rs @@ -5,7 +5,7 @@ use ckb_vm::{ asm::{AsmCoreMachine, AsmMachine}, DefaultMachineBuilder, VERSION0, VERSION2, }, - ISA_A, ISA_B, ISA_IMC, ISA_MOP, + ISA_B, ISA_IMC, ISA_MOP, }; use std::fs; @@ -79,7 +79,7 @@ fn test_memory_out_of_bounds() { #[cfg(has_asm)] { let asm_core = AsmCoreMachine::new_with_memory( - ISA_IMC | ISA_A | ISA_B | ISA_MOP, + ISA_IMC | ISA_B | ISA_MOP, VERSION2, u64::MAX, memory_size, diff --git a/tests/test_misc.rs b/tests/test_misc.rs index 0f8a50a5..19e195ad 100644 --- a/tests/test_misc.rs +++ b/tests/test_misc.rs @@ -1,11 +1,11 @@ use ckb_vm::cost_model::constant_cycles; use ckb_vm::error::OutOfBoundKind; -use ckb_vm::machine::VERSION0; +use ckb_vm::machine::{VERSION0, VERSION1}; use ckb_vm::registers::{A0, A1, A2, A3, A4, A5, A7}; use ckb_vm::{ run, CoreMachine, Debugger, DefaultCoreMachine, DefaultMachineBuilder, Error, FlatMemory, Memory, Register, SparseMemory, SupportMachine, Syscalls, WXorXMemory, DEFAULT_MEMORY_SIZE, - ISA_IMC, RISCV_PAGESIZE, + ISA_B, ISA_IMC, RISCV_PAGESIZE, }; #[cfg(has_asm)] use ckb_vm_definitions::asm::AsmCoreMachine; @@ -435,14 +435,24 @@ pub fn test_outofcycles_in_syscall() { #[test] pub fn test_clang() { { - let mut machine = machine_build::int_v1_imcb("tests/programs/clang_sample"); + let mut machine = machine_build::int( + "tests/programs/clang_sample", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert!(ret.is_ok()); } #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_imcb("tests/programs/clang_sample"); + let mut machine_asm = machine_build::asm( + "tests/programs/clang_sample", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); } diff --git a/tests/test_mop.rs b/tests/test_mop.rs index ba4a914f..2e016376 100644 --- a/tests/test_mop.rs +++ b/tests/test_mop.rs @@ -1,11 +1,18 @@ pub mod machine_build; use bytes::Bytes; -use ckb_vm::{error::OutOfBoundKind, registers::A0, CoreMachine, Error, SupportMachine}; +use ckb_vm::error::OutOfBoundKind; +use ckb_vm::machine::VERSION1; +use ckb_vm::{registers::A0, CoreMachine, Error, SupportMachine, ISA_B, ISA_IMC, ISA_MOP}; #[test] #[cfg_attr(miri, ignore)] pub fn test_mop_wide_multiply() { - let mut machine = machine_build::int_v1_imcb("tests/programs/mop_wide_multiply"); + let mut machine = machine_build::int( + "tests/programs/mop_wide_multiply", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); @@ -18,7 +25,12 @@ pub fn test_mop_wide_multiply() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop("tests/programs/mop_wide_multiply", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_wide_multiply", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -29,7 +41,12 @@ pub fn test_mop_wide_multiply() { #[test] #[cfg_attr(miri, ignore)] pub fn test_mop_wide_divide() { - let mut machine = machine_build::int_v1_imcb("tests/programs/mop_wide_divide"); + let mut machine = machine_build::int( + "tests/programs/mop_wide_divide", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); @@ -42,7 +59,12 @@ pub fn test_mop_wide_divide() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop("tests/programs/mop_wide_divide", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_wide_divide", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -52,7 +74,12 @@ pub fn test_mop_wide_divide() { #[test] pub fn test_mop_far_jump() { - let mut machine = machine_build::int_v1_imcb("tests/programs/mop_far_jump"); + let mut machine = machine_build::int( + "tests/programs/mop_far_jump", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); @@ -65,7 +92,12 @@ pub fn test_mop_far_jump() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop("tests/programs/mop_far_jump", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_far_jump", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -76,7 +108,12 @@ pub fn test_mop_far_jump() { #[test] #[cfg_attr(miri, ignore)] pub fn test_mop_ld_32_constants() { - let mut machine = machine_build::int_v1_imcb("tests/programs/mop_ld_signextend_32"); + let mut machine = machine_build::int( + "tests/programs/mop_ld_signextend_32", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); @@ -88,8 +125,12 @@ pub fn test_mop_ld_32_constants() { #[cfg(has_asm)] { - let mut machine_asm = - machine_build::asm_v1_mop("tests/programs/mop_ld_signextend_32", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_ld_signextend_32", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -120,8 +161,12 @@ pub fn test_mop_secp256k1() { #[cfg(has_asm)] { - let mut machine_asm = - machine_build::asm_v1_mop("benches/data/secp256k1_bench", args.clone()); + let mut machine_asm = machine_build::asm( + "benches/data/secp256k1_bench", + args.clone(), + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -138,7 +183,8 @@ pub fn test_mop_secp256k1() { #[test] pub fn test_mop_adc() { - let mut machine = machine_build::int_v1_imcb("tests/programs/mop_adc"); + let mut machine = + machine_build::int("tests/programs/mop_adc", vec![], VERSION1, ISA_IMC | ISA_B); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); @@ -152,7 +198,12 @@ pub fn test_mop_adc() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop("tests/programs/mop_adc", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_adc", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -162,7 +213,8 @@ pub fn test_mop_adc() { #[test] pub fn test_mop_adcs() { - let mut machine = machine_build::int_v1_imcb("tests/programs/mop_adcs"); + let mut machine = + machine_build::int("tests/programs/mop_adcs", vec![], VERSION1, ISA_IMC | ISA_B); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); @@ -182,7 +234,12 @@ pub fn test_mop_adcs() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop("tests/programs/mop_adcs", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_adcs", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -198,7 +255,8 @@ pub fn test_mop_adcs() { #[test] pub fn test_mop_add3() { - let mut machine = machine_build::int_v1_imcb("tests/programs/mop_add3"); + let mut machine = + machine_build::int("tests/programs/mop_add3", vec![], VERSION1, ISA_IMC | ISA_B); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0, "Machine state: {}", machine.machine); @@ -218,7 +276,12 @@ pub fn test_mop_add3() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop("tests/programs/mop_add3", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_add3", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -234,7 +297,8 @@ pub fn test_mop_add3() { #[test] pub fn test_mop_sbb() { - let mut machine = machine_build::int_v1_imcb("tests/programs/mop_sbb"); + let mut machine = + machine_build::int("tests/programs/mop_sbb", vec![], VERSION1, ISA_IMC | ISA_B); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); @@ -248,7 +312,12 @@ pub fn test_mop_sbb() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop("tests/programs/mop_sbb", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_sbb", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -258,7 +327,8 @@ pub fn test_mop_sbb() { #[test] pub fn test_mop_sbbs() { - let mut machine = machine_build::int_v1_imcb("tests/programs/mop_sbbs"); + let mut machine = + machine_build::int("tests/programs/mop_sbbs", vec![], VERSION1, ISA_IMC | ISA_B); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0, "Machine state: {}", machine.machine); @@ -278,7 +348,12 @@ pub fn test_mop_sbbs() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop("tests/programs/mop_sbbs", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_sbbs", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -294,7 +369,12 @@ pub fn test_mop_sbbs() { #[test] pub fn test_mop_random_adc_sbb() { - let mut machine = machine_build::int_v1_imcb("tests/programs/mop_random_adc_sbb"); + let mut machine = machine_build::int( + "tests/programs/mop_random_adc_sbb", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert!(ret.is_ok()); assert_eq!(ret.unwrap(), 0); @@ -314,8 +394,12 @@ pub fn test_mop_random_adc_sbb() { #[cfg(has_asm)] { - let mut machine_asm = - machine_build::asm_v1_mop("tests/programs/mop_random_adc_sbb", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_random_adc_sbb", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -340,8 +424,12 @@ pub fn test_mop_ld_signextend_32_overflow_bug() { #[cfg(has_asm)] { - let mut machine_asm = - machine_build::asm_v1_mop("tests/programs/mop_ld_signextend_32_overflow_bug", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_ld_signextend_32_overflow_bug", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -357,7 +445,12 @@ pub fn test_mop_wide_mul_zero() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop("tests/programs/mop_wide_mul_zero", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_wide_mul_zero", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -373,7 +466,12 @@ pub fn test_mop_wide_div_zero() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop("tests/programs/mop_wide_div_zero", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_wide_div_zero", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert!(ret_asm.is_ok()); assert_eq!(ret_asm.unwrap(), 0); @@ -382,7 +480,12 @@ pub fn test_mop_wide_div_zero() { #[test] pub fn test_mop_jump_rel_version1_bug() { - let mut machine = machine_build::int_v1_imcb("tests/programs/mop_jump_rel_version1_bug"); + let mut machine = machine_build::int( + "tests/programs/mop_jump_rel_version1_bug", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert_eq!( ret, @@ -414,8 +517,12 @@ pub fn test_mop_jump_rel_version1_bug() { #[cfg(has_asm)] { - let mut machine_asm = - machine_build::asm_v1_mop("tests/programs/mop_jump_rel_version1_bug", vec![]); + let mut machine_asm = machine_build::asm( + "tests/programs/mop_jump_rel_version1_bug", + vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, + ); let ret_asm = machine_asm.run(); assert_eq!( ret_asm, @@ -439,8 +546,12 @@ pub fn test_mop_jump_rel_version1_bug() { #[test] pub fn test_mop_jump_rel_version1_reg_not_updated_bug() { - let mut machine = - machine_build::int_v1_imcb("tests/programs/mop_jump_rel_version1_reg_not_updated_bug"); + let mut machine = machine_build::int( + "tests/programs/mop_jump_rel_version1_reg_not_updated_bug", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert_eq!( ret, @@ -473,9 +584,11 @@ pub fn test_mop_jump_rel_version1_reg_not_updated_bug() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop( + let mut machine_asm = machine_build::asm( "tests/programs/mop_jump_rel_version1_reg_not_updated_bug", vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, ); let ret_asm = machine_asm.run(); assert_eq!( @@ -500,8 +613,12 @@ pub fn test_mop_jump_rel_version1_reg_not_updated_bug() { #[test] pub fn test_mop_jump_abs_version1_reg_not_updated_bug() { - let mut machine = - machine_build::int_v1_imcb("tests/programs/mop_jump_abs_version1_reg_not_updated_bug"); + let mut machine = machine_build::int( + "tests/programs/mop_jump_abs_version1_reg_not_updated_bug", + vec![], + VERSION1, + ISA_IMC | ISA_B, + ); let ret = machine.run(); assert_eq!( ret, @@ -534,9 +651,11 @@ pub fn test_mop_jump_abs_version1_reg_not_updated_bug() { #[cfg(has_asm)] { - let mut machine_asm = machine_build::asm_v1_mop( + let mut machine_asm = machine_build::asm( "tests/programs/mop_jump_abs_version1_reg_not_updated_bug", vec![], + VERSION1, + ISA_IMC | ISA_B | ISA_MOP, ); let ret_asm = machine_asm.run(); assert_eq!(