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

Function hll_compound_assignment_all_operators

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

Source from the content-addressed store, hash-verified

470}
471
472// A program with disjoint branches and locals: lots of per-vreg store/reload
473// churn for the peephole to clean up, while exercising real control flow.
474const PEEPHOLE_PROGRAM: &str = r#"
475compute: (n: i64) -> i64 {
476 a: i64 = n + 1
477 b: i64 = a * 2
478 c: i64 = 0
479 if b > 10 {
480 c = b - a
481 } else {
482 c = a + b
483 }
484 d: i64 = c + a
485 return d
486}
487
488main: () -> i32 {
489 total: i64 = 0
490 i: i64 = 0
491 while i < 5 {
492 total = total + compute(i)
493 i = i + 1
494 }
495 return total as i32
496}
497"#;
498
499#[test]
500fn peephole_preserves_behavior_and_shrinks_code() {

Callers

nothing calls this directly

Calls 1

run_hllFunction · 0.70

Tested by

no test coverage detected