@@ -20,8 +20,8 @@ fn simple() {
20
20
// CHECK: [[e]] = const E::V1(0_i32);
21
21
let e = E :: V1 ( 0 ) ;
22
22
23
- // CHECK: switchInt(const 0_isize) -> [0: bb [[target_bb:[0-9]+ ]], 1: bb1, otherwise: bb2];
24
- // CHECK: bb [[target_bb]]: {
23
+ // CHECK: switchInt(const 0_isize) -> [0: [[target_bb:bb.* ]], 1: bb1, otherwise: bb2];
24
+ // CHECK: [[target_bb]]: {
25
25
// CHECK: [[x]] = const 0_i32;
26
26
let x = match e { E :: V1 ( x1) => x1, E :: V2 ( x2) => x2 } ;
27
27
}
@@ -36,8 +36,8 @@ fn constant() {
36
36
37
37
// CHECK: [[e]] = const _;
38
38
let e = C ;
39
- // CHECK: switchInt(const 0_isize) -> [0: bb [[target_bb:[0-9]+ ]], 1: bb1, otherwise: bb2];
40
- // CHECK: bb [[target_bb]]: {
39
+ // CHECK: switchInt(const 0_isize) -> [0: [[target_bb:bb.* ]], 1: bb1, otherwise: bb2];
40
+ // CHECK: [[target_bb]]: {
41
41
// CHECK: [[x]] = const 0_i32;
42
42
let x = match e { E :: V1 ( x1) => x1, E :: V2 ( x2) => x2 } ;
43
43
}
@@ -55,8 +55,8 @@ fn statics() {
55
55
56
56
// CHECK: [[e1]] = const E::V1(0_i32);
57
57
let e1 = C ;
58
- // CHECK: switchInt(const 0_isize) -> [0: bb[[target_bb1:[0-9]+ ]], 1: bb1, otherwise: bb2];
59
- // CHECK: bb [[target_bb]]: {
58
+ // CHECK: switchInt(const 0_isize) -> [0: [[target_bb:bb.* ]], 1: bb1, otherwise: bb2];
59
+ // CHECK: [[target_bb]]: {
60
60
// CHECK: [[x1]] = const 0_i32;
61
61
let x1 = match e1 { E :: V1 ( x11) => x11, E :: V2 ( x12) => x12 } ;
62
62
@@ -65,7 +65,8 @@ fn statics() {
65
65
// CHECK: [[t:_.*]] = const {alloc2: &&E};
66
66
// CHECK: [[e2]] = (*[[t]]);
67
67
let e2 = RC ;
68
- // CHECK: switchInt(move _{{[0-9]+}}) -> [0: bb{{[0-9]+}}, 1: bb{{[0-9]+}}, otherwise: bb{{[0-9]+}}];
68
+
69
+ // CHECK: switchInt({{move _.*}}) -> {{.*}}
69
70
// FIXME: add checks for x2. Currently, their MIRs are not symmetric in the two
70
71
// switch branches.
71
72
// One is `_9 = &(*_12) and another is `_9 = _11`. It is different from what we can
@@ -91,10 +92,10 @@ fn mutate_discriminant() -> u8 {
91
92
place!( Field ( Field ( Variant ( x, 1 ) , 0 ) , 0 ) ) = 0_usize ;
92
93
// So we cannot know the value of this discriminant.
93
94
94
- // CHECK: [[a:_.*]] = discriminant(_{{[0-9] *}});
95
+ // CHECK: [[a:_.*]] = discriminant({{_. *}});
95
96
let a = Discriminant ( x) ;
96
97
97
- // CHECK: switchInt([[a]]) -> [0: bb{{[0-9]+ }}, otherwise: bb{{[0-9]+ }}];
98
+ // CHECK: switchInt([[a]]) -> [0: {{bb.* }}, otherwise: {{bb.* }}];
98
99
match a {
99
100
0 => bb1,
100
101
_ => bad,
@@ -118,7 +119,7 @@ fn multiple(x: bool, i: u8) {
118
119
// CHECK: debug e => [[e:_.*]];
119
120
// CHECK: debug x2 => [[x2:_.*]];
120
121
let e = if x {
121
- // CHECK: [[e]] = Option::<u8>::Some(move _{{[0-9]+ }});
122
+ // CHECK: [[e]] = Option::<u8>::Some(move {{_.* }});
122
123
Some ( i)
123
124
} else {
124
125
// CHECK: [[e]] = Option::<u8>::None;
@@ -128,7 +129,7 @@ fn multiple(x: bool, i: u8) {
128
129
// discriminant(e) => Top
129
130
// (e as Some).0 => Top
130
131
// CHECK: [[x2]] = const 0_u8;
131
- // CHECK: [[x2]] = _{{[0-9]+}}
132
+ // CHECK: [[x2]] = {{_.*}};
132
133
let x2 = match e { Some ( i) => i, None => 0 } ;
133
134
// Therefore, `x2` should be `Top` here, and no replacement shall happen.
134
135
let y = x2;
0 commit comments