//! returns: 0 // Tests for block parameters (phi nodes). // Block parameters are generated when different branches assign // different values to a variable that's used after the merge point. @default fn main() -> i32 { // Simple `if-else` with variable assignment. let t: bool = true; let mut x: i32 = 0; if t { x = 1; } else { x = 2; } assert x == 1; // `if-else` with `false` condition. let f: bool = false; if f { x = 10; } else { x = 20; } assert x == 20; // `if-else` chain. let a: i32 = 5; if a == 3 { x = 100; } else if a == 5 { x = 200; } else { x = 300; } assert x == 200; return 0; }