From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/mir-opt/const_promotion_extern_static.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/mir-opt/const_promotion_extern_static.rs (limited to 'tests/mir-opt/const_promotion_extern_static.rs') diff --git a/tests/mir-opt/const_promotion_extern_static.rs b/tests/mir-opt/const_promotion_extern_static.rs new file mode 100644 index 000000000..e4261cfe5 --- /dev/null +++ b/tests/mir-opt/const_promotion_extern_static.rs @@ -0,0 +1,18 @@ +// ignore-endian-big +extern "C" { + static X: i32; +} +static Y: i32 = 42; + +// EMIT_MIR const_promotion_extern_static.BAR.PromoteTemps.diff +// EMIT_MIR const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir +static mut BAR: *const &i32 = [&Y].as_ptr(); + +// EMIT_MIR const_promotion_extern_static.FOO.PromoteTemps.diff +// 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() {} -- cgit v1.2.3