]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const-promotion-extern-static.rs
Fix wrong argument in autoderef process
[rust.git] / src / test / mir-opt / const-promotion-extern-static.rs
1 extern "C" {
2     static X: i32;
3 }
4
5 static Y: i32 = 42;
6
7 // EMIT_MIR rustc.BAR.PromoteTemps.diff
8 // EMIT_MIR rustc.BAR-promoted[0].ConstProp.after.mir
9 static mut BAR: *const &i32 = [&Y].as_ptr();
10
11 // EMIT_MIR rustc.FOO.PromoteTemps.diff
12 // EMIT_MIR rustc.FOO-promoted[0].ConstProp.after.mir
13 static mut FOO: *const &i32 = [unsafe { &X }].as_ptr();
14
15 fn main() {}