about summary refs log tree commit diff
path: root/src/test/mir-opt/const-promotion-extern-static.rs
blob: c9d350a98fd9c80aca4b4696f2283922bcf3440f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern "C" {
    static X: i32;
}

static Y: i32 = 42;

// EMIT_MIR rustc.BAR.PromoteTemps.diff
// EMIT_MIR rustc.BAR-promoted[0].ConstProp.after.mir
static mut BAR: *const &i32 = [&Y].as_ptr();

// EMIT_MIR rustc.FOO.PromoteTemps.diff
// EMIT_MIR rustc.FOO-promoted[0].ConstProp.after.mir
static mut FOO: *const &i32 = [unsafe { &X }].as_ptr();

fn main() {}