]> git.lizzy.rs Git - rust.git/blob - tests/ui/mir/mir_codegen_ssa.rs
Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
[rust.git] / tests / ui / mir / mir_codegen_ssa.rs
1 // build-pass
2 // compile-flags: --crate-type=lib
3 #![feature(custom_mir, core_intrinsics)]
4 use std::intrinsics::mir::*;
5
6 #[custom_mir(dialect = "runtime", phase = "optimized")]
7 pub fn f(a: u32) -> u32 {
8     mir!(
9         let x: u32;
10         {
11             // Previously code generation failed with ICE "use of .. before def ..." because the
12             // definition of x was incorrectly identified as dominating the use of x located in the
13             // same statement:
14             x = x + a;
15             RET = x;
16             Return()
17         }
18     )
19 }