Skip to content

Commit 9b95944

Browse files
authored
Mask unexpected inst ids (#6295)
Just more anti-churn work.
1 parent ec3f7dd commit 9b95944

File tree

6 files changed

+24
-23
lines changed

6 files changed

+24
-23
lines changed

toolchain/check/testdata/if_expr/fail_not_in_function.carbon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn F() {
130130
// CHECK:STDOUT: %true: bool = bool_literal true [concrete]
131131
// CHECK:STDOUT: }
132132
// CHECK:STDOUT:
133-
// CHECK:STDOUT: generic class @C(<unexpected>.inst68000014.loc4_14: type) {
133+
// CHECK:STDOUT: generic class @C(<unexpected>.inst{{[0-9A-F]+}}.loc4_14: type) {
134134
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
135135
// CHECK:STDOUT:
136136
// CHECK:STDOUT: !definition:
@@ -145,7 +145,7 @@ fn F() {
145145
// CHECK:STDOUT: }
146146
// CHECK:STDOUT:
147147
// CHECK:STDOUT: class @B {
148-
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, <unexpected>.inst68000019.loc4_24 [concrete = constants.%C.generic]
148+
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, <unexpected>.inst{{[0-9A-F]+}}.loc4_24 [concrete = constants.%C.generic]
149149
// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
150150
// CHECK:STDOUT: if %true br !if.expr.then else br !if.expr.else
151151
// CHECK:STDOUT: complete_type_witness = invalid

toolchain/check/testdata/interface/require.carbon

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fn F(T:! Z) {
185185
// CHECK:STDOUT:
186186
// CHECK:STDOUT: interface @Z {
187187
// CHECK:STDOUT: !members:
188-
// CHECK:STDOUT: .Self = <unexpected>.inst6000001D
188+
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
189189
// CHECK:STDOUT: witness = invalid
190190
// CHECK:STDOUT: }
191191
// CHECK:STDOUT:
@@ -196,7 +196,7 @@ fn F(T:! Z) {
196196
// CHECK:STDOUT:
197197
// CHECK:STDOUT: interface @Z {
198198
// CHECK:STDOUT: !members:
199-
// CHECK:STDOUT: .Self = <unexpected>.inst5000001D
199+
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
200200
// CHECK:STDOUT: witness = invalid
201201
// CHECK:STDOUT: }
202202
// CHECK:STDOUT:
@@ -207,7 +207,7 @@ fn F(T:! Z) {
207207
// CHECK:STDOUT:
208208
// CHECK:STDOUT: interface @Z {
209209
// CHECK:STDOUT: !members:
210-
// CHECK:STDOUT: .Self = <unexpected>.inst68000023
210+
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
211211
// CHECK:STDOUT: witness = invalid
212212
// CHECK:STDOUT: }
213213
// CHECK:STDOUT:
@@ -218,7 +218,7 @@ fn F(T:! Z) {
218218
// CHECK:STDOUT:
219219
// CHECK:STDOUT: interface @Z {
220220
// CHECK:STDOUT: !members:
221-
// CHECK:STDOUT: .Self = <unexpected>.inst5800001A
221+
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
222222
// CHECK:STDOUT: witness = invalid
223223
// CHECK:STDOUT: }
224224
// CHECK:STDOUT:
@@ -228,12 +228,12 @@ fn F(T:! Z) {
228228
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
229229
// CHECK:STDOUT: }
230230
// CHECK:STDOUT:
231-
// CHECK:STDOUT: generic interface @Z(<unexpected>.inst78000017.loc6_13: type) {
231+
// CHECK:STDOUT: generic interface @Z(<unexpected>.inst{{[0-9A-F]+}}.loc6_13: type) {
232232
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
233233
// CHECK:STDOUT:
234234
// CHECK:STDOUT: interface {
235235
// CHECK:STDOUT: !members:
236-
// CHECK:STDOUT: .Self = <unexpected>.inst78000021
236+
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
237237
// CHECK:STDOUT: witness = invalid
238238
// CHECK:STDOUT: }
239239
// CHECK:STDOUT: }
@@ -248,12 +248,12 @@ fn F(T:! Z) {
248248
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
249249
// CHECK:STDOUT: }
250250
// CHECK:STDOUT:
251-
// CHECK:STDOUT: generic interface @Z(<unexpected>.inst44000017.loc6_13: type) {
251+
// CHECK:STDOUT: generic interface @Z(<unexpected>.inst{{[0-9A-F]+}}.loc6_13: type) {
252252
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
253253
// CHECK:STDOUT:
254254
// CHECK:STDOUT: interface {
255255
// CHECK:STDOUT: !members:
256-
// CHECK:STDOUT: .Self = <unexpected>.inst44000021
256+
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
257257
// CHECK:STDOUT: witness = invalid
258258
// CHECK:STDOUT: }
259259
// CHECK:STDOUT: }
@@ -269,7 +269,7 @@ fn F(T:! Z) {
269269
// CHECK:STDOUT:
270270
// CHECK:STDOUT: interface @Z {
271271
// CHECK:STDOUT: !members:
272-
// CHECK:STDOUT: .Self = <unexpected>.inst6400001D
272+
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
273273
// CHECK:STDOUT: witness = invalid
274274
// CHECK:STDOUT: }
275275
// CHECK:STDOUT:

toolchain/check/testdata/let/compile_time_bindings.carbon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,12 +632,12 @@ impl i32 as Empty {
632632
// CHECK:STDOUT: !members:
633633
// CHECK:STDOUT: .Self = constants.%C
634634
// CHECK:STDOUT: .F = %C.F.decl
635-
// CHECK:STDOUT: .x = <unexpected>.inst48000023.loc14_7
635+
// CHECK:STDOUT: .x = <unexpected>.inst{{[0-9A-F]+}}.loc14_7
636636
// CHECK:STDOUT: }
637637
// CHECK:STDOUT:
638638
// CHECK:STDOUT: fn @C.F() -> %empty_tuple.type {
639639
// CHECK:STDOUT: !entry:
640-
// CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, <unexpected>.inst48000023.loc14_7
640+
// CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, <unexpected>.inst{{[0-9A-F]+}}.loc14_7
641641
// CHECK:STDOUT: %.loc5_25: init %empty_tuple.type = tuple_init () to %return [concrete = constants.%empty_tuple]
642642
// CHECK:STDOUT: %.loc5_26: init %empty_tuple.type = converted %x.ref, %.loc5_25 [concrete = constants.%empty_tuple]
643643
// CHECK:STDOUT: return %.loc5_26 to %return

toolchain/check/testdata/let/fail_missing_value.carbon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn F() {
5050
// CHECK:STDOUT: file {
5151
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
5252
// CHECK:STDOUT: .Core = imports.%Core
53-
// CHECK:STDOUT: .n = <unexpected>.inst6000002C.loc19_5
53+
// CHECK:STDOUT: .n = <unexpected>.inst{{[0-9A-F]+}}.loc19_5
5454
// CHECK:STDOUT: .F = %F.decl
5555
// CHECK:STDOUT: }
5656
// CHECK:STDOUT: %Core.import = import Core

toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn F() {
9696
// CHECK:STDOUT: %f64: type = class_type @Float, @Float(%int_64) [concrete]
9797
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
9898
// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
99-
// CHECK:STDOUT: %Copy.impl_witness.de9: <witness> = impl_witness <unexpected>.inst60000155 [concrete]
99+
// CHECK:STDOUT: %Copy.impl_witness.de9: <witness> = impl_witness <unexpected>.inst{{[0-9A-F]+}} [concrete]
100100
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value type, (%Copy.impl_witness.de9) [concrete]
101101
// CHECK:STDOUT: %.98f: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
102102
// CHECK:STDOUT: %type.as.Copy.impl.Op.type: type = fn_type @type.as.Copy.impl.Op [concrete]
@@ -105,7 +105,7 @@ fn F() {
105105
// CHECK:STDOUT:
106106
// CHECK:STDOUT: fn @F(%b.param: bool) -> type {
107107
// CHECK:STDOUT: !entry:
108-
// CHECK:STDOUT: %b.ref: bool = name_ref b, <unexpected>.inst6000001B.loc5_6
108+
// CHECK:STDOUT: %b.ref: bool = name_ref b, <unexpected>.inst{{[0-9A-F]+}}.loc5_6
109109
// CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else
110110
// CHECK:STDOUT:
111111
// CHECK:STDOUT: !if.expr.then:
@@ -123,7 +123,7 @@ fn F() {
123123
// CHECK:STDOUT: %impl.elem0: %.98f = impl_witness_access constants.%Copy.impl_witness.de9, element0 [concrete = constants.%type.as.Copy.impl.Op]
124124
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc6, %impl.elem0
125125
// CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%.loc6)
126-
// CHECK:STDOUT: return %type.as.Copy.impl.Op.call to <unexpected>.inst60000024.loc5_15
126+
// CHECK:STDOUT: return %type.as.Copy.impl.Op.call to <unexpected>.inst{{[0-9A-F]+}}.loc5_15
127127
// CHECK:STDOUT: }
128128
// CHECK:STDOUT:
129129
// CHECK:STDOUT: --- fail_and_val.carbon
@@ -140,7 +140,7 @@ fn F() {
140140
// CHECK:STDOUT: %f64: type = class_type @Float, @Float(%int_64) [concrete]
141141
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
142142
// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
143-
// CHECK:STDOUT: %Copy.impl_witness.de9: <witness> = impl_witness <unexpected>.inst70000155 [concrete]
143+
// CHECK:STDOUT: %Copy.impl_witness.de9: <witness> = impl_witness <unexpected>.inst{{[0-9A-F]+}} [concrete]
144144
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value type, (%Copy.impl_witness.de9) [concrete]
145145
// CHECK:STDOUT: %.98f: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
146146
// CHECK:STDOUT: %type.as.Copy.impl.Op.type: type = fn_type @type.as.Copy.impl.Op [concrete]
@@ -149,7 +149,7 @@ fn F() {
149149
// CHECK:STDOUT:
150150
// CHECK:STDOUT: fn @F(%b.param: bool) -> type {
151151
// CHECK:STDOUT: !entry:
152-
// CHECK:STDOUT: %b.ref: bool = name_ref b, <unexpected>.inst7000001B.loc5_6
152+
// CHECK:STDOUT: %b.ref: bool = name_ref b, <unexpected>.inst{{[0-9A-F]+}}.loc5_6
153153
// CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else
154154
// CHECK:STDOUT:
155155
// CHECK:STDOUT: !if.expr.then:
@@ -167,7 +167,7 @@ fn F() {
167167
// CHECK:STDOUT: %impl.elem0: %.98f = impl_witness_access constants.%Copy.impl_witness.de9, element0 [concrete = constants.%type.as.Copy.impl.Op]
168168
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc6, %impl.elem0
169169
// CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%.loc6)
170-
// CHECK:STDOUT: return %type.as.Copy.impl.Op.call to <unexpected>.inst70000024.loc5_15
170+
// CHECK:STDOUT: return %type.as.Copy.impl.Op.call to <unexpected>.inst{{[0-9A-F]+}}.loc5_15
171171
// CHECK:STDOUT: }
172172
// CHECK:STDOUT:
173173
// CHECK:STDOUT: --- fail_or_val.carbon
@@ -189,7 +189,7 @@ fn F() {
189189
// CHECK:STDOUT: %false: bool = bool_literal false [concrete]
190190
// CHECK:STDOUT: }
191191
// CHECK:STDOUT:
192-
// CHECK:STDOUT: generic class @C(<unexpected>.inst6800001E.loc4_14: bool) {
192+
// CHECK:STDOUT: generic class @C(<unexpected>.inst{{[0-9A-F]+}}.loc4_14: bool) {
193193
// CHECK:STDOUT: %B: bool = symbolic_binding B, 0 [symbolic = %B (constants.%B.931)]
194194
// CHECK:STDOUT:
195195
// CHECK:STDOUT: !definition:
@@ -204,7 +204,7 @@ fn F() {
204204
// CHECK:STDOUT: }
205205
// CHECK:STDOUT:
206206
// CHECK:STDOUT: class @B {
207-
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, <unexpected>.inst68000024.loc4_24 [concrete = constants.%C.generic]
207+
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, <unexpected>.inst{{[0-9A-F]+}}.loc4_24 [concrete = constants.%C.generic]
208208
// CHECK:STDOUT: %true.loc12_20: bool = bool_literal true [concrete = constants.%true]
209209
// CHECK:STDOUT: %.loc12: bool = not %true.loc12_20 [concrete = constants.%false]
210210
// CHECK:STDOUT: %true.loc12_25: bool = bool_literal true [concrete = constants.%true]

toolchain/testing/file_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ auto ToolchainFileTest::DoExtraCheckReplacements(std::string& check_line) const
322322

323323
// Reduce instruction numbering sensitivity; this is brittle for
324324
// instruction edits including adding/removing singleton instructions.
325-
static RE2 inst_re(R"((import_ref [^,]*, inst)[0-9A-F]+)");
325+
static RE2 inst_re(
326+
R"(((?:import_ref [^,]*, |<unexpected>\.)inst)[0-9A-F]+)");
326327
RE2::Replace(&check_line, inst_re, R"(\1{{[0-9A-F]+}})");
327328

328329
// Reduce location sensitivity in imports referring to `Core`; this is

0 commit comments

Comments
 (0)