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