File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
tests/mir-opt/dataflow-const-prop Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ fn multiple(x: bool, i: u8) {
118118 // CHECK: debug x => [[x:_.*]];
119119 // CHECK: debug e => [[e:_.*]];
120120 // CHECK: debug x2 => [[x2:_.*]];
121+ // CHECK: debug y => [[y:_.*]];
121122 let e = if x {
122123 // CHECK: [[e]] = Option::<u8>::Some(move {{_.*}});
123124 Some ( i)
@@ -128,10 +129,18 @@ fn multiple(x: bool, i: u8) {
128129 // The dataflow state must have:
129130 // discriminant(e) => Top
130131 // (e as Some).0 => Top
132+ // CHECK-NOT: [[x2]] = const 5
131133 // CHECK: [[x2]] = const 0_u8;
132- // CHECK: [[x2]] = {{_.*}};
134+ // CHECK-NOT: [[x2]] = const 5
135+ // CHECK: [[some:_.*]] = (({{_.*}} as Some
136+ // CHECK: [[x2]] = [[some]];
133137 let x2 = match e { Some ( i) => i, None => 0 } ;
138+
134139 // Therefore, `x2` should be `Top` here, and no replacement shall happen.
140+
141+ // CHECK-NOT: [[y]] = const
142+ // CHECK: [[y]] = [[x2]];
143+ // CHECK-NOT: [[y]] = const
135144 let y = x2;
136145}
137146
You can’t perform that action at this time.
0 commit comments