# mir_passes @preserve "test:main" {} @preserve "test:prop" { # Test propagation of register values to conditions let a: score = val 4s; if gt sco "foo" "bar", %a: say "hello"; # Test for propagating the value of a register # that is checked for eq or bool in the if let add: score = val 10s; let x: score = val sco @s[] "foo"; if eq %x, 15s: add %add, %x; let y: bool = cast bool sco @s[] "bar"; if bool %y: mul %add, %y; # Make sure that the value propagated inside the if doesn't # leak out afterwards add %add, %y; # Let cond pattern let left: score = val 100s; let right: score = val 100s; let equal: bool = cond eq %left, %right; use %equal; let nequal: bool = cond not eq %left, %right; use %nequal; } @preserve "test:partial" { # Test partial evaluation of inner conditions let x: score = val 6s; if and eq %x, 6s, pred "foo:bar": say "hello"; }