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

Function global_i32_counter

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

Source from the content-addressed store, hash-verified

1532 return 1
1533}
1534"#,
1535 );
1536 assert!(
1537 matches!(outcome, RunOutcome::Halted(0)),
1538 "li 0x7FFF_FFFF should load 2147483647, got {outcome:?}"
1539 );
1540}
1541
1542/// 0x8000_0000 - first value where LUI sign-extends; zero-extension is required.
1543#[test]
1544fn li_sign_extend_boundary() {
1545 let (_, outcome, _) = run_hll(
1546 r#"
1547main: () -> i32 {
1548 v: i64 = 2147483648
1549 a: i64 = 1048576
1550 b: i64 = 2048
1551 expected: i64 = a * b
1552 if v == expected {
1553 return 0
1554 }
1555 return 1
1556}
1557"#,
1558 );
1559 assert!(
1560 matches!(outcome, RunOutcome::Halted(0)),
1561 "li 0x8000_0000 should load 2147483648 (zero-extended), got {outcome:?}"
1562 );

Callers

nothing calls this directly

Calls 1

run_hllFunction · 0.70

Tested by

no test coverage detected