rust/tests/mir-opt/const_promotion_extern_static.rs

19 lines
599 B
Rust
Raw Normal View History

// ignore-endian-big
extern "C" {
static X: i32;
}
static Y: i32 = 42;
2020-07-27 14:22:43 -05:00
// EMIT_MIR const_promotion_extern_static.BAR.PromoteTemps.diff
2020-10-20 10:00:55 -05:00
// EMIT_MIR const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir
static mut BAR: *const &i32 = [&Y].as_ptr();
2020-07-27 14:22:43 -05:00
// EMIT_MIR const_promotion_extern_static.FOO.PromoteTemps.diff
2020-10-20 10:00:55 -05:00
// EMIT_MIR const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir
static mut FOO: *const &i32 = [unsafe { &X }].as_ptr();
// EMIT_MIR const_promotion_extern_static.BOP.built.after.mir
static BOP: &i32 = &13;
fn main() {}