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

Function global_i64_write_large_value

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

Source from the content-addressed store, hash-verified

1457// Expected values are built from safe (<= 2047) operands so the comparison
1458// target is not affected by the same bug under test.
1459
1460/// 42 - exercises the ADDI-only path (value in [-2048, 2047]).
1461#[test]
1462fn li_small_positive() {
1463 let (_, outcome, _) = run_hll(
1464 r#"
1465main: () -> i32 {
1466 v: i32 = 42
1467 if v == 42 {
1468 return 0
1469 }
1470 return 1
1471}
1472"#,
1473 );
1474 assert!(
1475 matches!(outcome, RunOutcome::Halted(0)),
1476 "li 42 should load 42, got {outcome:?}"
1477 );
1478}
1479
1480/// 2047 - last value that fits in a single ADDI.
1481#[test]
1482fn li_boundary_2047() {
1483 let (_, outcome, _) = run_hll(

Callers

nothing calls this directly

Calls 1

run_hllFunction · 0.70

Tested by

no test coverage detected