2023-10-16 12:36:39 -05:00
|
|
|
// skip-filecheck
|
2020-07-31 06:58:37 -05:00
|
|
|
//@ ignore-endian-big
|
2019-12-26 07:50:40 -06:00
|
|
|
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
|
2024-03-17 13:36:55 -05:00
|
|
|
// EMIT_MIR const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-pre-optimizations.after.mir
|
2020-02-15 06:13:20 -06:00
|
|
|
static mut BAR: *const &i32 = [&Y].as_ptr();
|
2019-12-26 07:50:40 -06:00
|
|
|
|
2020-07-27 14:22:43 -05:00
|
|
|
// EMIT_MIR const_promotion_extern_static.FOO.PromoteTemps.diff
|
2024-03-17 13:36:55 -05:00
|
|
|
// EMIT_MIR const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-pre-optimizations.after.mir
|
2020-02-15 06:13:20 -06:00
|
|
|
static mut FOO: *const &i32 = [unsafe { &X }].as_ptr();
|
2019-12-26 07:50:40 -06:00
|
|
|
|
2022-09-04 22:00:31 -05:00
|
|
|
// EMIT_MIR const_promotion_extern_static.BOP.built.after.mir
|
2020-12-09 04:50:34 -06:00
|
|
|
static BOP: &i32 = &13;
|
|
|
|
|
2019-12-26 07:50:40 -06:00
|
|
|
fn main() {}
|