MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / qemu_05_functions_and_io

Function qemu_05_functions_and_io

tests/integration/vm_execution.rs:1055–1062  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1053
1054#[test]
1055fn test_divide() {
1056 // 100 / 4 = 25
1057 let (_, outcome) = assemble_and_run(vec![
1058 ri(RealInstruction::Addi(Addi::new(11, 0, 100))), // a1 = 100
1059 ri(RealInstruction::Addi(Addi::new(12, 0, 4))), // a2 = 4
1060 ri(RealInstruction::Div(Div::new(10, 11, 12))), // a0 = 100 / 4 = 25
1061 ri(RealInstruction::Addi(Addi::new(17, 0, 93))), // a7 = 93
1062 ri(RealInstruction::Ecall(Ecall::new())),
1063 ]);
1064 assert!(
1065 matches!(outcome, StepOutcome::Halted(25)),

Callers

nothing calls this directly

Calls 1

run_hll_fileFunction · 0.85

Tested by

no test coverage detected