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

Function hll_new_and_free_basic

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

Source from the content-addressed store, hash-verified

984}
985
986#[test]
987fn test_subtract() {
988 // 100 - 37 = 63
989 let (_, outcome) = assemble_and_run(vec![
990 ri(RealInstruction::Addi(Addi::new(11, 0, 100))), // a1 = 100
991 ri(RealInstruction::Addi(Addi::new(12, 0, 37))), // a2 = 37
992 ri(RealInstruction::Sub(Sub::new(10, 11, 12))), // a0 = 100 - 37 = 63
993 ri(RealInstruction::Addi(Addi::new(17, 0, 93))), // a7 = 93
994 ri(RealInstruction::Ecall(Ecall::new())),
995 ]);
996 assert!(
997 matches!(outcome, StepOutcome::Halted(63)),
998 "expected Halted(63), got {outcome:?}"
999 );
1000}
1001
1002#[test]
1003fn test_memory_store_load() {
1004 // t0=x5, t1=x6, sp=x2, a0=x10, a7=x17
1005 // Store 99 to stack scratch space, load it back into a0, exit with it.

Callers

nothing calls this directly

Calls 1

run_hllFunction · 0.70

Tested by

no test coverage detected