zig/test/behavior/bugs/10970.zig
Veikka Tuominen 63788b2a51 stage2: change how stale store_to_block_ptrs are detected
Instead of explicitly setting lhs to .none,
check if the lhs instruction was analyzed.
This simpler approach also handles stores from nested blocks correctly.
2022-02-24 18:32:08 -05:00

16 lines
243 B
Zig

const builtin = @import("builtin");
fn retOpt() ?u32 {
return null;
}
test {
var cond = true;
const opt = while (cond) {
if (retOpt()) |opt| {
break opt;
}
break 1;
} else 2;
_ = opt;
}