Mask unexpected inst ids (#6295)

Just more anti-churn work.
This commit is contained in:
Jon Ross-Perkins
2025-10-29 22:07:33 +00:00
committed by GitHub
parent ec3f7dd9bd
commit 9b95944020
6 changed files with 24 additions and 23 deletions
@@ -130,7 +130,7 @@ fn F() {
// CHECK:STDOUT: %true: bool = bool_literal true [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @C(<unexpected>.inst68000014.loc4_14: type) {
// CHECK:STDOUT: generic class @C(<unexpected>.inst{{[0-9A-F]+}}.loc4_14: type) {
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -145,7 +145,7 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @B {
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, <unexpected>.inst68000019.loc4_24 [concrete = constants.%C.generic]
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, <unexpected>.inst{{[0-9A-F]+}}.loc4_24 [concrete = constants.%C.generic]
// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: if %true br !if.expr.then else br !if.expr.else
// CHECK:STDOUT: complete_type_witness = invalid
+9 -9
View File
@@ -185,7 +185,7 @@ fn F(T:! Z) {
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Z {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = <unexpected>.inst6000001D
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
// CHECK:STDOUT: witness = invalid
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -196,7 +196,7 @@ fn F(T:! Z) {
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Z {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = <unexpected>.inst5000001D
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
// CHECK:STDOUT: witness = invalid
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -207,7 +207,7 @@ fn F(T:! Z) {
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Z {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = <unexpected>.inst68000023
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
// CHECK:STDOUT: witness = invalid
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -218,7 +218,7 @@ fn F(T:! Z) {
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Z {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = <unexpected>.inst5800001A
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
// CHECK:STDOUT: witness = invalid
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -228,12 +228,12 @@ fn F(T:! Z) {
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @Z(<unexpected>.inst78000017.loc6_13: type) {
// CHECK:STDOUT: generic interface @Z(<unexpected>.inst{{[0-9A-F]+}}.loc6_13: type) {
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: interface {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = <unexpected>.inst78000021
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
// CHECK:STDOUT: witness = invalid
// CHECK:STDOUT: }
// CHECK:STDOUT: }
@@ -248,12 +248,12 @@ fn F(T:! Z) {
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @Z(<unexpected>.inst44000017.loc6_13: type) {
// CHECK:STDOUT: generic interface @Z(<unexpected>.inst{{[0-9A-F]+}}.loc6_13: type) {
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: interface {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = <unexpected>.inst44000021
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
// CHECK:STDOUT: witness = invalid
// CHECK:STDOUT: }
// CHECK:STDOUT: }
@@ -269,7 +269,7 @@ fn F(T:! Z) {
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Z {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = <unexpected>.inst6400001D
// CHECK:STDOUT: .Self = <unexpected>.inst{{[0-9A-F]+}}
// CHECK:STDOUT: witness = invalid
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2 -2
View File
@@ -632,12 +632,12 @@ impl i32 as Empty {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: .F = %C.F.decl
// CHECK:STDOUT: .x = <unexpected>.inst48000023.loc14_7
// CHECK:STDOUT: .x = <unexpected>.inst{{[0-9A-F]+}}.loc14_7
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C.F() -> %empty_tuple.type {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, <unexpected>.inst48000023.loc14_7
// CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, <unexpected>.inst{{[0-9A-F]+}}.loc14_7
// CHECK:STDOUT: %.loc5_25: init %empty_tuple.type = tuple_init () to %return [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc5_26: init %empty_tuple.type = converted %x.ref, %.loc5_25 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: return %.loc5_26 to %return
+1 -1
View File
@@ -50,7 +50,7 @@ fn F() {
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .n = <unexpected>.inst6000002C.loc19_5
// CHECK:STDOUT: .n = <unexpected>.inst{{[0-9A-F]+}}.loc19_5
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
@@ -96,7 +96,7 @@ fn F() {
// CHECK:STDOUT: %f64: type = class_type @Float, @Float(%int_64) [concrete]
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
// CHECK:STDOUT: %Copy.impl_witness.de9: <witness> = impl_witness <unexpected>.inst60000155 [concrete]
// CHECK:STDOUT: %Copy.impl_witness.de9: <witness> = impl_witness <unexpected>.inst{{[0-9A-F]+}} [concrete]
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value type, (%Copy.impl_witness.de9) [concrete]
// CHECK:STDOUT: %.98f: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
// CHECK:STDOUT: %type.as.Copy.impl.Op.type: type = fn_type @type.as.Copy.impl.Op [concrete]
@@ -105,7 +105,7 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%b.param: bool) -> type {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %b.ref: bool = name_ref b, <unexpected>.inst6000001B.loc5_6
// CHECK:STDOUT: %b.ref: bool = name_ref b, <unexpected>.inst{{[0-9A-F]+}}.loc5_6
// CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.then:
@@ -123,7 +123,7 @@ fn F() {
// CHECK:STDOUT: %impl.elem0: %.98f = impl_witness_access constants.%Copy.impl_witness.de9, element0 [concrete = constants.%type.as.Copy.impl.Op]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc6, %impl.elem0
// CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%.loc6)
// CHECK:STDOUT: return %type.as.Copy.impl.Op.call to <unexpected>.inst60000024.loc5_15
// CHECK:STDOUT: return %type.as.Copy.impl.Op.call to <unexpected>.inst{{[0-9A-F]+}}.loc5_15
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_and_val.carbon
@@ -140,7 +140,7 @@ fn F() {
// CHECK:STDOUT: %f64: type = class_type @Float, @Float(%int_64) [concrete]
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
// CHECK:STDOUT: %Copy.impl_witness.de9: <witness> = impl_witness <unexpected>.inst70000155 [concrete]
// CHECK:STDOUT: %Copy.impl_witness.de9: <witness> = impl_witness <unexpected>.inst{{[0-9A-F]+}} [concrete]
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value type, (%Copy.impl_witness.de9) [concrete]
// CHECK:STDOUT: %.98f: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
// CHECK:STDOUT: %type.as.Copy.impl.Op.type: type = fn_type @type.as.Copy.impl.Op [concrete]
@@ -149,7 +149,7 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%b.param: bool) -> type {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %b.ref: bool = name_ref b, <unexpected>.inst7000001B.loc5_6
// CHECK:STDOUT: %b.ref: bool = name_ref b, <unexpected>.inst{{[0-9A-F]+}}.loc5_6
// CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.then:
@@ -167,7 +167,7 @@ fn F() {
// CHECK:STDOUT: %impl.elem0: %.98f = impl_witness_access constants.%Copy.impl_witness.de9, element0 [concrete = constants.%type.as.Copy.impl.Op]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc6, %impl.elem0
// CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%.loc6)
// CHECK:STDOUT: return %type.as.Copy.impl.Op.call to <unexpected>.inst70000024.loc5_15
// CHECK:STDOUT: return %type.as.Copy.impl.Op.call to <unexpected>.inst{{[0-9A-F]+}}.loc5_15
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_or_val.carbon
@@ -189,7 +189,7 @@ fn F() {
// CHECK:STDOUT: %false: bool = bool_literal false [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @C(<unexpected>.inst6800001E.loc4_14: bool) {
// CHECK:STDOUT: generic class @C(<unexpected>.inst{{[0-9A-F]+}}.loc4_14: bool) {
// CHECK:STDOUT: %B: bool = symbolic_binding B, 0 [symbolic = %B (constants.%B.931)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -204,7 +204,7 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @B {
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, <unexpected>.inst68000024.loc4_24 [concrete = constants.%C.generic]
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, <unexpected>.inst{{[0-9A-F]+}}.loc4_24 [concrete = constants.%C.generic]
// CHECK:STDOUT: %true.loc12_20: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: %.loc12: bool = not %true.loc12_20 [concrete = constants.%false]
// CHECK:STDOUT: %true.loc12_25: bool = bool_literal true [concrete = constants.%true]
+2 -1
View File
@@ -322,7 +322,8 @@ auto ToolchainFileTest::DoExtraCheckReplacements(std::string& check_line) const
// Reduce instruction numbering sensitivity; this is brittle for
// instruction edits including adding/removing singleton instructions.
static RE2 inst_re(R"((import_ref [^,]*, inst)[0-9A-F]+)");
static RE2 inst_re(
R"(((?:import_ref [^,]*, |<unexpected>\.)inst)[0-9A-F]+)");
RE2::Replace(&check_line, inst_re, R"(\1{{[0-9A-F]+}})");
// Reduce location sensitivity in imports referring to `Core`; this is