()
| 1053 | |
| 1054 | #[test] |
| 1055 | fn 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)), |
nothing calls this directly
no test coverage detected