Skip to content

Commit 45dd5d6

Browse files
committed
FileCheck mutable_variable_unprop_assign.
1 parent 6a8eea8 commit 45dd5d6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
// skip-filecheck
21
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
32
// unit-test: ConstProp
43

54
// EMIT_MIR mutable_variable_unprop_assign.main.ConstProp.diff
65
fn main() {
6+
// CHECK-LABEL: fn main(
7+
// CHECK: debug a => [[a:_.*]];
8+
// CHECK: debug x => [[x:_.*]];
9+
// CHECK: debug y => [[y:_.*]];
10+
// CHECK: debug z => [[z:_.*]];
11+
// CHECK: [[a]] = foo()
12+
// CHECK: [[x]] = const (1_i32, 2_i32);
13+
// CHECK: [[tmp:_.*]] = [[a]];
14+
// CHECK: ([[x]].1: i32) = move [[tmp]];
15+
// CHECK: [[y]] = ([[x]].1: i32);
16+
// CHECK: [[z]] = const 1_i32;
717
let a = foo();
818
let mut x: (i32, i32) = (1, 2);
919
x.1 = a;
1020
let y = x.1;
11-
let z = x.0; // this could theoretically be allowed, but we can't handle it right now
21+
let z = x.0;
1222
}
1323

1424
#[inline(never)]

0 commit comments

Comments
 (0)