Skip to content

Commit

Permalink
FileCheck mutable_variable_no_prop.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Dec 2, 2023
1 parent 3e169ab commit d91bb50
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/mir-opt/const_prop/mutable_variable_no_prop.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
// skip-filecheck
// unit-test: ConstProp

// Verify that we do not propagate the contents of this mutable static.
static mut STATIC: u32 = 0x42424242;

// EMIT_MIR mutable_variable_no_prop.main.ConstProp.diff
fn main() {
// CHECK-LABEL: fn main(
// CHECK: debug x => [[x:_.*]];
// CHECK: debug y => [[y:_.*]];
// CHECK: [[x]] = const 42_u32;
// CHECK: [[tmp:_.*]] = (*{{_.*}});
// CHECK: [[x]] = move [[tmp]];
// CHECK: [[y]] = [[x]];
let mut x = 42;
unsafe {
x = STATIC;
Expand Down

0 comments on commit d91bb50

Please sign in to comment.