From 6c6552ce5797567d5e306d58c80a78d1725178a5 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 2 Jul 2025 15:21:41 -0400 Subject: [PATCH] Consistently return runtime phase if the operands contain a runtime (#5729) Currently if the first operand contains an error, we will return error, even though the second operands contains a runtime, and it has a stronger priority (the phase always goes up if possible). Import is only allowed on instructions with compile-time values, so we crash if we ever try to import a runtime value. Importable instructions must diagnose unexpected runtime values and produce errors in the semir from which they would be imported so that runtime values are never imported by another semir. If we had an instruction where you had an error value from the first operand, and runtime from the second, and we imported it: - Before https://github.com/carbon-language/carbon-lang/pull/5728 we would crash in import, but only because we treated errors as runtime - After https://github.com/carbon-language/carbon-lang/pull/5728 we would import ErrorInst because we propagate errors. This is desirable for cases with compile-time values and errors present only. - After this PR, we would crash again, cuz you're importing a runtime thing. This change means that instructions containing an `InstConstantKind::Never` instruction like`ValueParam` will consistently evaluate to a runtime value, even if there are errors present. This is visible in the `BindName` instructions changing in the semir, where they became constant `ErrorInst` values previously but no longer do. --- toolchain/check/eval.cpp | 31 ++++++++++--------- .../check/testdata/class/import_access.carbon | 4 +-- .../check/testdata/deduce/int_float.carbon | 2 +- .../value_with_type_through_access.carbon | 4 +-- ...uction_uses_runtime_type_conversion.carbon | 2 +- .../declaration/fail_param_in_type.carbon | 2 +- .../fail_decl_param_mismatch.carbon | 2 +- .../testdata/impl/fail_call_invalid.carbon | 2 +- .../testdata/impl/use_assoc_const.carbon | 14 ++++----- .../testdata/interface/import_access.carbon | 14 ++++----- .../check/testdata/interop/cpp/class.carbon | 6 ++-- .../interop/cpp/function/class.carbon | 2 +- .../interop/cpp/function/struct.carbon | 2 +- .../interop/cpp/function/union.carbon | 2 +- .../check/testdata/interop/cpp/struct.carbon | 6 ++-- .../check/testdata/interop/cpp/union.carbon | 4 +-- .../testdata/namespace/fail_params.carbon | 2 +- .../pointer/fail_deref_not_pointer.carbon | 4 +-- 18 files changed, 54 insertions(+), 51 deletions(-) diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index f7a9af84a368..09f19906d0e2 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -250,9 +250,8 @@ enum class Phase : uint8_t { }; } // namespace -// Returns whether the specified phase is a constant phase. -static auto IsConstant(Phase phase) -> bool { - return phase < Phase::UnknownDueToError; +static auto IsConstantOrError(Phase phase) -> bool { + return phase != Phase::Runtime; } // Gets the phase in which the value of a constant will become available. @@ -700,7 +699,7 @@ static auto ReplaceFieldWithConstantValue(EvalContext& eval_context, return false; } inst->*field = unwrapped; - return true; + return IsConstantOrError(*phase); } // Function template that can be called with an argument of type `T`. Used below @@ -765,13 +764,12 @@ static auto ReplaceAllFieldsWithConstantValues(EvalContext& eval_context, -> bool { auto arg0 = GetConstantValueForArg(eval_context, inst->arg0_and_kind(), phase); - if (!IsConstant(*phase)) { + if (!IsConstantOrError(*phase)) { return false; } - auto arg1 = GetConstantValueForArg(eval_context, inst->arg1_and_kind(), phase); - if (!IsConstant(*phase)) { + if (!IsConstantOrError(*phase)) { return false; } inst->SetArgs(arg0, arg1); @@ -786,7 +784,7 @@ static auto ReplaceTypeWithConstantValue(EvalContext& eval_context, SemIR::Inst* inst, Phase* phase) -> bool { inst->SetType(GetTypeOfInst(eval_context, inst_id, *inst, phase)); - return IsConstant(*phase); + return IsConstantOrError(*phase); } template @@ -794,7 +792,7 @@ static auto ReplaceTypeWithConstantValue(EvalContext& eval_context, SemIR::InstId inst_id, InstT* inst, Phase* phase) -> bool { inst->type_id = GetTypeOfInst(eval_context, inst_id, *inst, phase); - return IsConstant(*phase); + return IsConstantOrError(*phase); } template @@ -1835,7 +1833,7 @@ static auto ComputeInstPhase(Context& context, SemIR::Inst inst) -> Phase { context.types().GetConstantId(inst.type_id())); GetConstantValueForArg(eval_context, inst.arg0_and_kind(), &phase); GetConstantValueForArg(eval_context, inst.arg1_and_kind(), &phase); - CARBON_CHECK(phase != Phase::Runtime); + CARBON_CHECK(IsConstantOrError(phase)); return phase; } @@ -1890,10 +1888,14 @@ static auto TryEvalTypedInst(EvalContext& eval_context, SemIR::InstId inst_id, if (!ReplaceTypeWithConstantValue(eval_context, inst_id, &inst, &phase) || !ReplaceAllFieldsWithConstantValues(eval_context, &inst, &phase)) { if constexpr (ConstantKind == SemIR::InstConstantKind::Always) { - CARBON_CHECK(phase == Phase::UnknownDueToError, - "{0} should always be constant", InstT::Kind); + CARBON_FATAL("{0} should always be constant", InstT::Kind); } - return MakeNonConstantResult(phase); + return SemIR::ConstantId::NotConstant; + } + // If any operand of the instruction has an error in it, the instruction + // itself evaluates to an error. + if (phase == Phase::UnknownDueToError) { + return SemIR::ErrorInst::ConstantId; } // When canonicalizing a SpecificId, we defer resolving the specific's @@ -1993,8 +1995,9 @@ auto TryEvalTypedInst(EvalContext& eval_context, !ReplaceFieldWithConstantValue(eval_context, &bind, &SemIR::BindSymbolicName::entity_name_id, &phase)) { - return MakeNonConstantResult(phase); + return SemIR::ConstantId::NotConstant; } + // This correctly handles `Phase::UnknownDueToError`. return MakeConstantResult(eval_context.context(), bind, phase); } diff --git a/toolchain/check/testdata/class/import_access.carbon b/toolchain/check/testdata/class/import_access.carbon index 328882dcb609..ee47ef6aa791 100644 --- a/toolchain/check/testdata/class/import_access.carbon +++ b/toolchain/check/testdata/class/import_access.carbon @@ -505,7 +505,7 @@ private class Redecl {} // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %c: = bind_name c, %c.param [concrete = ] +// CHECK:STDOUT: %c: = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -544,7 +544,7 @@ private class Redecl {} // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %c: = bind_name c, %c.param [concrete = ] +// CHECK:STDOUT: %c: = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/int_float.carbon b/toolchain/check/testdata/deduce/int_float.carbon index e0c39b2062f4..3d7398952e79 100644 --- a/toolchain/check/testdata/deduce/int_float.carbon +++ b/toolchain/check/testdata/deduce/int_float.carbon @@ -241,7 +241,7 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %.loc9_44.1: type = value_of_initializer %float.make_type // CHECK:STDOUT: %.loc9_44.2: type = converted %float.make_type, %.loc9_44.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %n: = bind_name n, %n.param [concrete = ] +// CHECK:STDOUT: %n: = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param call_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon index a58a398b83da..7057f02d89af 100644 --- a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon +++ b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon @@ -636,7 +636,7 @@ fn G() { // CHECK:STDOUT: %.loc21_38.1: ref type = class_element_access %T.ref.loc21_37, element0 [symbolic = %.loc21_38.3 (constants.%.2fe)] // CHECK:STDOUT: %.loc21_38.2: type = bind_value %.loc21_38.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %a: = bind_name a, %a.param [concrete = ] +// CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} @@ -881,7 +881,7 @@ fn G() { // CHECK:STDOUT: %.loc12_49.2: ref type = array_index %.loc12_49.1, %.loc12_48.2 // CHECK:STDOUT: %.loc12_49.3: type = bind_value %.loc12_49.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %a: = bind_name a, %a.param [concrete = ] +// CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} diff --git a/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon b/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon index 6a88e6fb1c17..8ce33bc2ac83 100644 --- a/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon +++ b/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon @@ -293,7 +293,7 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, ))) { // CHECK:STDOUT: %.loc41_19.3: ref %RuntimeConvertTo = temporary %.loc41_19.1, %.loc41_19.2 // CHECK:STDOUT: %.loc41_19.4: %RuntimeConvertTo = bind_value %.loc41_19.3 // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%tuple, ) [concrete = ] -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%holds_to.ref) [concrete = ] +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%holds_to.ref) // CHECK:STDOUT: %impl.elem0.loc41_19.2: %.79d = impl_witness_access constants.%Destroy.impl_witness.3c9, element0 [concrete = constants.%Op.d2d] // CHECK:STDOUT: %bound_method.loc41_19.2: = bound_method %.loc41_19.1, %impl.elem0.loc41_19.2 // CHECK:STDOUT: %specific_fn.loc41: = specific_function %impl.elem0.loc41_19.2, @Op.2(constants.%RuntimeConvertTo) [concrete = constants.%Op.specific_fn.373] diff --git a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon index f75b21eb0fea..0bf26b8de4db 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -64,7 +64,7 @@ fn F(n: i32, a: array(i32, n)*); // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: = bind_name a, %a.param [concrete = ] +// CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon b/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon index d22d728c0140..2f8e92102982 100644 --- a/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon +++ b/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon @@ -153,7 +153,7 @@ fn K() -> {} { return {}; } // CHECK:STDOUT: %x.param_patt: = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: = value_param call_param0 -// CHECK:STDOUT: %x: = bind_name x, %x.param [concrete = ] +// CHECK:STDOUT: %x: = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %I.decl.loc42: %I.type.af49c4.1 = fn_decl @I.1 [concrete = constants.%I.58e4ec.1] {} {} // CHECK:STDOUT: %I.decl.loc50: %I.type.af49c4.2 = fn_decl @I.2 [concrete = constants.%I.58e4ec.2] { diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index ca9c78cd0e74..4020b4f930e2 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -123,7 +123,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: = value_param call_param0 // CHECK:STDOUT: %Undeclared.ref: = name_ref Undeclared, [concrete = ] -// CHECK:STDOUT: %self: = bind_name self, %self.param [concrete = ] +// CHECK:STDOUT: %self: = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl.loc24_27.2: %G.type.c9825d.2 = fn_decl @G.3 [concrete = constants.%G.e73e91.2] { // CHECK:STDOUT: %self.patt: %pattern_type.7ce = binding_pattern self [concrete] diff --git a/toolchain/check/testdata/impl/use_assoc_const.carbon b/toolchain/check/testdata/impl/use_assoc_const.carbon index bc1115d06620..c52e5c328349 100644 --- a/toolchain/check/testdata/impl/use_assoc_const.carbon +++ b/toolchain/check/testdata/impl/use_assoc_const.carbon @@ -2370,7 +2370,7 @@ fn F() { // CHECK:STDOUT: %U.ref.loc24_13: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411] // CHECK:STDOUT: %.loc24_13: type = converted %U.ref.loc24_13, [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %u: = bind_name u, %u.param [concrete = ] +// CHECK:STDOUT: %u: = bind_name u, %u.param // CHECK:STDOUT: %return.param: ref = out_param call_param1 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } @@ -2433,7 +2433,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(%u.param: ) -> { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %u.ref: = name_ref u, %u [concrete = ] +// CHECK:STDOUT: %u.ref: = name_ref u, %u // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2583,7 +2583,7 @@ fn F() { // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc19_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %z.param: = value_param call_param1 // CHECK:STDOUT: %Self.ref.loc19_23: %J2.type = name_ref Self, @J2.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %z: = bind_name z, %z.param [concrete = ] +// CHECK:STDOUT: %z: = bind_name z, %z.param // CHECK:STDOUT: %return.param: ref = out_param call_param2 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } @@ -2710,8 +2710,8 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type.f405c5.1 = name_ref F, @impl.4e9.%F.decl.loc30_33.1 [concrete = constants.%F.214a71.1] // CHECK:STDOUT: %self.ref: %empty_tuple.type = name_ref self, %self.param -// CHECK:STDOUT: %.ref: = name_ref , %.param [concrete = ] -// CHECK:STDOUT: %return.ref: ref = name_ref , %return.param [concrete = ] +// CHECK:STDOUT: %.ref: = name_ref , %.param +// CHECK:STDOUT: %return.ref: ref = name_ref , %return.param // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2725,8 +2725,8 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type.05d6a0.1 = name_ref F, @impl.8b3.%F.decl.loc39_33.1 [concrete = constants.%F.bfa759.1] // CHECK:STDOUT: %self.ref: %C2 = name_ref self, %self.param -// CHECK:STDOUT: %.ref: = name_ref , %.param [concrete = ] -// CHECK:STDOUT: %return.ref: ref = name_ref , %return.param [concrete = ] +// CHECK:STDOUT: %.ref: = name_ref , %.param +// CHECK:STDOUT: %return.ref: ref = name_ref , %return.param // CHECK:STDOUT: %F.bound: = bound_method %self.ref, %F.ref // CHECK:STDOUT: %F.call: init %C2 = call %F.bound(%self.ref, ) // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/interface/import_access.carbon b/toolchain/check/testdata/interface/import_access.carbon index 2e411d15c971..94322dcb036b 100644 --- a/toolchain/check/testdata/interface/import_access.carbon +++ b/toolchain/check/testdata/interface/import_access.carbon @@ -264,7 +264,7 @@ private interface Redecl {} // CHECK:STDOUT: } { // CHECK:STDOUT: %i.param: = value_param call_param0 // CHECK:STDOUT: %Def.ref: = name_ref Def, [concrete = ] -// CHECK:STDOUT: %i: = bind_name i, %i.param [concrete = ] +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -302,7 +302,7 @@ private interface Redecl {} // CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [concrete = imports.%Test] // CHECK:STDOUT: %Def.ref: = name_ref Def, [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %i: = bind_name i, %i.param [concrete = ] +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -372,7 +372,7 @@ private interface Redecl {} // CHECK:STDOUT: } { // CHECK:STDOUT: %i.param: = value_param call_param0 // CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [concrete = ] -// CHECK:STDOUT: %i: = bind_name i, %i.param [concrete = ] +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -410,7 +410,7 @@ private interface Redecl {} // CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [concrete = imports.%Test] // CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %i: = bind_name i, %i.param [concrete = ] +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -444,7 +444,7 @@ private interface Redecl {} // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %i: = bind_name i, %i.param [concrete = ] +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: %Forward.decl: type = interface_decl @Forward [concrete = constants.%Forward.type] {} {} // CHECK:STDOUT: } @@ -484,7 +484,7 @@ private interface Redecl {} // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %i: = bind_name i, %i.param [concrete = ] +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -522,7 +522,7 @@ private interface Redecl {} // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %i: = bind_name i, %i.param [concrete = ] +// CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class.carbon b/toolchain/check/testdata/interop/cpp/class.carbon index 555b7d4dda56..3754b7694eda 100644 --- a/toolchain/check/testdata/interop/cpp/class.carbon +++ b/toolchain/check/testdata/interop/cpp/class.carbon @@ -410,7 +410,7 @@ fn MyF(bar: Cpp.Bar*); // CHECK:STDOUT: %Bar.ref: = name_ref Bar, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %bar: = bind_name bar, %bar.param [concrete = ] +// CHECK:STDOUT: %bar: = bind_name bar, %bar.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -780,7 +780,7 @@ fn MyF(bar: Cpp.Bar*); // CHECK:STDOUT: %Bar.ref: = name_ref Bar, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %bar: = bind_name bar, %bar.param [concrete = ] +// CHECK:STDOUT: %bar: = bind_name bar, %bar.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -865,7 +865,7 @@ fn MyF(bar: Cpp.Bar*); // CHECK:STDOUT: %Bar.ref: = name_ref Bar, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %bar: = bind_name bar, %bar.param [concrete = ] +// CHECK:STDOUT: %bar: = bind_name bar, %bar.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/class.carbon b/toolchain/check/testdata/interop/cpp/function/class.carbon index d19bfa25c98d..fe40bf8d1945 100644 --- a/toolchain/check/testdata/interop/cpp/function/class.carbon +++ b/toolchain/check/testdata/interop/cpp/function/class.carbon @@ -828,7 +828,7 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: = name_ref foo, [concrete = ] -// CHECK:STDOUT: %c.ref: = name_ref c, %c [concrete = ] +// CHECK:STDOUT: %c.ref: = name_ref c, %c // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/struct.carbon b/toolchain/check/testdata/interop/cpp/function/struct.carbon index c5f19ffddebc..d6887bd83f6d 100644 --- a/toolchain/check/testdata/interop/cpp/function/struct.carbon +++ b/toolchain/check/testdata/interop/cpp/function/struct.carbon @@ -828,7 +828,7 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: = name_ref foo, [concrete = ] -// CHECK:STDOUT: %s.ref: = name_ref s, %s [concrete = ] +// CHECK:STDOUT: %s.ref: = name_ref s, %s // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/union.carbon b/toolchain/check/testdata/interop/cpp/function/union.carbon index 45a77a682790..76fd7468a13b 100644 --- a/toolchain/check/testdata/interop/cpp/function/union.carbon +++ b/toolchain/check/testdata/interop/cpp/function/union.carbon @@ -642,7 +642,7 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: = name_ref foo, [concrete = ] -// CHECK:STDOUT: %u.ref: = name_ref u, %u [concrete = ] +// CHECK:STDOUT: %u.ref: = name_ref u, %u // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/struct.carbon b/toolchain/check/testdata/interop/cpp/struct.carbon index 3cfaf7e79360..9fdfdc215f1a 100644 --- a/toolchain/check/testdata/interop/cpp/struct.carbon +++ b/toolchain/check/testdata/interop/cpp/struct.carbon @@ -400,7 +400,7 @@ fn MyF(bar: Cpp.Bar*); // CHECK:STDOUT: %Bar.ref: = name_ref Bar, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %bar: = bind_name bar, %bar.param [concrete = ] +// CHECK:STDOUT: %bar: = bind_name bar, %bar.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -770,7 +770,7 @@ fn MyF(bar: Cpp.Bar*); // CHECK:STDOUT: %Bar.ref: = name_ref Bar, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %bar: = bind_name bar, %bar.param [concrete = ] +// CHECK:STDOUT: %bar: = bind_name bar, %bar.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -855,7 +855,7 @@ fn MyF(bar: Cpp.Bar*); // CHECK:STDOUT: %Bar.ref: = name_ref Bar, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %bar: = bind_name bar, %bar.param [concrete = ] +// CHECK:STDOUT: %bar: = bind_name bar, %bar.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/union.carbon b/toolchain/check/testdata/interop/cpp/union.carbon index c9b30f547a9f..08613ce542d8 100644 --- a/toolchain/check/testdata/interop/cpp/union.carbon +++ b/toolchain/check/testdata/interop/cpp/union.carbon @@ -294,7 +294,7 @@ fn MyF(bar: Cpp.Bar*); // CHECK:STDOUT: %Bar.ref: = name_ref Bar, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %bar: = bind_name bar, %bar.param [concrete = ] +// CHECK:STDOUT: %bar: = bind_name bar, %bar.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -552,7 +552,7 @@ fn MyF(bar: Cpp.Bar*); // CHECK:STDOUT: %Bar.ref: = name_ref Bar, [concrete = ] // CHECK:STDOUT: %ptr: type = ptr_type [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %bar: = bind_name bar, %bar.param [concrete = ] +// CHECK:STDOUT: %bar: = bind_name bar, %bar.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index 686ecc0a29ce..41a0e7554feb 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -81,7 +81,7 @@ fn D(T:! type).F() {} // CHECK:STDOUT: %F.decl.loc22: %F.type.bd7 = fn_decl @F.1 [concrete = constants.%F.199] {} {} // CHECK:STDOUT: %n.param: = value_param call_param0 // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %n: = bind_name n, %n.param [concrete = ] +// CHECK:STDOUT: %n: = bind_name n, %n.param // CHECK:STDOUT: %B: = namespace [concrete] {} // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = constants.%T] // CHECK:STDOUT: %x.param: %T = value_param call_param0 diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index c3ff74e86000..15d091e53c60 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -92,9 +92,9 @@ fn Deref(n: i32) { // CHECK:STDOUT: fn @Deref(%n.param: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref.loc20: %i32 = name_ref n, %n -// CHECK:STDOUT: %.loc20: ref = deref %n.ref.loc20 [concrete = ] +// CHECK:STDOUT: %.loc20: ref = deref %n.ref.loc20 // CHECK:STDOUT: %n.ref.loc25: %i32 = name_ref n, %n -// CHECK:STDOUT: %.loc25: ref = deref %n.ref.loc25 [concrete = ] +// CHECK:STDOUT: %.loc25: ref = deref %n.ref.loc25 // CHECK:STDOUT: %foo.ref.loc25: = name_ref foo, [concrete = ] // CHECK:STDOUT: %.loc30_5.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %empty_tuple.loc30: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]