]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/const_promotion_extern_static.rs
Rollup merge of #106992 - joboet:alloc_remove_box_syntax, r=thomcc
[rust.git] / tests / mir-opt / const_promotion_extern_static.rs
1 // ignore-endian-big
2 extern "C" {
3     static X: i32;
4 }
5 static Y: i32 = 42;
6
7 // EMIT_MIR const_promotion_extern_static.BAR.PromoteTemps.diff
8 // EMIT_MIR const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir
9 static mut BAR: *const &i32 = [&Y].as_ptr();
10
11 // EMIT_MIR const_promotion_extern_static.FOO.PromoteTemps.diff
12 // EMIT_MIR const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir
13 static mut FOO: *const &i32 = [unsafe { &X }].as_ptr();
14
15 // EMIT_MIR const_promotion_extern_static.BOP.built.after.mir
16 static BOP: &i32 = &13;
17
18 fn main() {}