diff options
Diffstat (limited to 'src/test/mir-opt/const_prop/mutable_variable_no_prop.rs')
-rw-r--r-- | src/test/mir-opt/const_prop/mutable_variable_no_prop.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/mir-opt/const_prop/mutable_variable_no_prop.rs b/src/test/mir-opt/const_prop/mutable_variable_no_prop.rs new file mode 100644 index 000000000..4126fb3c6 --- /dev/null +++ b/src/test/mir-opt/const_prop/mutable_variable_no_prop.rs @@ -0,0 +1,12 @@ +// compile-flags: -O + +static mut STATIC: u32 = 42; + +// EMIT_MIR mutable_variable_no_prop.main.ConstProp.diff +fn main() { + let mut x = 42; + unsafe { + x = STATIC; + } + let y = x; +} |