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) {
118
118
// CHECK: debug x => [[x:_.*]];
119
119
// CHECK: debug e => [[e:_.*]];
120
120
// CHECK: debug x2 => [[x2:_.*]];
121
+ // CHECK: debug y => [[y:_.*]];
121
122
let e = if x {
122
123
// CHECK: [[e]] = Option::<u8>::Some(move {{_.*}});
123
124
Some ( i)
@@ -128,10 +129,18 @@ fn multiple(x: bool, i: u8) {
128
129
// The dataflow state must have:
129
130
// discriminant(e) => Top
130
131
// (e as Some).0 => Top
132
+ // CHECK-NOT: [[x2]] = const 5
131
133
// CHECK: [[x2]] = const 0_u8;
132
- // CHECK: [[x2]] = {{_.*}};
134
+ // CHECK-NOT: [[x2]] = const 5
135
+ // CHECK: [[some:_.*]] = (({{_.*}} as Some
136
+ // CHECK: [[x2]] = [[some]];
133
137
let x2 = match e { Some ( i) => i, None => 0 } ;
138
+
134
139
// 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
135
144
let y = x2;
136
145
}
137
146
You can’t perform that action at this time.
0 commit comments