diff --git a/toolchain/check/eval_inst.cpp b/toolchain/check/eval_inst.cpp index e3276a0cbc42d..e96f57b9aaa46 100644 --- a/toolchain/check/eval_inst.cpp +++ b/toolchain/check/eval_inst.cpp @@ -516,6 +516,12 @@ auto EvalConstantInst(Context& context, SemIR::InstId inst_id, return ConstantEvalResult::NewSamePhase(inst); } +auto EvalConstantInst(Context& context, SemIR::RequireSpecificDefinition inst) + -> ConstantEvalResult { + ResolveSpecificDefinition(context, SemIR::LocId::None, inst.specific_id); + return ConstantEvalResult::NewSamePhase(inst); +} + auto EvalConstantInst(Context& context, SemIR::SpecificConstant inst) -> ConstantEvalResult { // Pull the constant value out of the specific. diff --git a/toolchain/check/generic.cpp b/toolchain/check/generic.cpp index 2d229cb7761fb..b778026948e9e 100644 --- a/toolchain/check/generic.cpp +++ b/toolchain/check/generic.cpp @@ -719,6 +719,7 @@ auto ResolveSpecificDefinition(Context& context, SemIR::LocId loc_id, if (!specific.definition_block_id.has_value()) { // Evaluate the eval block for the definition of the generic. auto& generic = context.generics().Get(generic_id); + CARBON_CHECK(generic.decl_block_id.has_value(), "missing declaration"); if (!generic.definition_block_id.has_value()) { // The generic is not defined yet. return false; diff --git a/toolchain/check/impl_lookup.cpp b/toolchain/check/impl_lookup.cpp index 0fe1901e6509f..d7e73d3a5f65f 100644 --- a/toolchain/check/impl_lookup.cpp +++ b/toolchain/check/impl_lookup.cpp @@ -240,14 +240,15 @@ static auto GetWitnessIdForImpl(Context& context, SemIR::LocId loc_id, // The self type of the impl must match the type in the query, or this is an // `impl T as ...` for some other type `T` and should not be considered. - auto deduced_self_const_id = SemIR::GetConstantValueInSpecific( + auto noncanonical_deduced_self_const_id = SemIR::GetConstantValueInSpecific( context.sem_ir(), specific_id, impl.self_id); + // In a generic `impl forall` the self type can be a FacetAccessType, which // will not be the same constant value as a query facet value. We move through // to the facet value here, and if the query was a FacetAccessType we did the // same there so they still match. - deduced_self_const_id = - GetCanonicalFacetOrTypeValue(context, deduced_self_const_id); + auto deduced_self_const_id = + GetCanonicalFacetOrTypeValue(context, noncanonical_deduced_self_const_id); if (query_self_const_id != deduced_self_const_id) { return EvalImplLookupResult::MakeNone(); } @@ -288,6 +289,16 @@ static auto GetWitnessIdForImpl(Context& context, SemIR::LocId loc_id, LoadImportRef(context, impl.witness_id); if (specific_id.has_value()) { + // When working with a symbolic constant and a `final` impl, add an + // instruction to support requiring an impl definition which may not + // otherwise be generated. + AddInstInNoBlock( + context, loc_id, + SemIR::RequireSpecificDefinition{ + .type_id = GetSingletonType( + context, SemIR::RequireSpecificDefinitionType::TypeInstId), + .specific_id = specific_id}); + // We need a definition of the specific `impl` so we can access its // witness. ResolveSpecificDefinition(context, loc_id, specific_id); diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 4b3cf85bc41d4..5ccc4b1ac75ad 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -3054,6 +3054,31 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, .complete_type_inst_id = complete_type_inst_id}); } +static auto TryResolveTypedInst(ImportRefResolver& resolver, + SemIR::RequireSpecificDefinition inst) + -> ResolveResult { + return ResolveResult::Done(SemIR::ErrorInst::ConstantId, + SemIR::ErrorInst::InstId); + + CARBON_CHECK(resolver.import_types().GetInstId(inst.type_id) == + SemIR::RequireSpecificDefinitionType::TypeInstId); + + auto specific_data = GetLocalSpecificData(resolver, inst.specific_id); + + if (resolver.HasNewWork()) { + return ResolveResult::Retry(); + } + + auto specific_id = + GetOrAddLocalSpecific(resolver, inst.specific_id, specific_data); + + return ResolveAsDeduplicated( + resolver, {.type_id = GetSingletonType( + resolver.local_context(), + SemIR::RequireSpecificDefinitionType::TypeInstId), + .specific_id = specific_id}); +} + static auto TryResolveTypedInst(ImportRefResolver& resolver, SemIR::ReturnSlotPattern inst, SemIR::InstId import_inst_id) -> ResolveResult { @@ -3522,6 +3547,9 @@ static auto TryResolveInstCanonical(ImportRefResolver& resolver, case CARBON_KIND(SemIR::RequireCompleteType inst): { return TryResolveTypedInst(resolver, inst); } + case CARBON_KIND(SemIR::RequireSpecificDefinition inst): { + return TryResolveTypedInst(resolver, inst); + } case CARBON_KIND(SemIR::ReturnSlotPattern inst): { return TryResolveTypedInst(resolver, inst, constant_inst_id); } diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index 67a6c43990dd3..4b5fec8003500 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -78,6 +78,7 @@ fn H() { G(3); } // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.cc4: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.30f) [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.44f: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.cc4 = struct_value () [symbolic] // CHECK:STDOUT: %require_complete.2e8: = require_complete_type %ptr.a86 [symbolic] +// CHECK:STDOUT: %.019: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.30f) [symbolic] // CHECK:STDOUT: %Destroy.facet.49e: %Destroy.type = facet_value %array_type.512, (%Destroy.impl_witness.aa0) [symbolic] // CHECK:STDOUT: %.fb1: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.49e [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.91d: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.44f, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.30f) [symbolic] @@ -89,12 +90,13 @@ fn H() { G(3); } // CHECK:STDOUT: %array.2e5: %array_type.6f1 = tuple_value () [concrete] // CHECK:STDOUT: %facet_value.cba: %type_where = facet_value %array_type.6f1, () [concrete] // CHECK:STDOUT: %Destroy.impl_witness.dff: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.cba) [concrete] -// CHECK:STDOUT: %Destroy.facet.105: %Destroy.type = facet_value %array_type.6f1, (%Destroy.impl_witness.dff) [concrete] -// CHECK:STDOUT: %.0c7: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.105 [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.cc8: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.cba) [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.dcd: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.cc8 = struct_value () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.bf3: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.dcd, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.cba) [concrete] // CHECK:STDOUT: %complete_type.3e1: = complete_type_witness %ptr.cf4 [concrete] +// CHECK:STDOUT: %.793: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.cba) [concrete] +// CHECK:STDOUT: %Destroy.facet.105: %Destroy.type = facet_value %array_type.6f1, (%Destroy.impl_witness.dff) [concrete] +// CHECK:STDOUT: %.0c7: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.105 [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.bf3: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.dcd, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.cba) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -111,9 +113,10 @@ fn H() { G(3); } // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_22.2 [symbolic = %pattern_type (constants.%pattern_type.b5c)] // CHECK:STDOUT: %array: @G.%array_type.loc7_22.2 (%array_type.512) = tuple_value () [symbolic = %array (constants.%array.8ba)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.loc7_22.2, () [symbolic = %facet_value (constants.%facet_value.30f)] +// CHECK:STDOUT: %.loc7_3.2: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.loc7_3.2 (constants.%.019)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.aa0)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %array_type.loc7_22.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.49e)] -// CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc7_3.2 (constants.%.fb1)] +// CHECK:STDOUT: %.loc7_3.3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc7_3.3 (constants.%.fb1)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.cc4)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @G.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.cc4) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.44f)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.91d)] @@ -137,7 +140,7 @@ fn H() { G(3); } // CHECK:STDOUT: %array_type.loc7_22.1: type = array_type %int_0, %T.ref [symbolic = %array_type.loc7_22.2 (constants.%array_type.512)] // CHECK:STDOUT: } // CHECK:STDOUT: %arr: ref @G.%array_type.loc7_22.2 (%array_type.512) = ref_binding arr, %arr.var -// CHECK:STDOUT: %impl.elem0: @G.%.loc7_3.2 (%.fb1) = impl_witness_access constants.%Destroy.impl_witness.aa0, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.44f)] +// CHECK:STDOUT: %impl.elem0: @G.%.loc7_3.3 (%.fb1) = impl_witness_access constants.%Destroy.impl_witness.aa0, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.44f)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %arr.var, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.30f) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.91d)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %arr.var, %specific_fn @@ -160,9 +163,10 @@ fn H() { G(3); } // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9c8 // CHECK:STDOUT: %array => constants.%array.2e5 // CHECK:STDOUT: %facet_value => constants.%facet_value.cba +// CHECK:STDOUT: %.loc7_3.2 => constants.%.793 // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.dff // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.105 -// CHECK:STDOUT: %.loc7_3.2 => constants.%.0c7 +// CHECK:STDOUT: %.loc7_3.3 => constants.%.0c7 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.cc8 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.dcd // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.bf3 diff --git a/toolchain/check/testdata/class/destroy_calls.carbon b/toolchain/check/testdata/class/destroy_calls.carbon index c62aa6f5111cc..bbb1ff06bffba 100644 --- a/toolchain/check/testdata/class/destroy_calls.carbon +++ b/toolchain/check/testdata/class/destroy_calls.carbon @@ -391,6 +391,7 @@ fn G() { F({}); } // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.76f: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7d9 = struct_value () [template] // CHECK:STDOUT: %ptr.d75: type = ptr_type %C.3f0 [template] // CHECK:STDOUT: %require_complete.ba9: = require_complete_type %ptr.d75 [template] +// CHECK:STDOUT: %.3ed: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.bf8) [template] // CHECK:STDOUT: %Destroy.facet.a5b: %Destroy.type = facet_value %C.3f0, (%Destroy.impl_witness.a59) [template] // CHECK:STDOUT: %.4c5: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.a5b [template] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.5e4: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.76f, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.bf8) [template] @@ -398,13 +399,14 @@ fn G() { F({}); } // CHECK:STDOUT: %pattern_type.99a: type = pattern_type %C.7a7 [concrete] // CHECK:STDOUT: %facet_value.036: %type_where = facet_value %C.7a7, () [concrete] // CHECK:STDOUT: %Destroy.impl_witness.8e7: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.036) [concrete] -// CHECK:STDOUT: %Destroy.facet.056: %Destroy.type = facet_value %C.7a7, (%Destroy.impl_witness.8e7) [concrete] -// CHECK:STDOUT: %.1c0: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.056 [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c3a: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.036) [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.b3a: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c3a = struct_value () [concrete] // CHECK:STDOUT: %ptr.308: type = ptr_type %C.7a7 [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a93: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.b3a, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.036) [concrete] // CHECK:STDOUT: %complete_type.903: = complete_type_witness %ptr.308 [concrete] +// CHECK:STDOUT: %.8e4: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.036) [concrete] +// CHECK:STDOUT: %Destroy.facet.056: %Destroy.type = facet_value %C.7a7, (%Destroy.impl_witness.8e7) [concrete] +// CHECK:STDOUT: %.1c0: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.056 [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a93: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.b3a, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.036) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -429,9 +431,10 @@ fn G() { F({}); } // CHECK:STDOUT: %require_complete.loc7_13: = require_complete_type %C.loc7_13.2 [template = %require_complete.loc7_13 (constants.%require_complete.c98)] // CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc7_13.2 [template = %pattern_type (constants.%pattern_type.06f)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %C.loc7_13.2, () [template = %facet_value (constants.%facet_value.bf8)] +// CHECK:STDOUT: %.loc7_3.1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [template = %.loc7_3.1 (constants.%.3ed)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [template = %Destroy.impl_witness (constants.%Destroy.impl_witness.a59)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C.loc7_13.2, (%Destroy.impl_witness) [template = %Destroy.facet (constants.%Destroy.facet.a5b)] -// CHECK:STDOUT: %.loc7_3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [template = %.loc7_3 (constants.%.4c5)] +// CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [template = %.loc7_3.2 (constants.%.4c5)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [template = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.7d9)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.7d9) = struct_value () [template = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.76f)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [template = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.5e4)] @@ -451,7 +454,7 @@ fn G() { F({}); } // CHECK:STDOUT: %C.loc7_13.1: type = class_type @C, @C(constants.%T) [template = %C.loc7_13.2 (constants.%C.3f0)] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref @F.%C.loc7_13.2 (%C.3f0) = ref_binding v, %v.var -// CHECK:STDOUT: %impl.elem0: @F.%.loc7_3 (%.4c5) = impl_witness_access constants.%Destroy.impl_witness.a59, element0 [template = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.76f)] +// CHECK:STDOUT: %impl.elem0: @F.%.loc7_3.2 (%.4c5) = impl_witness_access constants.%Destroy.impl_witness.a59, element0 [template = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.76f)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.bf8) [template = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.5e4)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %v.var, %specific_fn @@ -473,9 +476,10 @@ fn G() { F({}); } // CHECK:STDOUT: %require_complete.loc7_13 => constants.%complete_type.357 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.99a // CHECK:STDOUT: %facet_value => constants.%facet_value.036 +// CHECK:STDOUT: %.loc7_3.1 => constants.%.8e4 // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.8e7 // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.056 -// CHECK:STDOUT: %.loc7_3 => constants.%.1c0 +// CHECK:STDOUT: %.loc7_3.2 => constants.%.1c0 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.c3a // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.b3a // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a93 diff --git a/toolchain/check/testdata/class/generic/basic.carbon b/toolchain/check/testdata/class/generic/basic.carbon index 20613d7ddf1c1..3694b1db70242 100644 --- a/toolchain/check/testdata/class/generic/basic.carbon +++ b/toolchain/check/testdata/class/generic/basic.carbon @@ -61,6 +61,7 @@ class Declaration(T:! type); // CHECK:STDOUT: %specific_impl_fn.103: = specific_impl_function %impl.elem0.fac, @Copy.Op(%T.417) [symbolic] // CHECK:STDOUT: %T.d9f: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] +// CHECK:STDOUT: %.d8a: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.binding.as_type) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.34c: = lookup_impl_witness %ptr.d8c, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.d8c, (%Copy.lookup_impl_witness.34c) [symbolic] // CHECK:STDOUT: %.dba: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [symbolic] @@ -185,10 +186,11 @@ class Declaration(T:! type); // CHECK:STDOUT: %require_complete.loc6_32: = require_complete_type %ptr.loc6_36.1 [symbolic = %require_complete.loc6_32 (constants.%require_complete.d1a)] // CHECK:STDOUT: %require_complete.loc6_22: = require_complete_type %Class [symbolic = %require_complete.loc6_22 (constants.%require_complete.f79)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem)] +// CHECK:STDOUT: %.loc7_12.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.binding.as_type) [symbolic = %.loc7_12.2 (constants.%.d8a)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc6_36.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.34c)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc6_36.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)] -// CHECK:STDOUT: %.loc7_12.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc7_12.2 (constants.%.dba)] -// CHECK:STDOUT: %impl.elem0.loc7_12.2: @Class.GetAddr.%.loc7_12.2 (%.dba) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.f88)] +// CHECK:STDOUT: %.loc7_12.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc7_12.3 (constants.%.dba)] +// CHECK:STDOUT: %impl.elem0.loc7_12.2: @Class.GetAddr.%.loc7_12.3 (%.dba) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.f88)] // CHECK:STDOUT: %specific_impl_fn.loc7_12.2: = specific_impl_function %impl.elem0.loc7_12.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc7_12.2 (constants.%specific_impl_fn.5e8)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @Class.GetAddr.%Class (%Class)) -> @Class.GetAddr.%ptr.loc6_36.1 (%ptr.d8c) { @@ -197,7 +199,7 @@ class Declaration(T:! type); // CHECK:STDOUT: %k.ref: @Class.GetAddr.%Class.elem (%Class.elem) = name_ref k, @Class.%.loc14_8 [concrete = @Class.%.loc14_8] // CHECK:STDOUT: %.loc7_17: ref @Class.GetAddr.%T.binding.as_type (%T.binding.as_type) = class_element_access %self.ref, element0 // CHECK:STDOUT: %addr: @Class.GetAddr.%ptr.loc6_36.1 (%ptr.d8c) = addr_of %.loc7_17 -// CHECK:STDOUT: %impl.elem0.loc7_12.1: @Class.GetAddr.%.loc7_12.2 (%.dba) = impl_witness_access constants.%Copy.lookup_impl_witness.34c, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.f88)] +// CHECK:STDOUT: %impl.elem0.loc7_12.1: @Class.GetAddr.%.loc7_12.3 (%.dba) = impl_witness_access constants.%Copy.lookup_impl_witness.34c, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.f88)] // CHECK:STDOUT: %bound_method.loc7_12.1: = bound_method %addr, %impl.elem0.loc7_12.1 // CHECK:STDOUT: %specific_impl_fn.loc7_12.1: = specific_impl_function %impl.elem0.loc7_12.1, @Copy.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc7_12.2 (constants.%specific_impl_fn.5e8)] // CHECK:STDOUT: %bound_method.loc7_12.2: = bound_method %addr, %specific_impl_fn.loc7_12.1 diff --git a/toolchain/check/testdata/class/generic/basic_addr.carbon b/toolchain/check/testdata/class/generic/basic_addr.carbon index 90d4d75dc14c9..ff66eae19de64 100644 --- a/toolchain/check/testdata/class/generic/basic_addr.carbon +++ b/toolchain/check/testdata/class/generic/basic_addr.carbon @@ -65,6 +65,7 @@ class Declaration(T:! type); // CHECK:STDOUT: %specific_impl_fn.103: = specific_impl_function %impl.elem0.fac, @Copy.Op(%T.417) [symbolic] // CHECK:STDOUT: %T.d9f: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] +// CHECK:STDOUT: %.d8a: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.binding.as_type) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.34c: = lookup_impl_witness %ptr.d8c, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.d8c, (%Copy.lookup_impl_witness.34c) [symbolic] // CHECK:STDOUT: %.dba: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [symbolic] @@ -193,10 +194,11 @@ class Declaration(T:! type); // CHECK:STDOUT: %require_complete.loc6_23: = require_complete_type %ptr.loc6_29.1 [symbolic = %require_complete.loc6_23 (constants.%require_complete.797)] // CHECK:STDOUT: %require_complete.loc7: = require_complete_type %Class [symbolic = %require_complete.loc7 (constants.%require_complete.f79)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem)] +// CHECK:STDOUT: %.loc7_12.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.binding.as_type) [symbolic = %.loc7_12.2 (constants.%.d8a)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc6_38.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.34c)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc6_38.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)] -// CHECK:STDOUT: %.loc7_12.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc7_12.2 (constants.%.dba)] -// CHECK:STDOUT: %impl.elem0.loc7_12.2: @Class.GetAddr.%.loc7_12.2 (%.dba) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.f88)] +// CHECK:STDOUT: %.loc7_12.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc7_12.3 (constants.%.dba)] +// CHECK:STDOUT: %impl.elem0.loc7_12.2: @Class.GetAddr.%.loc7_12.3 (%.dba) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.f88)] // CHECK:STDOUT: %specific_impl_fn.loc7_12.2: = specific_impl_function %impl.elem0.loc7_12.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc7_12.2 (constants.%specific_impl_fn.5e8)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @Class.GetAddr.%ptr.loc6_29.1 (%ptr.5a6)) -> @Class.GetAddr.%ptr.loc6_38.1 (%ptr.d8c) { @@ -206,7 +208,7 @@ class Declaration(T:! type); // CHECK:STDOUT: %k.ref: @Class.GetAddr.%Class.elem (%Class.elem) = name_ref k, @Class.%.loc14_8 [concrete = @Class.%.loc14_8] // CHECK:STDOUT: %.loc7_17.2: ref @Class.GetAddr.%T.binding.as_type (%T.binding.as_type) = class_element_access %.loc7_17.1, element0 // CHECK:STDOUT: %addr: @Class.GetAddr.%ptr.loc6_38.1 (%ptr.d8c) = addr_of %.loc7_17.2 -// CHECK:STDOUT: %impl.elem0.loc7_12.1: @Class.GetAddr.%.loc7_12.2 (%.dba) = impl_witness_access constants.%Copy.lookup_impl_witness.34c, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.f88)] +// CHECK:STDOUT: %impl.elem0.loc7_12.1: @Class.GetAddr.%.loc7_12.3 (%.dba) = impl_witness_access constants.%Copy.lookup_impl_witness.34c, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.f88)] // CHECK:STDOUT: %bound_method.loc7_12.1: = bound_method %addr, %impl.elem0.loc7_12.1 // CHECK:STDOUT: %specific_impl_fn.loc7_12.1: = specific_impl_function %impl.elem0.loc7_12.1, @Copy.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc7_12.2 (constants.%specific_impl_fn.5e8)] // CHECK:STDOUT: %bound_method.loc7_12.2: = bound_method %addr, %specific_impl_fn.loc7_12.1 diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index 429fd43e6dd5a..3a77e68c3b4b3 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -84,6 +84,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.61a: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.555 = struct_value () [symbolic] // CHECK:STDOUT: %ptr.289: type = ptr_type %Class.55f [symbolic] // CHECK:STDOUT: %require_complete.def: = require_complete_type %ptr.289 [symbolic] +// CHECK:STDOUT: %.b57: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.c52) [symbolic] // CHECK:STDOUT: %Destroy.facet.381: %Destroy.type = facet_value %Class.55f, (%Destroy.impl_witness.386) [symbolic] // CHECK:STDOUT: %.ab9: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.381 [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.95f: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.61a, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.c52) [symbolic] @@ -193,9 +194,10 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %specific_impl_fn.loc10_27.2: = specific_impl_function %impl.elem0.loc10_27.2, @Copy.Op(%T.loc9_26.1) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.103)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class.loc10_17.2, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem.4f3)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %Class.loc10_17.2, () [symbolic = %facet_value (constants.%facet_value.c52)] +// CHECK:STDOUT: %.loc10_3.2: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.loc10_3.2 (constants.%.b57)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.386)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Class.loc10_17.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.381)] -// CHECK:STDOUT: %.loc10_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc10_3.2 (constants.%.ab9)] +// CHECK:STDOUT: %.loc10_3.3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc10_3.3 (constants.%.ab9)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.555)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @InitFromStructGeneric.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.555) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.61a)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.95f)] @@ -239,7 +241,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %bound_method.loc11_11.2: = bound_method %.loc11_11.2, %specific_impl_fn.loc11 // CHECK:STDOUT: %.loc9_47: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = splice_block %return {} // CHECK:STDOUT: %.loc11_11.3: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = call %bound_method.loc11_11.2(%.loc11_11.2) to %.loc9_47 -// CHECK:STDOUT: %impl.elem0.loc10_3: @InitFromStructGeneric.%.loc10_3.2 (%.ab9) = impl_witness_access constants.%Destroy.impl_witness.386, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.61a)] +// CHECK:STDOUT: %impl.elem0.loc10_3: @InitFromStructGeneric.%.loc10_3.3 (%.ab9) = impl_witness_access constants.%Destroy.impl_witness.386, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.61a)] // CHECK:STDOUT: %bound_method.loc10_3.1: = bound_method %v.var, %impl.elem0.loc10_3 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc10_3, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.c52) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.95f)] // CHECK:STDOUT: %bound_method.loc10_3.2: = bound_method %v.var, %specific_fn diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index 7e47ef1901362..ae92b0de413b6 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -92,6 +92,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %T.d9f: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.75b: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.692: %ptr.as.Copy.impl.Op.type.75b = struct_value () [symbolic] +// CHECK:STDOUT: %.d8a: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.binding.as_type) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.34c: = lookup_impl_witness %ptr.d8c, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet.89c: %Copy.type = facet_value %ptr.d8c, (%Copy.lookup_impl_witness.34c) [symbolic] // CHECK:STDOUT: %.dba: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.89c [symbolic] @@ -131,6 +132,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Copy.impl_witness.be3: = impl_witness imports.%Copy.impl_witness_table.67d, @ptr.as.Copy.impl(%i32) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.d7c: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%i32) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.687: %ptr.as.Copy.impl.Op.type.d7c = struct_value () [concrete] +// CHECK:STDOUT: %.b55: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%i32) [concrete] // CHECK:STDOUT: %Copy.facet.687: %Copy.type = facet_value %ptr.235, (%Copy.impl_witness.be3) [concrete] // CHECK:STDOUT: %.cbc: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.687 [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.687, @ptr.as.Copy.impl.Op(%i32) [concrete] @@ -197,10 +199,11 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: %require_complete.loc15: = require_complete_type %Class [symbolic = %require_complete.loc15 (constants.%require_complete.f79)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem.bc9)] +// CHECK:STDOUT: %.loc15_12.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.binding.as_type) [symbolic = %.loc15_12.2 (constants.%.d8a)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc13_38.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.34c)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc13_38.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.89c)] -// CHECK:STDOUT: %.loc15_12.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc15_12.2 (constants.%.dba)] -// CHECK:STDOUT: %impl.elem0.loc15_12.2: @Class.GetAddr.%.loc15_12.2 (%.dba) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_12.2 (constants.%impl.elem0.f88)] +// CHECK:STDOUT: %.loc15_12.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc15_12.3 (constants.%.dba)] +// CHECK:STDOUT: %impl.elem0.loc15_12.2: @Class.GetAddr.%.loc15_12.3 (%.dba) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_12.2 (constants.%impl.elem0.f88)] // CHECK:STDOUT: %specific_impl_fn.loc15_12.2: = specific_impl_function %impl.elem0.loc15_12.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc15_12.2 (constants.%specific_impl_fn.5e8)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @Class.GetAddr.%ptr.loc13_29.1 (%ptr.5a6)) -> @Class.GetAddr.%ptr.loc13_38.1 (%ptr.d8c) { @@ -210,7 +213,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %x.ref: @Class.GetAddr.%Class.elem (%Class.elem.bc9) = name_ref x, @Class.%.loc5_8 [concrete = @Class.%.loc5_8] // CHECK:STDOUT: %.loc15_17.2: ref @Class.GetAddr.%T.binding.as_type (%T.binding.as_type) = class_element_access %.loc15_17.1, element0 // CHECK:STDOUT: %addr: @Class.GetAddr.%ptr.loc13_38.1 (%ptr.d8c) = addr_of %.loc15_17.2 -// CHECK:STDOUT: %impl.elem0.loc15_12.1: @Class.GetAddr.%.loc15_12.2 (%.dba) = impl_witness_access constants.%Copy.lookup_impl_witness.34c, element0 [symbolic = %impl.elem0.loc15_12.2 (constants.%impl.elem0.f88)] +// CHECK:STDOUT: %impl.elem0.loc15_12.1: @Class.GetAddr.%.loc15_12.3 (%.dba) = impl_witness_access constants.%Copy.lookup_impl_witness.34c, element0 [symbolic = %impl.elem0.loc15_12.2 (constants.%impl.elem0.f88)] // CHECK:STDOUT: %bound_method.loc15_12.1: = bound_method %addr, %impl.elem0.loc15_12.1 // CHECK:STDOUT: %specific_impl_fn.loc15_12.1: = specific_impl_function %impl.elem0.loc15_12.1, @Copy.Op(constants.%Copy.facet.89c) [symbolic = %specific_impl_fn.loc15_12.2 (constants.%specific_impl_fn.5e8)] // CHECK:STDOUT: %bound_method.loc15_12.2: = bound_method %addr, %specific_impl_fn.loc15_12.1 @@ -349,9 +352,10 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %require_complete.loc13_23 => constants.%complete_type.ae6 // CHECK:STDOUT: %require_complete.loc15 => constants.%complete_type.1ec // CHECK:STDOUT: %Class.elem => constants.%Class.elem.ef0 +// CHECK:STDOUT: %.loc15_12.2 => constants.%.b55 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.be3 // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.687 -// CHECK:STDOUT: %.loc15_12.2 => constants.%.cbc +// CHECK:STDOUT: %.loc15_12.3 => constants.%.cbc // CHECK:STDOUT: %impl.elem0.loc15_12.2 => constants.%ptr.as.Copy.impl.Op.687 // CHECK:STDOUT: %specific_impl_fn.loc15_12.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/member_type.carbon b/toolchain/check/testdata/class/generic/member_type.carbon index f024841ae51de..5d478f679ea85 100644 --- a/toolchain/check/testdata/class/generic/member_type.carbon +++ b/toolchain/check/testdata/class/generic/member_type.carbon @@ -442,6 +442,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %require_complete.4b7: = require_complete_type %T [symbolic] // CHECK:STDOUT: %require_complete.a8f: = require_complete_type %C.52d [symbolic] +// CHECK:STDOUT: %.ec4: require_specific_def_type = require_specific_def @C.as.Inner.impl(%T) [symbolic] // CHECK:STDOUT: %Inner.lookup_impl_witness: = lookup_impl_witness %C.52d, @Inner, @Inner(%T) [symbolic] // CHECK:STDOUT: %Inner.facet.318: %Inner.type.5f4 = facet_value %C.52d, (%Inner.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %.b0e: type = fn_type_with_self_type %Inner.F.type.b25, %Inner.facet.318 [symbolic] @@ -476,6 +477,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.impl_witness.f06: = impl_witness @C.%Inner.impl_witness_table, @C.as.Inner.impl(%i32) [concrete] // CHECK:STDOUT: %C.as.Inner.impl.F.type.aa4: type = fn_type @C.as.Inner.impl.F, @C.as.Inner.impl(%i32) [concrete] // CHECK:STDOUT: %C.as.Inner.impl.F.709: %C.as.Inner.impl.F.type.aa4 = struct_value () [concrete] +// CHECK:STDOUT: %.e9a: require_specific_def_type = require_specific_def @C.as.Inner.impl(%i32) [concrete] // CHECK:STDOUT: %Inner.facet.98e: %Inner.type.56c = facet_value %C.70f, (%Inner.impl_witness.f06) [concrete] // CHECK:STDOUT: %.3cd: type = fn_type_with_self_type %Inner.F.type.86e, %Inner.facet.98e [concrete] // CHECK:STDOUT: %C.as.Inner.impl.F.specific_fn: = specific_function %C.as.Inner.impl.F.709, @C.as.Inner.impl.F(%i32) [concrete] @@ -713,11 +715,12 @@ fn Test() -> i32 { // CHECK:STDOUT: %require_complete.loc11_48: = require_complete_type %Inner.type [symbolic = %require_complete.loc11_48 (constants.%require_complete.3ba)] // CHECK:STDOUT: %Inner.assoc_type: type = assoc_entity_type @Inner, @Inner(%T) [symbolic = %Inner.assoc_type (constants.%Inner.assoc_type.b54)] // CHECK:STDOUT: %assoc0: @C.as.Inner.impl.F.%Inner.assoc_type (%Inner.assoc_type.b54) = assoc_entity element0, @Inner.%Inner.F.decl [symbolic = %assoc0 (constants.%assoc0.dc7)] +// CHECK:STDOUT: %.loc11_41.1: require_specific_def_type = require_specific_def @C.as.Inner.impl(%T) [symbolic = %.loc11_41.1 (constants.%.ec4)] // CHECK:STDOUT: %Inner.lookup_impl_witness: = lookup_impl_witness %C, @Inner, @Inner(%T) [symbolic = %Inner.lookup_impl_witness (constants.%Inner.lookup_impl_witness)] // CHECK:STDOUT: %Inner.F.type: type = fn_type @Inner.F, @Inner(%T) [symbolic = %Inner.F.type (constants.%Inner.F.type.b25)] // CHECK:STDOUT: %Inner.facet: @C.as.Inner.impl.F.%Inner.type (%Inner.type.5f4) = facet_value %C, (%Inner.lookup_impl_witness) [symbolic = %Inner.facet (constants.%Inner.facet.318)] -// CHECK:STDOUT: %.loc11_41: type = fn_type_with_self_type %Inner.F.type, %Inner.facet [symbolic = %.loc11_41 (constants.%.b0e)] -// CHECK:STDOUT: %impl.elem0.loc11_41.2: @C.as.Inner.impl.F.%.loc11_41 (%.b0e) = impl_witness_access %Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_41.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %.loc11_41.2: type = fn_type_with_self_type %Inner.F.type, %Inner.facet [symbolic = %.loc11_41.2 (constants.%.b0e)] +// CHECK:STDOUT: %impl.elem0.loc11_41.2: @C.as.Inner.impl.F.%.loc11_41.2 (%.b0e) = impl_witness_access %Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_41.2 (constants.%impl.elem0)] // CHECK:STDOUT: %specific_impl_fn.loc11_41.2: = specific_impl_function %impl.elem0.loc11_41.2, @Inner.F(%T, %Inner.facet) [symbolic = %specific_impl_fn.loc11_41.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @C.as.Inner.impl.F.%C (%C.52d)) -> %return.param: @C.as.Inner.impl.F.%T (%T) { @@ -727,7 +730,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc11_43 [symbolic = %Inner.type (constants.%Inner.type.5f4)] // CHECK:STDOUT: %.loc11_48: @C.as.Inner.impl.F.%Inner.assoc_type (%Inner.assoc_type.b54) = specific_constant @Inner.%assoc0.loc6_28.1, @Inner(constants.%T) [symbolic = %assoc0 (constants.%assoc0.dc7)] // CHECK:STDOUT: %F.ref: @C.as.Inner.impl.F.%Inner.assoc_type (%Inner.assoc_type.b54) = name_ref F, %.loc11_48 [symbolic = %assoc0 (constants.%assoc0.dc7)] -// CHECK:STDOUT: %impl.elem0.loc11_41.1: @C.as.Inner.impl.F.%.loc11_41 (%.b0e) = impl_witness_access constants.%Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_41.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc11_41.1: @C.as.Inner.impl.F.%.loc11_41.2 (%.b0e) = impl_witness_access constants.%Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_41.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc11_41: = bound_method %self.ref, %impl.elem0.loc11_41.1 // CHECK:STDOUT: %specific_impl_fn.loc11_41.1: = specific_impl_function %impl.elem0.loc11_41.1, @Inner.F(constants.%T, constants.%Inner.facet.318) [symbolic = %specific_impl_fn.loc11_41.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.loc11_52: = bound_method %self.ref, %specific_impl_fn.loc11_41.1 @@ -908,10 +911,11 @@ fn Test() -> i32 { // CHECK:STDOUT: %require_complete.loc11_48 => constants.%complete_type.619 // CHECK:STDOUT: %Inner.assoc_type => constants.%Inner.assoc_type.215 // CHECK:STDOUT: %assoc0 => constants.%assoc0.eba +// CHECK:STDOUT: %.loc11_41.1 => constants.%.e9a // CHECK:STDOUT: %Inner.lookup_impl_witness => constants.%Inner.impl_witness.f06 // CHECK:STDOUT: %Inner.F.type => constants.%Inner.F.type.86e // CHECK:STDOUT: %Inner.facet => constants.%Inner.facet.98e -// CHECK:STDOUT: %.loc11_41 => constants.%.3cd +// CHECK:STDOUT: %.loc11_41.2 => constants.%.3cd // CHECK:STDOUT: %impl.elem0.loc11_41.2 => constants.%C.as.Inner.impl.F.709 // CHECK:STDOUT: %specific_impl_fn.loc11_41.2 => constants.%C.as.Inner.impl.F.specific_fn // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index 85370be7819c3..ee3931c427bda 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -59,6 +59,7 @@ class Class(T:! type) { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.47b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.85d = struct_value () [symbolic] // CHECK:STDOUT: %ptr.6fe: type = ptr_type %Class [symbolic] // CHECK:STDOUT: %require_complete.ecb: = require_complete_type %ptr.6fe [symbolic] +// CHECK:STDOUT: %.5ac: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Class, (%Destroy.impl_witness.fd0) [symbolic] // CHECK:STDOUT: %.610: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.47b, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic] @@ -183,9 +184,10 @@ class Class(T:! type) { // CHECK:STDOUT: %Class.MakeClass: @Class.F.%Class.MakeClass.type (%Class.MakeClass.type) = struct_value () [symbolic = %Class.MakeClass (constants.%Class.MakeClass)] // CHECK:STDOUT: %Class.MakeClass.specific_fn.loc22_19.2: = specific_function %Class.MakeClass, @Class.MakeClass(%T) [symbolic = %Class.MakeClass.specific_fn.loc22_19.2 (constants.%Class.MakeClass.specific_fn)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %Class.loc21_19.2, () [symbolic = %facet_value (constants.%facet_value)] +// CHECK:STDOUT: %.loc22_5.2: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.loc22_5.2 (constants.%.5ac)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.fd0)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Class.loc21_19.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] -// CHECK:STDOUT: %.loc22_5.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc22_5.2 (constants.%.610)] +// CHECK:STDOUT: %.loc22_5.3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc22_5.3 (constants.%.610)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.85d)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @Class.F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.85d) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.47b)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] @@ -227,13 +229,13 @@ class Class(T:! type) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc22_12.2 [symbolic = %Class.loc21_19.2 (constants.%Class)] // CHECK:STDOUT: } // CHECK:STDOUT: %s: ref @Class.F.%Class.loc21_19.2 (%Class) = ref_binding s, %s.var -// CHECK:STDOUT: %impl.elem0.loc22: @Class.F.%.loc22_5.2 (%.610) = impl_witness_access constants.%Destroy.impl_witness.fd0, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.47b)] +// CHECK:STDOUT: %impl.elem0.loc22: @Class.F.%.loc22_5.3 (%.610) = impl_witness_access constants.%Destroy.impl_witness.fd0, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.47b)] // CHECK:STDOUT: %bound_method.loc22_5.1: = bound_method %s.var, %impl.elem0.loc22 // CHECK:STDOUT: %specific_fn.loc22: = specific_function %impl.elem0.loc22, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] // CHECK:STDOUT: %bound_method.loc22_5.2: = bound_method %s.var, %specific_fn.loc22 // CHECK:STDOUT: %addr.loc22: @Class.F.%ptr (%ptr.6fe) = addr_of %s.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22_5.2(%addr.loc22) -// CHECK:STDOUT: %impl.elem0.loc21: @Class.F.%.loc22_5.2 (%.610) = impl_witness_access constants.%Destroy.impl_witness.fd0, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.47b)] +// CHECK:STDOUT: %impl.elem0.loc21: @Class.F.%.loc22_5.3 (%.610) = impl_witness_access constants.%Destroy.impl_witness.fd0, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.47b)] // CHECK:STDOUT: %bound_method.loc21_5.1: = bound_method %c.var, %impl.elem0.loc21 // CHECK:STDOUT: %specific_fn.loc21: = specific_function %impl.elem0.loc21, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] // CHECK:STDOUT: %bound_method.loc21_5.2: = bound_method %c.var, %specific_fn.loc21 diff --git a/toolchain/check/testdata/eval/aggregates.carbon b/toolchain/check/testdata/eval/aggregates.carbon index 1b7cde583fef4..65f65ca9b3f5e 100644 --- a/toolchain/check/testdata/eval/aggregates.carbon +++ b/toolchain/check/testdata/eval/aggregates.carbon @@ -523,6 +523,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.6fe: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.f78) [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.440: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.6fe = struct_value () [symbolic] // CHECK:STDOUT: %require_complete.930: = require_complete_type %ptr.e85 [symbolic] +// CHECK:STDOUT: %.83b: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.f78) [symbolic] // CHECK:STDOUT: %Destroy.facet.d98: %Destroy.type = facet_value %array_type.297, (%Destroy.impl_witness.fed) [symbolic] // CHECK:STDOUT: %.539: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.d98 [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.cd0: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.440, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.f78) [symbolic] @@ -532,6 +533,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.a8b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.722 = struct_value () [symbolic] // CHECK:STDOUT: %ptr.ee1: type = ptr_type %struct_type.a [symbolic] // CHECK:STDOUT: %require_complete.739: = require_complete_type %ptr.ee1 [symbolic] +// CHECK:STDOUT: %.76e: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d02) [symbolic] // CHECK:STDOUT: %Destroy.facet.1ca: %Destroy.type = facet_value %struct_type.a, (%Destroy.impl_witness.e1b) [symbolic] // CHECK:STDOUT: %.506: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.1ca [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.df3: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.a8b, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.d02) [symbolic] @@ -541,6 +543,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.2b6: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.36c = struct_value () [symbolic] // CHECK:STDOUT: %ptr.e22: type = ptr_type %tuple.type.2d0 [symbolic] // CHECK:STDOUT: %require_complete.dc5: = require_complete_type %ptr.e22 [symbolic] +// CHECK:STDOUT: %.64b: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.0f0) [symbolic] // CHECK:STDOUT: %Destroy.facet.ce6: %Destroy.type = facet_value %tuple.type.2d0, (%Destroy.impl_witness.ef2) [symbolic] // CHECK:STDOUT: %.271: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.ce6 [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.e81: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.2b6, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.0f0) [symbolic] @@ -570,6 +573,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.405: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.8c5) [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.a68: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.405 = struct_value () [symbolic] // CHECK:STDOUT: %require_complete.ced: = require_complete_type %ptr.330 [symbolic] +// CHECK:STDOUT: %.b21: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.8c5) [symbolic] // CHECK:STDOUT: %Destroy.facet.bb1: %Destroy.type = facet_value %array_type.58c, (%Destroy.impl_witness.db6) [symbolic] // CHECK:STDOUT: %.cc4: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.bb1 [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.695: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.a68, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.8c5) [symbolic] @@ -598,27 +602,30 @@ fn G(N:! i32) { // CHECK:STDOUT: %require_complete.loc8_20: = require_complete_type %array_type.loc8_20.2 [symbolic = %require_complete.loc8_20 (constants.%require_complete.e3e)] // CHECK:STDOUT: %pattern_type.loc8: type = pattern_type %array_type.loc8_20.2 [symbolic = %pattern_type.loc8 (constants.%pattern_type.9a2)] // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value %array_type.loc8_20.2, () [symbolic = %facet_value.loc8 (constants.%facet_value.f78)] +// CHECK:STDOUT: %.loc8_3.1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc8) [symbolic = %.loc8_3.1 (constants.%.83b)] // CHECK:STDOUT: %Destroy.impl_witness.loc8: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc8) [symbolic = %Destroy.impl_witness.loc8 (constants.%Destroy.impl_witness.fed)] // CHECK:STDOUT: %Destroy.facet.loc8: %Destroy.type = facet_value %array_type.loc8_20.2, (%Destroy.impl_witness.loc8) [symbolic = %Destroy.facet.loc8 (constants.%Destroy.facet.d98)] -// CHECK:STDOUT: %.loc8_3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc8 [symbolic = %.loc8_3 (constants.%.539)] +// CHECK:STDOUT: %.loc8_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc8 [symbolic = %.loc8_3.2 (constants.%.539)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc8: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc8) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.6fe)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc8 (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.6fe) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.440)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc8: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc8) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.cd0)] // CHECK:STDOUT: %ptr.loc8: type = ptr_type %array_type.loc8_20.2 [symbolic = %ptr.loc8 (constants.%ptr.e85)] // CHECK:STDOUT: %require_complete.loc8_3: = require_complete_type %ptr.loc8 [symbolic = %require_complete.loc8_3 (constants.%require_complete.930)] // CHECK:STDOUT: %facet_value.loc7: %type_where = facet_value %struct_type.a.loc7_16.2, () [symbolic = %facet_value.loc7 (constants.%facet_value.d02)] +// CHECK:STDOUT: %.loc7_3.1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc7) [symbolic = %.loc7_3.1 (constants.%.76e)] // CHECK:STDOUT: %Destroy.impl_witness.loc7: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc7) [symbolic = %Destroy.impl_witness.loc7 (constants.%Destroy.impl_witness.e1b)] // CHECK:STDOUT: %Destroy.facet.loc7: %Destroy.type = facet_value %struct_type.a.loc7_16.2, (%Destroy.impl_witness.loc7) [symbolic = %Destroy.facet.loc7 (constants.%Destroy.facet.1ca)] -// CHECK:STDOUT: %.loc7_3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc7 [symbolic = %.loc7_3 (constants.%.506)] +// CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc7 [symbolic = %.loc7_3.2 (constants.%.506)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc7: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc7) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.722)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc7 (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.722) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a8b)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc7: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc7) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.df3)] // CHECK:STDOUT: %ptr.loc7: type = ptr_type %struct_type.a.loc7_16.2 [symbolic = %ptr.loc7 (constants.%ptr.ee1)] // CHECK:STDOUT: %require_complete.loc7_3: = require_complete_type %ptr.loc7 [symbolic = %require_complete.loc7_3 (constants.%require_complete.739)] // CHECK:STDOUT: %facet_value.loc6: %type_where = facet_value %tuple.type, () [symbolic = %facet_value.loc6 (constants.%facet_value.0f0)] +// CHECK:STDOUT: %.loc6_3.1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc6) [symbolic = %.loc6_3.1 (constants.%.64b)] // CHECK:STDOUT: %Destroy.impl_witness.loc6: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc6) [symbolic = %Destroy.impl_witness.loc6 (constants.%Destroy.impl_witness.ef2)] // CHECK:STDOUT: %Destroy.facet.loc6: %Destroy.type = facet_value %tuple.type, (%Destroy.impl_witness.loc6) [symbolic = %Destroy.facet.loc6 (constants.%Destroy.facet.ce6)] -// CHECK:STDOUT: %.loc6_3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc6 [symbolic = %.loc6_3 (constants.%.271)] +// CHECK:STDOUT: %.loc6_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc6 [symbolic = %.loc6_3.2 (constants.%.271)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc6: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc6) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.36c)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc6 (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.36c) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.2b6)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc6: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc6) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.e81)] @@ -662,19 +669,19 @@ fn G(N:! i32) { // CHECK:STDOUT: %array_type.loc8_20.1: type = array_type %int_5, %T.ref.loc8 [symbolic = %array_type.loc8_20.2 (constants.%array_type.297)] // CHECK:STDOUT: } // CHECK:STDOUT: %w: ref @F.%array_type.loc8_20.2 (%array_type.297) = ref_binding w, %w.var -// CHECK:STDOUT: %impl.elem0.loc8: @F.%.loc8_3 (%.539) = impl_witness_access constants.%Destroy.impl_witness.fed, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.440)] +// CHECK:STDOUT: %impl.elem0.loc8: @F.%.loc8_3.2 (%.539) = impl_witness_access constants.%Destroy.impl_witness.fed, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.440)] // CHECK:STDOUT: %bound_method.loc8_3.1: = bound_method %w.var, %impl.elem0.loc8 // CHECK:STDOUT: %specific_fn.loc8: = specific_function %impl.elem0.loc8, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.f78) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.cd0)] // CHECK:STDOUT: %bound_method.loc8_3.2: = bound_method %w.var, %specific_fn.loc8 // CHECK:STDOUT: %addr.loc8: @F.%ptr.loc8 (%ptr.e85) = addr_of %w.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8_3.2(%addr.loc8) -// CHECK:STDOUT: %impl.elem0.loc7: @F.%.loc7_3 (%.506) = impl_witness_access constants.%Destroy.impl_witness.e1b, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a8b)] +// CHECK:STDOUT: %impl.elem0.loc7: @F.%.loc7_3.2 (%.506) = impl_witness_access constants.%Destroy.impl_witness.e1b, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a8b)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem0.loc7 // CHECK:STDOUT: %specific_fn.loc7: = specific_function %impl.elem0.loc7, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.d02) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.df3)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %v.var, %specific_fn.loc7 // CHECK:STDOUT: %addr.loc7: @F.%ptr.loc7 (%ptr.ee1) = addr_of %v.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc7: init %empty_tuple.type = call %bound_method.loc7_3.2(%addr.loc7) -// CHECK:STDOUT: %impl.elem0.loc6: @F.%.loc6_3 (%.271) = impl_witness_access constants.%Destroy.impl_witness.ef2, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.2b6)] +// CHECK:STDOUT: %impl.elem0.loc6: @F.%.loc6_3.2 (%.271) = impl_witness_access constants.%Destroy.impl_witness.ef2, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.2b6)] // CHECK:STDOUT: %bound_method.loc6_3.1: = bound_method %u.var, %impl.elem0.loc6 // CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.0f0) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.e81)] // CHECK:STDOUT: %bound_method.loc6_3.2: = bound_method %u.var, %specific_fn.loc6 @@ -695,9 +702,10 @@ fn G(N:! i32) { // CHECK:STDOUT: %require_complete.loc14_22: = require_complete_type %array_type.loc14_22.2 [symbolic = %require_complete.loc14_22 (constants.%require_complete.33a)] // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc14_22.2 [symbolic = %pattern_type (constants.%pattern_type.e6c)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.loc14_22.2, () [symbolic = %facet_value (constants.%facet_value.8c5)] +// CHECK:STDOUT: %.loc14_3.1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.loc14_3.1 (constants.%.b21)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.db6)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %array_type.loc14_22.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.bb1)] -// CHECK:STDOUT: %.loc14_3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc14_3 (constants.%.cc4)] +// CHECK:STDOUT: %.loc14_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc14_3.2 (constants.%.cc4)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.405)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @G.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.405) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a68)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.695)] @@ -725,7 +733,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %array_type.loc14_22.1: type = array_type %.loc14_21.2, %i32.loc14 [symbolic = %array_type.loc14_22.2 (constants.%array_type.58c)] // CHECK:STDOUT: } // CHECK:STDOUT: %k: ref @G.%array_type.loc14_22.2 (%array_type.58c) = ref_binding k, %k.var -// CHECK:STDOUT: %impl.elem0.loc14_3: @G.%.loc14_3 (%.cc4) = impl_witness_access constants.%Destroy.impl_witness.db6, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a68)] +// CHECK:STDOUT: %impl.elem0.loc14_3: @G.%.loc14_3.2 (%.cc4) = impl_witness_access constants.%Destroy.impl_witness.db6, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a68)] // CHECK:STDOUT: %bound_method.loc14_3.1: = bound_method %k.var, %impl.elem0.loc14_3 // CHECK:STDOUT: %specific_fn.loc14_3: = specific_function %impl.elem0.loc14_3, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.8c5) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.695)] // CHECK:STDOUT: %bound_method.loc14_3.2: = bound_method %k.var, %specific_fn.loc14_3 diff --git a/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon b/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon index f0d2adf8dbb1b..baa8cb5aa5521 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon @@ -529,6 +529,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: %Animal.lookup_impl_witness: = lookup_impl_witness %W, @Animal [symbolic] // CHECK:STDOUT: %Animal.facet: %Animal.type = facet_value %W.binding.as_type, (%Animal.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %Eats.impl_witness.4bd: = impl_witness file.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%Animal.facet) [symbolic] +// CHECK:STDOUT: %.16f: require_specific_def_type = require_specific_def @A.binding.as_type.as.Eats.impl(%Animal.facet) [symbolic] // CHECK:STDOUT: %Eats.lookup_impl_witness: = lookup_impl_witness %W, @Eats [symbolic] // CHECK:STDOUT: %Tame.lookup_impl_witness: = lookup_impl_witness %W, @Tame [symbolic] // CHECK:STDOUT: %facet_value: %facet_type.807 = facet_value %W.binding.as_type, (%Eats.lookup_impl_witness, %Tame.lookup_impl_witness) [symbolic] @@ -682,6 +683,9 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %W.binding.as_type [symbolic = %require_complete (constants.%require_complete.b58)] +// CHECK:STDOUT: %Animal.lookup_impl_witness: = lookup_impl_witness %W.loc11_22.1, @Animal [symbolic = %Animal.lookup_impl_witness (constants.%Animal.lookup_impl_witness)] +// CHECK:STDOUT: %Animal.facet: %Animal.type = facet_value %W.binding.as_type, (%Animal.lookup_impl_witness) [symbolic = %Animal.facet (constants.%Animal.facet)] +// CHECK:STDOUT: %.loc12_14.3: require_specific_def_type = require_specific_def @A.binding.as_type.as.Eats.impl(%Animal.facet) [symbolic = %.loc12_14.3 (constants.%.16f)] // CHECK:STDOUT: %Eats.lookup_impl_witness: = lookup_impl_witness %W.loc11_22.1, @Eats [symbolic = %Eats.lookup_impl_witness (constants.%Eats.lookup_impl_witness)] // CHECK:STDOUT: %Tame.lookup_impl_witness: = lookup_impl_witness %W.loc11_22.1, @Tame [symbolic = %Tame.lookup_impl_witness (constants.%Tame.lookup_impl_witness)] // CHECK:STDOUT: %facet_value.loc12_14.3: %facet_type.807 = facet_value %W.binding.as_type, (%Eats.lookup_impl_witness, %Tame.lookup_impl_witness) [symbolic = %facet_value.loc12_14.3 (constants.%facet_value)] diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon index 2cc1d285033ec..dadc779c67076 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon @@ -49,6 +49,7 @@ fn HandleAnimal[T:! Animal](a: T) { Feed(a); } // CHECK:STDOUT: %HandleAnimal: %HandleAnimal.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.c0f: = require_complete_type %T.binding.as_type.5cd [symbolic] // CHECK:STDOUT: %Eats.impl_witness.62c94e.2: = impl_witness file.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%T.84c) [symbolic] +// CHECK:STDOUT: %.cd5: require_specific_def_type = require_specific_def @A.binding.as_type.as.Eats.impl(%T.84c) [symbolic] // CHECK:STDOUT: %Eats.lookup_impl_witness: = lookup_impl_witness %T.84c, @Eats [symbolic] // CHECK:STDOUT: %Eats.facet: %Eats.type = facet_value %T.binding.as_type.5cd, (%Eats.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %Feed.specific_fn: = specific_function %Feed, @Feed(%Eats.facet) [symbolic] @@ -175,6 +176,7 @@ fn HandleAnimal[T:! Animal](a: T) { Feed(a); } // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.c0f)] +// CHECK:STDOUT: %.loc22_43.3: require_specific_def_type = require_specific_def @A.binding.as_type.as.Eats.impl(%T.loc22_17.1) [symbolic = %.loc22_43.3 (constants.%.cd5)] // CHECK:STDOUT: %Eats.lookup_impl_witness: = lookup_impl_witness %T.loc22_17.1, @Eats [symbolic = %Eats.lookup_impl_witness (constants.%Eats.lookup_impl_witness)] // CHECK:STDOUT: %Eats.facet.loc22_43.3: %Eats.type = facet_value %T.binding.as_type, (%Eats.lookup_impl_witness) [symbolic = %Eats.facet.loc22_43.3 (constants.%Eats.facet)] // CHECK:STDOUT: %Feed.specific_fn.loc22_37.2: = specific_function constants.%Feed, @Feed(%Eats.facet.loc22_43.3) [symbolic = %Feed.specific_fn.loc22_37.2 (constants.%Feed.specific_fn)] diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon index e001cf88b66f5..df4942e9fa30b 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon @@ -93,6 +93,7 @@ fn F() { // CHECK:STDOUT: %Eats.type.98f93b.2: type = facet_type <@Eats, @Eats(%Food.binding.as_type.86a)> [symbolic] // CHECK:STDOUT: %require_complete.cc38c8.2: = require_complete_type %Eats.type.98f93b.2 [symbolic] // CHECK:STDOUT: %Eats.impl_witness.42a0e2.2: = impl_witness file.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%A, %Food.e7a) [symbolic] +// CHECK:STDOUT: %.f1a: require_specific_def_type = require_specific_def @T.binding.as_type.as.Eats.impl(%A, %Food.e7a) [symbolic] // CHECK:STDOUT: %Eats.lookup_impl_witness: = lookup_impl_witness %A, @Eats, @Eats(%Food.binding.as_type.86a) [symbolic] // CHECK:STDOUT: %Eats.facet.bda: %Eats.type.98f93b.2 = facet_value %A.binding.as_type, (%Eats.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %pattern_type.5a9: type = pattern_type %Eats.type.98f93b.2 [symbolic] @@ -122,6 +123,7 @@ fn F() { // CHECK:STDOUT: %Self.026: %Eats.type.cee = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %complete_type.eba: = complete_type_witness %Eats.type.cee [concrete] // CHECK:STDOUT: %Eats.impl_witness.7f7: = impl_witness file.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%Animal.facet, %Edible.facet) [concrete] +// CHECK:STDOUT: %.8d1: require_specific_def_type = require_specific_def @T.binding.as_type.as.Eats.impl(%Animal.facet, %Edible.facet) [concrete] // CHECK:STDOUT: %Eats.facet.179: %Eats.type.cee = facet_value %Goat, (%Eats.impl_witness.7f7) [concrete] // CHECK:STDOUT: %pattern_type.cf8: type = pattern_type %Eats.type.cee [concrete] // CHECK:STDOUT: %Feed.specific_fn.577: = specific_function %Feed, @Feed(%Edible.facet, %Eats.facet.179) [concrete] @@ -375,6 +377,7 @@ fn F() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc32_45: = require_complete_type %A.binding.as_type [symbolic = %require_complete.loc32_45 (constants.%require_complete.c0f)] // CHECK:STDOUT: %require_complete.loc32_54: = require_complete_type %Food.binding.as_type [symbolic = %require_complete.loc32_54 (constants.%require_complete.74d)] +// CHECK:STDOUT: %.loc32_76.4: require_specific_def_type = require_specific_def @T.binding.as_type.as.Eats.impl(%A.loc32_17.1, %Food.loc32_29.1) [symbolic = %.loc32_76.4 (constants.%.f1a)] // CHECK:STDOUT: %Eats.lookup_impl_witness: = lookup_impl_witness %A.loc32_17.1, @Eats, @Eats(%Food.binding.as_type) [symbolic = %Eats.lookup_impl_witness (constants.%Eats.lookup_impl_witness)] // CHECK:STDOUT: %Eats.type: type = facet_type <@Eats, @Eats(%Food.binding.as_type)> [symbolic = %Eats.type (constants.%Eats.type.98f93b.2)] // CHECK:STDOUT: %Eats.facet.loc32_76.2: @HandleAnimal.%Eats.type (%Eats.type.98f93b.2) = facet_value %A.binding.as_type, (%Eats.lookup_impl_witness) [symbolic = %Eats.facet.loc32_76.2 (constants.%Eats.facet.bda)] @@ -527,20 +530,13 @@ fn F() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc32_45 => constants.%complete_type.357 // CHECK:STDOUT: %require_complete.loc32_54 => constants.%complete_type.357 +// CHECK:STDOUT: %.loc32_76.4 => constants.%.8d1 // CHECK:STDOUT: %Eats.lookup_impl_witness => constants.%Eats.impl_witness.7f7 // CHECK:STDOUT: %Eats.type => constants.%Eats.type.cee // CHECK:STDOUT: %Eats.facet.loc32_76.2 => constants.%Eats.facet.179 // CHECK:STDOUT: %Feed.specific_fn.loc32_64.2 => constants.%Feed.specific_fn.577 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Eats(constants.%Grass) { -// CHECK:STDOUT: %Food.loc21_16.1 => constants.%Grass -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Eats.type => constants.%Eats.type.cee -// CHECK:STDOUT: %Self.loc21_29.2 => constants.%Self.026 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @T.binding.as_type.as.Eats.impl(constants.%Animal.facet, constants.%Edible.facet) { // CHECK:STDOUT: %T.loc26_14.2 => constants.%Animal.facet // CHECK:STDOUT: %U.loc26_26.2 => constants.%Edible.facet @@ -553,6 +549,14 @@ fn F() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Eats(constants.%Grass) { +// CHECK:STDOUT: %Food.loc21_16.1 => constants.%Grass +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Eats.type => constants.%Eats.type.cee +// CHECK:STDOUT: %Self.loc21_29.2 => constants.%Self.026 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @Feed(constants.%Edible.facet, constants.%Eats.facet.179) { // CHECK:STDOUT: %Food.loc31_9.1 => constants.%Edible.facet // CHECK:STDOUT: %Food.binding.as_type => constants.%Grass diff --git a/toolchain/check/testdata/function/generic/call.carbon b/toolchain/check/testdata/function/generic/call.carbon index 25e3a85cb78fa..0662ec7b21039 100644 --- a/toolchain/check/testdata/function/generic/call.carbon +++ b/toolchain/check/testdata/function/generic/call.carbon @@ -93,6 +93,7 @@ fn CallSpecific(x: C*) -> C* { // CHECK:STDOUT: %pattern_type.a60: type = pattern_type %ptr.4f0 [symbolic] // CHECK:STDOUT: %require_complete.482: = require_complete_type %ptr.4f0 [symbolic] // CHECK:STDOUT: %Function.specific_fn.c1b: = specific_function %Function, @Function(%T.417) [symbolic] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet.747: %Copy.type = facet_value %ptr.4f0, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %Function.specific_fn.244: = specific_function %Function, @Function(%Copy.facet.747) [symbolic] @@ -203,6 +204,7 @@ fn CallSpecific(x: C*) -> C* { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: +// CHECK:STDOUT: %.loc18_24.4: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc16_19.1) [symbolic = %.loc18_24.4 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc16_33.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet.loc18_24.4: %Copy.type = facet_value %ptr.loc16_33.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc18_24.4 (constants.%Copy.facet.747)] // CHECK:STDOUT: %Function.specific_fn.loc18_10.2: = specific_function constants.%Function, @Function(%Copy.facet.loc18_24.4) [symbolic = %Function.specific_fn.loc18_10.2 (constants.%Function.specific_fn.244)] @@ -316,6 +318,7 @@ fn CallSpecific(x: C*) -> C* { // CHECK:STDOUT: %pattern_type.a60: type = pattern_type %ptr.4f0 [symbolic] // CHECK:STDOUT: %require_complete.482: = require_complete_type %ptr.4f0 [symbolic] // CHECK:STDOUT: %Function.specific_fn.c1b: = specific_function %Function, @Function(%T.417) [symbolic] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet.747: %Copy.type = facet_value %ptr.4f0, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %Function.specific_fn.244: = specific_function %Function, @Function(%Copy.facet.747) [symbolic] @@ -425,6 +428,7 @@ fn CallSpecific(x: C*) -> C* { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: +// CHECK:STDOUT: %.loc18_20.3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc16_19.1) [symbolic = %.loc18_20.3 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc16_33.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet.loc18_20.3: %Copy.type = facet_value %ptr.loc16_33.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc18_20.3 (constants.%Copy.facet.747)] // CHECK:STDOUT: %Function.specific_fn.loc18_10.2: = specific_function constants.%Function, @Function(%Copy.facet.loc18_20.3) [symbolic = %Function.specific_fn.loc18_10.2 (constants.%Function.specific_fn.244)] diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 2ca3f952b5fe9..989d17132f506 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -1591,6 +1591,7 @@ fn F() { // CHECK:STDOUT: %CC.type: type = generic_class_type @CC [concrete] // CHECK:STDOUT: %CC.generic: %CC.type = struct_value () [concrete] // CHECK:STDOUT: %CC.218: type = class_type @CC, @CC(%D) [symbolic] +// CHECK:STDOUT: %.7ec: require_specific_def_type = require_specific_def @DD.as.Z.impl(%E) [symbolic] // CHECK:STDOUT: %Z.lookup_impl_witness: = lookup_impl_witness %DD.1e7, @Z [symbolic] // CHECK:STDOUT: %Z.facet.4e5: %Z.type = facet_value %DD.1e7, (%Z.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %CC.fef: type = class_type @CC, @CC(%Z.facet.4e5) [symbolic] @@ -1599,6 +1600,7 @@ fn F() { // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %DD.689: type = class_type @DD, @DD(%EE) [concrete] // CHECK:STDOUT: %Z.impl_witness.5de: = impl_witness file.%Z.impl_witness_table.loc9, @DD.as.Z.impl(%EE) [concrete] +// CHECK:STDOUT: %.889: require_specific_def_type = require_specific_def @DD.as.Z.impl(%EE) [concrete] // CHECK:STDOUT: %Z.facet.72a: %Z.type = facet_value %DD.689, (%Z.impl_witness.5de) [concrete] // CHECK:STDOUT: %CC.86a: type = class_type @CC, @CC(%Z.facet.72a) [concrete] // CHECK:STDOUT: %Z.impl_witness.516: = impl_witness file.%Z.impl_witness_table.loc12, @CC.as.Z.impl(%EE) [concrete] @@ -1665,7 +1667,7 @@ fn F() { // CHECK:STDOUT: %E.ref: type = name_ref E, %E.loc12_14.1 [symbolic = %E.loc12_14.2 (constants.%E)] // CHECK:STDOUT: %DD.loc12_31.1: type = class_type @DD, @DD(constants.%E) [symbolic = %DD.loc12_31.2 (constants.%DD.1e7)] // CHECK:STDOUT: %Z.facet.loc12_32.1: %Z.type = facet_value %DD.loc12_31.1, (constants.%Z.lookup_impl_witness) [symbolic = %Z.facet.loc12_32.2 (constants.%Z.facet.4e5)] -// CHECK:STDOUT: %.loc12: %Z.type = converted %DD.loc12_31.1, %Z.facet.loc12_32.1 [symbolic = %Z.facet.loc12_32.2 (constants.%Z.facet.4e5)] +// CHECK:STDOUT: %.loc12_32.1: %Z.type = converted %DD.loc12_31.1, %Z.facet.loc12_32.1 [symbolic = %Z.facet.loc12_32.2 (constants.%Z.facet.4e5)] // CHECK:STDOUT: %CC.loc12_32.1: type = class_type @CC, @CC(constants.%Z.facet.4e5) [symbolic = %CC.loc12_32.2 (constants.%CC.fef)] // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] @@ -1705,6 +1707,7 @@ fn F() { // CHECK:STDOUT: generic impl @CC.as.Z.impl(%E.loc12_14.1: type) { // CHECK:STDOUT: %E.loc12_14.2: type = symbolic_binding E, 0 [symbolic = %E.loc12_14.2 (constants.%E)] // CHECK:STDOUT: %DD.loc12_31.2: type = class_type @DD, @DD(%E.loc12_14.2) [symbolic = %DD.loc12_31.2 (constants.%DD.1e7)] +// CHECK:STDOUT: %.loc12_32.2: require_specific_def_type = require_specific_def @DD.as.Z.impl(%E.loc12_14.2) [symbolic = %.loc12_32.2 (constants.%.7ec)] // CHECK:STDOUT: %Z.lookup_impl_witness: = lookup_impl_witness %DD.loc12_31.2, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)] // CHECK:STDOUT: %Z.facet.loc12_32.2: %Z.type = facet_value %DD.loc12_31.2, (%Z.lookup_impl_witness) [symbolic = %Z.facet.loc12_32.2 (constants.%Z.facet.4e5)] // CHECK:STDOUT: %CC.loc12_32.2: type = class_type @CC, @CC(%Z.facet.loc12_32.2) [symbolic = %CC.loc12_32.2 (constants.%CC.fef)] @@ -1792,6 +1795,7 @@ fn F() { // CHECK:STDOUT: specific @CC.as.Z.impl(constants.%E) { // CHECK:STDOUT: %E.loc12_14.2 => constants.%E // CHECK:STDOUT: %DD.loc12_31.2 => constants.%DD.1e7 +// CHECK:STDOUT: %.loc12_32.2 => constants.%.7ec // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness // CHECK:STDOUT: %Z.facet.loc12_32.2 => constants.%Z.facet.4e5 // CHECK:STDOUT: %CC.loc12_32.2 => constants.%CC.fef @@ -1817,6 +1821,7 @@ fn F() { // CHECK:STDOUT: specific @CC.as.Z.impl(constants.%EE) { // CHECK:STDOUT: %E.loc12_14.2 => constants.%EE // CHECK:STDOUT: %DD.loc12_31.2 => constants.%DD.689 +// CHECK:STDOUT: %.loc12_32.2 => constants.%.889 // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.impl_witness.5de // CHECK:STDOUT: %Z.facet.loc12_32.2 => constants.%Z.facet.72a // CHECK:STDOUT: %CC.loc12_32.2 => constants.%CC.86a diff --git a/toolchain/check/testdata/function/generic/indirect_generic_type.carbon b/toolchain/check/testdata/function/generic/indirect_generic_type.carbon index ee11c2543297c..3c3f3a97c485b 100644 --- a/toolchain/check/testdata/function/generic/indirect_generic_type.carbon +++ b/toolchain/check/testdata/function/generic/indirect_generic_type.carbon @@ -30,6 +30,7 @@ fn F(T:! type, p: T**) -> T* { // CHECK:STDOUT: %pattern_type.a60: type = pattern_type %ptr.4f0 [symbolic] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.4f0, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %.89d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [symbolic] @@ -45,10 +46,11 @@ fn F(T:! type, p: T**) -> T* { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: +// CHECK:STDOUT: %.loc6_10.4: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc4_6.1) [symbolic = %.loc6_10.4 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc4_20.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc4_20.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)] -// CHECK:STDOUT: %.loc6_10.4: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc6_10.4 (constants.%.89d)] -// CHECK:STDOUT: %impl.elem0.loc6_10.2: @F.%.loc6_10.4 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %.loc6_10.5: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc6_10.5 (constants.%.89d)] +// CHECK:STDOUT: %impl.elem0.loc6_10.2: @F.%.loc6_10.5 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %specific_impl_fn.loc6_10.2: = specific_impl_function %impl.elem0.loc6_10.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%p.param: @F.%ptr.loc4_21.1 (%ptr.3f2)) -> @F.%ptr.loc4_20.1 (%ptr.4f0) { @@ -56,7 +58,7 @@ fn F(T:! type, p: T**) -> T* { // CHECK:STDOUT: %p.ref: @F.%ptr.loc4_21.1 (%ptr.3f2) = name_ref p, %p // CHECK:STDOUT: %.loc6_10.1: ref @F.%ptr.loc4_20.1 (%ptr.4f0) = deref %p.ref // CHECK:STDOUT: %.loc6_10.2: @F.%ptr.loc4_20.1 (%ptr.4f0) = acquire_value %.loc6_10.1 -// CHECK:STDOUT: %impl.elem0.loc6_10.1: @F.%.loc6_10.4 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %impl.elem0.loc6_10.1: @F.%.loc6_10.5 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %bound_method.loc6_10.1: = bound_method %.loc6_10.2, %impl.elem0.loc6_10.1 // CHECK:STDOUT: %specific_impl_fn.loc6_10.1: = specific_impl_function %impl.elem0.loc6_10.1, @Copy.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: %bound_method.loc6_10.2: = bound_method %.loc6_10.2, %specific_impl_fn.loc6_10.1 diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index 6058849abc2ac..0581a31a4d233 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -67,6 +67,7 @@ fn CallNegative() { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.3be: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.353 = struct_value () [symbolic] // CHECK:STDOUT: %ptr.1cf: type = ptr_type %Int [symbolic] // CHECK:STDOUT: %require_complete.6ca: = require_complete_type %ptr.1cf [symbolic] +// CHECK:STDOUT: %.4d6: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.4a9) [symbolic] // CHECK:STDOUT: %Destroy.facet.04a: %Destroy.type = facet_value %Int, (%Destroy.impl_witness.437) [symbolic] // CHECK:STDOUT: %.200: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.04a [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.e87: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.3be, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.4a9) [symbolic] @@ -79,13 +80,14 @@ fn CallNegative() { // CHECK:STDOUT: %pattern_type.47b: type = pattern_type %i0 [concrete] // CHECK:STDOUT: %facet_value.5b4: %type_where = facet_value %i0, () [concrete] // CHECK:STDOUT: %Destroy.impl_witness.db9: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.5b4) [concrete] -// CHECK:STDOUT: %Destroy.facet.b5f: %Destroy.type = facet_value %i0, (%Destroy.impl_witness.db9) [concrete] -// CHECK:STDOUT: %.54d: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.b5f [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7d2: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.5b4) [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.cc2: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7d2 = struct_value () [concrete] // CHECK:STDOUT: %ptr.3f1: type = ptr_type %i0 [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.6f4: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.cc2, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.5b4) [concrete] // CHECK:STDOUT: %complete_type.588: = complete_type_witness %ptr.3f1 [concrete] +// CHECK:STDOUT: %.53b: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.5b4) [concrete] +// CHECK:STDOUT: %Destroy.facet.b5f: %Destroy.type = facet_value %i0, (%Destroy.impl_witness.db9) [concrete] +// CHECK:STDOUT: %.54d: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.b5f [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.6f4: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.cc2, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.5b4) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -134,9 +136,10 @@ fn CallNegative() { // CHECK:STDOUT: %require_complete.loc15_20: = require_complete_type %Int.loc15_20.2 [symbolic = %require_complete.loc15_20 (constants.%require_complete.e66)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Int.loc15_20.2 [symbolic = %pattern_type (constants.%pattern_type.60f)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %Int.loc15_20.2, () [symbolic = %facet_value (constants.%facet_value.4a9)] +// CHECK:STDOUT: %.loc15_3.1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.loc15_3.1 (constants.%.4d6)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.437)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Int.loc15_20.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.04a)] -// CHECK:STDOUT: %.loc15_3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc15_3 (constants.%.200)] +// CHECK:STDOUT: %.loc15_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc15_3.2 (constants.%.200)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.353)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @ErrorIfNIsZero.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.353) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.3be)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.e87)] @@ -157,7 +160,7 @@ fn CallNegative() { // CHECK:STDOUT: %Int.loc15_20.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc15_20.2 (constants.%Int)] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = ref_binding v, %v.var -// CHECK:STDOUT: %impl.elem0: @ErrorIfNIsZero.%.loc15_3 (%.200) = impl_witness_access constants.%Destroy.impl_witness.437, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.3be)] +// CHECK:STDOUT: %impl.elem0: @ErrorIfNIsZero.%.loc15_3.2 (%.200) = impl_witness_access constants.%Destroy.impl_witness.437, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.3be)] // CHECK:STDOUT: %bound_method.loc15_3.1: = bound_method %v.var, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.4a9) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.e87)] // CHECK:STDOUT: %bound_method.loc15_3.2: = bound_method %v.var, %specific_fn @@ -188,9 +191,10 @@ fn CallNegative() { // CHECK:STDOUT: %require_complete.loc15_20 => constants.%complete_type.d94 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.47b // CHECK:STDOUT: %facet_value => constants.%facet_value.5b4 +// CHECK:STDOUT: %.loc15_3.1 => constants.%.53b // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.db9 // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.b5f -// CHECK:STDOUT: %.loc15_3 => constants.%.54d +// CHECK:STDOUT: %.loc15_3.2 => constants.%.54d // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.7d2 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.cc2 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.6f4 diff --git a/toolchain/check/testdata/function/generic/type_param.carbon b/toolchain/check/testdata/function/generic/type_param.carbon index d9669da9f6b7e..865b0f7de8d41 100644 --- a/toolchain/check/testdata/function/generic/type_param.carbon +++ b/toolchain/check/testdata/function/generic/type_param.carbon @@ -44,6 +44,7 @@ fn F(T:! type) { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.9ef: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.e46 = struct_value () [symbolic] // CHECK:STDOUT: %ptr.3f2: type = ptr_type %ptr.4f0 [symbolic] // CHECK:STDOUT: %require_complete.6d1: = require_complete_type %ptr.3f2 [symbolic] +// CHECK:STDOUT: %.209: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr.4f0, (%Destroy.impl_witness.60c) [symbolic] // CHECK:STDOUT: %.17f: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.9ef, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic] @@ -84,9 +85,10 @@ fn F(T:! type) { // CHECK:STDOUT: %require_complete.loc17: = require_complete_type %T.loc15_6.1 [symbolic = %require_complete.loc17 (constants.%require_complete.4b7)] // CHECK:STDOUT: %pattern_type.loc17: type = pattern_type %T.loc15_6.1 [symbolic = %pattern_type.loc17 (constants.%pattern_type.e68)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr.loc16_11.2, () [symbolic = %facet_value (constants.%facet_value)] +// CHECK:STDOUT: %.loc16_3.1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.loc16_3.1 (constants.%.209)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.60c)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr.loc16_11.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] -// CHECK:STDOUT: %.loc16_3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc16_3 (constants.%.17f)] +// CHECK:STDOUT: %.loc16_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc16_3.2 (constants.%.17f)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.e46)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.e46) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9ef)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] @@ -114,7 +116,7 @@ fn F(T:! type) { // CHECK:STDOUT: %T.ref.loc17: type = name_ref T, %T.loc15_6.2 [symbolic = %T.loc15_6.1 (constants.%T)] // CHECK:STDOUT: %.loc17_14.2: @F.%T.loc15_6.1 (%T) = acquire_value %.loc17_14.1 // CHECK:STDOUT: %n: @F.%T.loc15_6.1 (%T) = value_binding n, %.loc17_14.2 -// CHECK:STDOUT: %impl.elem0: @F.%.loc16_3 (%.17f) = impl_witness_access constants.%Destroy.impl_witness.60c, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9ef)] +// CHECK:STDOUT: %impl.elem0: @F.%.loc16_3.2 (%.17f) = impl_witness_access constants.%Destroy.impl_witness.60c, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9ef)] // CHECK:STDOUT: %bound_method.loc16_3.1: = bound_method %p.var, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] // CHECK:STDOUT: %bound_method.loc16_3.2: = bound_method %p.var, %specific_fn diff --git a/toolchain/check/testdata/function/generic/type_param_scope.carbon b/toolchain/check/testdata/function/generic/type_param_scope.carbon index 75eeff7e2e435..5e043fa4ab814 100644 --- a/toolchain/check/testdata/function/generic/type_param_scope.carbon +++ b/toolchain/check/testdata/function/generic/type_param_scope.carbon @@ -29,6 +29,7 @@ fn F(T:! type, n: T*) -> T* { // CHECK:STDOUT: %pattern_type.a60: type = pattern_type %ptr [symbolic] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %.89d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [symbolic] @@ -44,10 +45,11 @@ fn F(T:! type, n: T*) -> T* { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: +// CHECK:STDOUT: %.loc7_10.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc4_6.1) [symbolic = %.loc7_10.2 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc4_20.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc4_20.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)] -// CHECK:STDOUT: %.loc7_10.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc7_10.2 (constants.%.89d)] -// CHECK:STDOUT: %impl.elem0.loc7_10.2: @F.%.loc7_10.2 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_10.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %.loc7_10.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc7_10.3 (constants.%.89d)] +// CHECK:STDOUT: %impl.elem0.loc7_10.2: @F.%.loc7_10.3 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_10.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %specific_impl_fn.loc7_10.2: = specific_impl_function %impl.elem0.loc7_10.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc7_10.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%n.param: @F.%ptr.loc4_20.1 (%ptr)) -> @F.%ptr.loc4_20.1 (%ptr) { @@ -62,7 +64,7 @@ fn F(T:! type, n: T*) -> T* { // CHECK:STDOUT: } // CHECK:STDOUT: %m: @F.%ptr.loc4_20.1 (%ptr) = value_binding m, %n.ref // CHECK:STDOUT: %m.ref: @F.%ptr.loc4_20.1 (%ptr) = name_ref m, %m -// CHECK:STDOUT: %impl.elem0.loc7_10.1: @F.%.loc7_10.2 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc7_10.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %impl.elem0.loc7_10.1: @F.%.loc7_10.3 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc7_10.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %bound_method.loc7_10.1: = bound_method %m.ref, %impl.elem0.loc7_10.1 // CHECK:STDOUT: %specific_impl_fn.loc7_10.1: = specific_impl_function %impl.elem0.loc7_10.1, @Copy.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc7_10.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: %bound_method.loc7_10.2: = bound_method %m.ref, %specific_impl_fn.loc7_10.1 diff --git a/toolchain/check/testdata/generic/complete_type.carbon b/toolchain/check/testdata/generic/complete_type.carbon index f76cfd8eddaf4..d4c83fc2c92a9 100644 --- a/toolchain/check/testdata/generic/complete_type.carbon +++ b/toolchain/check/testdata/generic/complete_type.carbon @@ -223,6 +223,7 @@ fn G() { F(B); } // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.9ef: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.e46 = struct_value () [symbolic] // CHECK:STDOUT: %ptr.3f2: type = ptr_type %ptr.4f0 [symbolic] // CHECK:STDOUT: %require_complete.6d1: = require_complete_type %ptr.3f2 [symbolic] +// CHECK:STDOUT: %.209: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.ddd) [symbolic] // CHECK:STDOUT: %Destroy.facet.78b: %Destroy.type = facet_value %ptr.4f0, (%Destroy.impl_witness.60c) [symbolic] // CHECK:STDOUT: %.17f: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.78b [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.af8: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.9ef, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.ddd) [symbolic] @@ -236,13 +237,14 @@ fn G() { F(B); } // CHECK:STDOUT: %pattern_type.960: type = pattern_type %ptr.e79 [concrete] // CHECK:STDOUT: %facet_value.888: %type_where = facet_value %ptr.e79, () [concrete] // CHECK:STDOUT: %Destroy.impl_witness.42f: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.888) [concrete] -// CHECK:STDOUT: %Destroy.facet.de3: %Destroy.type = facet_value %ptr.e79, (%Destroy.impl_witness.42f) [concrete] -// CHECK:STDOUT: %.dfd: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.de3 [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b47: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.888) [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.c02: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b47 = struct_value () [concrete] // CHECK:STDOUT: %ptr.3fb: type = ptr_type %ptr.e79 [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a4b: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.c02, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.888) [concrete] // CHECK:STDOUT: %complete_type.c9f: = complete_type_witness %ptr.3fb [concrete] +// CHECK:STDOUT: %.9d3: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.888) [concrete] +// CHECK:STDOUT: %Destroy.facet.de3: %Destroy.type = facet_value %ptr.e79, (%Destroy.impl_witness.42f) [concrete] +// CHECK:STDOUT: %.dfd: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.de3 [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a4b: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.c02, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.888) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -292,9 +294,10 @@ fn G() { F(B); } // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc7_11.2 [symbolic = %pattern_type (constants.%pattern_type.a60)] // CHECK:STDOUT: %require_complete.loc8: = require_complete_type %T.loc6_6.1 [symbolic = %require_complete.loc8 (constants.%require_complete.4b7)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr.loc7_11.2, () [symbolic = %facet_value (constants.%facet_value.ddd)] +// CHECK:STDOUT: %.loc7_3.1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.loc7_3.1 (constants.%.209)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.60c)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr.loc7_11.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.78b)] -// CHECK:STDOUT: %.loc7_3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc7_3 (constants.%.17f)] +// CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc7_3.2 (constants.%.17f)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.e46)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.e46) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9ef)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.af8)] @@ -316,7 +319,7 @@ fn G() { F(B); } // CHECK:STDOUT: %v.ref: ref @F.%ptr.loc7_11.2 (%ptr.4f0) = name_ref v, %v // CHECK:STDOUT: %.loc8_4: @F.%ptr.loc7_11.2 (%ptr.4f0) = acquire_value %v.ref // CHECK:STDOUT: %.loc8_3: ref @F.%T.loc6_6.1 (%T) = deref %.loc8_4 -// CHECK:STDOUT: %impl.elem0: @F.%.loc7_3 (%.17f) = impl_witness_access constants.%Destroy.impl_witness.60c, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9ef)] +// CHECK:STDOUT: %impl.elem0: @F.%.loc7_3.2 (%.17f) = impl_witness_access constants.%Destroy.impl_witness.60c, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9ef)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.ddd) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.af8)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %v.var, %specific_fn @@ -348,9 +351,10 @@ fn G() { F(B); } // CHECK:STDOUT: %pattern_type => constants.%pattern_type.960 // CHECK:STDOUT: %require_complete.loc8 => constants.%complete_type.357 // CHECK:STDOUT: %facet_value => constants.%facet_value.888 +// CHECK:STDOUT: %.loc7_3.1 => constants.%.9d3 // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.42f // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.de3 -// CHECK:STDOUT: %.loc7_3 => constants.%.dfd +// CHECK:STDOUT: %.loc7_3.2 => constants.%.dfd // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b47 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.c02 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a4b @@ -385,6 +389,7 @@ fn G() { F(B); } // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.9ef: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.e46 = struct_value () [symbolic] // CHECK:STDOUT: %ptr.3f2: type = ptr_type %ptr.4f0 [symbolic] // CHECK:STDOUT: %require_complete.6d1: = require_complete_type %ptr.3f2 [symbolic] +// CHECK:STDOUT: %.209: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.ddd) [symbolic] // CHECK:STDOUT: %Destroy.facet.78b: %Destroy.type = facet_value %ptr.4f0, (%Destroy.impl_witness.60c) [symbolic] // CHECK:STDOUT: %.17f: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.78b [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.af8: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.9ef, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.ddd) [symbolic] @@ -396,13 +401,14 @@ fn G() { F(B); } // CHECK:STDOUT: %pattern_type.960: type = pattern_type %ptr.e79 [concrete] // CHECK:STDOUT: %facet_value.888: %type_where = facet_value %ptr.e79, () [concrete] // CHECK:STDOUT: %Destroy.impl_witness.42f: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.888) [concrete] -// CHECK:STDOUT: %Destroy.facet.de3: %Destroy.type = facet_value %ptr.e79, (%Destroy.impl_witness.42f) [concrete] -// CHECK:STDOUT: %.dfd: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.de3 [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b47: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.888) [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.c02: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b47 = struct_value () [concrete] // CHECK:STDOUT: %ptr.3fb: type = ptr_type %ptr.e79 [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a4b: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.c02, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.888) [concrete] // CHECK:STDOUT: %complete_type.c9f: = complete_type_witness %ptr.3fb [concrete] +// CHECK:STDOUT: %.9d3: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.888) [concrete] +// CHECK:STDOUT: %Destroy.facet.de3: %Destroy.type = facet_value %ptr.e79, (%Destroy.impl_witness.42f) [concrete] +// CHECK:STDOUT: %.dfd: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.de3 [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a4b: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.c02, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.888) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -445,9 +451,10 @@ fn G() { F(B); } // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc7_11.2 [symbolic = %pattern_type (constants.%pattern_type.a60)] // CHECK:STDOUT: %require_complete.loc14: = require_complete_type %T.loc6_6.1 [symbolic = %require_complete.loc14 (constants.%require_complete.4b7)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr.loc7_11.2, () [symbolic = %facet_value (constants.%facet_value.ddd)] +// CHECK:STDOUT: %.loc7_3.1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.loc7_3.1 (constants.%.209)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.60c)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr.loc7_11.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.78b)] -// CHECK:STDOUT: %.loc7_3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc7_3 (constants.%.17f)] +// CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc7_3.2 (constants.%.17f)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.e46)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.e46) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9ef)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.af8)] @@ -469,7 +476,7 @@ fn G() { F(B); } // CHECK:STDOUT: %v.ref: ref @F.%ptr.loc7_11.2 (%ptr.4f0) = name_ref v, %v // CHECK:STDOUT: %.loc14_4: @F.%ptr.loc7_11.2 (%ptr.4f0) = acquire_value %v.ref // CHECK:STDOUT: %.loc14_3: ref @F.%T.loc6_6.1 (%T) = deref %.loc14_4 -// CHECK:STDOUT: %impl.elem0: @F.%.loc7_3 (%.17f) = impl_witness_access constants.%Destroy.impl_witness.60c, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9ef)] +// CHECK:STDOUT: %impl.elem0: @F.%.loc7_3.2 (%.17f) = impl_witness_access constants.%Destroy.impl_witness.60c, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9ef)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.ddd) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.af8)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %v.var, %specific_fn @@ -501,9 +508,10 @@ fn G() { F(B); } // CHECK:STDOUT: %pattern_type => constants.%pattern_type.960 // CHECK:STDOUT: %require_complete.loc14 => // CHECK:STDOUT: %facet_value => constants.%facet_value.888 +// CHECK:STDOUT: %.loc7_3.1 => constants.%.9d3 // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.42f // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.de3 -// CHECK:STDOUT: %.loc7_3 => constants.%.dfd +// CHECK:STDOUT: %.loc7_3.2 => constants.%.dfd // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b47 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.c02 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a4b diff --git a/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon b/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon index 72d7fb1de00cc..1bb41d4429fd5 100644 --- a/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon +++ b/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon @@ -339,6 +339,7 @@ fn H(T:! type) { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %ptr.4f0b5c.2: type = ptr_type %DD [symbolic] // CHECK:STDOUT: %B.type.1e50b2.2: type = facet_type <@B, @B(%ptr.4f0b5c.2)> [symbolic] +// CHECK:STDOUT: %.0a8: require_specific_def_type = require_specific_def @BB.as.B.impl(%ptr.4f0b5c.2, %T.b88) [symbolic] // CHECK:STDOUT: %B.lookup_impl_witness.57f: = lookup_impl_witness %T.b88, @B, @B(%ptr.4f0b5c.2) [symbolic] // CHECK:STDOUT: %B.facet.88e: %B.type.1e50b2.2 = facet_value %T.b88, (%B.lookup_impl_witness.57f) [symbolic] // CHECK:STDOUT: %T.d9f: type = symbolic_binding T, 0 [symbolic] @@ -346,6 +347,7 @@ fn H(T:! type) { // CHECK:STDOUT: %D.G.54c: %D.G.type.0da = struct_value () [concrete] // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] // CHECK:STDOUT: %B.type.997: type = facet_type <@B, @B(%ptr.c28)> [concrete] +// CHECK:STDOUT: %.be0: require_specific_def_type = require_specific_def @BB.as.B.impl(%ptr.c28, %T.d9f) [symbolic] // CHECK:STDOUT: %B.lookup_impl_witness.10f: = lookup_impl_witness %T.d9f, @B, @B(%ptr.c28) [symbolic] // CHECK:STDOUT: %B.facet.a05: %B.type.997 = facet_value %T.d9f, (%B.lookup_impl_witness.10f) [symbolic] // CHECK:STDOUT: } @@ -441,6 +443,7 @@ fn H(T:! type) { // CHECK:STDOUT: %DD: type = symbolic_binding DD, 0 [symbolic = %DD (constants.%DD)] // CHECK:STDOUT: %ptr.loc21_14.2: type = ptr_type %DD [symbolic = %ptr.loc21_14.2 (constants.%ptr.4f0b5c.2)] // CHECK:STDOUT: %B.type.loc21_15.2: type = facet_type <@B, @B(%ptr.loc21_14.2)> [symbolic = %B.type.loc21_15.2 (constants.%B.type.1e50b2.2)] +// CHECK:STDOUT: %.loc21_7.2: require_specific_def_type = require_specific_def @BB.as.B.impl(%ptr.loc21_14.2, %T.loc15_8.1) [symbolic = %.loc21_7.2 (constants.%.0a8)] // CHECK:STDOUT: %B.lookup_impl_witness: = lookup_impl_witness %T.loc15_8.1, @B, @B(%ptr.loc21_14.2) [symbolic = %B.lookup_impl_witness (constants.%B.lookup_impl_witness.57f)] // CHECK:STDOUT: %B.facet.loc21_7.2: @D.G.%B.type.loc21_15.2 (%B.type.1e50b2.2) = facet_value %T.loc15_8.1, (%B.lookup_impl_witness) [symbolic = %B.facet.loc21_7.2 (constants.%B.facet.88e)] // CHECK:STDOUT: @@ -452,7 +455,7 @@ fn H(T:! type) { // CHECK:STDOUT: %ptr.loc21_14.1: type = ptr_type %DD.ref [symbolic = %ptr.loc21_14.2 (constants.%ptr.4f0b5c.2)] // CHECK:STDOUT: %B.type.loc21_15.1: type = facet_type <@B, @B(constants.%ptr.4f0b5c.2)> [symbolic = %B.type.loc21_15.2 (constants.%B.type.1e50b2.2)] // CHECK:STDOUT: %B.facet.loc21_7.1: @D.G.%B.type.loc21_15.2 (%B.type.1e50b2.2) = facet_value %T.ref, (constants.%B.lookup_impl_witness.57f) [symbolic = %B.facet.loc21_7.2 (constants.%B.facet.88e)] -// CHECK:STDOUT: %.loc21: @D.G.%B.type.loc21_15.2 (%B.type.1e50b2.2) = converted %T.ref, %B.facet.loc21_7.1 [symbolic = %B.facet.loc21_7.2 (constants.%B.facet.88e)] +// CHECK:STDOUT: %.loc21_7.1: @D.G.%B.type.loc21_15.2 (%B.type.1e50b2.2) = converted %T.ref, %B.facet.loc21_7.1 [symbolic = %B.facet.loc21_7.2 (constants.%B.facet.88e)] // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -504,6 +507,7 @@ fn H(T:! type) { // CHECK:STDOUT: %DD => constants.%empty_struct_type // CHECK:STDOUT: %ptr.loc21_14.2 => constants.%ptr.c28 // CHECK:STDOUT: %B.type.loc21_15.2 => constants.%B.type.997 +// CHECK:STDOUT: %.loc21_7.2 => constants.%.be0 // CHECK:STDOUT: %B.lookup_impl_witness => constants.%B.lookup_impl_witness.10f // CHECK:STDOUT: %B.facet.loc21_7.2 => constants.%B.facet.a05 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/generic/template_dependence.carbon b/toolchain/check/testdata/generic/template_dependence.carbon index 8cf36d23af6e2..01bc17a9dcdca 100644 --- a/toolchain/check/testdata/generic/template_dependence.carbon +++ b/toolchain/check/testdata/generic/template_dependence.carbon @@ -45,6 +45,7 @@ fn F(template T:! type, U:! type) -> (T, U) { // CHECK:STDOUT: %require_complete.6d1: = require_complete_type %ptr.3f2 [template] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.d9fe7a.1) [template] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0b5c.1, @Copy [template] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.4f0b5c.1, (%Copy.lookup_impl_witness.c66) [template] // CHECK:STDOUT: %.89d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [template] @@ -89,10 +90,11 @@ fn F(template T:! type, U:! type) -> (T, U) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc5_33: = require_complete_type %ptr.loc5_29.1 [template = %require_complete.loc5_33 (constants.%require_complete.482d3f.1)] // CHECK:STDOUT: %require_complete.loc5_26: = require_complete_type %ptr.loc5_30.1 [template = %require_complete.loc5_26 (constants.%require_complete.6d1)] +// CHECK:STDOUT: %.loc6_10.4: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_15.1) [template = %.loc6_10.4 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc5_29.1, @Copy [template = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc5_29.1, (%Copy.lookup_impl_witness) [template = %Copy.facet (constants.%Copy.facet)] -// CHECK:STDOUT: %.loc6_10.4: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [template = %.loc6_10.4 (constants.%.89d)] -// CHECK:STDOUT: %impl.elem0.loc6_10.2: @F.%.loc6_10.4 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [template = %impl.elem0.loc6_10.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %.loc6_10.5: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [template = %.loc6_10.5 (constants.%.89d)] +// CHECK:STDOUT: %impl.elem0.loc6_10.2: @F.%.loc6_10.5 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [template = %impl.elem0.loc6_10.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %specific_impl_fn.loc6_10.2: = specific_impl_function %impl.elem0.loc6_10.2, @Copy.Op(%Copy.facet) [template = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%ptr.loc5_30.1 (%ptr.3f2)) -> @F.%ptr.loc5_29.1 (%ptr.4f0b5c.1) { @@ -100,7 +102,7 @@ fn F(template T:! type, U:! type) -> (T, U) { // CHECK:STDOUT: %x.ref: @F.%ptr.loc5_30.1 (%ptr.3f2) = name_ref x, %x // CHECK:STDOUT: %.loc6_10.1: ref @F.%ptr.loc5_29.1 (%ptr.4f0b5c.1) = deref %x.ref // CHECK:STDOUT: %.loc6_10.2: @F.%ptr.loc5_29.1 (%ptr.4f0b5c.1) = acquire_value %.loc6_10.1 -// CHECK:STDOUT: %impl.elem0.loc6_10.1: @F.%.loc6_10.4 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [template = %impl.elem0.loc6_10.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %impl.elem0.loc6_10.1: @F.%.loc6_10.5 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [template = %impl.elem0.loc6_10.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %bound_method.loc6_10.1: = bound_method %.loc6_10.2, %impl.elem0.loc6_10.1 // CHECK:STDOUT: %specific_impl_fn.loc6_10.1: = specific_impl_function %impl.elem0.loc6_10.1, @Copy.Op(constants.%Copy.facet) [template = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: %bound_method.loc6_10.2: = bound_method %.loc6_10.2, %specific_impl_fn.loc6_10.1 diff --git a/toolchain/check/testdata/impl/impl_thunk.carbon b/toolchain/check/testdata/impl/impl_thunk.carbon index 64c5c6f56e6e8..671a5305e3be7 100644 --- a/toolchain/check/testdata/impl/impl_thunk.carbon +++ b/toolchain/check/testdata/impl/impl_thunk.carbon @@ -950,6 +950,7 @@ impl () as I({}) { // CHECK:STDOUT: %.a79665.2: type = fn_type_with_self_type %Copy.Op.type, %U.417 [symbolic] // CHECK:STDOUT: %impl.elem0.fac0be.2: %.a79665.2 = impl_witness_access %Copy.lookup_impl_witness.c42a3d.2, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.103937.2: = specific_impl_function %impl.elem0.fac0be.2, @Copy.Op(%U.417) [symbolic] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.4f0, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn: = specific_function %empty_tuple.type.as.I.impl.F.f1aebb.1, @empty_tuple.type.as.I.impl.F.loc10_34.1(%Copy.facet) [symbolic] @@ -1034,6 +1035,7 @@ impl () as I({}) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %.loc10_34.3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_8.1) [symbolic = %.loc10_34.3 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet.loc10_34.3: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_34.3 (constants.%Copy.facet)] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_34.2: = specific_function constants.%empty_tuple.type.as.I.impl.F.f1aebb.1, @empty_tuple.type.as.I.impl.F.loc10_34.1(%Copy.facet.loc10_34.3) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_34.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)] @@ -1102,6 +1104,7 @@ impl () as I({}) { // CHECK:STDOUT: %.a79665.2: type = fn_type_with_self_type %Copy.Op.type, %U.417 [symbolic] // CHECK:STDOUT: %impl.elem0.fac0be.2: %.a79665.2 = impl_witness_access %Copy.lookup_impl_witness.c42a3d.2, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.103937.2: = specific_impl_function %impl.elem0.fac0be.2, @Copy.Op(%U.417) [symbolic] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.4f0, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn: = specific_function %empty_tuple.type.as.I.impl.F.f1aebb.1, @empty_tuple.type.as.I.impl.F.loc10_44.1(%Copy.facet) [symbolic] @@ -1194,6 +1197,7 @@ impl () as I({}) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %.loc10_44.3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_20.1) [symbolic = %.loc10_44.3 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet.loc10_44.3: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_44.3 (constants.%Copy.facet)] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.2: = specific_function constants.%empty_tuple.type.as.I.impl.F.f1aebb.1, @empty_tuple.type.as.I.impl.F.loc10_44.1(%Copy.facet.loc10_44.3) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)] diff --git a/toolchain/check/testdata/impl/import_builtin_call.carbon b/toolchain/check/testdata/impl/import_builtin_call.carbon index a453451a44f8d..bbe7a29b3e7b5 100644 --- a/toolchain/check/testdata/impl/import_builtin_call.carbon +++ b/toolchain/check/testdata/impl/import_builtin_call.carbon @@ -114,6 +114,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Add.facet.099: %Add.type = facet_value %MyInt, (%Add.impl_witness) [symbolic] // CHECK:STDOUT: %Double.type: type = fn_type @Double [concrete] // CHECK:STDOUT: %Double: %Double.type = struct_value () [concrete] +// CHECK:STDOUT: %.bc4: require_specific_def_type = require_specific_def @MyInt.as.Add.impl(%N) [symbolic] // CHECK:STDOUT: %Add.lookup_impl_witness: = lookup_impl_witness %MyInt, @Add [symbolic] // CHECK:STDOUT: %Add.facet.98c: %Add.type = facet_value %MyInt, (%Add.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %.99e: type = fn_type_with_self_type %Add.Op.type, %Add.facet.98c [symbolic] @@ -342,10 +343,11 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %MyInt.loc19_39.1 [symbolic = %require_complete (constants.%require_complete.a87)] +// CHECK:STDOUT: %.loc20_11.1: require_specific_def_type = require_specific_def @MyInt.as.Add.impl(%N.loc19_11.1) [symbolic = %.loc20_11.1 (constants.%.bc4)] // CHECK:STDOUT: %Add.lookup_impl_witness: = lookup_impl_witness %MyInt.loc19_39.1, @Add [symbolic = %Add.lookup_impl_witness (constants.%Add.lookup_impl_witness)] // CHECK:STDOUT: %Add.facet.loc20_11: %Add.type = facet_value %MyInt.loc19_39.1, (%Add.lookup_impl_witness) [symbolic = %Add.facet.loc20_11 (constants.%Add.facet.98c)] -// CHECK:STDOUT: %.loc20_11: type = fn_type_with_self_type constants.%Add.Op.type, %Add.facet.loc20_11 [symbolic = %.loc20_11 (constants.%.99e)] -// CHECK:STDOUT: %impl.elem0.loc20_11.2: @Double.%.loc20_11 (%.99e) = impl_witness_access %Add.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_11.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %.loc20_11.2: type = fn_type_with_self_type constants.%Add.Op.type, %Add.facet.loc20_11 [symbolic = %.loc20_11.2 (constants.%.99e)] +// CHECK:STDOUT: %impl.elem0.loc20_11.2: @Double.%.loc20_11.2 (%.99e) = impl_witness_access %Add.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_11.2 (constants.%impl.elem0)] // CHECK:STDOUT: %specific_impl_fn.loc20_11.2: = specific_impl_function %impl.elem0.loc20_11.2, @Add.Op(%Add.facet.loc20_11) [symbolic = %specific_impl_fn.loc20_11.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @Double.%MyInt.loc19_39.1 (%MyInt)) -> @Double.%MyInt.loc19_39.1 (%MyInt) { @@ -353,7 +355,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %x.ref.loc20_10: @Double.%MyInt.loc19_39.1 (%MyInt) = name_ref x, %x // CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [concrete = constants.%Add.type] // CHECK:STDOUT: %Op.ref: %Add.assoc_type = name_ref Op, @Add.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc20_11.1: @Double.%.loc20_11 (%.99e) = impl_witness_access constants.%Add.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_11.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc20_11.1: @Double.%.loc20_11.2 (%.99e) = impl_witness_access constants.%Add.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_11.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc20_11: = bound_method %x.ref.loc20_10, %impl.elem0.loc20_11.1 // CHECK:STDOUT: %x.ref.loc20_21: @Double.%MyInt.loc19_39.1 (%MyInt) = name_ref x, %x // CHECK:STDOUT: %Add.facet.loc20_22.1: %Add.type = facet_value constants.%MyInt, (constants.%Add.lookup_impl_witness) [symbolic = %Add.facet.loc20_11 (constants.%Add.facet.98c)] @@ -450,6 +452,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Add.impl_witness.8fe: = impl_witness imports.%Add.impl_witness_table, @MyInt.as.Add.impl(%int_64) [concrete] // CHECK:STDOUT: %MyInt.as.Add.impl.Op.type.193: type = fn_type @MyInt.as.Add.impl.Op, @MyInt.as.Add.impl(%int_64) [concrete] // CHECK:STDOUT: %MyInt.as.Add.impl.Op.803: %MyInt.as.Add.impl.Op.type.193 = struct_value () [concrete] +// CHECK:STDOUT: %.9b3: require_specific_def_type = require_specific_def @MyInt.as.Add.impl(%int_64) [concrete] // CHECK:STDOUT: %Add.facet.bfc: %Add.type = facet_value %MyInt.f30, (%Add.impl_witness.8fe) [concrete] // CHECK:STDOUT: %.006: type = fn_type_with_self_type %Add.Op.type, %Add.facet.bfc [concrete] // CHECK:STDOUT: %MyInt.as.Add.impl.Op.specific_fn: = specific_function %MyInt.as.Add.impl.Op.803, @MyInt.as.Add.impl.Op(%int_64) [concrete] @@ -457,6 +460,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %CallImportedDouble: %CallImportedDouble.type = struct_value () [concrete] // CHECK:STDOUT: %Double.type: type = fn_type @Double [concrete] // CHECK:STDOUT: %Double: %Double.type = struct_value () [concrete] +// CHECK:STDOUT: %.bc4: require_specific_def_type = require_specific_def @MyInt.as.Add.impl(%N) [symbolic] // CHECK:STDOUT: %Add.lookup_impl_witness: = lookup_impl_witness %MyInt.19f, @Add [symbolic] // CHECK:STDOUT: %Add.facet.98c: %Add.type = facet_value %MyInt.19f, (%Add.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %.99e: type = fn_type_with_self_type %Add.Op.type, %Add.facet.98c [symbolic] @@ -627,10 +631,11 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %MyInt [symbolic = %require_complete (constants.%require_complete.a87)] +// CHECK:STDOUT: %.1: require_specific_def_type = require_specific_def @MyInt.as.Add.impl(%N) [symbolic = %.1 (constants.%.bc4)] // CHECK:STDOUT: %Add.lookup_impl_witness: = lookup_impl_witness %MyInt, @Add [symbolic = %Add.lookup_impl_witness (constants.%Add.lookup_impl_witness)] // CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt, (%Add.lookup_impl_witness) [symbolic = %Add.facet (constants.%Add.facet.98c)] -// CHECK:STDOUT: %.1: type = fn_type_with_self_type constants.%Add.Op.type, %Add.facet [symbolic = %.1 (constants.%.99e)] -// CHECK:STDOUT: %impl.elem0: @Double.%.1 (%.99e) = impl_witness_access %Add.lookup_impl_witness, element0 [symbolic = %impl.elem0 (constants.%impl.elem0)] +// CHECK:STDOUT: %.2: type = fn_type_with_self_type constants.%Add.Op.type, %Add.facet [symbolic = %.2 (constants.%.99e)] +// CHECK:STDOUT: %impl.elem0: @Double.%.2 (%.99e) = impl_witness_access %Add.lookup_impl_witness, element0 [symbolic = %impl.elem0 (constants.%impl.elem0)] // CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Add.Op(%Add.facet) [symbolic = %specific_impl_fn (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn; @@ -715,9 +720,10 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.4a1 +// CHECK:STDOUT: %.1 => constants.%.9b3 // CHECK:STDOUT: %Add.lookup_impl_witness => constants.%Add.impl_witness.8fe // CHECK:STDOUT: %Add.facet => constants.%Add.facet.bfc -// CHECK:STDOUT: %.1 => constants.%.006 +// CHECK:STDOUT: %.2 => constants.%.006 // CHECK:STDOUT: %impl.elem0 => constants.%MyInt.as.Add.impl.Op.803 // CHECK:STDOUT: %specific_impl_fn => constants.%MyInt.as.Add.impl.Op.specific_fn // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/import_thunk.carbon b/toolchain/check/testdata/impl/import_thunk.carbon index 07f40d056bb1b..d81ff330911cc 100644 --- a/toolchain/check/testdata/impl/import_thunk.carbon +++ b/toolchain/check/testdata/impl/import_thunk.carbon @@ -142,6 +142,7 @@ fn G() { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.393: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.edc = struct_value () [symbolic] // CHECK:STDOUT: %ptr.8f8: type = ptr_type %C.32c8ec.2 [symbolic] // CHECK:STDOUT: %require_complete.8ff: = require_complete_type %ptr.8f8 [symbolic] +// CHECK:STDOUT: %.052: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C.32c8ec.2, (%Destroy.impl_witness.a7c) [symbolic] // CHECK:STDOUT: %.05d: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.393, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic] @@ -290,9 +291,10 @@ fn G() { // CHECK:STDOUT: %require_complete.1: = require_complete_type %C [symbolic = %require_complete.1 (constants.%require_complete.10b)] // CHECK:STDOUT: %C.val: @C.as.I.impl.F.loc8_17.2.%C (%C.32c8ec.2) = struct_value () [symbolic = %C.val (constants.%C.val)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [symbolic = %facet_value (constants.%facet_value)] +// CHECK:STDOUT: %.6: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.6 (constants.%.052)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.a7c)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] -// CHECK:STDOUT: %.6: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.6 (constants.%.05d)] +// CHECK:STDOUT: %.7: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.7 (constants.%.05d)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.edc)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @C.as.I.impl.F.loc8_17.2.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.edc) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.393)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] @@ -312,7 +314,7 @@ fn G() { // CHECK:STDOUT: %.5: @C.as.I.impl.F.loc8_17.2.%C (%C.32c8ec.2) = acquire_value %.4 // CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn.loc8_17.1(%.5) // CHECK:STDOUT: %Op.ref: %Destroy.assoc_type = name_ref Op, imports.%Core.import_ref.f99 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: @C.as.I.impl.F.loc8_17.2.%.6 (%.05d) = impl_witness_access constants.%Destroy.impl_witness.a7c, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.393)] +// CHECK:STDOUT: %impl.elem0: @C.as.I.impl.F.loc8_17.2.%.7 (%.05d) = impl_witness_access constants.%Destroy.impl_witness.a7c, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.393)] // CHECK:STDOUT: %bound_method.1: = bound_method %.3, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] // CHECK:STDOUT: %bound_method.2: = bound_method %.3, %specific_fn @@ -393,6 +395,7 @@ fn G() { // CHECK:STDOUT: %facet_value.4a7: %type_where = facet_value %C.32c8ec.2, () [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %DestroyT: %type_where = symbolic_binding DestroyT, 0 [symbolic] +// CHECK:STDOUT: %.fa1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.4a7) [symbolic] // CHECK:STDOUT: %Destroy.impl_witness.3e8: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.4a7) [symbolic] // CHECK:STDOUT: %Destroy.facet.f71: %Destroy.type = facet_value %C.32c8ec.2, (%Destroy.impl_witness.3e8) [symbolic] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] @@ -422,6 +425,7 @@ fn G() { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.302: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c6d = struct_value () [concrete] // CHECK:STDOUT: %ptr.2ce: type = ptr_type %C.607 [concrete] // CHECK:STDOUT: %complete_type.e2c: = complete_type_witness %ptr.2ce [concrete] +// CHECK:STDOUT: %.a6e: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.637) [concrete] // CHECK:STDOUT: %Destroy.facet.91e: %Destroy.type = facet_value %C.607, (%Destroy.impl_witness.e84) [concrete] // CHECK:STDOUT: %.303: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.91e [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.942: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.302, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.637) [concrete] @@ -566,9 +570,10 @@ fn G() { // CHECK:STDOUT: %require_complete.1: = require_complete_type %C [symbolic = %require_complete.1 (constants.%require_complete.10b)] // CHECK:STDOUT: %C.val: @C.as.I.impl.F.2.%C (%C.32c8ec.2) = struct_value () [symbolic = %C.val (constants.%C.val.31e)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [symbolic = %facet_value (constants.%facet_value.4a7)] +// CHECK:STDOUT: %.1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.1 (constants.%.fa1)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.3e8)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.f71)] -// CHECK:STDOUT: %.1: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.1 (constants.%.7e5)] +// CHECK:STDOUT: %.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.2 (constants.%.7e5)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.9d8)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @C.as.I.impl.F.2.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.9d8) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.32b)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a82)] @@ -641,9 +646,10 @@ fn G() { // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.357 // CHECK:STDOUT: %C.val => constants.%C.val.12f // CHECK:STDOUT: %facet_value => constants.%facet_value.637 +// CHECK:STDOUT: %.1 => constants.%.a6e // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.e84 // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.91e -// CHECK:STDOUT: %.1 => constants.%.303 +// CHECK:STDOUT: %.2 => constants.%.303 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.c6d // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.302 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.942 diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index 478f5bcd18995..aeac3ee92c5be 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -349,6 +349,7 @@ fn G(x: A) { // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.75b: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.692: %ptr.as.Copy.impl.Op.type.75b = struct_value () [symbolic] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet.747: %Copy.type = facet_value %ptr.4f0, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %.89d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.747 [symbolic] @@ -369,6 +370,7 @@ fn G(x: A) { // CHECK:STDOUT: %Copy.impl_witness.433: = impl_witness imports.%Copy.impl_witness_table.67d, @ptr.as.Copy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.424: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.15e: %ptr.as.Copy.impl.Op.type.424 = struct_value () [concrete] +// CHECK:STDOUT: %.1b5: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %Copy.facet.48c: %Copy.type = facet_value %ptr.c28, (%Copy.impl_witness.433) [concrete] // CHECK:STDOUT: %.fb0: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.48c [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.15e, @ptr.as.Copy.impl.Op(%empty_struct_type) [concrete] @@ -501,16 +503,17 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %ptr.loc9_14 [symbolic = %require_complete (constants.%require_complete.482)] +// CHECK:STDOUT: %.loc9_37.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T) [symbolic = %.loc9_37.2 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc9_14, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc9_14, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.747)] -// CHECK:STDOUT: %.loc9_37.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc9_37.2 (constants.%.89d)] -// CHECK:STDOUT: %impl.elem0.loc9_37.2: @ptr.as.HasF.impl.F.%.loc9_37.2 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_37.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %.loc9_37.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc9_37.3 (constants.%.89d)] +// CHECK:STDOUT: %impl.elem0.loc9_37.2: @ptr.as.HasF.impl.F.%.loc9_37.3 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_37.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %specific_impl_fn.loc9_37.2: = specific_impl_function %impl.elem0.loc9_37.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc9_37.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.4f0)) -> @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.4f0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.4f0) = name_ref self, %self -// CHECK:STDOUT: %impl.elem0.loc9_37.1: @ptr.as.HasF.impl.F.%.loc9_37.2 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc9_37.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %impl.elem0.loc9_37.1: @ptr.as.HasF.impl.F.%.loc9_37.3 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc9_37.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %bound_method.loc9_37.1: = bound_method %self.ref, %impl.elem0.loc9_37.1 // CHECK:STDOUT: %specific_impl_fn.loc9_37.1: = specific_impl_function %impl.elem0.loc9_37.1, @Copy.Op(constants.%Copy.facet.747) [symbolic = %specific_impl_fn.loc9_37.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: %bound_method.loc9_37.2: = bound_method %self.ref, %specific_impl_fn.loc9_37.1 @@ -577,9 +580,10 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type +// CHECK:STDOUT: %.loc9_37.2 => constants.%.1b5 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.433 // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.48c -// CHECK:STDOUT: %.loc9_37.2 => constants.%.fb0 +// CHECK:STDOUT: %.loc9_37.3 => constants.%.fb0 // CHECK:STDOUT: %impl.elem0.loc9_37.2 => constants.%ptr.as.Copy.impl.Op.15e // CHECK:STDOUT: %specific_impl_fn.loc9_37.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/impl_forall.carbon b/toolchain/check/testdata/impl/lookup/impl_forall.carbon index cfcbb0426a37f..54cb695e65c32 100644 --- a/toolchain/check/testdata/impl/lookup/impl_forall.carbon +++ b/toolchain/check/testdata/impl/lookup/impl_forall.carbon @@ -67,6 +67,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.75bcbe.1: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.692ac2.1: %ptr.as.Copy.impl.Op.type.75bcbe.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%V.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0b5c.2, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet.747: %Copy.type = facet_value %ptr.4f0b5c.2, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %.89d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.747 [symbolic] @@ -86,6 +87,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %I.impl_witness.0c179e.2: = impl_witness file.%I.impl_witness_table, @A.as.I.impl(%W) [symbolic] // CHECK:STDOUT: %A.as.I.impl.F.type.2974bf.2: type = fn_type @A.as.I.impl.F, @A.as.I.impl(%W) [symbolic] // CHECK:STDOUT: %A.as.I.impl.F.786476.2: %A.as.I.impl.F.type.2974bf.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.dfa: require_specific_def_type = require_specific_def @A.as.I.impl(%W) [symbolic] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %A.2ddf89.3, @I, @I(%W) [symbolic] // CHECK:STDOUT: %I.facet.84d: %I.type.07036d.3 = facet_value %A.2ddf89.3, (%I.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %.e50: type = fn_type_with_self_type %I.F.type.76d346.3, %I.facet.84d [symbolic] @@ -116,6 +118,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %Copy.impl_witness.433: = impl_witness imports.%Copy.impl_witness_table.67d, @ptr.as.Copy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.424: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.15e: %ptr.as.Copy.impl.Op.type.424 = struct_value () [concrete] +// CHECK:STDOUT: %.1b5: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %Copy.facet.48c: %Copy.type = facet_value %ptr.c28, (%Copy.impl_witness.433) [concrete] // CHECK:STDOUT: %.fb0: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.48c [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.15e, @ptr.as.Copy.impl.Op(%empty_struct_type) [concrete] @@ -188,10 +191,11 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %require_complete.loc13_26: = require_complete_type %ptr.loc13_30.1 [symbolic = %require_complete.loc13_26 (constants.%require_complete.482d3f.1)] // CHECK:STDOUT: %require_complete.loc13_16: = require_complete_type %A [symbolic = %require_complete.loc13_16 (constants.%require_complete.f6b5ff.1)] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %V [symbolic = %A.elem (constants.%A.elem.ee5a68.2)] +// CHECK:STDOUT: %.loc14_12.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%V) [symbolic = %.loc14_12.2 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc13_30.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc13_30.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.747)] -// CHECK:STDOUT: %.loc14_12.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc14_12.2 (constants.%.89d)] -// CHECK:STDOUT: %impl.elem0.loc14_12.2: @A.as.I.impl.F.%.loc14_12.2 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %.loc14_12.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc14_12.3 (constants.%.89d)] +// CHECK:STDOUT: %impl.elem0.loc14_12.2: @A.as.I.impl.F.%.loc14_12.3 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %specific_impl_fn.loc14_12.2: = specific_impl_function %impl.elem0.loc14_12.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc14_12.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @A.as.I.impl.F.%A (%A.2ddf89.2)) -> @A.as.I.impl.F.%ptr.loc13_30.1 (%ptr.4f0b5c.2) { @@ -200,7 +204,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %n.ref: @A.as.I.impl.F.%A.elem (%A.elem.ee5a68.2) = name_ref n, @A.%.loc4 [concrete = @A.%.loc4] // CHECK:STDOUT: %.loc14_17: ref @A.as.I.impl.F.%V (%V.d9f) = class_element_access %self.ref, element0 // CHECK:STDOUT: %addr: @A.as.I.impl.F.%ptr.loc13_30.1 (%ptr.4f0b5c.2) = addr_of %.loc14_17 -// CHECK:STDOUT: %impl.elem0.loc14_12.1: @A.as.I.impl.F.%.loc14_12.2 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %impl.elem0.loc14_12.1: @A.as.I.impl.F.%.loc14_12.3 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %bound_method.loc14_12.1: = bound_method %addr, %impl.elem0.loc14_12.1 // CHECK:STDOUT: %specific_impl_fn.loc14_12.1: = specific_impl_function %impl.elem0.loc14_12.1, @Copy.Op(constants.%Copy.facet.747) [symbolic = %specific_impl_fn.loc14_12.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: %bound_method.loc14_12.2: = bound_method %addr, %specific_impl_fn.loc14_12.1 @@ -218,11 +222,12 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %require_complete.loc21_18: = require_complete_type %I.type.loc21_17.2 [symbolic = %require_complete.loc21_18 (constants.%require_complete.c94ab4.2)] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I, @I(%W.loc19_16.1) [symbolic = %I.assoc_type (constants.%I.assoc_type.b650b2.3)] // CHECK:STDOUT: %assoc0: @TestGeneric.%I.assoc_type (%I.assoc_type.b650b2.3) = assoc_entity element0, @I.%I.F.decl [symbolic = %assoc0 (constants.%assoc0.b4fda0.3)] +// CHECK:STDOUT: %.loc21_11.2: require_specific_def_type = require_specific_def @A.as.I.impl(%W.loc19_16.1) [symbolic = %.loc21_11.2 (constants.%.dfa)] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %A.loc19_32.1, @I, @I(%W.loc19_16.1) [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)] // CHECK:STDOUT: %I.F.type: type = fn_type @I.F, @I(%W.loc19_16.1) [symbolic = %I.F.type (constants.%I.F.type.76d346.3)] // CHECK:STDOUT: %I.facet: @TestGeneric.%I.type.loc21_17.2 (%I.type.07036d.3) = facet_value %A.loc19_32.1, (%I.lookup_impl_witness) [symbolic = %I.facet (constants.%I.facet.84d)] -// CHECK:STDOUT: %.loc21_11.2: type = fn_type_with_self_type %I.F.type, %I.facet [symbolic = %.loc21_11.2 (constants.%.e50)] -// CHECK:STDOUT: %impl.elem0.loc21_11.2: @TestGeneric.%.loc21_11.2 (%.e50) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.a9e)] +// CHECK:STDOUT: %.loc21_11.3: type = fn_type_with_self_type %I.F.type, %I.facet [symbolic = %.loc21_11.3 (constants.%.e50)] +// CHECK:STDOUT: %impl.elem0.loc21_11.2: @TestGeneric.%.loc21_11.3 (%.e50) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.a9e)] // CHECK:STDOUT: %specific_impl_fn.loc21_11.2: = specific_impl_function %impl.elem0.loc21_11.2, @I.F(%W.loc19_16.1, %I.facet) [symbolic = %specific_impl_fn.loc21_11.2 (constants.%specific_impl_fn.2e3)] // CHECK:STDOUT: %require_complete.loc21_11: = require_complete_type %A.loc19_32.1 [symbolic = %require_complete.loc21_11 (constants.%require_complete.f6b5ff.2)] // CHECK:STDOUT: @@ -235,7 +240,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %.loc21_18: @TestGeneric.%I.assoc_type (%I.assoc_type.b650b2.3) = specific_constant @I.%assoc0.loc8_31.1, @I(constants.%W) [symbolic = %assoc0 (constants.%assoc0.b4fda0.3)] // CHECK:STDOUT: %F.ref: @TestGeneric.%I.assoc_type (%I.assoc_type.b650b2.3) = name_ref F, %.loc21_18 [symbolic = %assoc0 (constants.%assoc0.b4fda0.3)] // CHECK:STDOUT: %.loc21_11.1: ref @TestGeneric.%A.loc19_32.1 (%A.2ddf89.3) = deref %a.ref -// CHECK:STDOUT: %impl.elem0.loc21_11.1: @TestGeneric.%.loc21_11.2 (%.e50) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.a9e)] +// CHECK:STDOUT: %impl.elem0.loc21_11.1: @TestGeneric.%.loc21_11.3 (%.e50) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.a9e)] // CHECK:STDOUT: %bound_method.loc21_11: = bound_method %.loc21_11.1, %impl.elem0.loc21_11.1 // CHECK:STDOUT: %specific_impl_fn.loc21_11.1: = specific_impl_function %impl.elem0.loc21_11.1, @I.F(constants.%W, constants.%I.facet.84d) [symbolic = %specific_impl_fn.loc21_11.2 (constants.%specific_impl_fn.2e3)] // CHECK:STDOUT: %bound_method.loc21_22: = bound_method %.loc21_11.1, %specific_impl_fn.loc21_11.1 @@ -326,9 +331,10 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %require_complete.loc13_26 => constants.%complete_type.38e // CHECK:STDOUT: %require_complete.loc13_16 => constants.%complete_type.0a6 // CHECK:STDOUT: %A.elem => constants.%A.elem.2af +// CHECK:STDOUT: %.loc14_12.2 => constants.%.1b5 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.433 // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.48c -// CHECK:STDOUT: %.loc14_12.2 => constants.%.fb0 +// CHECK:STDOUT: %.loc14_12.3 => constants.%.fb0 // CHECK:STDOUT: %impl.elem0.loc14_12.2 => constants.%ptr.as.Copy.impl.Op.15e // CHECK:STDOUT: %specific_impl_fn.loc14_12.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/impl_forall_addr.carbon b/toolchain/check/testdata/impl/lookup/impl_forall_addr.carbon index 0973cc4724a77..982878029c816 100644 --- a/toolchain/check/testdata/impl/lookup/impl_forall_addr.carbon +++ b/toolchain/check/testdata/impl/lookup/impl_forall_addr.carbon @@ -70,6 +70,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.75bcbe.1: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.692ac2.1: %ptr.as.Copy.impl.Op.type.75bcbe.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%V.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0b5c.2, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet.747: %Copy.type = facet_value %ptr.4f0b5c.2, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %.89d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.747 [symbolic] @@ -89,6 +90,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %I.impl_witness.0c179e.2: = impl_witness file.%I.impl_witness_table, @A.as.I.impl(%W) [symbolic] // CHECK:STDOUT: %A.as.I.impl.F.type.2974bf.2: type = fn_type @A.as.I.impl.F, @A.as.I.impl(%W) [symbolic] // CHECK:STDOUT: %A.as.I.impl.F.786476.2: %A.as.I.impl.F.type.2974bf.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.dfa: require_specific_def_type = require_specific_def @A.as.I.impl(%W) [symbolic] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %A.2ddf89.3, @I, @I(%W) [symbolic] // CHECK:STDOUT: %I.facet.84d: %I.type.07036d.3 = facet_value %A.2ddf89.3, (%I.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %.e50: type = fn_type_with_self_type %I.F.type.76d346.3, %I.facet.84d [symbolic] @@ -120,6 +122,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %Copy.impl_witness.433: = impl_witness imports.%Copy.impl_witness_table.67d, @ptr.as.Copy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.424: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.15e: %ptr.as.Copy.impl.Op.type.424 = struct_value () [concrete] +// CHECK:STDOUT: %.1b5: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %Copy.facet.48c: %Copy.type = facet_value %ptr.c28, (%Copy.impl_witness.433) [concrete] // CHECK:STDOUT: %.fb0: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.48c [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.15e, @ptr.as.Copy.impl.Op(%empty_struct_type) [concrete] @@ -198,10 +201,11 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %require_complete.loc13_17: = require_complete_type %ptr.loc13_23.1 [symbolic = %require_complete.loc13_17 (constants.%require_complete.743ecf.1)] // CHECK:STDOUT: %require_complete.loc14: = require_complete_type %A [symbolic = %require_complete.loc14 (constants.%require_complete.f6b5ff.1)] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %V [symbolic = %A.elem (constants.%A.elem.ee5a68.2)] +// CHECK:STDOUT: %.loc14_12.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%V) [symbolic = %.loc14_12.2 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc13_32.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc13_32.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.747)] -// CHECK:STDOUT: %.loc14_12.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc14_12.2 (constants.%.89d)] -// CHECK:STDOUT: %impl.elem0.loc14_12.2: @A.as.I.impl.F.%.loc14_12.2 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %.loc14_12.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc14_12.3 (constants.%.89d)] +// CHECK:STDOUT: %impl.elem0.loc14_12.2: @A.as.I.impl.F.%.loc14_12.3 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %specific_impl_fn.loc14_12.2: = specific_impl_function %impl.elem0.loc14_12.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc14_12.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @A.as.I.impl.F.%ptr.loc13_23.1 (%ptr.6f46b6.1)) -> @A.as.I.impl.F.%ptr.loc13_32.1 (%ptr.4f0b5c.2) { @@ -211,7 +215,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %n.ref: @A.as.I.impl.F.%A.elem (%A.elem.ee5a68.2) = name_ref n, @A.%.loc4 [concrete = @A.%.loc4] // CHECK:STDOUT: %.loc14_17.2: ref @A.as.I.impl.F.%V (%V.d9f) = class_element_access %.loc14_17.1, element0 // CHECK:STDOUT: %addr: @A.as.I.impl.F.%ptr.loc13_32.1 (%ptr.4f0b5c.2) = addr_of %.loc14_17.2 -// CHECK:STDOUT: %impl.elem0.loc14_12.1: @A.as.I.impl.F.%.loc14_12.2 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %impl.elem0.loc14_12.1: @A.as.I.impl.F.%.loc14_12.3 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %bound_method.loc14_12.1: = bound_method %addr, %impl.elem0.loc14_12.1 // CHECK:STDOUT: %specific_impl_fn.loc14_12.1: = specific_impl_function %impl.elem0.loc14_12.1, @Copy.Op(constants.%Copy.facet.747) [symbolic = %specific_impl_fn.loc14_12.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: %bound_method.loc14_12.2: = bound_method %addr, %specific_impl_fn.loc14_12.1 @@ -229,11 +233,12 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %require_complete.loc21_18: = require_complete_type %I.type.loc21_17.2 [symbolic = %require_complete.loc21_18 (constants.%require_complete.c94ab4.2)] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I, @I(%W.loc19_16.1) [symbolic = %I.assoc_type (constants.%I.assoc_type.b650b2.3)] // CHECK:STDOUT: %assoc0: @TestGeneric.%I.assoc_type (%I.assoc_type.b650b2.3) = assoc_entity element0, @I.%I.F.decl [symbolic = %assoc0 (constants.%assoc0.b4fda0.3)] +// CHECK:STDOUT: %.loc21_11.2: require_specific_def_type = require_specific_def @A.as.I.impl(%W.loc19_16.1) [symbolic = %.loc21_11.2 (constants.%.dfa)] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %A.loc19_32.1, @I, @I(%W.loc19_16.1) [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)] // CHECK:STDOUT: %I.F.type: type = fn_type @I.F, @I(%W.loc19_16.1) [symbolic = %I.F.type (constants.%I.F.type.76d346.3)] // CHECK:STDOUT: %I.facet: @TestGeneric.%I.type.loc21_17.2 (%I.type.07036d.3) = facet_value %A.loc19_32.1, (%I.lookup_impl_witness) [symbolic = %I.facet (constants.%I.facet.84d)] -// CHECK:STDOUT: %.loc21_11.2: type = fn_type_with_self_type %I.F.type, %I.facet [symbolic = %.loc21_11.2 (constants.%.e50)] -// CHECK:STDOUT: %impl.elem0.loc21_11.2: @TestGeneric.%.loc21_11.2 (%.e50) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.a9e)] +// CHECK:STDOUT: %.loc21_11.3: type = fn_type_with_self_type %I.F.type, %I.facet [symbolic = %.loc21_11.3 (constants.%.e50)] +// CHECK:STDOUT: %impl.elem0.loc21_11.2: @TestGeneric.%.loc21_11.3 (%.e50) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.a9e)] // CHECK:STDOUT: %specific_impl_fn.loc21_11.2: = specific_impl_function %impl.elem0.loc21_11.2, @I.F(%W.loc19_16.1, %I.facet) [symbolic = %specific_impl_fn.loc21_11.2 (constants.%specific_impl_fn.2e3)] // CHECK:STDOUT: %require_complete.loc21_11: = require_complete_type %A.loc19_32.1 [symbolic = %require_complete.loc21_11 (constants.%require_complete.f6b5ff.2)] // CHECK:STDOUT: @@ -246,7 +251,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %.loc21_18: @TestGeneric.%I.assoc_type (%I.assoc_type.b650b2.3) = specific_constant @I.%assoc0.loc8_33.1, @I(constants.%W) [symbolic = %assoc0 (constants.%assoc0.b4fda0.3)] // CHECK:STDOUT: %F.ref: @TestGeneric.%I.assoc_type (%I.assoc_type.b650b2.3) = name_ref F, %.loc21_18 [symbolic = %assoc0 (constants.%assoc0.b4fda0.3)] // CHECK:STDOUT: %.loc21_11.1: ref @TestGeneric.%A.loc19_32.1 (%A.2ddf89.3) = deref %a.ref -// CHECK:STDOUT: %impl.elem0.loc21_11.1: @TestGeneric.%.loc21_11.2 (%.e50) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.a9e)] +// CHECK:STDOUT: %impl.elem0.loc21_11.1: @TestGeneric.%.loc21_11.3 (%.e50) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.a9e)] // CHECK:STDOUT: %bound_method.loc21_11: = bound_method %.loc21_11.1, %impl.elem0.loc21_11.1 // CHECK:STDOUT: %specific_impl_fn.loc21_11.1: = specific_impl_function %impl.elem0.loc21_11.1, @I.F(constants.%W, constants.%I.facet.84d) [symbolic = %specific_impl_fn.loc21_11.2 (constants.%specific_impl_fn.2e3)] // CHECK:STDOUT: %bound_method.loc21_22: = bound_method %.loc21_11.1, %specific_impl_fn.loc21_11.1 @@ -342,9 +347,10 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %require_complete.loc13_17 => constants.%complete_type.d27 // CHECK:STDOUT: %require_complete.loc14 => constants.%complete_type.0a6 // CHECK:STDOUT: %A.elem => constants.%A.elem.2af +// CHECK:STDOUT: %.loc14_12.2 => constants.%.1b5 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.433 // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.48c -// CHECK:STDOUT: %.loc14_12.2 => constants.%.fb0 +// CHECK:STDOUT: %.loc14_12.3 => constants.%.fb0 // CHECK:STDOUT: %impl.elem0.loc14_12.2 => constants.%ptr.as.Copy.impl.Op.15e // CHECK:STDOUT: %specific_impl_fn.loc14_12.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon b/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon index 0387928eb9bc7..7c167c10b43e4 100644 --- a/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon +++ b/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon @@ -145,6 +145,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %Z_where.type.593: type = facet_type <@Z, @Z(%C) where %impl.elem0.62f = %T.binding.as_type> [symbolic] // CHECK:STDOUT: %require_complete.bf7: = require_complete_type %Z_where.type.593 [symbolic] // CHECK:STDOUT: %Z.impl_witness.f1f: = impl_witness file.%Z.impl_witness_table.loc11, @T.as.Z.impl.030(%T.binding.as_type) [symbolic] +// CHECK:STDOUT: %.1c1: require_specific_def_type = require_specific_def @T.as.Z.impl.030(%T.binding.as_type) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -323,6 +324,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.9c0)] +// CHECK:STDOUT: %.loc15_11.4: require_specific_def_type = require_specific_def @T.as.Z.impl.030(%T.binding.as_type) [symbolic = %.loc15_11.4 (constants.%.1c1)] // CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table.loc11, @T.as.Z.impl.030(%T.binding.as_type) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.f1f)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: @F.%T.binding.as_type (%T.binding.as_type)) { @@ -790,6 +792,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %Ptr_where.type.0d1962.2: type = facet_type <@Ptr where %impl.elem0.00d = %ptr.4f0b5c.2> [symbolic] // CHECK:STDOUT: %require_complete.19c230.2: = require_complete_type %Ptr_where.type.0d1962.2 [symbolic] // CHECK:STDOUT: %Ptr.impl_witness.a48d1a.2: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.d9f) [symbolic] +// CHECK:STDOUT: %.a2d: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %Ptr.facet: %Ptr.type = facet_value %T.d9f, (%Ptr.impl_witness.a48d1a.2) [symbolic] // CHECK:STDOUT: %pattern_type.a60: type = pattern_type %ptr.4f0b5c.2 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] @@ -798,6 +801,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %require_complete.4b7: = require_complete_type %T.d9f [symbolic] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0b5c.2, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.4f0b5c.2, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %.89d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [symbolic] @@ -857,7 +861,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %Ptr.ref: type = name_ref Ptr, file.%Ptr.decl [concrete = constants.%Ptr.type] // CHECK:STDOUT: %Type.ref: %Ptr.assoc_type = name_ref Type, @Type.%assoc0 [concrete = constants.%assoc0.d28] // CHECK:STDOUT: %Ptr.facet.loc9_30.2: %Ptr.type = facet_value %T.ref.loc9_29, (constants.%Ptr.impl_witness.a48d1a.2) [symbolic = %Ptr.facet.loc9_30.1 (constants.%Ptr.facet)] -// CHECK:STDOUT: %.loc9: %Ptr.type = converted %T.ref.loc9_29, %Ptr.facet.loc9_30.2 [symbolic = %Ptr.facet.loc9_30.1 (constants.%Ptr.facet)] +// CHECK:STDOUT: %.loc9_30.2: %Ptr.type = converted %T.ref.loc9_29, %Ptr.facet.loc9_30.2 [symbolic = %Ptr.facet.loc9_30.1 (constants.%Ptr.facet)] // CHECK:STDOUT: %impl.elem0.loc9: type = impl_witness_access constants.%Ptr.impl_witness.a48d1a.2, element0 [symbolic = %ptr (constants.%ptr.4f0b5c.2)] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.3b7] // CHECK:STDOUT: %T.loc9_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.d9f)] @@ -903,6 +907,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: generic fn @F(%T.loc9_6.2: type) { // CHECK:STDOUT: %T.loc9_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.d9f)] // CHECK:STDOUT: %pattern_type.loc9_20: type = pattern_type %T.loc9_6.1 [symbolic = %pattern_type.loc9_20 (constants.%pattern_type.e68)] +// CHECK:STDOUT: %.loc9_30.1: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.loc9_6.1) [symbolic = %.loc9_30.1 (constants.%.a2d)] // CHECK:STDOUT: %Ptr.impl_witness: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.loc9_6.1) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.a48d1a.2)] // CHECK:STDOUT: %Ptr.facet.loc9_30.1: %Ptr.type = facet_value %T.loc9_6.1, (%Ptr.impl_witness) [symbolic = %Ptr.facet.loc9_30.1 (constants.%Ptr.facet)] // CHECK:STDOUT: %ptr: type = ptr_type %T.loc9_6.1 [symbolic = %ptr (constants.%ptr.4f0b5c.2)] @@ -911,17 +916,18 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc9_26: = require_complete_type %ptr [symbolic = %require_complete.loc9_26 (constants.%require_complete.482)] // CHECK:STDOUT: %require_complete.loc9_16: = require_complete_type %T.loc9_6.1 [symbolic = %require_complete.loc9_16 (constants.%require_complete.4b7)] +// CHECK:STDOUT: %.loc10_10.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc9_6.1) [symbolic = %.loc10_10.2 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)] -// CHECK:STDOUT: %.loc10_10.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc10_10.2 (constants.%.89d)] -// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.2 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %.loc10_10.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc10_10.3 (constants.%.89d)] +// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.3 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %specific_impl_fn.loc10_10.2: = specific_impl_function %impl.elem0.loc10_10.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: @F.%T.loc9_6.1 (%T.d9f)) -> @F.%ptr (%ptr.4f0b5c.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %t.ref: ref @F.%T.loc9_6.1 (%T.d9f) = name_ref t, %t // CHECK:STDOUT: %addr: @F.%ptr (%ptr.4f0b5c.2) = addr_of %t.ref -// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.2 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.3 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %bound_method.loc10_10.1: = bound_method %addr, %impl.elem0.loc10_10.1 // CHECK:STDOUT: %specific_impl_fn.loc10_10.1: = specific_impl_function %impl.elem0.loc10_10.1, @Copy.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: %bound_method.loc10_10.2: = bound_method %addr, %specific_impl_fn.loc10_10.1 @@ -957,6 +963,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: specific @F(constants.%T.d9f) { // CHECK:STDOUT: %T.loc9_6.1 => constants.%T.d9f // CHECK:STDOUT: %pattern_type.loc9_20 => constants.%pattern_type.e68 +// CHECK:STDOUT: %.loc9_30.1 => constants.%.a2d // CHECK:STDOUT: %Ptr.impl_witness => constants.%Ptr.impl_witness.a48d1a.2 // CHECK:STDOUT: %Ptr.facet.loc9_30.1 => constants.%Ptr.facet // CHECK:STDOUT: %ptr => constants.%ptr.4f0b5c.2 @@ -990,6 +997,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %Ptr_where.type.1bd: type = facet_type <@Ptr where %impl.elem0.00d = %ptr.86c> [symbolic] // CHECK:STDOUT: %require_complete.ec0: = require_complete_type %Ptr_where.type.1bd [symbolic] // CHECK:STDOUT: %Ptr.impl_witness.d27: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type.28a) [symbolic] +// CHECK:STDOUT: %.1a9: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.binding.as_type.28a) [symbolic] // CHECK:STDOUT: %pattern_type.425: type = pattern_type %ptr.86c [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -997,6 +1005,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %require_complete.b27: = require_complete_type %T.binding.as_type.28a [symbolic] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %.fd3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.binding.as_type.28a) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c59: = lookup_impl_witness %ptr.86c, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.86c, (%Copy.lookup_impl_witness.c59) [symbolic] // CHECK:STDOUT: %.32f: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [symbolic] @@ -1055,7 +1064,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %T.ref.loc9_28: %Ptr.type = name_ref T, %T.loc9_6.2 [symbolic = %T.loc9_6.1 (constants.%T.717)] // CHECK:STDOUT: %Type.ref: %Ptr.assoc_type = name_ref Type, @Type.%assoc0 [concrete = constants.%assoc0.d28] // CHECK:STDOUT: %T.as_type.loc9_29: type = facet_access_type %T.ref.loc9_28 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.28a)] -// CHECK:STDOUT: %.loc9_29: type = converted %T.ref.loc9_28, %T.as_type.loc9_29 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.28a)] +// CHECK:STDOUT: %.loc9_29.2: type = converted %T.ref.loc9_28, %T.as_type.loc9_29 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.28a)] // CHECK:STDOUT: %impl.elem0.loc9: type = impl_witness_access constants.%Ptr.impl_witness.d27, element0 [symbolic = %ptr (constants.%ptr.86c)] // CHECK:STDOUT: %.loc9_10: type = splice_block %Ptr.ref [concrete = constants.%Ptr.type] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.3b7] @@ -1109,6 +1118,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %T.loc9_6.1: %Ptr.type = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.717)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc9_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.28a)] // CHECK:STDOUT: %pattern_type.loc9_19: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc9_19 (constants.%pattern_type.6f0)] +// CHECK:STDOUT: %.loc9_29.1: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.binding.as_type) [symbolic = %.loc9_29.1 (constants.%.1a9)] // CHECK:STDOUT: %Ptr.impl_witness: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.d27)] // CHECK:STDOUT: %ptr: type = ptr_type %T.binding.as_type [symbolic = %ptr (constants.%ptr.86c)] // CHECK:STDOUT: %pattern_type.loc9_25: type = pattern_type %ptr [symbolic = %pattern_type.loc9_25 (constants.%pattern_type.425)] @@ -1116,17 +1126,18 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc9_25: = require_complete_type %ptr [symbolic = %require_complete.loc9_25 (constants.%require_complete.c88)] // CHECK:STDOUT: %require_complete.loc9_15: = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc9_15 (constants.%require_complete.b27)] +// CHECK:STDOUT: %.loc10_10.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.binding.as_type) [symbolic = %.loc10_10.2 (constants.%.fd3)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c59)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)] -// CHECK:STDOUT: %.loc10_10.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc10_10.2 (constants.%.32f)] -// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.2 (%.32f) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1e1)] +// CHECK:STDOUT: %.loc10_10.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc10_10.3 (constants.%.32f)] +// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.3 (%.32f) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1e1)] // CHECK:STDOUT: %specific_impl_fn.loc10_10.2: = specific_impl_function %impl.elem0.loc10_10.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.cac)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: @F.%T.binding.as_type (%T.binding.as_type.28a)) -> @F.%ptr (%ptr.86c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %t.ref: ref @F.%T.binding.as_type (%T.binding.as_type.28a) = name_ref t, %t // CHECK:STDOUT: %addr: @F.%ptr (%ptr.86c) = addr_of %t.ref -// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.2 (%.32f) = impl_witness_access constants.%Copy.lookup_impl_witness.c59, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1e1)] +// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.3 (%.32f) = impl_witness_access constants.%Copy.lookup_impl_witness.c59, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1e1)] // CHECK:STDOUT: %bound_method.loc10_10.1: = bound_method %addr, %impl.elem0.loc10_10.1 // CHECK:STDOUT: %specific_impl_fn.loc10_10.1: = specific_impl_function %impl.elem0.loc10_10.1, @Copy.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.cac)] // CHECK:STDOUT: %bound_method.loc10_10.2: = bound_method %addr, %specific_impl_fn.loc10_10.1 @@ -1163,6 +1174,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %T.loc9_6.1 => constants.%T.717 // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.28a // CHECK:STDOUT: %pattern_type.loc9_19 => constants.%pattern_type.6f0 +// CHECK:STDOUT: %.loc9_29.1 => constants.%.1a9 // CHECK:STDOUT: %Ptr.impl_witness => constants.%Ptr.impl_witness.d27 // CHECK:STDOUT: %ptr => constants.%ptr.86c // CHECK:STDOUT: %pattern_type.loc9_25 => constants.%pattern_type.425 @@ -1195,6 +1207,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %Ptr_where.type.1bd: type = facet_type <@Ptr where %impl.elem0.00d = %ptr.86c> [symbolic] // CHECK:STDOUT: %require_complete.ec0: = require_complete_type %Ptr_where.type.1bd [symbolic] // CHECK:STDOUT: %Ptr.impl_witness.d27: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type.28a) [symbolic] +// CHECK:STDOUT: %.1a9: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.binding.as_type.28a) [symbolic] // CHECK:STDOUT: %pattern_type.425: type = pattern_type %ptr.86c [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -1202,6 +1215,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %require_complete.b27: = require_complete_type %T.binding.as_type.28a [symbolic] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %.fd3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.binding.as_type.28a) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c59: = lookup_impl_witness %ptr.86c, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.86c, (%Copy.lookup_impl_witness.c59) [symbolic] // CHECK:STDOUT: %.32f: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [symbolic] @@ -1313,6 +1327,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %T.loc9_6.1: %Ptr.type = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.717)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc9_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.28a)] // CHECK:STDOUT: %pattern_type.loc9_19: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc9_19 (constants.%pattern_type.6f0)] +// CHECK:STDOUT: %.loc9_29: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.binding.as_type) [symbolic = %.loc9_29 (constants.%.1a9)] // CHECK:STDOUT: %Ptr.impl_witness: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.d27)] // CHECK:STDOUT: %ptr: type = ptr_type %T.binding.as_type [symbolic = %ptr (constants.%ptr.86c)] // CHECK:STDOUT: %pattern_type.loc9_25: type = pattern_type %ptr [symbolic = %pattern_type.loc9_25 (constants.%pattern_type.425)] @@ -1320,17 +1335,18 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc9_25: = require_complete_type %ptr [symbolic = %require_complete.loc9_25 (constants.%require_complete.c88)] // CHECK:STDOUT: %require_complete.loc9_15: = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc9_15 (constants.%require_complete.b27)] +// CHECK:STDOUT: %.loc10_10.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.binding.as_type) [symbolic = %.loc10_10.2 (constants.%.fd3)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c59)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)] -// CHECK:STDOUT: %.loc10_10.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc10_10.2 (constants.%.32f)] -// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.2 (%.32f) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1e1)] +// CHECK:STDOUT: %.loc10_10.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc10_10.3 (constants.%.32f)] +// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.3 (%.32f) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1e1)] // CHECK:STDOUT: %specific_impl_fn.loc10_10.2: = specific_impl_function %impl.elem0.loc10_10.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.cac)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: @F.%T.binding.as_type (%T.binding.as_type.28a)) -> @F.%ptr (%ptr.86c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %t.ref: ref @F.%T.binding.as_type (%T.binding.as_type.28a) = name_ref t, %t // CHECK:STDOUT: %addr: @F.%ptr (%ptr.86c) = addr_of %t.ref -// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.2 (%.32f) = impl_witness_access constants.%Copy.lookup_impl_witness.c59, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1e1)] +// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.3 (%.32f) = impl_witness_access constants.%Copy.lookup_impl_witness.c59, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1e1)] // CHECK:STDOUT: %bound_method.loc10_10.1: = bound_method %addr, %impl.elem0.loc10_10.1 // CHECK:STDOUT: %specific_impl_fn.loc10_10.1: = specific_impl_function %impl.elem0.loc10_10.1, @Copy.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.cac)] // CHECK:STDOUT: %bound_method.loc10_10.2: = bound_method %addr, %specific_impl_fn.loc10_10.1 @@ -1367,6 +1383,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %T.loc9_6.1 => constants.%T.717 // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.28a // CHECK:STDOUT: %pattern_type.loc9_19 => constants.%pattern_type.6f0 +// CHECK:STDOUT: %.loc9_29 => constants.%.1a9 // CHECK:STDOUT: %Ptr.impl_witness => constants.%Ptr.impl_witness.d27 // CHECK:STDOUT: %ptr => constants.%ptr.86c // CHECK:STDOUT: %pattern_type.loc9_25 => constants.%pattern_type.425 diff --git a/toolchain/check/testdata/interface/as_type_of_type.carbon b/toolchain/check/testdata/interface/as_type_of_type.carbon index 8cc39b371444b..d726125b1f5c7 100644 --- a/toolchain/check/testdata/interface/as_type_of_type.carbon +++ b/toolchain/check/testdata/interface/as_type_of_type.carbon @@ -54,6 +54,7 @@ fn F(T:! Empty) { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.f7c: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.13d = struct_value () [symbolic] // CHECK:STDOUT: %ptr.d9e: type = ptr_type %ptr.ac9 [symbolic] // CHECK:STDOUT: %require_complete.ff7: = require_complete_type %ptr.d9e [symbolic] +// CHECK:STDOUT: %.eec: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr.ac9, (%Destroy.impl_witness.080) [symbolic] // CHECK:STDOUT: %.c8c: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.f7c, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic] @@ -127,9 +128,10 @@ fn F(T:! Empty) { // CHECK:STDOUT: %require_complete.loc22_11: = require_complete_type %ptr.loc22_11.2 [symbolic = %require_complete.loc22_11 (constants.%require_complete.78f)] // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc22_11.2 [symbolic = %pattern_type (constants.%pattern_type.0e5)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr.loc22_11.2, () [symbolic = %facet_value (constants.%facet_value)] +// CHECK:STDOUT: %.loc22_3.1: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.loc22_3.1 (constants.%.eec)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.080)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr.loc22_11.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] -// CHECK:STDOUT: %.loc22_3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc22_3 (constants.%.c8c)] +// CHECK:STDOUT: %.loc22_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc22_3.2 (constants.%.c8c)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.13d)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.13d) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f7c)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] @@ -150,7 +152,7 @@ fn F(T:! Empty) { // CHECK:STDOUT: %ptr.loc22_11.1: type = ptr_type %.loc22_11.2 [symbolic = %ptr.loc22_11.2 (constants.%ptr.ac9)] // CHECK:STDOUT: } // CHECK:STDOUT: %x: ref @F.%ptr.loc22_11.2 (%ptr.ac9) = ref_binding x, %x.var -// CHECK:STDOUT: %impl.elem0: @F.%.loc22_3 (%.c8c) = impl_witness_access constants.%Destroy.impl_witness.080, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f7c)] +// CHECK:STDOUT: %impl.elem0: @F.%.loc22_3.2 (%.c8c) = impl_witness_access constants.%Destroy.impl_witness.080, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f7c)] // CHECK:STDOUT: %bound_method.loc22_3.1: = bound_method %x.var, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] // CHECK:STDOUT: %bound_method.loc22_3.2: = bound_method %x.var, %specific_fn diff --git a/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon b/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon index ac94989c06845..af3c1dbc12429 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon @@ -293,6 +293,7 @@ interface C { // CHECK:STDOUT: %Self.4d7: %J2.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self.4d7 [symbolic] // CHECK:STDOUT: %I2.impl_witness.7b7f96.2: = impl_witness file.%I2.impl_witness_table, @V.binding.as_type.as.I2.impl(%Self.4d7) [symbolic] +// CHECK:STDOUT: %.6cb: require_specific_def_type = require_specific_def @V.binding.as_type.as.I2.impl(%Self.4d7) [symbolic] // CHECK:STDOUT: %I2.lookup_impl_witness.1de: = lookup_impl_witness %Self.4d7, @I2 [symbolic] // CHECK:STDOUT: %I2.facet: %I2.type = facet_value %Self.binding.as_type, (%I2.lookup_impl_witness.1de) [symbolic] // CHECK:STDOUT: %impl.elem0.804: type = impl_witness_access %I2.lookup_impl_witness.1de, element0 [symbolic] @@ -372,7 +373,7 @@ interface C { // CHECK:STDOUT: } { // CHECK:STDOUT: %as_type: type = facet_access_type @J2.%Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] // CHECK:STDOUT: %I2.facet.loc15_14.2: %I2.type = facet_value %as_type, (constants.%I2.lookup_impl_witness.1de) [symbolic = %I2.facet.loc15_14.1 (constants.%I2.facet)] -// CHECK:STDOUT: %.loc15: %I2.type = converted @J2.%Self, %I2.facet.loc15_14.2 [symbolic = %I2.facet.loc15_14.1 (constants.%I2.facet)] +// CHECK:STDOUT: %.loc15_14.2: %I2.type = converted @J2.%Self, %I2.facet.loc15_14.2 [symbolic = %I2.facet.loc15_14.1 (constants.%I2.facet)] // CHECK:STDOUT: %impl.elem0.loc15_14.2: type = impl_witness_access constants.%I2.lookup_impl_witness.1de, element0 [symbolic = %impl.elem0.loc15_14.1 (constants.%impl.elem0.804)] // CHECK:STDOUT: %U2.ref: type = name_ref U2, %impl.elem0.loc15_14.2 [symbolic = %impl.elem0.loc15_14.1 (constants.%impl.elem0.804)] // CHECK:STDOUT: %return.param: ref @J2.F2.%impl.elem0.loc15_14.1 (%impl.elem0.804) = out_param call_param0 @@ -408,6 +409,7 @@ interface C { // CHECK:STDOUT: generic fn @J2.F2(@J2.%Self: %J2.type) { // CHECK:STDOUT: %Self: %J2.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.4d7)] // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] +// CHECK:STDOUT: %.loc15_14.1: require_specific_def_type = require_specific_def @V.binding.as_type.as.I2.impl(%Self) [symbolic = %.loc15_14.1 (constants.%.6cb)] // CHECK:STDOUT: %I2.lookup_impl_witness: = lookup_impl_witness %Self, @I2 [symbolic = %I2.lookup_impl_witness (constants.%I2.lookup_impl_witness.1de)] // CHECK:STDOUT: %I2.facet.loc15_14.1: %I2.type = facet_value %Self.binding.as_type, (%I2.lookup_impl_witness) [symbolic = %I2.facet.loc15_14.1 (constants.%I2.facet)] // CHECK:STDOUT: %impl.elem0.loc15_14.1: type = impl_witness_access %I2.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_14.1 (constants.%impl.elem0.804)] @@ -439,6 +441,7 @@ interface C { // CHECK:STDOUT: specific @J2.F2(constants.%Self.4d7) { // CHECK:STDOUT: %Self => constants.%Self.4d7 // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type +// CHECK:STDOUT: %.loc15_14.1 => constants.%.6cb // CHECK:STDOUT: %I2.lookup_impl_witness => constants.%I2.lookup_impl_witness.1de // CHECK:STDOUT: %I2.facet.loc15_14.1 => constants.%I2.facet // CHECK:STDOUT: %impl.elem0.loc15_14.1 => constants.%impl.elem0.804 diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 60cd4b65d5b65..b8f7dbd17aab7 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -225,6 +225,7 @@ fn Interface.C.F[self: Self](U:! type, u: U*) -> U* { return u; } // CHECK:STDOUT: %require_complete.886: = require_complete_type %C [symbolic] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %.f91: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%U.b88) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.7dd: = lookup_impl_witness %ptr.262, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.262, (%Copy.lookup_impl_witness.7dd) [symbolic] // CHECK:STDOUT: %.2d0: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [symbolic] @@ -343,16 +344,17 @@ fn Interface.C.F[self: Self](U:! type, u: U*) -> U* { return u; } // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc20_47: = require_complete_type %ptr.loc14_36.1 [symbolic = %require_complete.loc20_47 (constants.%require_complete.88b)] // CHECK:STDOUT: %require_complete.loc20_22: = require_complete_type %C [symbolic = %require_complete.loc20_22 (constants.%require_complete.886)] +// CHECK:STDOUT: %.loc20_62.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%U.loc14_22.1) [symbolic = %.loc20_62.2 (constants.%.f91)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc14_36.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.7dd)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc14_36.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)] -// CHECK:STDOUT: %.loc20_62.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc20_62.2 (constants.%.2d0)] -// CHECK:STDOUT: %impl.elem0.loc20_62.2: @C.F.%.loc20_62.2 (%.2d0) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_62.2 (constants.%impl.elem0.720)] +// CHECK:STDOUT: %.loc20_62.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc20_62.3 (constants.%.2d0)] +// CHECK:STDOUT: %impl.elem0.loc20_62.2: @C.F.%.loc20_62.3 (%.2d0) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_62.2 (constants.%impl.elem0.720)] // CHECK:STDOUT: %specific_impl_fn.loc20_62.2: = specific_impl_function %impl.elem0.loc20_62.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc20_62.2 (constants.%specific_impl_fn.b1c)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param.loc20: @C.F.%C (%C), %u.param.loc20: @C.F.%ptr.loc14_36.1 (%ptr.262)) -> @C.F.%ptr.loc14_36.1 (%ptr.262) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %u.ref: @C.F.%ptr.loc14_36.1 (%ptr.262) = name_ref u, %u.loc20 -// CHECK:STDOUT: %impl.elem0.loc20_62.1: @C.F.%.loc20_62.2 (%.2d0) = impl_witness_access constants.%Copy.lookup_impl_witness.7dd, element0 [symbolic = %impl.elem0.loc20_62.2 (constants.%impl.elem0.720)] +// CHECK:STDOUT: %impl.elem0.loc20_62.1: @C.F.%.loc20_62.3 (%.2d0) = impl_witness_access constants.%Copy.lookup_impl_witness.7dd, element0 [symbolic = %impl.elem0.loc20_62.2 (constants.%impl.elem0.720)] // CHECK:STDOUT: %bound_method.loc20_62.1: = bound_method %u.ref, %impl.elem0.loc20_62.1 // CHECK:STDOUT: %specific_impl_fn.loc20_62.1: = specific_impl_function %impl.elem0.loc20_62.1, @Copy.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc20_62.2 (constants.%specific_impl_fn.b1c)] // CHECK:STDOUT: %bound_method.loc20_62.2: = bound_method %u.ref, %specific_impl_fn.loc20_62.1 diff --git a/toolchain/check/testdata/interface/generic_method.carbon b/toolchain/check/testdata/interface/generic_method.carbon index d6e1e11f93551..d45db1165eaa9 100644 --- a/toolchain/check/testdata/interface/generic_method.carbon +++ b/toolchain/check/testdata/interface/generic_method.carbon @@ -137,6 +137,7 @@ fn CallIndirect() { // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.75bcbe.1: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.692ac2.1: %ptr.as.Copy.impl.Op.type.75bcbe.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%U.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0b5c.1, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet.747: %Copy.type = facet_value %ptr.4f0b5c.1, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %.89d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.747 [symbolic] @@ -163,6 +164,7 @@ fn CallIndirect() { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.056: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.cee = struct_value () [concrete] // CHECK:STDOUT: %ptr.5df: type = ptr_type %tuple.type.092 [concrete] // CHECK:STDOUT: %complete_type.aab: = complete_type_witness %ptr.5df [concrete] +// CHECK:STDOUT: %.d23: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.352) [concrete] // CHECK:STDOUT: %Destroy.facet.272: %Destroy.type = facet_value %tuple.type.092, (%Destroy.impl_witness.cc1) [concrete] // CHECK:STDOUT: %.30d: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.272 [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.7b8: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.056, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.352) [concrete] @@ -189,6 +191,7 @@ fn CallIndirect() { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.8d9: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c7f = struct_value () [symbolic] // CHECK:STDOUT: %ptr.0f5: type = ptr_type %tuple.type.86a [symbolic] // CHECK:STDOUT: %require_complete.536: = require_complete_type %ptr.0f5 [symbolic] +// CHECK:STDOUT: %.984: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.a42) [symbolic] // CHECK:STDOUT: %Destroy.facet.ac7: %Destroy.type = facet_value %tuple.type.86a, (%Destroy.impl_witness.7b0) [symbolic] // CHECK:STDOUT: %.47a: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.ac7 [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.b2a: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.8d9, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.a42) [symbolic] @@ -200,6 +203,7 @@ fn CallIndirect() { // CHECK:STDOUT: %Copy.impl_witness.f1c: = impl_witness imports.%Copy.impl_witness_table.67d, @ptr.as.Copy.impl(%Z) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.31e: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%Z) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.525: %ptr.as.Copy.impl.Op.type.31e = struct_value () [concrete] +// CHECK:STDOUT: %.f24: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%Z) [concrete] // CHECK:STDOUT: %Copy.facet.347: %Copy.type = facet_value %ptr.fb6, (%Copy.impl_witness.f1c) [concrete] // CHECK:STDOUT: %.90e: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.347 [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.525, @ptr.as.Copy.impl.Op(%Z) [concrete] @@ -397,10 +401,11 @@ fn CallIndirect() { // CHECK:STDOUT: %require_complete.loc16_25: = require_complete_type %tuple.type.loc16 [symbolic = %require_complete.loc16_25 (constants.%require_complete.dc0)] // CHECK:STDOUT: %require_complete.loc16_19: = require_complete_type %ptr.loc16_22.1 [symbolic = %require_complete.loc16_19 (constants.%require_complete.482d3f.1)] // CHECK:STDOUT: %tuple.type.loc17: type = tuple_type (constants.%empty_struct_type, constants.%empty_struct_type, %ptr.loc16_22.1) [symbolic = %tuple.type.loc17 (constants.%tuple.type.f88)] +// CHECK:STDOUT: %.loc17_21.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%U.loc16_8.1) [symbolic = %.loc17_21.2 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc16_22.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc16_22.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.747)] -// CHECK:STDOUT: %.loc17_21.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc17_21.2 (constants.%.89d)] -// CHECK:STDOUT: %impl.elem0.loc17_21.2: @Y.as.A.impl.F.%.loc17_21.2 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc17_21.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %.loc17_21.3: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc17_21.3 (constants.%.89d)] +// CHECK:STDOUT: %impl.elem0.loc17_21.2: @Y.as.A.impl.F.%.loc17_21.3 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc17_21.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %specific_impl_fn.loc17_21.2: = specific_impl_function %impl.elem0.loc17_21.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc17_21.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%u.param: @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.4f0b5c.1)) -> %return.param: @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.576) { @@ -415,7 +420,7 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.elem1: ref %Y = tuple_access %return, element1 // CHECK:STDOUT: %.loc17_18.2: init %Y = class_init (), %tuple.elem1 [concrete = constants.%Y.val] // CHECK:STDOUT: %.loc17_22.3: init %Y = converted %.loc17_18.1, %.loc17_18.2 [concrete = constants.%Y.val] -// CHECK:STDOUT: %impl.elem0.loc17_21.1: @Y.as.A.impl.F.%.loc17_21.2 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc17_21.2 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %impl.elem0.loc17_21.1: @Y.as.A.impl.F.%.loc17_21.3 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc17_21.2 (constants.%impl.elem0.928)] // CHECK:STDOUT: %bound_method.loc17_21.1: = bound_method %u.ref, %impl.elem0.loc17_21.1 // CHECK:STDOUT: %specific_impl_fn.loc17_21.1: = specific_impl_function %impl.elem0.loc17_21.1, @Copy.Op(constants.%Copy.facet.747) [symbolic = %specific_impl_fn.loc17_21.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: %bound_method.loc17_21.2: = bound_method %u.ref, %specific_impl_fn.loc17_21.1 @@ -480,9 +485,10 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.binding.as_type, constants.%ptr.fb6) [symbolic = %tuple.type (constants.%tuple.type.86a)] // CHECK:STDOUT: %require_complete.loc28_12.1: = require_complete_type %tuple.type [symbolic = %require_complete.loc28_12.1 (constants.%require_complete.93d)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %tuple.type, () [symbolic = %facet_value (constants.%facet_value.a42)] +// CHECK:STDOUT: %.loc28_12.4: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.loc28_12.4 (constants.%.984)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.7b0)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.ac7)] -// CHECK:STDOUT: %.loc28_12.4: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc28_12.4 (constants.%.47a)] +// CHECK:STDOUT: %.loc28_12.5: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc28_12.5 (constants.%.47a)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.c7f)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @CallGeneric.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.c7f) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.8d9)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.b2a)] @@ -511,7 +517,7 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.86a) = temporary_storage // CHECK:STDOUT: %.loc28_12.2: init @CallGeneric.%tuple.type (%tuple.type.86a) = call %specific_impl_fn.loc28_4.1(%addr.loc28_10) to %.loc28_12.1 // CHECK:STDOUT: %.loc28_12.3: ref @CallGeneric.%tuple.type (%tuple.type.86a) = temporary %.loc28_12.1, %.loc28_12.2 -// CHECK:STDOUT: %impl.elem0.loc28_12: @CallGeneric.%.loc28_12.4 (%.47a) = impl_witness_access constants.%Destroy.impl_witness.7b0, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.8d9)] +// CHECK:STDOUT: %impl.elem0.loc28_12: @CallGeneric.%.loc28_12.5 (%.47a) = impl_witness_access constants.%Destroy.impl_witness.7b0, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.8d9)] // CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.3, %impl.elem0.loc28_12 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc28_12, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.a42) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.b2a)] // CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.3, %specific_fn @@ -598,9 +604,10 @@ fn CallIndirect() { // CHECK:STDOUT: %require_complete.loc16_25 => constants.%complete_type.05d // CHECK:STDOUT: %require_complete.loc16_19 => constants.%complete_type.d3e // CHECK:STDOUT: %tuple.type.loc17 => constants.%tuple.type.953 +// CHECK:STDOUT: %.loc17_21.2 => constants.%.f24 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.f1c // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.347 -// CHECK:STDOUT: %.loc17_21.2 => constants.%.90e +// CHECK:STDOUT: %.loc17_21.3 => constants.%.90e // CHECK:STDOUT: %impl.elem0.loc17_21.2 => constants.%ptr.as.Copy.impl.Op.525 // CHECK:STDOUT: %specific_impl_fn.loc17_21.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } @@ -634,9 +641,10 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.092 // CHECK:STDOUT: %require_complete.loc28_12.1 => constants.%complete_type.05d // CHECK:STDOUT: %facet_value => constants.%facet_value.352 +// CHECK:STDOUT: %.loc28_12.4 => constants.%.d23 // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.cc1 // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.272 -// CHECK:STDOUT: %.loc28_12.4 => constants.%.30d +// CHECK:STDOUT: %.loc28_12.5 => constants.%.30d // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.cee // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.056 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.7b8 @@ -742,6 +750,7 @@ fn CallIndirect() { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.472: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.5cd = struct_value () [concrete] // CHECK:STDOUT: %ptr.ad9: type = ptr_type %tuple.type.415 [concrete] // CHECK:STDOUT: %complete_type.e23: = complete_type_witness %ptr.ad9 [concrete] +// CHECK:STDOUT: %.a06: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.71a) [concrete] // CHECK:STDOUT: %Destroy.facet.b37: %Destroy.type = facet_value %tuple.type.415, (%Destroy.impl_witness.c75) [concrete] // CHECK:STDOUT: %.322: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.b37 [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.12b: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.472, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.71a) [concrete] @@ -769,6 +778,7 @@ fn CallIndirect() { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.a08: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a5d = struct_value () [symbolic] // CHECK:STDOUT: %ptr.4ce: type = ptr_type %tuple.type.bf3 [symbolic] // CHECK:STDOUT: %require_complete.7d0: = require_complete_type %ptr.4ce [symbolic] +// CHECK:STDOUT: %.1ce: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.185) [symbolic] // CHECK:STDOUT: %Destroy.facet.1b6: %Destroy.type = facet_value %tuple.type.bf3, (%Destroy.impl_witness.cd1) [symbolic] // CHECK:STDOUT: %.cce: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.1b6 [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.760: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.a08, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.185) [symbolic] @@ -1069,9 +1079,10 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.binding.as_type, constants.%Z) [symbolic = %tuple.type (constants.%tuple.type.bf3)] // CHECK:STDOUT: %require_complete.loc28_12.1: = require_complete_type %tuple.type [symbolic = %require_complete.loc28_12.1 (constants.%require_complete.4e9)] // CHECK:STDOUT: %facet_value: %type_where = facet_value %tuple.type, () [symbolic = %facet_value (constants.%facet_value.185)] +// CHECK:STDOUT: %.loc28_12.4: require_specific_def_type = require_specific_def @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %.loc28_12.4 (constants.%.1ce)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.cd1)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.1b6)] -// CHECK:STDOUT: %.loc28_12.4: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc28_12.4 (constants.%.cce)] +// CHECK:STDOUT: %.loc28_12.5: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc28_12.5 (constants.%.cce)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.a5d)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @CallGeneric.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.a5d) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a08)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.760)] @@ -1097,7 +1108,7 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc28_11.6: %Z = acquire_value %.loc28_11.5 // CHECK:STDOUT: %.loc28_12.2: init @CallGeneric.%tuple.type (%tuple.type.bf3) = call %specific_impl_fn.loc28_4.1(%.loc28_11.6) to %.loc28_12.1 // CHECK:STDOUT: %.loc28_12.3: ref @CallGeneric.%tuple.type (%tuple.type.bf3) = temporary %.loc28_12.1, %.loc28_12.2 -// CHECK:STDOUT: %impl.elem0.loc28_12: @CallGeneric.%.loc28_12.4 (%.cce) = impl_witness_access constants.%Destroy.impl_witness.cd1, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a08)] +// CHECK:STDOUT: %impl.elem0.loc28_12: @CallGeneric.%.loc28_12.5 (%.cce) = impl_witness_access constants.%Destroy.impl_witness.cd1, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a08)] // CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.3, %impl.elem0.loc28_12 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc28_12, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.185) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.760)] // CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.3, %specific_fn @@ -1270,9 +1281,10 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.415 // CHECK:STDOUT: %require_complete.loc28_12.1 => constants.%complete_type.aa8 // CHECK:STDOUT: %facet_value => constants.%facet_value.71a +// CHECK:STDOUT: %.loc28_12.4 => constants.%.a06 // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.c75 // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.b37 -// CHECK:STDOUT: %.loc28_12.4 => constants.%.322 +// CHECK:STDOUT: %.loc28_12.5 => constants.%.322 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.5cd // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.472 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.12b diff --git a/toolchain/check/testdata/interface/member_lookup.carbon b/toolchain/check/testdata/interface/member_lookup.carbon index 772e941abb7b0..5c472f26f4fbe 100644 --- a/toolchain/check/testdata/interface/member_lookup.carbon +++ b/toolchain/check/testdata/interface/member_lookup.carbon @@ -80,6 +80,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.75b: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.692: %ptr.as.Copy.impl.Op.type.75b = struct_value () [symbolic] +// CHECK:STDOUT: %.dcd: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.d9f) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.c66: = lookup_impl_witness %ptr.4f0, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet.747: %Copy.type = facet_value %ptr.4f0, (%Copy.lookup_impl_witness.c66) [symbolic] // CHECK:STDOUT: %.89d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.747 [symbolic] @@ -230,10 +231,11 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %Interface.lookup_impl_witness: = lookup_impl_witness %I.loc8_28.1, @Interface, @Interface(%T.loc8_18.1) [symbolic = %Interface.lookup_impl_witness (constants.%Interface.lookup_impl_witness.8cd)] // CHECK:STDOUT: %impl.elem0.loc9_11.3: @AccessGeneric.%ptr.loc8_50.1 (%ptr.4f0) = impl_witness_access %Interface.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_11.3 (constants.%impl.elem0.2bc)] // CHECK:STDOUT: %require_complete.loc9_13: = require_complete_type %ptr.loc8_50.1 [symbolic = %require_complete.loc9_13 (constants.%require_complete.482)] +// CHECK:STDOUT: %.loc9_11.4: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc8_18.1) [symbolic = %.loc9_11.4 (constants.%.dcd)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc8_50.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.c66)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc8_50.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.747)] -// CHECK:STDOUT: %.loc9_11.4: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc9_11.4 (constants.%.89d)] -// CHECK:STDOUT: %impl.elem0.loc9_11.4: @AccessGeneric.%.loc9_11.4 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_11.4 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %.loc9_11.5: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc9_11.5 (constants.%.89d)] +// CHECK:STDOUT: %impl.elem0.loc9_11.4: @AccessGeneric.%.loc9_11.5 (%.89d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_11.4 (constants.%impl.elem0.928)] // CHECK:STDOUT: %bound_method.loc9_11.3: = bound_method %impl.elem0.loc9_11.3, %impl.elem0.loc9_11.4 [symbolic = %bound_method.loc9_11.3 (constants.%bound_method.f64)] // CHECK:STDOUT: %specific_impl_fn.loc9_11.2: = specific_impl_function %impl.elem0.loc9_11.4, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: %bound_method.loc9_11.4: = bound_method %impl.elem0.loc9_11.3, %specific_impl_fn.loc9_11.2 [symbolic = %bound_method.loc9_11.4 (constants.%bound_method.930)] @@ -246,7 +248,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %I.as_type: type = facet_access_type %I.ref [symbolic = %I.binding.as_type (constants.%I.binding.as_type.594)] // CHECK:STDOUT: %.loc9_11.2: type = converted %I.ref, %I.as_type [symbolic = %I.binding.as_type (constants.%I.binding.as_type.594)] // CHECK:STDOUT: %impl.elem0.loc9_11.1: @AccessGeneric.%ptr.loc8_50.1 (%ptr.4f0) = impl_witness_access constants.%Interface.lookup_impl_witness.8cd, element0 [symbolic = %impl.elem0.loc9_11.3 (constants.%impl.elem0.2bc)] -// CHECK:STDOUT: %impl.elem0.loc9_11.2: @AccessGeneric.%.loc9_11.4 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc9_11.4 (constants.%impl.elem0.928)] +// CHECK:STDOUT: %impl.elem0.loc9_11.2: @AccessGeneric.%.loc9_11.5 (%.89d) = impl_witness_access constants.%Copy.lookup_impl_witness.c66, element0 [symbolic = %impl.elem0.loc9_11.4 (constants.%impl.elem0.928)] // CHECK:STDOUT: %bound_method.loc9_11.1: = bound_method %impl.elem0.loc9_11.1, %impl.elem0.loc9_11.2 [symbolic = %bound_method.loc9_11.3 (constants.%bound_method.f64)] // CHECK:STDOUT: %specific_impl_fn.loc9_11.1: = specific_impl_function %impl.elem0.loc9_11.2, @Copy.Op(constants.%Copy.facet.747) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn.6a1)] // CHECK:STDOUT: %bound_method.loc9_11.2: = bound_method %impl.elem0.loc9_11.1, %specific_impl_fn.loc9_11.1 [symbolic = %bound_method.loc9_11.4 (constants.%bound_method.930)] diff --git a/toolchain/check/testdata/interface/test.carbon b/toolchain/check/testdata/interface/test.carbon new file mode 100644 index 0000000000000..2d96239868e25 --- /dev/null +++ b/toolchain/check/testdata/interface/test.carbon @@ -0,0 +1,330 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon +// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/test.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/test.carbon + +// --- require_complete_impl.carbon +library "[[@TEST_NAME]]"; + +interface I { fn F(); } +interface J {} + +final impl forall [T:! J] T as I { fn F() {} } + +fn UseI(T:! I) { T.F(); } +fn UseJ(T:! J) { UseI(T); } + +impl {} as J {} +fn Use() { UseJ({}); } + +// CHECK:STDOUT: --- require_complete_impl.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] +// CHECK:STDOUT: %Self.9f2: %I.type = symbolic_binding Self, 0 [symbolic] +// CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete] +// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%I.F.decl [concrete] +// CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete] +// CHECK:STDOUT: %Self.dc6: %J.type = symbolic_binding Self, 0 [symbolic] +// CHECK:STDOUT: %type: type = facet_type [concrete] +// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %T.dc6: %J.type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.84b: type = pattern_type %J.type [concrete] +// CHECK:STDOUT: %T.binding.as_type.1fa: type = symbolic_binding_type T, 0, %T.dc6 [symbolic] +// CHECK:STDOUT: %I.impl_witness.2d8: = impl_witness file.%I.impl_witness_table, @T.binding.as_type.as.I.impl(%T.dc6) [symbolic] +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.type.0a0: type = fn_type @T.binding.as_type.as.I.impl.F, @T.binding.as_type.as.I.impl(%T.dc6) [symbolic] +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.793: %T.binding.as_type.as.I.impl.F.type.0a0 = struct_value () [symbolic] +// CHECK:STDOUT: %I.facet.238: %I.type = facet_value %T.binding.as_type.1fa, (%I.impl_witness.2d8) [symbolic] +// CHECK:STDOUT: %T.9f2: %I.type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.09a: type = pattern_type %I.type [concrete] +// CHECK:STDOUT: %UseI.type: type = fn_type @UseI [concrete] +// CHECK:STDOUT: %UseI: %UseI.type = struct_value () [concrete] +// CHECK:STDOUT: %T.binding.as_type.bcb: type = symbolic_binding_type T, 0, %T.9f2 [symbolic] +// CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %T.9f2, @I [symbolic] +// CHECK:STDOUT: %.258: type = fn_type_with_self_type %I.F.type, %T.9f2 [symbolic] +// CHECK:STDOUT: %impl.elem0: %.258 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @I.F(%T.9f2) [symbolic] +// CHECK:STDOUT: %UseJ.type: type = fn_type @UseJ [concrete] +// CHECK:STDOUT: %UseJ: %UseJ.type = struct_value () [concrete] +// CHECK:STDOUT: %.f34: require_specific_def_type = require_specific_def @T.binding.as_type.as.I.impl(%T.dc6) [symbolic] +// CHECK:STDOUT: %UseI.specific_fn.6e9: = specific_function %UseI, @UseI(%I.facet.238) [symbolic] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %Use.type: type = fn_type @Use [concrete] +// CHECK:STDOUT: %Use: %Use.type = struct_value () [concrete] +// CHECK:STDOUT: %J.facet: %J.type = facet_value %empty_struct_type, (%J.impl_witness) [concrete] +// CHECK:STDOUT: %UseJ.specific_fn: = specific_function %UseJ, @UseJ(%J.facet) [concrete] +// CHECK:STDOUT: %.1ec: type = fn_type_with_self_type %I.F.type, %I.facet.238 [symbolic] +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.specific_fn.4f0: = specific_function %T.binding.as_type.as.I.impl.F.793, @T.binding.as_type.as.I.impl.F(%T.dc6) [symbolic] +// CHECK:STDOUT: %I.impl_witness.d5a: = impl_witness file.%I.impl_witness_table, @T.binding.as_type.as.I.impl(%J.facet) [concrete] +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.type.318: type = fn_type @T.binding.as_type.as.I.impl.F, @T.binding.as_type.as.I.impl(%J.facet) [concrete] +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.5ff: %T.binding.as_type.as.I.impl.F.type.318 = struct_value () [concrete] +// CHECK:STDOUT: %.6ba: require_specific_def_type = require_specific_def @T.binding.as_type.as.I.impl(%J.facet) [concrete] +// CHECK:STDOUT: %I.facet.7b1: %I.type = facet_value %empty_struct_type, (%I.impl_witness.d5a) [concrete] +// CHECK:STDOUT: %UseI.specific_fn.f7e: = specific_function %UseI, @UseI(%I.facet.7b1) [concrete] +// CHECK:STDOUT: %.b25: type = fn_type_with_self_type %I.F.type, %I.facet.7b1 [concrete] +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.specific_fn.3bf: = specific_function %T.binding.as_type.as.I.impl.F.5ff, @T.binding.as_type.as.I.impl.F(%J.facet) [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .J = %J.decl +// CHECK:STDOUT: .UseI = %UseI.decl +// CHECK:STDOUT: .UseJ = %UseJ.decl +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {} +// CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {} +// CHECK:STDOUT: impl_decl @T.binding.as_type.as.I.impl [concrete] { +// CHECK:STDOUT: %T.patt: %pattern_type.84b = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc6_20.2 [symbolic = %T.loc6_20.1 (constants.%T.dc6)] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.1fa)] +// CHECK:STDOUT: %.loc6_27: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.1fa)] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] +// CHECK:STDOUT: %.loc6_24: type = splice_block %J.ref [concrete = constants.%J.type] { +// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc6_20.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc6_20.1 (constants.%T.dc6)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@T.binding.as_type.as.I.impl.%T.binding.as_type.as.I.impl.F.decl), @T.binding.as_type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @T.binding.as_type.as.I.impl(constants.%T.dc6) [symbolic = @T.binding.as_type.as.I.impl.%I.impl_witness (constants.%I.impl_witness.2d8)] +// CHECK:STDOUT: %UseI.decl: %UseI.type = fn_decl @UseI [concrete = constants.%UseI] { +// CHECK:STDOUT: %T.patt: %pattern_type.09a = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.loc8_13: type = splice_block %I.ref [concrete = constants.%I.type] { +// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc8_9.2: %I.type = symbolic_binding T, 0 [symbolic = %T.loc8_9.1 (constants.%T.9f2)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %UseJ.decl: %UseJ.type = fn_decl @UseJ [concrete = constants.%UseJ] { +// CHECK:STDOUT: %T.patt: %pattern_type.84b = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.loc9_13: type = splice_block %J.ref [concrete = constants.%J.type] { +// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc9_9.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc9_9.1 (constants.%T.dc6)] +// CHECK:STDOUT: } +// CHECK:STDOUT: impl_decl @empty_struct_type.as.J.impl [concrete] {} { +// CHECK:STDOUT: %.loc11_7.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc11_7.2: type = converted %.loc11_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @empty_struct_type.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] +// CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [concrete = constants.%Use] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I { +// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.9f2] +// CHECK:STDOUT: %I.F.decl: %I.F.type = fn_decl @I.F [concrete = constants.%I.F] {} {} +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.F.decl [concrete = constants.%assoc0] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .F = %assoc0 +// CHECK:STDOUT: witness = (%I.F.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @J { +// CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.dc6] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: witness = () +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @T.binding.as_type.as.I.impl(%T.loc6_20.2: %J.type) { +// CHECK:STDOUT: %T.loc6_20.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc6_20.1 (constants.%T.dc6)] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc6_20.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.1fa)] +// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @T.binding.as_type.as.I.impl(%T.loc6_20.1) [symbolic = %I.impl_witness (constants.%I.impl_witness.2d8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.type: type = fn_type @T.binding.as_type.as.I.impl.F, @T.binding.as_type.as.I.impl(%T.loc6_20.1) [symbolic = %T.binding.as_type.as.I.impl.F.type (constants.%T.binding.as_type.as.I.impl.F.type.0a0)] +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F: @T.binding.as_type.as.I.impl.%T.binding.as_type.as.I.impl.F.type (%T.binding.as_type.as.I.impl.F.type.0a0) = struct_value () [symbolic = %T.binding.as_type.as.I.impl.F (constants.%T.binding.as_type.as.I.impl.F.793)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: %.loc6_27 as %I.ref { +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.decl: @T.binding.as_type.as.I.impl.%T.binding.as_type.as.I.impl.F.type (%T.binding.as_type.as.I.impl.F.type.0a0) = fn_decl @T.binding.as_type.as.I.impl.F [symbolic = @T.binding.as_type.as.I.impl.%T.binding.as_type.as.I.impl.F (constants.%T.binding.as_type.as.I.impl.F.793)] {} {} +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .F = %T.binding.as_type.as.I.impl.F.decl +// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @empty_struct_type.as.J.impl: %.loc11_7.2 as %J.ref { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%J.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @I.F(@I.%Self: %I.type) { +// CHECK:STDOUT: fn(); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @T.binding.as_type.as.I.impl.F(@T.binding.as_type.as.I.impl.%T.loc6_20.2: %J.type) { +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @UseI(%T.loc8_9.2: %I.type) { +// CHECK:STDOUT: %T.loc8_9.1: %I.type = symbolic_binding T, 0 [symbolic = %T.loc8_9.1 (constants.%T.9f2)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc8_9.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.bcb)] +// CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %T.loc8_9.1, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)] +// CHECK:STDOUT: %.loc8_19.2: type = fn_type_with_self_type constants.%I.F.type, %T.loc8_9.1 [symbolic = %.loc8_19.2 (constants.%.258)] +// CHECK:STDOUT: %impl.elem0.loc8_19.2: @UseI.%.loc8_19.2 (%.258) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_19.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc8_19.2: = specific_impl_function %impl.elem0.loc8_19.2, @I.F(%T.loc8_9.1) [symbolic = %specific_impl_fn.loc8_19.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %T.ref: %I.type = name_ref T, %T.loc8_9.2 [symbolic = %T.loc8_9.1 (constants.%T.9f2)] +// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.bcb)] +// CHECK:STDOUT: %.loc8_19.1: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.bcb)] +// CHECK:STDOUT: %impl.elem0.loc8_19.1: @UseI.%.loc8_19.2 (%.258) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_19.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc8_19.1: = specific_impl_function %impl.elem0.loc8_19.1, @I.F(constants.%T.9f2) [symbolic = %specific_impl_fn.loc8_19.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc8_22: init %empty_tuple.type = call %specific_impl_fn.loc8_19.1() +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @UseJ(%T.loc9_9.2: %J.type) { +// CHECK:STDOUT: %T.loc9_9.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc9_9.1 (constants.%T.dc6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc9_9.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.1fa)] +// CHECK:STDOUT: %.loc9_24.2: require_specific_def_type = require_specific_def @T.binding.as_type.as.I.impl(%T.loc9_9.1) [symbolic = %.loc9_24.2 (constants.%.f34)] +// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @T.binding.as_type.as.I.impl(%T.loc9_9.1) [symbolic = %I.impl_witness (constants.%I.impl_witness.2d8)] +// CHECK:STDOUT: %I.facet.loc9_24.2: %I.type = facet_value %T.binding.as_type, (%I.impl_witness) [symbolic = %I.facet.loc9_24.2 (constants.%I.facet.238)] +// CHECK:STDOUT: %UseI.specific_fn.loc9_18.2: = specific_function constants.%UseI, @UseI(%I.facet.loc9_24.2) [symbolic = %UseI.specific_fn.loc9_18.2 (constants.%UseI.specific_fn.6e9)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %UseI.ref: %UseI.type = name_ref UseI, file.%UseI.decl [concrete = constants.%UseI] +// CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc9_9.2 [symbolic = %T.loc9_9.1 (constants.%T.dc6)] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.1fa)] +// CHECK:STDOUT: %I.facet.loc9_24.1: %I.type = facet_value %T.as_type, (constants.%I.impl_witness.2d8) [symbolic = %I.facet.loc9_24.2 (constants.%I.facet.238)] +// CHECK:STDOUT: %.loc9_24.1: %I.type = converted %T.ref, %I.facet.loc9_24.1 [symbolic = %I.facet.loc9_24.2 (constants.%I.facet.238)] +// CHECK:STDOUT: %UseI.specific_fn.loc9_18.1: = specific_function %UseI.ref, @UseI(constants.%I.facet.238) [symbolic = %UseI.specific_fn.loc9_18.2 (constants.%UseI.specific_fn.6e9)] +// CHECK:STDOUT: %UseI.call: init %empty_tuple.type = call %UseI.specific_fn.loc9_18.1() +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Use() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %UseJ.ref: %UseJ.type = name_ref UseJ, file.%UseJ.decl [concrete = constants.%UseJ] +// CHECK:STDOUT: %.loc12_18: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %J.facet: %J.type = facet_value constants.%empty_struct_type, (constants.%J.impl_witness) [concrete = constants.%J.facet] +// CHECK:STDOUT: %.loc12_19: %J.type = converted %.loc12_18, %J.facet [concrete = constants.%J.facet] +// CHECK:STDOUT: %UseJ.specific_fn: = specific_function %UseJ.ref, @UseJ(constants.%J.facet) [concrete = constants.%UseJ.specific_fn] +// CHECK:STDOUT: %UseJ.call: init %empty_tuple.type = call %UseJ.specific_fn() +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @I.F(constants.%Self.9f2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T.binding.as_type.as.I.impl(constants.%T.dc6) { +// CHECK:STDOUT: %T.loc6_20.1 => constants.%T.dc6 +// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.1fa +// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.2d8 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.type => constants.%T.binding.as_type.as.I.impl.F.type.0a0 +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F => constants.%T.binding.as_type.as.I.impl.F.793 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T.binding.as_type.as.I.impl.F(constants.%T.dc6) { +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @I.F(constants.%I.facet.238) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @UseI(constants.%T.9f2) { +// CHECK:STDOUT: %T.loc8_9.1 => constants.%T.9f2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @I.F(constants.%T.9f2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @UseJ(constants.%T.dc6) { +// CHECK:STDOUT: %T.loc9_9.1 => constants.%T.dc6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @UseI(constants.%I.facet.238) { +// CHECK:STDOUT: %T.loc8_9.1 => constants.%I.facet.238 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.1fa +// CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.impl_witness.2d8 +// CHECK:STDOUT: %.loc8_19.2 => constants.%.1ec +// CHECK:STDOUT: %impl.elem0.loc8_19.2 => constants.%T.binding.as_type.as.I.impl.F.793 +// CHECK:STDOUT: %specific_impl_fn.loc8_19.2 => constants.%T.binding.as_type.as.I.impl.F.specific_fn.4f0 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @UseJ(constants.%J.facet) { +// CHECK:STDOUT: %T.loc9_9.1 => constants.%J.facet +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.binding.as_type => constants.%empty_struct_type +// CHECK:STDOUT: %.loc9_24.2 => constants.%.6ba +// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.d5a +// CHECK:STDOUT: %I.facet.loc9_24.2 => constants.%I.facet.7b1 +// CHECK:STDOUT: %UseI.specific_fn.loc9_18.2 => constants.%UseI.specific_fn.f7e +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T.binding.as_type.as.I.impl(constants.%J.facet) { +// CHECK:STDOUT: %T.loc6_20.1 => constants.%J.facet +// CHECK:STDOUT: %T.binding.as_type => constants.%empty_struct_type +// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.d5a +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.type => constants.%T.binding.as_type.as.I.impl.F.type.318 +// CHECK:STDOUT: %T.binding.as_type.as.I.impl.F => constants.%T.binding.as_type.as.I.impl.F.5ff +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @UseI(constants.%I.facet.7b1) { +// CHECK:STDOUT: %T.loc8_9.1 => constants.%I.facet.7b1 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.binding.as_type => constants.%empty_struct_type +// CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.impl_witness.d5a +// CHECK:STDOUT: %.loc8_19.2 => constants.%.b25 +// CHECK:STDOUT: %impl.elem0.loc8_19.2 => constants.%T.binding.as_type.as.I.impl.F.5ff +// CHECK:STDOUT: %specific_impl_fn.loc8_19.2 => constants.%T.binding.as_type.as.I.impl.F.specific_fn.3bf +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @I.F(constants.%I.facet.7b1) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T.binding.as_type.as.I.impl.F(constants.%J.facet) { +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/type_completion.cpp b/toolchain/check/type_completion.cpp index ce1384630591b..1909ebd35a01d 100644 --- a/toolchain/check/type_completion.cpp +++ b/toolchain/check/type_completion.cpp @@ -144,8 +144,9 @@ class TypeCompleter { SemIR::CharLiteralType, SemIR::ErrorInst, SemIR::FacetType, SemIR::FloatLiteralType, SemIR::FloatType, SemIR::IntType, SemIR::IntLiteralType, SemIR::NamespaceType, SemIR::PatternType, - SemIR::PointerType, SemIR::SpecificFunctionType, SemIR::TypeType, - SemIR::VtableType, SemIR::WitnessType>()) + SemIR::PointerType, SemIR::RequireSpecificDefinitionType, + SemIR::SpecificFunctionType, SemIR::TypeType, SemIR::VtableType, + SemIR::WitnessType>()) auto BuildInfoForInst(SemIR::TypeId type_id, InstT /*inst*/) const -> SemIR::CompleteTypeInfo { return {.value_repr = MakeCopyValueRepr(type_id)}; diff --git a/toolchain/driver/testdata/stdin.carbon b/toolchain/driver/testdata/stdin.carbon index b17bc5c93148b..75f4e1bbff8f0 100644 --- a/toolchain/driver/testdata/stdin.carbon +++ b/toolchain/driver/testdata/stdin.carbon @@ -32,7 +32,7 @@ // CHECK:STDOUT: import_ir_insts: {} // CHECK:STDOUT: clang_decls: {} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope00000000: {inst: inst0000000E, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope00000000: {inst: inst0000000F, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {}} // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: {} @@ -49,10 +49,10 @@ // CHECK:STDOUT: 'type(inst(NamespaceType))': // CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(NamespaceType))} // CHECK:STDOUT: insts: -// CHECK:STDOUT: inst0000000E: {kind: Namespace, arg0: name_scope00000000, arg1: inst, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst0000000F: {kind: Namespace, arg0: name_scope00000000, arg1: inst, type: type(inst(NamespaceType))} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: values: -// CHECK:STDOUT: inst0000000E: concrete_constant(inst0000000E) +// CHECK:STDOUT: inst0000000F: concrete_constant(inst0000000F) // CHECK:STDOUT: symbolic_constants: {} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} @@ -60,7 +60,7 @@ // CHECK:STDOUT: imports: {} // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block60000004: -// CHECK:STDOUT: 0: inst0000000E +// CHECK:STDOUT: 0: inst0000000F // CHECK:STDOUT: ... // CHECK:STDOUT: --- - // CHECK:STDOUT: diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index cc808f4f477bc..6018dc406c876 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -554,9 +554,8 @@ static auto GetFunctionDefinition(const SemIR::File* decl_ir, return {decl_ir, decl_ir_function_id}; } -auto FileContext::BuildFunctionDefinition(SemIR::FunctionId function_id, - SemIR::SpecificId specific_id) - -> void { +auto FileContext::BuildFunctionDefinition( + SemIR::FunctionId function_id, SemIR::SpecificId specific_id) -> void { auto [definition_ir, definition_ir_function_id] = GetFunctionDefinition(&sem_ir(), function_id); if (!definition_ir) { @@ -571,12 +570,11 @@ auto FileContext::BuildFunctionDefinition(SemIR::FunctionId function_id, context().GetFileContext(definition_ir), definition_function); } -auto FileContext::BuildFunctionBody(SemIR::FunctionId function_id, - SemIR::SpecificId specific_id, - const SemIR::Function& declaration_function, - FileContext& definition_context, - const SemIR::Function& definition_function) - -> void { +auto FileContext::BuildFunctionBody( + SemIR::FunctionId function_id, SemIR::SpecificId specific_id, + const SemIR::Function& declaration_function, + FileContext& definition_context, + const SemIR::Function& definition_function) -> void { // On crash, report the function we were lowering. PrettyStackTraceFunction stack_trace_entry([&](llvm::raw_ostream& output) { SemIR::DiagnosticLocConverter converter( @@ -762,36 +760,36 @@ auto FileContext::BuildDISubprogram(const SemIR::Function& function, // is the fallback handler for non-type instructions. template requires(InstT::Kind.is_type() == SemIR::InstIsType::Never) -static auto BuildTypeForInst(FileContext& /*context*/, InstT inst) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& /*context*/, + InstT inst) -> llvm::Type* { CARBON_FATAL("Cannot use inst as type: {0}", inst); } template requires(InstT::Kind.is_symbolic_when_type()) -static auto BuildTypeForInst(FileContext& context, InstT /*inst*/) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + InstT /*inst*/) -> llvm::Type* { // Treat non-monomorphized symbolic types as opaque. return llvm::StructType::get(context.llvm_context()); } -static auto BuildTypeForInst(FileContext& context, SemIR::ArrayType inst) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + SemIR::ArrayType inst) -> llvm::Type* { return llvm::ArrayType::get( context.GetType(context.sem_ir().types().GetTypeIdForTypeInstId( inst.element_type_inst_id)), *context.sem_ir().GetArrayBoundValue(inst.bound_id)); } -static auto BuildTypeForInst(FileContext& context, SemIR::BoolType /*inst*/) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + SemIR::BoolType /*inst*/) -> llvm::Type* { // TODO: We may want to have different representations for `bool` storage // (`i8`) versus for `bool` values (`i1`). return llvm::Type::getInt1Ty(context.llvm_context()); } -static auto BuildTypeForInst(FileContext& context, SemIR::ClassType inst) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + SemIR::ClassType inst) -> llvm::Type* { auto object_repr_id = context.sem_ir() .classes() .Get(inst.class_id) @@ -806,8 +804,8 @@ static auto BuildTypeForInst(FileContext& context, InstT inst) -> llvm::Type* { context.sem_ir().types().GetTypeIdForTypeInstId(inst.inner_id)); } -static auto BuildTypeForInst(FileContext& context, SemIR::CustomLayoutType inst) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + SemIR::CustomLayoutType inst) -> llvm::Type* { auto layout = context.sem_ir().custom_layouts().Get(inst.layout_id); return llvm::ArrayType::get(llvm::Type::getInt8Ty(context.llvm_context()), layout[SemIR::CustomLayoutId::SizeIndex]); @@ -825,14 +823,14 @@ static auto BuildTypeForInst(FileContext& /*context*/, return nullptr; } -static auto BuildTypeForInst(FileContext& context, SemIR::FloatType inst) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + SemIR::FloatType inst) -> llvm::Type* { return llvm::Type::getFloatingPointTy(context.llvm_context(), inst.float_kind.Semantics()); } -static auto BuildTypeForInst(FileContext& context, SemIR::IntType inst) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + SemIR::IntType inst) -> llvm::Type* { auto width = context.sem_ir().insts().TryGetAs(inst.bit_width_id); CARBON_CHECK(width, "Can't lower int type with symbolic width"); @@ -841,8 +839,8 @@ static auto BuildTypeForInst(FileContext& context, SemIR::IntType inst) context.sem_ir().ints().Get(width->int_id).getZExtValue()); } -static auto BuildTypeForInst(FileContext& context, SemIR::PointerType /*inst*/) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + SemIR::PointerType /*inst*/) -> llvm::Type* { return llvm::PointerType::get(context.llvm_context(), /*AddressSpace=*/0); } @@ -851,8 +849,8 @@ static auto BuildTypeForInst(FileContext& /*context*/, CARBON_FATAL("Unexpected pattern type in lowering"); } -static auto BuildTypeForInst(FileContext& context, SemIR::StructType inst) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + SemIR::StructType inst) -> llvm::Type* { auto fields = context.sem_ir().struct_type_fields().Get(inst.fields_id); llvm::SmallVector subtypes; subtypes.reserve(fields.size()); @@ -863,8 +861,8 @@ static auto BuildTypeForInst(FileContext& context, SemIR::StructType inst) return llvm::StructType::get(context.llvm_context(), subtypes); } -static auto BuildTypeForInst(FileContext& context, SemIR::TupleType inst) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + SemIR::TupleType inst) -> llvm::Type* { // TODO: Investigate special-casing handling of empty tuples so that they // can be collectively replaced with LLVM's void, particularly around // function returns. LLVM doesn't allow declaring variables with a void @@ -878,34 +876,34 @@ static auto BuildTypeForInst(FileContext& context, SemIR::TupleType inst) return llvm::StructType::get(context.llvm_context(), subtypes); } -static auto BuildTypeForInst(FileContext& context, SemIR::TypeType /*inst*/) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + SemIR::TypeType /*inst*/) -> llvm::Type* { return context.GetTypeType(); } -static auto BuildTypeForInst(FileContext& context, SemIR::VtableType /*inst*/) - -> llvm::Type* { +static auto BuildTypeForInst(FileContext& context, + SemIR::VtableType /*inst*/) -> llvm::Type* { return llvm::Type::getVoidTy(context.llvm_context()); } -static auto BuildTypeForInst(FileContext& context, - SemIR::SpecificFunctionType /*inst*/) - -> llvm::Type* { +static auto BuildTypeForInst( + FileContext& context, SemIR::SpecificFunctionType /*inst*/) -> llvm::Type* { return llvm::PointerType::get(context.llvm_context(), 0); } template - requires( - InstT::Kind.template IsAnyOf< - SemIR::AssociatedEntityType, SemIR::AutoType, SemIR::BoundMethodType, - SemIR::CharLiteralType, SemIR::CppOverloadSetType, SemIR::CppVoidType, - SemIR::FacetType, SemIR::FloatLiteralType, SemIR::FunctionType, - SemIR::FunctionTypeWithSelfType, SemIR::GenericClassType, - SemIR::GenericInterfaceType, SemIR::GenericNamedConstraintType, - SemIR::InstType, SemIR::IntLiteralType, SemIR::NamespaceType, - SemIR::WhereExpr, SemIR::WitnessType, SemIR::UnboundElementType>()) -static auto BuildTypeForInst(FileContext& context, InstT /*inst*/) - -> llvm::Type* { + requires(InstT::Kind.template IsAnyOf< + SemIR::AssociatedEntityType, SemIR::AutoType, + SemIR::BoundMethodType, SemIR::CharLiteralType, + SemIR::CppOverloadSetType, SemIR::CppVoidType, SemIR::FacetType, + SemIR::FloatLiteralType, SemIR::FunctionType, + SemIR::FunctionTypeWithSelfType, SemIR::GenericClassType, + SemIR::GenericInterfaceType, SemIR::GenericNamedConstraintType, + SemIR::InstType, SemIR::IntLiteralType, SemIR::NamespaceType, + SemIR::RequireSpecificDefinitionType, SemIR::UnboundElementType, + SemIR::WhereExpr, SemIR::WitnessType>()) +static auto BuildTypeForInst(FileContext& context, + InstT /*inst*/) -> llvm::Type* { // Return an empty struct as a placeholder. // TODO: Should we model an interface as a witness table, or an associated // entity as an index? diff --git a/toolchain/lower/mangler.cpp b/toolchain/lower/mangler.cpp index f0d372ddc0375..13fc7fdf848a8 100644 --- a/toolchain/lower/mangler.cpp +++ b/toolchain/lower/mangler.cpp @@ -90,6 +90,7 @@ auto Mangler::MangleInverseQualifiedNameScope(llvm::raw_ostream& os, case SemIR::FloatLiteralType::Kind: case SemIR::IntLiteralType::Kind: case SemIR::NamespaceType::Kind: + case SemIR::RequireSpecificDefinitionType::Kind: case SemIR::SpecificFunctionType::Kind: case SemIR::TypeType::Kind: case SemIR::VtableType::Kind: diff --git a/toolchain/lower/testdata/interface/test.carbon b/toolchain/lower/testdata/interface/test.carbon new file mode 100644 index 0000000000000..eec2459e9132e --- /dev/null +++ b/toolchain/lower/testdata/interface/test.carbon @@ -0,0 +1,65 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interface/test.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interface/test.carbon + +// --- a.carbon +library "[[@TEST_NAME]]"; + +class Optional(T:! Core.Copy & Core.Destroy) { + fn None() -> Self { + returned var me: Self; + return var; + } + + fn Get[self: Self]() -> T { return self.value; } + + private var value: T; +} + +// --- b.carbon +library "[[@TEST_NAME]]"; +export import library "a"; + +interface Iterate { + // TODO: Support iterating ranges of non-copyable values. + let ElementType:! Core.Copy & Core.Destroy; + let CursorType:! type; + fn Next[self: Self]() -> Optional(ElementType); +} + +// --- c.carbon +library "[[@TEST_NAME]]"; +export import library "b"; + +class IntRange(N:! Core.IntLiteral()) { + fn Make() -> Self { + return {}; + } + + impl as Iterate where .CursorType = Core.Int(N) and .ElementType = Core.Int(N) { + fn Next[self: Self]() -> Optional(Core.Int(N)) { + return Optional(Core.Int(N)).None(); + } + } +} + +fn Range(end: i32) -> IntRange(32) { + return IntRange(32).Make(); +} + +// --- d.carbon +library "[[@TEST_NAME]]"; +import library "c"; + +fn F() -> i32 { + let range: IntRange(32) = Range(2); + return range.(Iterate.Next)().Get(); +} diff --git a/toolchain/sem_ir/expr_info.cpp b/toolchain/sem_ir/expr_info.cpp index 7d4f68c85c468..afab2d512c327 100644 --- a/toolchain/sem_ir/expr_info.cpp +++ b/toolchain/sem_ir/expr_info.cpp @@ -151,6 +151,8 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case PointerType::Kind: case RefineTypeAction::Kind: case RequireCompleteType::Kind: + case RequireSpecificDefinition::Kind: + case RequireSpecificDefinitionType::Kind: case SpecificFunction::Kind: case SpecificFunctionType::Kind: case SpecificImplFunction::Kind: diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index 9eedd4bb9578e..24b54fcb716b6 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -111,6 +111,8 @@ CARBON_SEM_IR_INST_KIND(RefParam) CARBON_SEM_IR_INST_KIND(RefParamPattern) CARBON_SEM_IR_INST_KIND(RefineTypeAction) CARBON_SEM_IR_INST_KIND(RequireCompleteType) +CARBON_SEM_IR_INST_KIND(RequireSpecificDefinition) +CARBON_SEM_IR_INST_KIND(RequireSpecificDefinitionType) CARBON_SEM_IR_INST_KIND(RequirementBaseFacetType) CARBON_SEM_IR_INST_KIND(RequirementEquivalent) CARBON_SEM_IR_INST_KIND(RequirementImpls) diff --git a/toolchain/sem_ir/singleton_insts.h b/toolchain/sem_ir/singleton_insts.h index d3d8a76c22c5a..4b8e0eb6c2967 100644 --- a/toolchain/sem_ir/singleton_insts.h +++ b/toolchain/sem_ir/singleton_insts.h @@ -13,13 +13,21 @@ namespace Carbon::SemIR { // The canonical list of singleton kinds. The order of `TypeType` is // significant because other singletons use it as a type. static constexpr std::array SingletonInstKinds = { - InstKind::TypeType, InstKind::AutoType, - InstKind::BoolType, InstKind::BoundMethodType, - InstKind::CharLiteralType, InstKind::CppVoidType, - InstKind::ErrorInst, InstKind::FloatLiteralType, - InstKind::InstType, InstKind::IntLiteralType, - InstKind::NamespaceType, InstKind::SpecificFunctionType, - InstKind::VtableType, InstKind::WitnessType, + InstKind::TypeType, + InstKind::AutoType, + InstKind::BoolType, + InstKind::BoundMethodType, + InstKind::CharLiteralType, + InstKind::CppVoidType, + InstKind::ErrorInst, + InstKind::FloatLiteralType, + InstKind::InstType, + InstKind::IntLiteralType, + InstKind::NamespaceType, + InstKind::RequireSpecificDefinitionType, + InstKind::SpecificFunctionType, + InstKind::VtableType, + InstKind::WitnessType, }; // Returns true if the InstKind is a singleton. diff --git a/toolchain/sem_ir/type_iterator.cpp b/toolchain/sem_ir/type_iterator.cpp index f38de7f145de5..dffd351e30558 100644 --- a/toolchain/sem_ir/type_iterator.cpp +++ b/toolchain/sem_ir/type_iterator.cpp @@ -97,6 +97,7 @@ auto TypeIterator::ProcessTypeId(TypeId type_id) -> std::optional { case ImplWitnessAccess::Kind: case IntLiteralType::Kind: case NamespaceType::Kind: + case RequireSpecificDefinitionType::Kind: case TypeType::Kind: case WitnessType::Kind: { return Step::ConcreteType{.type_id = type_id}; diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 94fde245c328e..1d87b8f4a7241 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -1341,6 +1341,25 @@ struct RequireCompleteType { TypeInstId complete_type_inst_id; }; +// As part of a generic region, requires that an `impl` which is initially part +// of a symbolic specific be defined once a concrete specific is formed. +struct RequireSpecificDefinition { + static constexpr auto Kind = + InstKind::RequireSpecificDefinition.Define( + {.ir_name = "require_specific_def", + .constant_kind = InstConstantKind::Conditional, + .is_lowered = false}); + // Always the builtin `WitnessType` type. + // FIXME: Just copying from `RequireCompleteType`. Maybe its own type? + TypeId type_id; + SemIR::SpecificId specific_id; +}; + +// A dedicated type for `RequireSpecificDefinition`. +using RequireSpecificDefinitionType = + SingletonTypeInst; + // A requirement that `.Self` implements a facet type, specified as the first // operand of a `where` expression. This is always the first requirement in a // requirement block for a `where` expression.