about summary refs log tree commit diff
path: root/tests/mir-opt/const_prop/mutable_variable.rs
blob: 3aa1b1bcd2181fa19e437fe236fcab9688e9a37a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ test-mir-pass: GVN

// EMIT_MIR mutable_variable.main.GVN.diff
fn main() {
    // CHECK-LABEL: fn main(
    // CHECK: debug x => [[x:_.*]];
    // CHECK: debug y => [[y:_.*]];
    // CHECK: [[x]] = const 42_i32;
    // CHECK: [[x]] = const 99_i32;
    // CHECK: [[y]] = copy [[x]];
    let mut x = 42;
    x = 99;
    let y = x;
}