diff --git a/toolchain/check/check_unit.cpp b/toolchain/check/check_unit.cpp index 68deb164e23c..e4efef0f7a69 100644 --- a/toolchain/check/check_unit.cpp +++ b/toolchain/check/check_unit.cpp @@ -8,6 +8,7 @@ #include "toolchain/base/pretty_stack_trace_function.h" #include "toolchain/check/generic.h" #include "toolchain/check/handle.h" +#include "toolchain/check/impl.h" #include "toolchain/check/import.h" #include "toolchain/check/import_ref.h" #include "toolchain/check/node_id_traversal.h" @@ -397,6 +398,7 @@ auto CheckUnit::CheckRequiredDefinitions() -> void { case CARBON_KIND(SemIR::ImplDecl impl_decl): { auto& impl = context_.impls().Get(impl_decl.impl_id); if (!impl.is_defined()) { + FillImplWitnessWithErrors(context_, impl); CARBON_DIAGNOSTIC(MissingImplDefinition, Error, "impl declared but not defined"); emitter_.Emit(decl_inst_id, MissingImplDefinition); diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 5250697f77da..b9eebb72d0dd 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -1284,7 +1284,7 @@ class TypeCompleter { template requires(InstT::Kind.template IsAnyOf()) + SemIR::ImplWitnessAccess>()) auto BuildValueReprForInst(SemIR::TypeId type_id, InstT /*inst*/) const -> SemIR::ValueRepr { // For symbolic types, we arbitrarily pick a copy representation. diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index aa25e1710960..72b6ee057a49 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -7,6 +7,7 @@ #include "toolchain/base/kind_switch.h" #include "toolchain/check/diagnostic_helpers.h" #include "toolchain/check/generic.h" +#include "toolchain/check/import_ref.h" #include "toolchain/diagnostics/diagnostic_emitter.h" #include "toolchain/diagnostics/format_providers.h" #include "toolchain/sem_ir/builtin_function_kind.h" @@ -1565,9 +1566,13 @@ static auto TryEvalInstInContext(EvalContext& eval_context, return RebuildIfFieldsAreConstant( eval_context, inst, &SemIR::GenericInterfaceType::enclosing_specific_id); - case SemIR::InterfaceWitness::Kind: + case SemIR::ImplWitness::Kind: + // We intentionally don't replace the `elements_id` field here. We want to + // track that specific InstBlock in particular, not coalesce blocks with + // the same members. That block may get updated, and we want to pick up + // those changes. return RebuildIfFieldsAreConstant(eval_context, inst, - &SemIR::InterfaceWitness::elements_id); + &SemIR::ImplWitness::specific_id); case CARBON_KIND(SemIR::IntType int_type): { return RebuildAndValidateIfFieldsAreConstant( eval_context, inst, @@ -1742,11 +1747,48 @@ static auto TryEvalInstInContext(EvalContext& eval_context, // The elements of a constant aggregate can be accessed. case SemIR::ClassElementAccess::Kind: - case SemIR::InterfaceWitnessAccess::Kind: case SemIR::StructAccess::Kind: case SemIR::TupleAccess::Kind: return PerformAggregateAccess(eval_context, inst); + case CARBON_KIND(SemIR::ImplWitnessAccess access_inst): { + // This is PerformAggregateAccess followed by GetConstantInSpecific. + Phase phase = Phase::Template; + if (ReplaceFieldWithConstantValue(eval_context, &access_inst, + &SemIR::ImplWitnessAccess::witness_id, + &phase)) { + if (auto witness = eval_context.insts().TryGetAs( + access_inst.witness_id)) { + auto elements = eval_context.inst_blocks().Get(witness->elements_id); + auto index = static_cast(access_inst.index.index); + CARBON_CHECK(index < elements.size(), "Access out of bounds."); + // `Phase` is not used here. If this element is a template constant, + // then so is the result of indexing, even if the aggregate also + // contains a symbolic context. + + auto element = elements[index]; + if (!element.is_valid()) { + // TODO: Perhaps this should be a `{}` value with incomplete type? + CARBON_DIAGNOSTIC(ImplAccessMemberBeforeComplete, Error, + "accessing member from impl before the end of " + "its definition"); + // TODO: Add note pointing to the impl declaration. + eval_context.emitter().Emit(eval_context.GetDiagnosticLoc(inst_id), + ImplAccessMemberBeforeComplete); + return SemIR::ErrorInst::SingletonConstantId; + } + LoadImportRef(eval_context.context(), element); + return GetConstantValueInSpecific(eval_context.sem_ir(), + witness->specific_id, element); + } else { + CARBON_CHECK(phase != Phase::Template, + "Failed to evaluate template constant {0} arg0: {1}", + inst, eval_context.insts().Get(access_inst.witness_id)); + } + return MakeConstantResult(eval_context.context(), access_inst, phase); + } + return MakeNonConstantResult(phase); + } case CARBON_KIND(SemIR::ArrayIndex index): { return PerformArrayIndex(eval_context, index); } diff --git a/toolchain/check/generic.cpp b/toolchain/check/generic.cpp index e9abbba09dd2..f99a7afd17ea 100644 --- a/toolchain/check/generic.cpp +++ b/toolchain/check/generic.cpp @@ -15,6 +15,11 @@ namespace Carbon::Check { +static auto MakeSelfSpecificId(Context& context, SemIR::GenericId generic_id) + -> SemIR::SpecificId; +static auto ResolveSpecificDeclaration(Context& context, SemIRLoc loc, + SemIR::SpecificId specific_id) -> void; + auto StartGenericDecl(Context& context) -> void { context.generic_region_stack().Push(); } @@ -315,15 +320,19 @@ auto DiscardGenericDecl(Context& context) -> void { context.generic_region_stack().Pop(); } -auto FinishGenericDecl(Context& context, SemIR::InstId decl_id) - -> SemIR::GenericId { +auto BuildGeneric(Context& context, SemIR::InstId decl_id) -> SemIR::GenericId { auto all_bindings = context.scope_stack().compile_time_bindings_stack().PeekAllValues(); if (all_bindings.empty()) { CARBON_CHECK(context.generic_region_stack().PeekDependentInsts().empty(), - "Have dependent instructions but no compile time bindings are " - "in scope."); + "Have dependent instruction {0} in declaration {1} but no " + "compile time bindings are in scope.", + context.insts().Get(context.generic_region_stack() + .PeekDependentInsts() + .front() + .inst_id), + context.insts().Get(decl_id)); context.generic_region_stack().Pop(); return SemIR::GenericId::Invalid; } @@ -333,18 +342,38 @@ auto FinishGenericDecl(Context& context, SemIR::InstId decl_id) // collection can have items added to it by import resolution while we are // building this generic. auto bindings_id = context.inst_blocks().Add(all_bindings); - auto generic_id = context.generics().Add( + + SemIR::GenericId generic_id = context.generics().Add( SemIR::Generic{.decl_id = decl_id, .bindings_id = bindings_id, .self_specific_id = SemIR::SpecificId::Invalid}); + // MakeSelfSpecificId could cause something to be imported, which would + // invalidate the return value of `context.generics().Get(generic_id)`. + auto self_specific_id = MakeSelfSpecificId(context, generic_id); + context.generics().Get(generic_id).self_specific_id = self_specific_id; + return generic_id; +} +auto FinishGenericDecl(Context& context, SemIRLoc loc, + SemIR::GenericId generic_id) -> void { + if (!generic_id.is_valid()) { + return; + } auto decl_block_id = MakeGenericEvalBlock( context, generic_id, SemIR::GenericInstIndex::Region::Declaration); context.generic_region_stack().Pop(); context.generics().Get(generic_id).decl_block_id = decl_block_id; - auto self_specific_id = MakeSelfSpecific(context, decl_id, generic_id); - context.generics().Get(generic_id).self_specific_id = self_specific_id; + ResolveSpecificDeclaration(context, loc, + context.generics().GetSelfSpecific(generic_id)); +} + +auto BuildGenericDecl(Context& context, SemIR::InstId decl_id) + -> SemIR::GenericId { + SemIR::GenericId generic_id = BuildGeneric(context, decl_id); + if (generic_id.is_valid()) { + FinishGenericDecl(context, decl_id, generic_id); + } return generic_id; } @@ -373,13 +402,16 @@ auto FinishGenericDefinition(Context& context, SemIR::GenericId generic_id) context.generic_region_stack().Pop(); } -auto MakeSpecific(Context& context, SemIRLoc loc, SemIR::GenericId generic_id, - SemIR::InstBlockId args_id) -> SemIR::SpecificId { - auto specific_id = context.specifics().GetOrAdd(generic_id, args_id); - +static auto ResolveSpecificDeclaration(Context& context, SemIRLoc loc, + SemIR::SpecificId specific_id) -> void { // If this is the first time we've formed this specific, evaluate its decl // block to form information about the specific. if (!context.specifics().Get(specific_id).decl_block_id.is_valid()) { + // Set a placeholder value as the decl block ID so we won't attempt to + // recursively resolve the same specific. + context.specifics().Get(specific_id).decl_block_id = + SemIR::InstBlockId::Empty; + auto decl_block_id = TryEvalBlockForSpecific(context, loc, specific_id, SemIR::GenericInstIndex::Region::Declaration); @@ -387,12 +419,17 @@ auto MakeSpecific(Context& context, SemIRLoc loc, SemIR::GenericId generic_id, // so re-lookup the specific here. context.specifics().Get(specific_id).decl_block_id = decl_block_id; } +} +auto MakeSpecific(Context& context, SemIRLoc loc, SemIR::GenericId generic_id, + SemIR::InstBlockId args_id) -> SemIR::SpecificId { + auto specific_id = context.specifics().GetOrAdd(generic_id, args_id); + ResolveSpecificDeclaration(context, loc, specific_id); return specific_id; } -auto MakeSelfSpecific(Context& context, SemIRLoc loc, - SemIR::GenericId generic_id) -> SemIR::SpecificId { +static auto MakeSelfSpecificId(Context& context, SemIR::GenericId generic_id) + -> SemIR::SpecificId { if (!generic_id.is_valid()) { return SemIR::SpecificId::Invalid; } @@ -407,16 +444,23 @@ auto MakeSelfSpecific(Context& context, SemIRLoc loc, arg_ids.push_back(context.constant_values().GetConstantInstId(arg_id)); } auto args_id = context.inst_blocks().AddCanonical(arg_ids); + return context.specifics().GetOrAdd(generic_id, args_id); +} +auto MakeSelfSpecific(Context& context, SemIRLoc loc, + SemIR::GenericId generic_id) -> SemIR::SpecificId { // Build a corresponding specific. + SemIR::SpecificId specific_id = MakeSelfSpecificId(context, generic_id); // TODO: This could be made more efficient. We don't need to perform // substitution here; we know we want identity mappings for all constants and // types. We could also consider not storing the mapping at all in this case. - return MakeSpecific(context, loc, generic_id, args_id); + ResolveSpecificDeclaration(context, loc, specific_id); + return specific_id; } auto ResolveSpecificDefinition(Context& context, SemIRLoc loc, SemIR::SpecificId specific_id) -> bool { + // TODO: Handle recursive resolution of the same generic definition. auto& specific = context.specifics().Get(specific_id); auto generic_id = specific.generic_id; CARBON_CHECK(generic_id.is_valid(), "Specific with no generic ID"); diff --git a/toolchain/check/generic.h b/toolchain/check/generic.h index 9813ae405c97..8e37b1e478f1 100644 --- a/toolchain/check/generic.h +++ b/toolchain/check/generic.h @@ -24,7 +24,15 @@ auto DiscardGenericDecl(Context& context) -> void; // Finish processing a potentially generic declaration and produce a // corresponding generic object. Returns SemIR::GenericId::Invalid if this // declaration is not actually generic. -auto FinishGenericDecl(Context& context, SemIR::InstId decl_id) +auto BuildGeneric(Context& context, SemIR::InstId decl_id) -> SemIR::GenericId; + +// Builds eval block for the declaration. +auto FinishGenericDecl(Context& context, SemIRLoc loc, + SemIR::GenericId generic_id) -> void; + +// BuildGeneric() and FinishGenericDecl() combined. Normally you would call this +// function unless the caller has work to do between the two steps. +auto BuildGenericDecl(Context& context, SemIR::InstId decl_id) -> SemIR::GenericId; // Merge a redeclaration of an entity that might be a generic into the original diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index 3d54e62bbbba..5fe5d116832f 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -237,7 +237,7 @@ static auto BuildClassDecl(Context& context, Parse::AnyClassDeclId node_id, // TODO: If this is an invalid redeclaration of a non-class entity or there // was an error in the qualifier, we will have lost track of the class name // here. We should keep track of it even if the name is invalid. - class_info.generic_id = FinishGenericDecl(context, class_decl_id); + class_info.generic_id = BuildGenericDecl(context, class_decl_id); class_decl.class_id = context.classes().Add(class_info); if (class_info.has_parameters()) { class_decl.type_id = context.GetGenericClassType( diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index 8e88fd697c80..8a6707fc1f77 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -261,7 +261,7 @@ static auto BuildFunctionDecl(Context& context, if (function_info.is_extern && context.IsImplFile()) { DiagnoseExternRequiresDeclInApiFile(context, node_id); } - function_info.generic_id = FinishGenericDecl(context, decl_id); + function_info.generic_id = BuildGenericDecl(context, decl_id); function_decl.function_id = context.functions().Add(function_info); } else { FinishGenericRedecl(context, decl_id, function_info.generic_id); diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index 20e6d0afe93c..4589062367e7 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -241,8 +241,6 @@ static auto MergeImplRedecl(Context& context, SemIR::Impl& new_impl, SemIR::ImplId prev_impl_id) -> bool { auto& prev_impl = context.impls().Get(prev_impl_id); - // TODO: Following #3763, disallow redeclarations in different scopes. - // If the parameters aren't the same, then this is not a redeclaration of this // `impl`. Keep looking for a prior declaration without issuing a diagnostic. if (!CheckRedeclParamsMatch(context, DeclParams(new_impl), @@ -343,8 +341,9 @@ static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id, // Create a new impl if this isn't a valid redeclaration. if (!impl_decl.impl_id.is_valid()) { - impl_info.generic_id = FinishGenericDecl(context, impl_decl_id); + impl_info.generic_id = BuildGeneric(context, impl_decl_id); impl_info.witness_id = ImplWitnessForDeclaration(context, impl_info); + FinishGenericDecl(context, impl_decl_id, impl_info.generic_id); impl_decl.impl_id = context.impls().Add(impl_info); lookup_bucket_ref.push_back(impl_decl.impl_id); } else { @@ -416,6 +415,9 @@ auto HandleParseNode(Context& context, Parse::ImplDefinitionStartId node_id) context.generics().GetSelfSpecific(impl_info.generic_id)); StartGenericDefinition(context); + if (!impl_info.is_defined()) { + ImplWitnessStartDefinition(context, impl_info); + } context.inst_block_stack().Push(); context.node_stack().Push(node_id, impl_id); @@ -439,7 +441,7 @@ auto HandleParseNode(Context& context, Parse::ImplDefinitionId /*node_id*/) auto& impl_info = context.impls().Get(impl_id); if (!impl_info.is_defined()) { - impl_info.witness_id = BuildImplWitness(context, impl_info); + FinishImplWitness(context, impl_info); impl_info.defined = true; } diff --git a/toolchain/check/handle_interface.cpp b/toolchain/check/handle_interface.cpp index ce310929e444..9d06b0deff3f 100644 --- a/toolchain/check/handle_interface.cpp +++ b/toolchain/check/handle_interface.cpp @@ -115,7 +115,7 @@ static auto BuildInterfaceDecl(Context& context, // there was an error in the qualifier, we will have lost track of the // interface name here. We should keep track of it even if the name is // invalid. - interface_info.generic_id = FinishGenericDecl(context, interface_decl_id); + interface_info.generic_id = BuildGenericDecl(context, interface_decl_id); interface_decl.interface_id = context.interfaces().Add(interface_info); if (interface_info.has_parameters()) { interface_decl.type_id = context.GetGenericInterfaceType( diff --git a/toolchain/check/impl.cpp b/toolchain/check/impl.cpp index 3fcc0463ae78..e4692ff7fda2 100644 --- a/toolchain/check/impl.cpp +++ b/toolchain/check/impl.cpp @@ -34,8 +34,8 @@ static auto NoteAssociatedFunction(Context& context, // given a specific for an enclosing generic, plus a type to use as `Self`. static auto GetSelfSpecificForInterfaceMemberWithSelfType( Context& context, SemIRLoc loc, SemIR::SpecificId enclosing_specific_id, - SemIR::GenericId generic_id, SemIR::TypeId self_type_id) - -> SemIR::SpecificId { + SemIR::GenericId generic_id, SemIR::TypeId self_type_id, + SemIR::InstId witness_inst_id) -> SemIR::SpecificId { const auto& generic = context.generics().Get(generic_id); auto bindings = context.inst_blocks().Get(generic.bindings_id); @@ -61,12 +61,9 @@ static auto GetSelfSpecificForInterfaceMemberWithSelfType( "Expected a Self binding, found {0}", self_binding); // Create a facet value to be the value of `Self` in the interface. // This facet value consists of the type `self_type_id` and a witness that the - // type implements `self_binding.type_id`. The witness needs to be symbolic + // type implements `self_binding.type_id`. Note that the witness is incomplete // since we haven't finished defining the implementation here. auto type_inst_id = context.types().GetInstId(self_type_id); - // TODO: Make a symbolic interface witness here. For the moment, the witness - // is never used. - auto witness_inst_id = type_inst_id; auto facet_value_const_id = TryEvalInst(context, SemIR::InstId::Invalid, SemIR::FacetValue{.type_id = self_binding.type_id, @@ -93,7 +90,8 @@ static auto GetSelfSpecificForInterfaceMemberWithSelfType( // `BuiltinErrorInst` if the function is not usable. static auto CheckAssociatedFunctionImplementation( Context& context, SemIR::FunctionType interface_function_type, - SemIR::InstId impl_decl_id, SemIR::TypeId self_type_id) -> SemIR::InstId { + SemIR::InstId impl_decl_id, SemIR::TypeId self_type_id, + SemIR::InstId witness_inst_id) -> SemIR::InstId { auto impl_function_decl = context.insts().TryGetAs(impl_decl_id); if (!impl_function_decl) { @@ -119,7 +117,7 @@ static auto CheckAssociatedFunctionImplementation( context.functions() .Get(interface_function_type.function_id) .generic_id, - self_type_id); + self_type_id, witness_inst_id); // TODO: This should be a semantic check rather than a syntactic one. The // functions should be allowed to have different signatures as long as we can @@ -134,8 +132,11 @@ static auto CheckAssociatedFunctionImplementation( return impl_decl_id; } +// Builds an initial empty witness. auto ImplWitnessForDeclaration(Context& context, const SemIR::Impl& impl) -> SemIR::InstId { + CARBON_CHECK(!impl.has_definition_started()); + auto facet_type_id = context.GetTypeIdForTypeInst(impl.constraint_id); if (facet_type_id == SemIR::ErrorInst::SingletonTypeId) { return SemIR::ErrorInst::SingletonInstId; @@ -158,6 +159,7 @@ auto ImplWitnessForDeclaration(Context& context, const SemIR::Impl& impl) } const auto& interface = context.interfaces().Get(interface_type->interface_id); + // TODO: This is going to try and define all the interfaces for this facet // type, and so once we support impl of a facet type with more than one // interface, it might give the wrong name in the diagnostic. @@ -172,17 +174,6 @@ auto ImplWitnessForDeclaration(Context& context, const SemIR::Impl& impl) })) { return SemIR::ErrorInst::SingletonInstId; } - return SemIR::InstId::Invalid; -} - -// Builds a witness that the specified impl implements the given interface. -static auto BuildInterfaceWitness( - Context& context, const SemIR::Impl& impl, - SemIR::FacetTypeInfo::ImplsConstraint interface_type, - llvm::SmallVectorImpl& used_decl_ids) -> SemIR::InstId { - const auto& interface = context.interfaces().Get(interface_type.interface_id); - auto& impl_scope = context.name_scopes().Get(impl.scope_id); - auto self_type_id = context.GetTypeIdForTypeInst(impl.self_id); llvm::SmallVector table; auto assoc_entities = @@ -193,45 +184,29 @@ static auto BuildInterfaceWitness( LoadImportRef(context, decl_id); decl_id = context.constant_values().GetInstId(SemIR::GetConstantValueInSpecific( - context.sem_ir(), interface_type.specific_id, decl_id)); + context.sem_ir(), interface_type->specific_id, decl_id)); CARBON_CHECK(decl_id.is_valid(), "Non-constant associated entity"); auto decl = context.insts().Get(decl_id); CARBON_KIND_SWITCH(decl) { case CARBON_KIND(SemIR::StructValue struct_value): { if (struct_value.type_id == SemIR::ErrorInst::SingletonTypeId) { - return SemIR::ErrorInst::SingletonInstId; + table.push_back(SemIR::ErrorInst::SingletonInstId); + break; } auto type_inst = context.types().GetAsInst(struct_value.type_id); auto fn_type = type_inst.TryAs(); if (!fn_type) { CARBON_FATAL("Unexpected type: {0}", type_inst); } - auto& fn = context.functions().Get(fn_type->function_id); - auto [impl_decl_id, _] = context.LookupNameInExactScope( - decl_id, fn.name_id, impl.scope_id, impl_scope); - if (impl_decl_id.is_valid()) { - used_decl_ids.push_back(impl_decl_id); - table.push_back(CheckAssociatedFunctionImplementation( - context, *fn_type, impl_decl_id, self_type_id)); - } else { - CARBON_DIAGNOSTIC( - ImplMissingFunction, Error, - "missing implementation of {0} in impl of interface {1}", - SemIR::NameId, SemIR::NameId); - auto builder = - context.emitter().Build(impl.definition_id, ImplMissingFunction, - fn.name_id, interface.name_id); - NoteAssociatedFunction(context, builder, fn_type->function_id); - builder.Emit(); - - table.push_back(SemIR::ErrorInst::SingletonInstId); - } + table.push_back(SemIR::InstId::Invalid); break; } case CARBON_KIND(SemIR::AssociatedConstantDecl associated): { - // TODO: Check we have a value for this constant in the constraint. + // TODO: Allow these using: + // table.push_back(SemIR::InstId::Invalid); + // break; context.TODO( - impl.definition_id, + impl.latest_decl_id(), "impl of interface with associated constant " + context.names().GetFormatted(associated.name_id).str()); return SemIR::ErrorInst::SingletonInstId; @@ -245,17 +220,27 @@ static auto BuildInterfaceWitness( } auto table_id = context.inst_blocks().Add(table); - return context.AddInst( - context.insts().GetLocId(impl.definition_id), + return context.AddInst( + context.insts().GetLocId(impl.latest_decl_id()), {.type_id = context.GetSingletonType(SemIR::WitnessType::SingletonInstId), - .elements_id = table_id}); + .elements_id = table_id, + .specific_id = context.generics().GetSelfSpecific(impl.generic_id)}); } -auto BuildImplWitness(Context& context, const SemIR::Impl& impl) - -> SemIR::InstId { +auto ImplWitnessStartDefinition(Context& /*context*/, SemIR::Impl& impl) + -> void { + CARBON_CHECK(impl.is_being_defined()); + // TODO: Check we have a value for all non-function associated constants in + // the constraint, and fill the witness with them. + return; +} + +// Adds functions to the witness that the specified impl implements the given +// interface. +auto FinishImplWitness(Context& context, SemIR::Impl& impl) -> void { CARBON_CHECK(impl.is_being_defined()); if (impl.witness_id == SemIR::ErrorInst::SingletonInstId) { - return SemIR::ErrorInst::SingletonInstId; + return; } auto facet_type_id = context.GetTypeIdForTypeInst(impl.constraint_id); @@ -264,16 +249,81 @@ auto BuildImplWitness(Context& context, const SemIR::Impl& impl) const SemIR::FacetTypeInfo& facet_type_info = context.facet_types().Get(facet_type.facet_type_id); - auto interface = facet_type_info.TryAsSingleInterface(); - CARBON_CHECK(interface.has_value()); + auto interface_type = facet_type_info.TryAsSingleInterface(); + CARBON_CHECK(interface_type.has_value()); + const auto& interface = + context.interfaces().Get(interface_type->interface_id); + auto witness = context.insts().GetAs(impl.witness_id); + auto witness_block = context.inst_blocks().GetMutable(witness.elements_id); + auto& impl_scope = context.name_scopes().Get(impl.scope_id); + auto self_type_id = context.GetTypeIdForTypeInst(impl.self_id); + auto assoc_entities = + context.inst_blocks().Get(interface.associated_entities_id); llvm::SmallVector used_decl_ids; - auto witness_id = - BuildInterfaceWitness(context, impl, *interface, used_decl_ids); + + for (auto index : llvm::seq(assoc_entities.size())) { + auto decl_id = assoc_entities[index]; + decl_id = + context.constant_values().GetInstId(SemIR::GetConstantValueInSpecific( + context.sem_ir(), interface_type->specific_id, decl_id)); + CARBON_CHECK(decl_id.is_valid(), "Non-constant associated entity"); + auto decl = context.insts().Get(decl_id); + CARBON_KIND_SWITCH(decl) { + case CARBON_KIND(SemIR::StructValue struct_value): { + if (struct_value.type_id == SemIR::ErrorInst::SingletonTypeId) { + break; + } + auto type_inst = context.types().GetAsInst(struct_value.type_id); + auto fn_type = type_inst.As(); + auto& fn = context.functions().Get(fn_type.function_id); + auto [impl_decl_id, _] = context.LookupNameInExactScope( + decl_id, fn.name_id, impl.scope_id, impl_scope); + if (impl_decl_id.is_valid()) { + used_decl_ids.push_back(impl_decl_id); + witness_block[index] = CheckAssociatedFunctionImplementation( + context, fn_type, impl_decl_id, self_type_id, impl.witness_id); + } else { + CARBON_DIAGNOSTIC( + ImplMissingFunction, Error, + "missing implementation of {0} in impl of interface {1}", + SemIR::NameId, SemIR::NameId); + auto builder = + context.emitter().Build(impl.definition_id, ImplMissingFunction, + fn.name_id, interface.name_id); + NoteAssociatedFunction(context, builder, fn_type.function_id); + builder.Emit(); + + witness_block[index] = SemIR::ErrorInst::SingletonInstId; + } + break; + } + case SemIR::AssociatedConstantDecl::Kind: { + // These are set to their final values already. + break; + } + default: + CARBON_CHECK(decl_id == SemIR::ErrorInst::SingletonInstId, + "Unexpected kind of associated entity {0}", decl); + // These are set to their final values already. + break; + } + } // TODO: Diagnose if any declarations in the impl are not in used_decl_ids. +} - return witness_id; +auto FillImplWitnessWithErrors(Context& context, SemIR::Impl& impl) -> void { + if (impl.witness_id.is_valid() && + impl.witness_id != SemIR::ErrorInst::SingletonInstId) { + auto witness = context.insts().GetAs(impl.witness_id); + auto witness_block = context.inst_blocks().GetMutable(witness.elements_id); + for (auto& elem : witness_block) { + if (!elem.is_valid()) { + elem = SemIR::ErrorInst::SingletonInstId; + } + } + } } } // namespace Carbon::Check diff --git a/toolchain/check/impl.h b/toolchain/check/impl.h index 418a4a29d068..f225f6f565c3 100644 --- a/toolchain/check/impl.h +++ b/toolchain/check/impl.h @@ -14,9 +14,16 @@ namespace Carbon::Check { auto ImplWitnessForDeclaration(Context& context, const SemIR::Impl& impl) -> SemIR::InstId; -// Builds and returns a witness for the impl `impl_id`. -auto BuildImplWitness(Context& context, const SemIR::Impl& impl) - -> SemIR::InstId; +// TODO: AddConstantsToImplWitnessFromConstraint() + +// Update `impl`'s witness at the start of a definition. +auto ImplWitnessStartDefinition(Context& context, SemIR::Impl& impl) -> void; + +// Adds the function members to the witness for `impl`. +auto FinishImplWitness(Context& context, SemIR::Impl& impl) -> void; + +// Sets all unset members of the witness for `impl` to the error instruction. +auto FillImplWitnessWithErrors(Context& context, SemIR::Impl& impl) -> void; } // namespace Carbon::Check diff --git a/toolchain/check/impl_lookup.cpp b/toolchain/check/impl_lookup.cpp index c07f26622a06..7becce46521d 100644 --- a/toolchain/check/impl_lookup.cpp +++ b/toolchain/check/impl_lookup.cpp @@ -110,10 +110,9 @@ static auto FindAssociatedImportIRs(Context& context, return result; } -auto LookupInterfaceWitness(Context& context, SemIR::LocId loc_id, - SemIR::ConstantId type_const_id, - SemIR::ConstantId interface_const_id) - -> SemIR::InstId { +auto LookupImplWitness(Context& context, SemIR::LocId loc_id, + SemIR::ConstantId type_const_id, + SemIR::ConstantId interface_const_id) -> SemIR::InstId { if (type_const_id == SemIR::ErrorInst::SingletonConstantId || interface_const_id == SemIR::ErrorInst::SingletonConstantId) { return SemIR::ErrorInst::SingletonInstId; diff --git a/toolchain/check/impl_lookup.h b/toolchain/check/impl_lookup.h index e027f99cdf70..db2617676e1a 100644 --- a/toolchain/check/impl_lookup.h +++ b/toolchain/check/impl_lookup.h @@ -13,10 +13,9 @@ namespace Carbon::Check { // Looks up the witness to use for a particular type and interface. Returns the // witness, or `InstId::Invalid` if the type is not known to implement the // interface. -auto LookupInterfaceWitness(Context& context, SemIR::LocId loc_id, - SemIR::ConstantId type_const_id, - SemIR::ConstantId interface_const_id) - -> SemIR::InstId; +auto LookupImplWitness(Context& context, SemIR::LocId loc_id, + SemIR::ConstantId type_const_id, + SemIR::ConstantId interface_const_id) -> SemIR::InstId; } // namespace Carbon::Check diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 7429ccc918ab..9760a9d52407 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -1874,7 +1874,8 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, // Make a declaration of an impl. This is done as a separate step from // importing the impl definition in order to resolve cycles. static auto MakeImplDeclaration(ImportContext& context, - const SemIR::Impl& import_impl) + const SemIR::Impl& import_impl, + SemIR::InstId witness_id) -> std::pair { SemIR::ImplDecl impl_decl = {.impl_id = SemIR::ImplId::Invalid, .decl_block_id = SemIR::InstBlockId::Empty}; @@ -1885,7 +1886,7 @@ static auto MakeImplDeclaration(ImportContext& context, {GetIncompleteLocalEntityBase(context, impl_decl_id, import_impl), {.self_id = SemIR::InstId::Invalid, .constraint_id = SemIR::InstId::Invalid, - .witness_id = SemIR::InstId::Invalid}}); + .witness_id = witness_id}}); // Write the impl ID into the ImplDecl. context.local_context().ReplaceInstBeforeConstantUse(impl_decl_id, impl_decl); @@ -1895,10 +1896,8 @@ static auto MakeImplDeclaration(ImportContext& context, // Imports the definition of an impl. static auto AddImplDefinition(ImportContext& context, const SemIR::Impl& import_impl, - SemIR::Impl& new_impl, SemIR::InstId witness_id) - -> void { + SemIR::Impl& new_impl) -> void { new_impl.definition_id = new_impl.first_owning_decl_id; - new_impl.witness_id = witness_id; new_impl.defined = true; if (import_impl.scope_id.is_valid()) { @@ -1943,8 +1942,9 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, // On the second phase, create a forward declaration of the impl for any // recursive references. + auto witness_id = AddImportRef(resolver, import_impl.witness_id); std::tie(impl_id, impl_const_id) = - MakeImplDeclaration(resolver, import_impl); + MakeImplDeclaration(resolver, import_impl, witness_id); } else { // On the third phase, compute the impl ID from the "constant value" of // the declaration, which is a reference to the created ImplDecl. @@ -1985,8 +1985,7 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, import_impl.constraint_id, constraint_const_id); if (import_impl.is_defined()) { - auto witness_id = AddImportRef(resolver, import_impl.witness_id); - AddImplDefinition(resolver, import_impl, new_impl, witness_id); + AddImplDefinition(resolver, import_impl, new_impl); } // If the `impl` is declared in the API file corresponding to the current @@ -2269,22 +2268,30 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, } static auto TryResolveTypedInst(ImportRefResolver& resolver, - SemIR::InterfaceWitness inst) -> ResolveResult { - auto elements = GetLocalInstBlockContents(resolver, inst.elements_id); + SemIR::ImplWitness inst) -> ResolveResult { + auto specific_data = GetLocalSpecificData(resolver, inst.specific_id); if (resolver.HasNewWork()) { return ResolveResult::Retry(); } - auto elements_id = - GetLocalCanonicalInstBlockId(resolver, inst.elements_id, elements); - return ResolveAs( + llvm::SmallVector elements; + auto import_elements = resolver.import_inst_blocks().Get(inst.elements_id); + elements.reserve(import_elements.size()); + for (auto element : import_elements) { + elements.push_back(AddImportRef(resolver, element)); + } + auto elements_id = resolver.local_inst_blocks().Add(elements); + auto specific_id = + GetOrAddLocalSpecific(resolver, inst.specific_id, specific_data); + return ResolveAs( resolver, {.type_id = resolver.local_context().GetSingletonType( SemIR::WitnessType::SingletonInstId), - .elements_id = elements_id}); + .elements_id = elements_id, + .specific_id = specific_id}); } static auto TryResolveTypedInst(ImportRefResolver& resolver, - SemIR::InterfaceWitnessAccess inst) + SemIR::ImplWitnessAccess inst) -> ResolveResult { auto type_id = GetLocalConstantId(resolver, inst.type_id); auto witness_id = GetLocalConstantInstId(resolver, inst.witness_id); @@ -2292,7 +2299,7 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, return ResolveResult::Retry(); } - return ResolveAs( + return ResolveAs( resolver, {.type_id = resolver.local_context().GetTypeIdForTypeConstant(type_id), .witness_id = witness_id, @@ -2626,18 +2633,18 @@ static auto TryResolveInstCanonical(ImportRefResolver& resolver, case CARBON_KIND(SemIR::ImplDecl inst): { return TryResolveTypedInst(resolver, inst, const_id); } + case CARBON_KIND(SemIR::ImplWitness inst): { + return TryResolveTypedInst(resolver, inst); + } + case CARBON_KIND(SemIR::ImplWitnessAccess inst): { + return TryResolveTypedInst(resolver, inst); + } case CARBON_KIND(SemIR::ImportRefLoaded inst): { return TryResolveTypedInst(resolver, inst, inst_id); } case CARBON_KIND(SemIR::InterfaceDecl inst): { return TryResolveTypedInst(resolver, inst, const_id); } - case CARBON_KIND(SemIR::InterfaceWitness inst): { - return TryResolveTypedInst(resolver, inst); - } - case CARBON_KIND(SemIR::InterfaceWitnessAccess inst): { - return TryResolveTypedInst(resolver, inst); - } case CARBON_KIND(SemIR::IntValue inst): { return TryResolveTypedInst(resolver, inst); } diff --git a/toolchain/check/member_access.cpp b/toolchain/check/member_access.cpp index 3686b515b3ab..0bc26f7ef9e9 100644 --- a/toolchain/check/member_access.cpp +++ b/toolchain/check/member_access.cpp @@ -136,10 +136,11 @@ static auto GetInterfaceFromFacetType(Context& context, SemIR::TypeId type_id) return facet_type_info.TryAsSingleInterface(); } -static auto AccessMemberOfInterfaceWitness( - Context& context, SemIR::LocId loc_id, SemIR::InstId witness_id, - SemIR::SpecificId interface_specific_id, - SemIR::AssociatedEntityType assoc_type, SemIR::InstId member_id) +static auto AccessMemberOfImplWitness(Context& context, SemIR::LocId loc_id, + SemIR::InstId witness_id, + SemIR::SpecificId interface_specific_id, + SemIR::AssociatedEntityType assoc_type, + SemIR::InstId member_id) -> SemIR::InstId { auto member_value_id = context.constant_values().GetConstantInstId(member_id); if (!member_value_id.is_valid()) { @@ -162,7 +163,7 @@ static auto AccessMemberOfInterfaceWitness( auto subst_type_id = SemIR::GetTypeInSpecific( context.sem_ir(), interface_specific_id, assoc_type.entity_type_id); - return context.GetOrAddInst( + return context.GetOrAddInst( loc_id, {.type_id = subst_type_id, .witness_id = witness_id, .index = assoc_entity->index}); @@ -185,8 +186,8 @@ static auto PerformImplLookup( } auto witness_id = - LookupInterfaceWitness(context, loc_id, type_const_id, - assoc_type.interface_type_id.AsConstantId()); + LookupImplWitness(context, loc_id, type_const_id, + assoc_type.interface_type_id.AsConstantId()); if (!witness_id.is_valid()) { auto interface_type_id = context.GetInterfaceType( interface_type->interface_id, interface_type->specific_id); @@ -211,9 +212,9 @@ static auto PerformImplLookup( } return SemIR::ErrorInst::SingletonInstId; } - return AccessMemberOfInterfaceWitness(context, loc_id, witness_id, - interface_type->specific_id, assoc_type, - member_id); + return AccessMemberOfImplWitness(context, loc_id, witness_id, + interface_type->specific_id, assoc_type, + member_id); } // Performs a member name lookup into the specified scope, including performing @@ -313,9 +314,9 @@ static auto LookupMemberNameInScope(Context& context, SemIR::LocId loc_id, return SemIR::ErrorInst::SingletonInstId; } - member_id = AccessMemberOfInterfaceWitness( - context, loc_id, witness_inst_id, assoc_interface->specific_id, - *assoc_type, member_id); + member_id = AccessMemberOfImplWitness(context, loc_id, witness_inst_id, + assoc_interface->specific_id, + *assoc_type, member_id); } else { // Handles `x.F` if `x` is of type `class C` that extends an interface // containing `F`. diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index 39bf62380535..3d4ec7067b2b 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -28,9 +28,9 @@ fn G() { // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -71,7 +71,7 @@ fn G() { // CHECK:STDOUT: %int_2.loc13_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc13: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc13_29.1: %tuple.type.1 = tuple_literal (%int_1.loc13_22, %int_2.loc13_25, %int_3.loc13) -// CHECK:STDOUT: %impl.elem0.loc13_29.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_29.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29.1: = bound_method %int_1.loc13_22, %impl.elem0.loc13_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_29.1: = specific_function %Convert.bound.loc13_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_29.1: init %i32 = call %Convert.specific_fn.loc13_29.1(%int_1.loc13_22) [template = constants.%int_1.2] @@ -79,7 +79,7 @@ fn G() { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc13_29.3: ref %i32 = array_index %a.var, %int_0 // CHECK:STDOUT: %.loc13_29.4: init %i32 = initialize_from %.loc13_29.2 to %.loc13_29.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_29.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_29.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29.2: = bound_method %int_2.loc13_25, %impl.elem0.loc13_29.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_29.2: = specific_function %Convert.bound.loc13_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_29.2: init %i32 = call %Convert.specific_fn.loc13_29.2(%int_2.loc13_25) [template = constants.%int_2.2] @@ -87,7 +87,7 @@ fn G() { // CHECK:STDOUT: %int_1.loc13_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc13_29.6: ref %i32 = array_index %a.var, %int_1.loc13_29 // CHECK:STDOUT: %.loc13_29.7: init %i32 = initialize_from %.loc13_29.5 to %.loc13_29.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc13_29.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_29.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29.3: = bound_method %int_3.loc13, %impl.elem0.loc13_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_29.3: = specific_function %Convert.bound.loc13_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_29.3: init %i32 = call %Convert.specific_fn.loc13_29.3(%int_3.loc13) [template = constants.%int_3.2] @@ -104,21 +104,21 @@ fn G() { // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc14: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc14_36.1: %tuple.type.1 = tuple_literal (%int_1.loc14, %int_2.loc14, %int_3.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_36.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_36.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_36.1: = bound_method %int_1.loc14, %impl.elem0.loc14_36.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_36.1: = specific_function %Convert.bound.loc14_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_36.1: init %i32 = call %Convert.specific_fn.loc14_36.1(%int_1.loc14) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_36.2: init %i32 = converted %int_1.loc14, %int.convert_checked.loc14_36.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %b.var, element0 // CHECK:STDOUT: %.loc14_36.3: init %i32 = initialize_from %.loc14_36.2 to %tuple.elem0 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_36.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_36.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_36.2: = bound_method %int_2.loc14, %impl.elem0.loc14_36.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_36.2: = specific_function %Convert.bound.loc14_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_36.2: init %i32 = call %Convert.specific_fn.loc14_36.2(%int_2.loc14) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc14_36.4: init %i32 = converted %int_2.loc14, %int.convert_checked.loc14_36.2 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %b.var, element1 // CHECK:STDOUT: %.loc14_36.5: init %i32 = initialize_from %.loc14_36.4 to %tuple.elem1 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc14_36.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_36.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_36.3: = bound_method %int_3.loc14, %impl.elem0.loc14_36.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc14_36.3: = specific_function %Convert.bound.loc14_36.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc14_36.3: init %i32 = call %Convert.specific_fn.loc14_36.3(%int_3.loc14) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index c9e634d7e0af..27386f3119a3 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -26,9 +26,9 @@ fn Run() { // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -73,7 +73,7 @@ fn Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.3 = tuple_literal (%int_0) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index 1fc27f9444a8..a679d163f091 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -22,9 +22,9 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -67,21 +67,21 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %int_2.loc11: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_34.1: %tuple.type.3 = tuple_literal (%int_1.loc11, %int_2.loc11, %int_3) -// CHECK:STDOUT: %impl.elem0.loc11_34.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_34.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_34.1: = bound_method %int_1.loc11, %impl.elem0.loc11_34.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_34.1: = specific_function %Convert.bound.loc11_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_34.1: init %i32 = call %Convert.specific_fn.loc11_34.1(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_34.2: init %i32 = converted %int_1.loc11, %int.convert_checked.loc11_34.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc11: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_34.3: init %i32 = initialize_from %.loc11_34.2 to %tuple.elem0.loc11 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_34.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_34.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_34.2: = bound_method %int_2.loc11, %impl.elem0.loc11_34.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_34.2: = specific_function %Convert.bound.loc11_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_34.2: init %i32 = call %Convert.specific_fn.loc11_34.2(%int_2.loc11) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc11_34.4: init %i32 = converted %int_2.loc11, %int.convert_checked.loc11_34.2 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem1.loc11: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_34.5: init %i32 = initialize_from %.loc11_34.4 to %tuple.elem1.loc11 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_34.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_34.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_34.3: = bound_method %int_3, %impl.elem0.loc11_34.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_34.3: = specific_function %Convert.bound.loc11_34.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_34.3: init %i32 = call %Convert.specific_fn.loc11_34.3(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index 1bde25885486..18993062b087 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -23,9 +23,9 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -49,7 +49,7 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Float = %import_ref.229 +// CHECK:STDOUT: .Float = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -75,7 +75,7 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_22.1: %tuple.type.1 = tuple_literal (%int_1.loc11) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.loc11, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1.loc11) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index d69cea13ec5a..dffe286c7f90 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -28,9 +28,9 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.18), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -124,7 +124,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_2.loc14_31: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc14_35.1: %tuple.type = tuple_literal (%int_1.loc14_28, %int_2.loc14_31, %int_3) -// CHECK:STDOUT: %impl.elem0.loc14_35.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_35.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35.1: = bound_method %int_1.loc14_28, %impl.elem0.loc14_35.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_35.1: = specific_function %Convert.bound.loc14_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_35.1: init %i32 = call %Convert.specific_fn.loc14_35.1(%int_1.loc14_28) [template = constants.%int_1.2] @@ -132,7 +132,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc14_35.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc14_35.4: init %i32 = initialize_from %.loc14_35.2 to %.loc14_35.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_35.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_35.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35.2: = bound_method %int_2.loc14_31, %impl.elem0.loc14_35.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_35.2: = specific_function %Convert.bound.loc14_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_35.2: init %i32 = call %Convert.specific_fn.loc14_35.2(%int_2.loc14_31) [template = constants.%int_2.2] @@ -140,7 +140,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_1.loc14_35: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_35.6: ref %i32 = array_index file.%a.var, %int_1.loc14_35 // CHECK:STDOUT: %.loc14_35.7: init %i32 = initialize_from %.loc14_35.5 to %.loc14_35.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc14_35.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_35.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35.3: = bound_method %int_3, %impl.elem0.loc14_35.3 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc14_35.3: = specific_function %Convert.bound.loc14_35.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc14_35.3: init %i32 = call %Convert.specific_fn.loc14_35.3(%int_3) [template = constants.%int_3.1] diff --git a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon index a6f485661532..7251ca19c539 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon @@ -26,9 +26,9 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -71,7 +71,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_2.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc11: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%int_1.loc11_20, %int_2.loc11_23, %int_3.loc11) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_1.loc11_20) [template = constants.%int_1.2] @@ -79,7 +79,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_27.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_27.4: init %i32 = initialize_from %.loc11_27.2 to %.loc11_27.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_2.loc11_23) [template = constants.%int_2.2] @@ -87,7 +87,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_1.loc11_27: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_27.6: ref %i32 = array_index file.%a.var, %int_1.loc11_27 // CHECK:STDOUT: %.loc11_27.7: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.3: = bound_method %int_3.loc11, %impl.elem0.loc11_27.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.3: = specific_function %Convert.bound.loc11_27.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %Convert.specific_fn.loc11_27.3(%int_3.loc11) [template = constants.%int_3.2] @@ -106,7 +106,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %.loc15_28.1: Core.IntLiteral = struct_access %.loc15_27.2, element0 [template = constants.%int_3.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %.loc15_28.1, %impl.elem0.loc15 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%.loc15_28.1) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 8b370b1b337a..8942fe75bb43 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -52,9 +52,9 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral, String, String) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -104,7 +104,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %str.loc18_23: String = string_literal "Hello" [template = constants.%str.1] // CHECK:STDOUT: %str.loc18_32: String = string_literal "World" [template = constants.%str.2] // CHECK:STDOUT: %.loc18_39.1: %tuple.type.1 = tuple_literal (%int_1.loc18, %str.loc18_23, %str.loc18_32) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.loc18, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1.loc18) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index 18a2f18cb790..bb4773eac6da 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -32,9 +32,9 @@ fn G() -> i32 { // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -121,7 +121,7 @@ fn G() -> i32 { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc16_20.1: %tuple.type = tuple_literal (%int_1.loc16_13, %int_2.loc16_16, %int_3) // CHECK:STDOUT: %int_1.loc16_23: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16_20.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_20.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_20.1: = bound_method %int_1.loc16_13, %impl.elem0.loc16_20.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16_20.1: = specific_function %Convert.bound.loc16_20.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16_20.1: init %i32 = call %Convert.specific_fn.loc16_20.1(%int_1.loc16_13) [template = constants.%int_1.2] @@ -130,7 +130,7 @@ fn G() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc16_20.4: ref %i32 = array_index %.loc16_20.3, %int_0 // CHECK:STDOUT: %.loc16_20.5: init %i32 = initialize_from %.loc16_20.2 to %.loc16_20.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc16_20.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_20.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_20.2: = bound_method %int_2.loc16_16, %impl.elem0.loc16_20.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16_20.2: = specific_function %Convert.bound.loc16_20.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16_20.2: init %i32 = call %Convert.specific_fn.loc16_20.2(%int_2.loc16_16) [template = constants.%int_2.2] @@ -138,7 +138,7 @@ fn G() -> i32 { // CHECK:STDOUT: %int_1.loc16_20: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc16_20.7: ref %i32 = array_index %.loc16_20.3, %int_1.loc16_20 // CHECK:STDOUT: %.loc16_20.8: init %i32 = initialize_from %.loc16_20.6 to %.loc16_20.7 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc16_20.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_20.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_20.3: = bound_method %int_3, %impl.elem0.loc16_20.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc16_20.3: = specific_function %Convert.bound.loc16_20.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc16_20.3: init %i32 = call %Convert.specific_fn.loc16_20.3(%int_3) [template = constants.%int_3.2] @@ -150,7 +150,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc16_20.13: init %array_type = converted %.loc16_20.1, %.loc16_20.12 [template = constants.%array] // CHECK:STDOUT: %.loc16_20.14: ref %array_type = temporary %.loc16_20.3, %.loc16_20.13 // CHECK:STDOUT: %.loc16_20.15: %array_type = bind_value %.loc16_20.14 -// CHECK:STDOUT: %impl.elem0.loc16_23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_23: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_23: = bound_method %int_1.loc16_23, %impl.elem0.loc16_23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16_23: = specific_function %Convert.bound.loc16_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16_23: init %i32 = call %Convert.specific_fn.loc16_23(%int_1.loc16_23) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index c411019a07a9..dc3ccda2d0f5 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -23,9 +23,9 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -68,7 +68,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_2.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%int_1.loc11_20, %int_2.loc11_23, %int_3) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_1.loc11_20) [template = constants.%int_1.2] @@ -76,7 +76,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_27.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_27.4: init %i32 = initialize_from %.loc11_27.2 to %.loc11_27.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_2.loc11_23) [template = constants.%int_2.2] @@ -84,7 +84,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_1.loc11_27: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_27.6: ref %i32 = array_index file.%a.var, %int_1.loc11_27 // CHECK:STDOUT: %.loc11_27.7: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.3: = bound_method %int_3, %impl.elem0.loc11_27.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.3: = specific_function %Convert.bound.loc11_27.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %Convert.specific_fn.loc11_27.3(%int_3) [template = constants.%int_3.2] @@ -103,7 +103,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %.loc12_28.1: Core.IntLiteral = struct_access %.loc12_27.2, element0 [template = constants.%int_2.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %.loc12_28.1, %impl.elem0.loc12 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%.loc12_28.1) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index 469f2ca244eb..81c1e96c42ac 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -28,9 +28,9 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -92,7 +92,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_8.loc11_41: Core.IntLiteral = int_value 8 [template = constants.%int_8.1] // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.1] // CHECK:STDOUT: %.loc11_45.1: %tuple.type = tuple_literal (%int_1.loc11_20, %int_2.loc11_23, %int_3.loc11_26, %int_4.loc11_29, %int_5.loc11_32, %int_6.loc11_35, %int_7.loc11_38, %int_8.loc11_41, %int_9) -// CHECK:STDOUT: %impl.elem0.loc11_45.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_45.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.1: = specific_function %Convert.bound.loc11_45.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_45.1: init %i32 = call %Convert.specific_fn.loc11_45.1(%int_1.loc11_20) [template = constants.%int_1.2] @@ -100,7 +100,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_45.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_45.4: init %i32 = initialize_from %.loc11_45.2 to %.loc11_45.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_45.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.2: = specific_function %Convert.bound.loc11_45.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_45.2: init %i32 = call %Convert.specific_fn.loc11_45.2(%int_2.loc11_23) [template = constants.%int_2.2] @@ -108,7 +108,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_1.loc11_45: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_45.6: ref %i32 = array_index file.%a.var, %int_1.loc11_45 // CHECK:STDOUT: %.loc11_45.7: init %i32 = initialize_from %.loc11_45.5 to %.loc11_45.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.3: = bound_method %int_3.loc11_26, %impl.elem0.loc11_45.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.3: = specific_function %Convert.bound.loc11_45.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_45.3: init %i32 = call %Convert.specific_fn.loc11_45.3(%int_3.loc11_26) [template = constants.%int_3.2] @@ -116,7 +116,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_2.loc11_45: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_45.9: ref %i32 = array_index file.%a.var, %int_2.loc11_45 // CHECK:STDOUT: %.loc11_45.10: init %i32 = initialize_from %.loc11_45.8 to %.loc11_45.9 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.4: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.4: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.4: = bound_method %int_4.loc11_29, %impl.elem0.loc11_45.4 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.4: = specific_function %Convert.bound.loc11_45.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc11_45.4: init %i32 = call %Convert.specific_fn.loc11_45.4(%int_4.loc11_29) [template = constants.%int_4.2] @@ -124,7 +124,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_3.loc11_45: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_45.12: ref %i32 = array_index file.%a.var, %int_3.loc11_45 // CHECK:STDOUT: %.loc11_45.13: init %i32 = initialize_from %.loc11_45.11 to %.loc11_45.12 [template = constants.%int_4.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.5: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.5: = bound_method %int_5.loc11_32, %impl.elem0.loc11_45.5 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.5: = specific_function %Convert.bound.loc11_45.5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc11_45.5: init %i32 = call %Convert.specific_fn.loc11_45.5(%int_5.loc11_32) [template = constants.%int_5.2] @@ -132,7 +132,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_4.loc11_45: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_45.15: ref %i32 = array_index file.%a.var, %int_4.loc11_45 // CHECK:STDOUT: %.loc11_45.16: init %i32 = initialize_from %.loc11_45.14 to %.loc11_45.15 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.6: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.6: = bound_method %int_6.loc11_35, %impl.elem0.loc11_45.6 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.6: = specific_function %Convert.bound.loc11_45.6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc11_45.6: init %i32 = call %Convert.specific_fn.loc11_45.6(%int_6.loc11_35) [template = constants.%int_6.2] @@ -140,7 +140,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_5.loc11_45: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc11_45.18: ref %i32 = array_index file.%a.var, %int_5.loc11_45 // CHECK:STDOUT: %.loc11_45.19: init %i32 = initialize_from %.loc11_45.17 to %.loc11_45.18 [template = constants.%int_6.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.7: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.7: = bound_method %int_7.loc11_38, %impl.elem0.loc11_45.7 [template = constants.%Convert.bound.7] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.7: = specific_function %Convert.bound.loc11_45.7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.7] // CHECK:STDOUT: %int.convert_checked.loc11_45.7: init %i32 = call %Convert.specific_fn.loc11_45.7(%int_7.loc11_38) [template = constants.%int_7.2] @@ -148,7 +148,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_6.loc11_45: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_45.21: ref %i32 = array_index file.%a.var, %int_6.loc11_45 // CHECK:STDOUT: %.loc11_45.22: init %i32 = initialize_from %.loc11_45.20 to %.loc11_45.21 [template = constants.%int_7.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.8: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.8: = bound_method %int_8.loc11_41, %impl.elem0.loc11_45.8 [template = constants.%Convert.bound.8] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.8: = specific_function %Convert.bound.loc11_45.8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.8] // CHECK:STDOUT: %int.convert_checked.loc11_45.8: init %i32 = call %Convert.specific_fn.loc11_45.8(%int_8.loc11_41) [template = constants.%int_8.2] @@ -156,7 +156,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_7.loc11_45: Core.IntLiteral = int_value 7 [template = constants.%int_7.1] // CHECK:STDOUT: %.loc11_45.24: ref %i32 = array_index file.%a.var, %int_7.loc11_45 // CHECK:STDOUT: %.loc11_45.25: init %i32 = initialize_from %.loc11_45.23 to %.loc11_45.24 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.9: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.9: = bound_method %int_9, %impl.elem0.loc11_45.9 [template = constants.%Convert.bound.9] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.9: = specific_function %Convert.bound.loc11_45.9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9] // CHECK:STDOUT: %int.convert_checked.loc11_45.9: init %i32 = call %Convert.specific_fn.loc11_45.9(%int_9) [template = constants.%int_9.2] diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 3bf811ac33f4..14758c2bed76 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -120,9 +120,9 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.x.y.2: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -199,14 +199,14 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc9_27.1: %struct_type.x.y.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_27.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_27.1: = bound_method %int_1, %impl.elem0.loc9_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_27.1: = specific_function %Convert.bound.loc9_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_27.1: init %i32 = call %Convert.specific_fn.loc9_27.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_27.2: init %i32 = converted %int_1, %int.convert_checked.loc9_27.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_27.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc9_27.4: init %i32 = initialize_from %.loc9_27.2 to %.loc9_27.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_27.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_27.2: = bound_method %int_2, %impl.elem0.loc9_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_27.2: = specific_function %Convert.bound.loc9_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_27.2: init %i32 = call %Convert.specific_fn.loc9_27.2(%int_2) [template = constants.%int_2.2] @@ -223,14 +223,14 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc17_31.1: %struct_type.x.y.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc17_31.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_31.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_31.1: = bound_method %int_1, %impl.elem0.loc17_31.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc17_31.1: = specific_function %Convert.bound.loc17_31.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc17_31.1: init %i32 = call %Convert.specific_fn.loc17_31.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_31.2: init %i32 = converted %int_1, %int.convert_checked.loc17_31.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_31.3: ref %i32 = class_element_access file.%a_ref.var, element0 // CHECK:STDOUT: %.loc17_31.4: init %i32 = initialize_from %.loc17_31.2 to %.loc17_31.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc17_31.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_31.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_31.2: = bound_method %int_2, %impl.elem0.loc17_31.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_31.2: = specific_function %Convert.bound.loc17_31.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_31.2: init %i32 = call %Convert.specific_fn.loc17_31.2(%int_2) [template = constants.%int_2.2] @@ -275,9 +275,9 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.27), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -319,7 +319,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -439,9 +439,9 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.x.y.2: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -503,7 +503,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_2.loc13: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc13_34.1: %struct_type.x.y.2 = struct_literal (%int_1.loc13, %int_2.loc13) // CHECK:STDOUT: %A.ref.loc13: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %impl.elem0.loc13_34.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_34.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_34.1: = bound_method %int_1.loc13, %impl.elem0.loc13_34.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_34.1: = specific_function %Convert.bound.loc13_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_34.1: init %i32 = call %Convert.specific_fn.loc13_34.1(%int_1.loc13) [template = constants.%int_1.2] @@ -511,7 +511,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc13_34.3: ref %A = temporary_storage // CHECK:STDOUT: %.loc13_34.4: ref %i32 = class_element_access %.loc13_34.3, element0 // CHECK:STDOUT: %.loc13_34.5: init %i32 = initialize_from %.loc13_34.2 to %.loc13_34.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_34.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_34.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_34.2: = bound_method %int_2.loc13, %impl.elem0.loc13_34.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_34.2: = specific_function %Convert.bound.loc13_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_34.2: init %i32 = call %Convert.specific_fn.loc13_34.2(%int_2.loc13) [template = constants.%int_2.2] @@ -530,7 +530,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_2.loc24: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc24_33.1: %struct_type.x.y.2 = struct_literal (%int_1.loc24, %int_2.loc24) // CHECK:STDOUT: %A.ref.loc24: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %impl.elem0.loc24_33.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_33.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_33.1: = bound_method %int_1.loc24, %impl.elem0.loc24_33.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc24_33.1: = specific_function %Convert.bound.loc24_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc24_33.1: init %i32 = call %Convert.specific_fn.loc24_33.1(%int_1.loc24) [template = constants.%int_1.2] @@ -538,7 +538,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc24_33.3: ref %A = temporary_storage // CHECK:STDOUT: %.loc24_33.4: ref %i32 = class_element_access %.loc24_33.3, element0 // CHECK:STDOUT: %.loc24_33.5: init %i32 = initialize_from %.loc24_33.2 to %.loc24_33.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc24_33.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_33.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_33.2: = bound_method %int_2.loc24, %impl.elem0.loc24_33.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc24_33.2: = specific_function %Convert.bound.loc24_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc24_33.2: init %i32 = call %Convert.specific_fn.loc24_33.2(%int_2.loc24) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/as/basic.carbon b/toolchain/check/testdata/as/basic.carbon index 7ed50cd41432..7f6aa708f52a 100644 --- a/toolchain/check/testdata/as/basic.carbon +++ b/toolchain/check/testdata/as/basic.carbon @@ -21,9 +21,9 @@ fn Main() -> i32 { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.27), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -60,7 +60,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index 4b3a88e35913..0a8e0a0ca482 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -35,18 +35,18 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %As.generic: %As.type.1 = struct_value () [template] // CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%X)> [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%X) [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Convert.3) [template] // CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%i32)> [template] // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Convert.5) [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %impl_witness.21: = impl_witness (imports.%import_ref.27), @impl.5(%int_32) [template] // CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.7, @impl.5(%int_32) [template] // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %interface.21: = interface_witness (%Convert.13) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.13 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound.1, @Convert.7(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -79,6 +79,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%X)> [template = constants.%As.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc15: = impl_witness (@impl.1.%Convert.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] @@ -87,6 +88,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%i32)> [template = constants.%As.type.4] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc19: = impl_witness (@impl.2.%Convert.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %i32 as %As.type { @@ -106,11 +108,10 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %return.param: ref %X = out_param runtime_param1 // CHECK:STDOUT: %return: ref %X = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %X.ref as %As.type { @@ -128,11 +129,10 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { @@ -170,21 +170,21 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %int_32.loc23_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc23_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc23_18: %Convert.type.4 = interface_witness_access constants.%interface.21, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %impl.elem0.loc23_18: %Convert.type.4 = impl_witness_access constants.%impl_witness.21, element0 [template = constants.%Convert.13] // CHECK:STDOUT: %Convert.bound.loc23_18: = bound_method %int_4, %impl.elem0.loc23_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound.loc23_18, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc23_18.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_4.2] // CHECK:STDOUT: %.loc23_18.2: %i32 = converted %int_4, %.loc23_18.1 [template = constants.%int_4.2] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %impl.elem0.loc23_26: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc23_26: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc23_26: = bound_method %.loc23_18.2, %impl.elem0.loc23_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %.loc23_26.1: ref %X = temporary_storage // CHECK:STDOUT: %Convert.call.loc23_26: init %X = call %Convert.bound.loc23_26(%.loc23_18.2) to %.loc23_26.1 // CHECK:STDOUT: %.loc23_26.2: init %X = converted %.loc23_18.2, %Convert.call.loc23_26 // CHECK:STDOUT: %int_32.loc23_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc23_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc23_32: %Convert.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Convert.5] +// CHECK:STDOUT: %impl.elem0.loc23_32: %Convert.type.4 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Convert.5] // CHECK:STDOUT: %Convert.bound.loc23_32: = bound_method %.loc23_26.2, %impl.elem0.loc23_32 // CHECK:STDOUT: %.loc23_26.3: ref %X = temporary %.loc23_26.1, %.loc23_26.2 // CHECK:STDOUT: %.loc23_26.4: %X = bind_value %.loc23_26.3 diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index 3937cb3a9715..fd11fc36b3f3 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -20,9 +20,9 @@ var test_type: type = i32; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -34,7 +34,7 @@ var test_type: type = i32; // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Float = %import_ref.229 +// CHECK:STDOUT: .Float = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,7 +60,7 @@ var test_type: type = i32; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index a5952ca460ba..051f4a220e9a 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -44,9 +44,9 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_39999999999999999993.1: Core.IntLiteral = int_value 39999999999999999993 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_39999999999999999993.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_39999999999999999993.2: %i32 = int_value 39999999999999999993 [template] @@ -60,7 +60,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Float = %import_ref.229 +// CHECK:STDOUT: .Float = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -81,7 +81,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_39999999999999999993: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%int_39999999999999999993.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_39999999999999999993, %impl.elem0.loc15 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_39999999999999999993) [template = constants.%int_39999999999999999993.2] @@ -89,7 +89,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %.loc15_34.2: %i32 = converted %int_39999999999999999993, %.loc15_34.1 [template = constants.%int_39999999999999999993.2] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc15_34.2 // CHECK:STDOUT: %int_2147483648.loc21: Core.IntLiteral = int_value 2147483648 [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_2147483648.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_2147483648.loc21) [template = constants.%int_2147483648.2] @@ -97,7 +97,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %.loc21_27.2: %i32 = converted %int_2147483648.loc21, %.loc21_27.1 [template = constants.%int_2147483648.2] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc21_27.2 // CHECK:STDOUT: %int_2147483648.loc27: Core.IntLiteral = int_value 2147483648 [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_2147483648.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_2147483648.loc27) [template = constants.%int_2147483648.2] diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index 110e85d0d152..f146f9bfdf54 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -44,9 +44,9 @@ fn F() { // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_8.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_8.2: %i32 = int_value 8 [template] @@ -77,7 +77,7 @@ fn F() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Float = %import_ref.229 +// CHECK:STDOUT: .Float = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -103,7 +103,7 @@ fn F() { // CHECK:STDOUT: %int_2147483647.loc19: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_2147483647.loc20: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %.loc21_3.1: %tuple.type.1 = tuple_literal (%int_8.loc15, %int_9, %int_8.loc17, %int_8.loc18, %int_2147483647.loc19, %int_2147483647.loc20) -// CHECK:STDOUT: %impl.elem0.loc21_3.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.1: = bound_method %int_8.loc15, %impl.elem0.loc21_3.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.1: = specific_function %Convert.bound.loc21_3.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc21_3.1: init %i32 = call %Convert.specific_fn.loc21_3.1(%int_8.loc15) [template = constants.%int_8.2] @@ -111,7 +111,7 @@ fn F() { // CHECK:STDOUT: %int_0.loc21: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc21_3.3: ref %i32 = array_index %ints.var, %int_0.loc21 // CHECK:STDOUT: %.loc21_3.4: init %i32 = initialize_from %.loc21_3.2 to %.loc21_3.3 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.2: = bound_method %int_9, %impl.elem0.loc21_3.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.2: = specific_function %Convert.bound.loc21_3.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21_3.2: init %i32 = call %Convert.specific_fn.loc21_3.2(%int_9) [template = constants.%int_9.2] @@ -119,7 +119,7 @@ fn F() { // CHECK:STDOUT: %int_1.loc21: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %.loc21_3.6: ref %i32 = array_index %ints.var, %int_1.loc21 // CHECK:STDOUT: %.loc21_3.7: init %i32 = initialize_from %.loc21_3.5 to %.loc21_3.6 [template = constants.%int_9.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.3: = bound_method %int_8.loc17, %impl.elem0.loc21_3.3 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.3: = specific_function %Convert.bound.loc21_3.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc21_3.3: init %i32 = call %Convert.specific_fn.loc21_3.3(%int_8.loc17) [template = constants.%int_8.2] @@ -127,7 +127,7 @@ fn F() { // CHECK:STDOUT: %int_2.loc21: Core.IntLiteral = int_value 2 [template = constants.%int_2] // CHECK:STDOUT: %.loc21_3.9: ref %i32 = array_index %ints.var, %int_2.loc21 // CHECK:STDOUT: %.loc21_3.10: init %i32 = initialize_from %.loc21_3.8 to %.loc21_3.9 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.4: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.4: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.4: = bound_method %int_8.loc18, %impl.elem0.loc21_3.4 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.4: = specific_function %Convert.bound.loc21_3.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc21_3.4: init %i32 = call %Convert.specific_fn.loc21_3.4(%int_8.loc18) [template = constants.%int_8.2] @@ -135,7 +135,7 @@ fn F() { // CHECK:STDOUT: %int_3.loc21: Core.IntLiteral = int_value 3 [template = constants.%int_3] // CHECK:STDOUT: %.loc21_3.12: ref %i32 = array_index %ints.var, %int_3.loc21 // CHECK:STDOUT: %.loc21_3.13: init %i32 = initialize_from %.loc21_3.11 to %.loc21_3.12 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.5: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.5: = bound_method %int_2147483647.loc19, %impl.elem0.loc21_3.5 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.5: = specific_function %Convert.bound.loc21_3.5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc21_3.5: init %i32 = call %Convert.specific_fn.loc21_3.5(%int_2147483647.loc19) [template = constants.%int_2147483647.2] @@ -143,7 +143,7 @@ fn F() { // CHECK:STDOUT: %int_4.loc21: Core.IntLiteral = int_value 4 [template = constants.%int_4] // CHECK:STDOUT: %.loc21_3.15: ref %i32 = array_index %ints.var, %int_4.loc21 // CHECK:STDOUT: %.loc21_3.16: init %i32 = initialize_from %.loc21_3.14 to %.loc21_3.15 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.6: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.6: = bound_method %int_2147483647.loc20, %impl.elem0.loc21_3.6 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.6: = specific_function %Convert.bound.loc21_3.6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc21_3.6: init %i32 = call %Convert.specific_fn.loc21_3.6(%int_2147483647.loc20) [template = constants.%int_2147483647.2] diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index a9fbd832629c..9b45bc356a6e 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -18,9 +18,9 @@ var b: i32 = ((2)); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -55,14 +55,14 @@ var b: i32 = ((2)); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_1, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11: init %i32 = converted %int_1, %int.convert_checked.loc11 [template = constants.%int_1.2] // CHECK:STDOUT: assign file.%a.var, %.loc11 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_2, %impl.elem0.loc12 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/basics/run_i32.carbon b/toolchain/check/testdata/basics/run_i32.carbon index bfa6a608f136..e8f0dcb15274 100644 --- a/toolchain/check/testdata/basics/run_i32.carbon +++ b/toolchain/check/testdata/basics/run_i32.carbon @@ -19,9 +19,9 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -58,7 +58,7 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: fn @Run() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index 1148e06d1095..b8df2da32f4a 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -102,7 +102,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, Float, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Int = %import_ref.229 +// CHECK:STDOUT: .Int = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -163,9 +163,9 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32.1) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32.1) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %int_64.1: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_64.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32.1) [template] @@ -176,7 +176,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, Float, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Int = %import_ref.229 +// CHECK:STDOUT: .Int = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -205,7 +205,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_64, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_64) [template = constants.%int_64.2] diff --git a/toolchain/check/testdata/builtins/print/char.carbon b/toolchain/check/testdata/builtins/print/char.carbon index 79d3d4ae9095..c5dd2c0987f5 100644 --- a/toolchain/check/testdata/builtins/print/char.carbon +++ b/toolchain/check/testdata/builtins/print/char.carbon @@ -28,9 +28,9 @@ fn Main() { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -46,12 +46,12 @@ fn Main() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .PrintChar = %import_ref.229 +// CHECK:STDOUT: .PrintChar = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//io // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.229: %PrintChar.type.2 = import_ref Core//io, PrintChar, loaded [template = constants.%PrintChar.2] +// CHECK:STDOUT: %import_ref.252: %PrintChar.type.2 = import_ref Core//io, PrintChar, loaded [template = constants.%PrintChar.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -87,7 +87,7 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %PrintChar.ref.loc16: %PrintChar.type.1 = name_ref PrintChar, file.%PrintChar.decl [template = constants.%PrintChar.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.2] @@ -95,9 +95,9 @@ fn Main() { // CHECK:STDOUT: %.loc16_13.2: %i32 = converted %int_1, %.loc16_13.1 [template = constants.%int_1.2] // CHECK:STDOUT: %print.char.loc16: init %i32 = call %PrintChar.ref.loc16(%.loc16_13.2) // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %PrintChar.ref.loc17: %PrintChar.type.2 = name_ref PrintChar, imports.%import_ref.229 [template = constants.%PrintChar.2] +// CHECK:STDOUT: %PrintChar.ref.loc17: %PrintChar.type.2 = name_ref PrintChar, imports.%import_ref.252 [template = constants.%PrintChar.2] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_2, %impl.elem0.loc17 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/builtins/print/int.carbon b/toolchain/check/testdata/builtins/print/int.carbon index d114966529d6..4502ececb5e4 100644 --- a/toolchain/check/testdata/builtins/print/int.carbon +++ b/toolchain/check/testdata/builtins/print/int.carbon @@ -30,9 +30,9 @@ fn Main() { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -48,12 +48,12 @@ fn Main() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Print = %import_ref.229 +// CHECK:STDOUT: .Print = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//io // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.229: %Print.type.2 = import_ref Core//io, Print, loaded [template = constants.%Print.2] +// CHECK:STDOUT: %import_ref.252: %Print.type.2 = import_ref Core//io, Print, loaded [template = constants.%Print.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -83,7 +83,7 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Print.ref.loc16: %Print.type.1 = name_ref Print, file.%Print.decl [template = constants.%Print.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.2] @@ -91,9 +91,9 @@ fn Main() { // CHECK:STDOUT: %.loc16_9.2: %i32 = converted %int_1, %.loc16_9.1 [template = constants.%int_1.2] // CHECK:STDOUT: %print.int.loc16: init %empty_tuple.type = call %Print.ref.loc16(%.loc16_9.2) // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Print.ref.loc18: %Print.type.2 = name_ref Print, imports.%import_ref.229 [template = constants.%Print.2] +// CHECK:STDOUT: %Print.ref.loc18: %Print.type.2 = name_ref Print, imports.%import_ref.252 [template = constants.%Print.2] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_2, %impl.elem0.loc18 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 8de0f6c34e8c..1ed7a1ea2f6e 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -154,9 +154,9 @@ class A { // CHECK:STDOUT: %Circle.elem: type = unbound_element_type %Circle, %i32 [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] @@ -165,7 +165,7 @@ class A { // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %struct_type.radius.1: type = struct_type {.radius: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.radius.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.radius.1 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] @@ -199,7 +199,7 @@ class A { // CHECK:STDOUT: class @Circle { // CHECK:STDOUT: %.loc5: %Circle.elem = field_decl radius, element0 [template] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -223,7 +223,7 @@ class A { // CHECK:STDOUT: %return.param: ref %Circle = out_param runtime_param0 // CHECK:STDOUT: %return: ref %Circle = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius.1 [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle @@ -237,7 +237,7 @@ class A { // CHECK:STDOUT: fn @SomeInternalFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -250,7 +250,7 @@ class A { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc13_24.1: %struct_type.radius.2 = struct_literal (%int_5) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -352,9 +352,9 @@ class A { // CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.radius [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -440,7 +440,7 @@ class A { // CHECK:STDOUT: fn @SomeInternalFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -467,14 +467,14 @@ class A { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -498,14 +498,14 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc5_17.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.2] // CHECK:STDOUT: %.loc5_17.2: %i32 = converted %int_5, %.loc5_17.1 [template = constants.%int_5.2] // CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_17.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -529,14 +529,14 @@ class A { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -561,7 +561,7 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_5.loc5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_5.loc5) [template = constants.%int_5.2] @@ -569,14 +569,14 @@ class A { // CHECK:STDOUT: %.loc5_27.2: %i32 = converted %int_5.loc5, %.loc5_27.1 [template = constants.%int_5.2] // CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_27.2 // CHECK:STDOUT: %int_5.loc6: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_5.loc6) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc6_25.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc6_25.2: %i32 = converted %int_5.loc6, %.loc6_25.1 [template = constants.%int_5.2] // CHECK:STDOUT: %y: %i32 = bind_name y, %.loc6_25.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index e0d429f014a8..25a592e890b1 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -105,9 +105,9 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -199,7 +199,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc13_27.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.1: = bound_method %int_1, %impl.elem0.loc13_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.1: = specific_function %Convert.bound.loc13_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %Convert.specific_fn.loc13_27.1(%int_1) [template = constants.%int_1.2] @@ -207,7 +207,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.3: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.4: ref %i32 = class_element_access %.loc13_27.3, element0 // CHECK:STDOUT: %.loc13_27.5: init %i32 = initialize_from %.loc13_27.2 to %.loc13_27.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.2: = bound_method %int_2, %impl.elem0.loc13_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.2: = specific_function %Convert.bound.loc13_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %Convert.specific_fn.loc13_27.2(%int_2) [template = constants.%int_2.2] @@ -260,9 +260,9 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -354,7 +354,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc13_27.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.1: = bound_method %int_1, %impl.elem0.loc13_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.1: = specific_function %Convert.bound.loc13_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %Convert.specific_fn.loc13_27.1(%int_1) [template = constants.%int_1.2] @@ -362,7 +362,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.3: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.4: ref %i32 = class_element_access %.loc13_27.3, element0 // CHECK:STDOUT: %.loc13_27.5: init %i32 = initialize_from %.loc13_27.2 to %.loc13_27.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.2: = bound_method %int_2, %impl.elem0.loc13_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.2: = specific_function %Convert.bound.loc13_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %Convert.specific_fn.loc13_27.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index 7bf5bd41139b..043ca41cf82d 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -65,9 +65,9 @@ class Derived { // CHECK:STDOUT: %int_7.1: Core.IntLiteral = int_value 7 [template] // CHECK:STDOUT: %struct_type.base.d.3: type = struct_type {.base: %struct_type.b.2, .d: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -160,7 +160,7 @@ class Derived { // CHECK:STDOUT: %.loc14_26.1: %struct_type.b.2 = struct_literal (%int_4) // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7.1] // CHECK:STDOUT: %.loc14_35.1: %struct_type.base.d.3 = struct_literal (%.loc14_26.1, %int_7) -// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_26: = bound_method %int_4, %impl.elem0.loc14_26 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_26: = specific_function %Convert.bound.loc14_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %Convert.specific_fn.loc14_26(%int_4) [template = constants.%int_4.2] @@ -170,7 +170,7 @@ class Derived { // CHECK:STDOUT: %.loc14_26.4: init %i32 = initialize_from %.loc14_26.2 to %.loc14_26.3 [template = constants.%int_4.2] // CHECK:STDOUT: %.loc14_26.5: init %Base = class_init (%.loc14_26.4), %.loc14_35.2 [template = constants.%Base.val] // CHECK:STDOUT: %.loc14_35.3: init %Base = converted %.loc14_26.1, %.loc14_26.5 [template = constants.%Base.val] -// CHECK:STDOUT: %impl.elem0.loc14_35: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_35: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35: = bound_method %int_7, %impl.elem0.loc14_35 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_35: = specific_function %Convert.bound.loc14_35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_35: init %i32 = call %Convert.specific_fn.loc14_35(%int_7) [template = constants.%int_7.2] diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index 969fd0117ae1..fda6d97dad3b 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -41,16 +41,16 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %Derived [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] @@ -126,7 +126,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc22: %Derived.elem = base_decl %Base.ref, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -142,7 +142,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12 [template = @Base.%.loc12] // CHECK:STDOUT: %.loc18_10: ref %i32 = class_element_access %.loc18_4, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index 51ca98f26ffd..10865240d946 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -43,9 +43,9 @@ fn Run() -> i32 { // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -161,7 +161,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index 4a5697d186fc..d411f4d20ecb 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -79,9 +79,9 @@ fn ConvertInit() { // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %struct_type.base.c.3: type = struct_type {.base: %struct_type.base.b.3, .c: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -302,7 +302,7 @@ fn ConvertInit() { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc38_57.1: %struct_type.base.c.3 = struct_literal (%.loc38_48.1, %int_3) // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %impl.elem0.loc38_39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc38_39: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc38_39: = bound_method %int_1, %impl.elem0.loc38_39 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc38_39: = specific_function %Convert.bound.loc38_39, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc38_39: init %i32 = call %Convert.specific_fn.loc38_39(%int_1) [template = constants.%int_1.2] @@ -314,7 +314,7 @@ fn ConvertInit() { // CHECK:STDOUT: %.loc38_39.4: init %i32 = initialize_from %.loc38_39.2 to %.loc38_39.3 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc38_39.5: init %A = class_init (%.loc38_39.4), %.loc38_48.2 [template = constants.%A.val] // CHECK:STDOUT: %.loc38_48.3: init %A = converted %.loc38_39.1, %.loc38_39.5 [template = constants.%A.val] -// CHECK:STDOUT: %impl.elem0.loc38_48: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc38_48: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc38_48: = bound_method %int_2, %impl.elem0.loc38_48 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc38_48: = specific_function %Convert.bound.loc38_48, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc38_48: init %i32 = call %Convert.specific_fn.loc38_48(%int_2) [template = constants.%int_2.2] @@ -323,7 +323,7 @@ fn ConvertInit() { // CHECK:STDOUT: %.loc38_48.6: init %i32 = initialize_from %.loc38_48.4 to %.loc38_48.5 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc38_48.7: init %B = class_init (%.loc38_48.3, %.loc38_48.6), %.loc38_57.3 [template = constants.%B.val] // CHECK:STDOUT: %.loc38_57.4: init %B = converted %.loc38_48.1, %.loc38_48.7 [template = constants.%B.val] -// CHECK:STDOUT: %impl.elem0.loc38_57: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc38_57: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc38_57: = bound_method %int_3, %impl.elem0.loc38_57 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc38_57: = specific_function %Convert.bound.loc38_57, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc38_57: init %i32 = call %Convert.specific_fn.loc38_57(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index 99a39a16b2f0..3ab4be4f7532 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -43,9 +43,9 @@ class Class { // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -54,7 +54,7 @@ class Class { // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.j.k [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.j.k [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -79,7 +79,7 @@ class Class { // CHECK:STDOUT: %.loc17: %Class.elem = field_decl j, element0 [template] // CHECK:STDOUT: %.loc23: %Class.elem = field_decl k, element1 [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_0, %impl.elem0.loc29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_0) [template = constants.%int_0.2] @@ -87,14 +87,14 @@ class Class { // CHECK:STDOUT: %.loc29_25.2: %i32 = converted %int_0, %.loc29_25.1 [template = constants.%int_0.2] // CHECK:STDOUT: %l: %i32 = bind_name l, %.loc29_25.2 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc34: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc34: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34: = bound_method %int_1, %impl.elem0.loc34 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc34: = specific_function %Convert.bound.loc34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc34: init %i32 = call %Convert.specific_fn.loc34(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc34_23.1: %i32 = value_of_initializer %int.convert_checked.loc34 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc34_23.2: %i32 = converted %int_1, %.loc34_23.1 [template = constants.%int_1.2] // CHECK:STDOUT: %m: %i32 = bind_name m, %.loc34_23.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 96891e4d1163..5c1338f13150 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -160,13 +160,13 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@F.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(@F.%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(%T.loc11_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%N.2) { diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index d10c76c764e8..9dc5ed8c4200 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -46,9 +46,9 @@ fn F() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.c: type = struct_type {.a: Core.IntLiteral, .c: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -100,7 +100,7 @@ fn F() { // CHECK:STDOUT: %int_2.loc26: Core.IntLiteral = int_value 2 [template = constants.%int_2] // CHECK:STDOUT: %.loc26_18.1: %struct_type.a.c = struct_literal (%int_1.loc26, %int_2.loc26) // CHECK:STDOUT: %Class.ref.loc26: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.loc26, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1.loc26) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 5e6b2cc9cf44..ffcd858adf61 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -45,9 +45,9 @@ fn F() { // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -111,7 +111,7 @@ fn F() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc25_33.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0.loc25_33.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc25_33.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_33.1: = bound_method %int_1, %impl.elem0.loc25_33.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc25_33.1: = specific_function %Convert.bound.loc25_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc25_33.1: init %i32 = call %Convert.specific_fn.loc25_33.1(%int_1) [template = constants.%int_1.2] @@ -119,7 +119,7 @@ fn F() { // CHECK:STDOUT: %.loc25_33.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc25_33.4: ref %i32 = class_element_access %.loc25_33.3, element0 // CHECK:STDOUT: %.loc25_33.5: init %i32 = initialize_from %.loc25_33.2 to %.loc25_33.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc25_33.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc25_33.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_33.2: = bound_method %int_2, %impl.elem0.loc25_33.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc25_33.2: = specific_function %Convert.bound.loc25_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc25_33.2: init %i32 = call %Convert.specific_fn.loc25_33.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index a717e0769bea..e6c748851dbe 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -33,9 +33,9 @@ fn G() -> i32 { // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -92,7 +92,7 @@ fn G() -> i32 { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index ada7b6c1cc3a..08ae8650b4f5 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -34,9 +34,9 @@ fn Run() { // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -86,7 +86,7 @@ fn Run() { // CHECK:STDOUT: %j.ref.loc18: %Class.elem = name_ref j, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc18_4: ref %i32 = class_element_access %c.ref.loc18, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_1, %impl.elem0.loc18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_1) [template = constants.%int_1.2] @@ -96,7 +96,7 @@ fn Run() { // CHECK:STDOUT: %k.ref.loc19: %Class.elem = name_ref k, @Class.%.loc13 [template = @Class.%.loc13] // CHECK:STDOUT: %.loc19_4: ref %i32 = class_element_access %c.ref.loc19, element1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index f999f5cd77e4..b8c78e3e92ff 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -35,9 +35,9 @@ fn Test() { // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -87,7 +87,7 @@ fn Test() { // CHECK:STDOUT: %j.ref.loc18: %Class.elem = name_ref j, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc18_5: ref %i32 = class_element_access %cv.ref.loc18, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_1, %impl.elem0.loc18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_1) [template = constants.%int_1.2] @@ -97,7 +97,7 @@ fn Test() { // CHECK:STDOUT: %k.ref.loc19: %Class.elem = name_ref k, @Class.%.loc13 [template = @Class.%.loc13] // CHECK:STDOUT: %.loc19_5: ref %i32 = class_element_access %cv.ref.loc19, element1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/generic/basic.carbon b/toolchain/check/testdata/class/generic/basic.carbon index 4a7948701042..010af619c65c 100644 --- a/toolchain/check/testdata/class/generic/basic.carbon +++ b/toolchain/check/testdata/class/generic/basic.carbon @@ -206,8 +206,6 @@ class Declaration(T:! type); // CHECK:STDOUT: %complete_type.loc22_1.2 => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@GetAddr.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @GetAddr(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class => constants.%Class @@ -215,13 +213,15 @@ class Declaration(T:! type); // CHECK:STDOUT: %ptr.loc12_38.1 => constants.%ptr.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@GetValue.%T) {} +// CHECK:STDOUT: specific @Class(@GetAddr.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GetValue(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(@GetValue.%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(%T.loc11_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Declaration(constants.%T) { diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index ed8b1c7bba3f..51db8a59b5cd 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -670,13 +670,13 @@ class Outer(T:! type) { // CHECK:STDOUT: %D => constants.%D.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(@A.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%T, constants.%U) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Outer.loc4_22.1 => constants.%Outer.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Outer(@A.%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%U) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%U // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%U @@ -686,13 +686,13 @@ class Outer(T:! type) { // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(@B.%U) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @B(constants.%T, constants.%U) { // CHECK:STDOUT: %U => constants.%U // CHECK:STDOUT: %Outer.loc7_22.1 => constants.%Outer.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Outer(@B.%U) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(constants.%T, constants.%T) { // CHECK:STDOUT: %U.loc3_15.2 => constants.%T // CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%T @@ -709,10 +709,6 @@ class Outer(T:! type) { // CHECK:STDOUT: %D => constants.%D.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(@C.%T) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(@C.%T, @C.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T, constants.%U) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Inner.type => constants.%Inner.type.1 @@ -720,9 +716,9 @@ class Outer(T:! type) { // CHECK:STDOUT: %Inner.loc10_22.1 => constants.%Inner.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(@D.%T) {} +// CHECK:STDOUT: specific @Outer(@C.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(@D.%T, @D.%U) {} +// CHECK:STDOUT: specific @Inner(@C.%T, @C.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%T, constants.%U) { // CHECK:STDOUT: %T => constants.%T @@ -732,6 +728,10 @@ class Outer(T:! type) { // CHECK:STDOUT: %Inner.loc13_22.1 => constants.%Inner.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Outer(@D.%T) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Inner(@D.%T, @D.%U) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(%T, %U.loc3_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(%T.loc2_13.2) {} diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index ee34b89a5c59..b4991d6c36bb 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -54,15 +54,15 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.3(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn.1(%N.2) [symbolic] // CHECK:STDOUT: %iN.builtin.2: type = int_type signed, %int.convert_checked [symbolic] -// CHECK:STDOUT: %require_complete.3: = require_complete_type %iN.builtin.2 [symbolic] +// CHECK:STDOUT: %require_complete.5: = require_complete_type %iN.builtin.2 [symbolic] // CHECK:STDOUT: %A.elem.2: type = unbound_element_type %A.1, %iN.builtin.2 [symbolic] // CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: %iN.builtin.2} [symbolic] // CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.n [symbolic] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.21: = impl_witness (imports.%import_ref.15), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.20: = interface_witness (%Convert.11) [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.11 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -134,7 +134,7 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %.loc15_13: type = splice_block %ptr [template = constants.%ptr.2] { // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.10 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.11] +// CHECK:STDOUT: %impl.elem0: %Convert.type.10 = impl_witness_access constants.%impl_witness.21, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -166,7 +166,7 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn.1)] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.loc6_9.2) [symbolic = %int.convert_checked (constants.%int.convert_checked)] // CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked [symbolic = %iN.builtin (constants.%iN.builtin.2)] -// CHECK:STDOUT: %require_complete: = require_complete_type @A.%iN.builtin (%iN.builtin.2) [symbolic = %require_complete (constants.%require_complete.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @A.%iN.builtin (%iN.builtin.2) [symbolic = %require_complete (constants.%require_complete.5)] // CHECK:STDOUT: %A.elem.loc12: type = unbound_element_type @A.%A (%A.1), @A.%iN.builtin (%iN.builtin.2) [symbolic = %A.elem.loc12 (constants.%A.elem.2)] // CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: @A.%iN.builtin (%iN.builtin.2)} [symbolic = %struct_type.base.n (constants.%struct_type.base.n)] // CHECK:STDOUT: %complete_type.loc13_1.2: = complete_type_witness @A.%struct_type.base.n (%struct_type.base.n) [symbolic = %complete_type.loc13_1.2 (constants.%complete_type.4)] diff --git a/toolchain/check/testdata/class/generic/field.carbon b/toolchain/check/testdata/class/generic/field.carbon index 95a9889dc701..aaecb56e22d0 100644 --- a/toolchain/check/testdata/class/generic/field.carbon +++ b/toolchain/check/testdata/class/generic/field.carbon @@ -245,14 +245,14 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@G.%T.loc19_6.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T.loc19_6.2 => constants.%T // CHECK:STDOUT: %T.patt.loc19_6.2 => constants.%T // CHECK:STDOUT: %Class.loc19_26.2 => constants.%Class.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(@G.%T.loc19_6.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%U) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%U // CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%U @@ -265,11 +265,11 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@H.%U.loc23_6.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%U) { // CHECK:STDOUT: %U.loc23_6.2 => constants.%U // CHECK:STDOUT: %U.patt.loc23_6.2 => constants.%U // CHECK:STDOUT: %Class.loc23_26.2 => constants.%Class.3 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(@H.%U.loc23_6.2) {} +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 3e773962f29e..ed52a2d1ef6e 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -103,9 +103,9 @@ class Class(U:! type) { // CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -202,7 +202,7 @@ class Class(U:! type) { // CHECK:STDOUT: fn() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -242,6 +242,10 @@ class Class(U:! type) { // CHECK:STDOUT: --- foo.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] @@ -249,7 +253,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic] -// CHECK:STDOUT: %require_complete.3: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.5: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x [symbolic] @@ -267,30 +271,28 @@ class Class(U:! type) { // CHECK:STDOUT: %CompleteClass.elem.2: type = unbound_element_type %CompleteClass.2, %i32 [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.1, @CompleteClass(%i32) [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.n.2: type = struct_type {.n: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %CompleteClass.val: %CompleteClass.2 = struct_value (%int_1.2) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %Convert.2 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%N) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init %Int = call %Convert.specific_fn(%int_1) [symbolic] +// CHECK:STDOUT: %CompleteClass.val: %CompleteClass.2 = struct_value (%int.convert_checked) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, CompleteClass, loaded [template = constants.%CompleteClass.generic] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.233 -// CHECK:STDOUT: .ImplicitAs = %import_ref.234 +// CHECK:STDOUT: .Int = %import_ref.255 +// CHECK:STDOUT: .ImplicitAs = %import_ref.256 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.229: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type.4] -// CHECK:STDOUT: %import_ref.230 = import_ref Main//foo, inst37 [no loc], unloaded -// CHECK:STDOUT: %import_ref.231 = import_ref Main//foo, loc7_8, unloaded -// CHECK:STDOUT: %import_ref.232 = import_ref Main//foo, loc8_17, unloaded +// CHECK:STDOUT: %import_ref.251: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type.4] +// CHECK:STDOUT: %import_ref.252 = import_ref Main//foo, inst37 [no loc], unloaded +// CHECK:STDOUT: %import_ref.253 = import_ref Main//foo, loc7_8, unloaded +// CHECK:STDOUT: %import_ref.254 = import_ref Main//foo, loc8_17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -328,7 +330,7 @@ class Class(U:! type) { // CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.1 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.1 (%T) [symbolic = %require_complete (constants.%require_complete.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.1 (%T) [symbolic = %require_complete (constants.%require_complete.5)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class), @Class.%T.1 (%T) [symbolic = %Class.elem (constants.%Class.elem)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @Class.%T.1 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x)] @@ -357,10 +359,10 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.230 -// CHECK:STDOUT: .n = imports.%import_ref.231 -// CHECK:STDOUT: .F = imports.%import_ref.232 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.229 +// CHECK:STDOUT: .Self = imports.%import_ref.252 +// CHECK:STDOUT: .n = imports.%import_ref.253 +// CHECK:STDOUT: .F = imports.%import_ref.254 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.251 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -372,17 +374,17 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() -> %return.param_patt: %CompleteClass.2 [from "foo.carbon"] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %.loc9_17.1: %struct_type.n.2 = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0: %Convert.type.9 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_17.2: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.2] +// CHECK:STDOUT: %impl.elem0: %Convert.type.9 = impl_witness_access constants.%impl_witness.19, element0 [symbolic = constants.%Convert.2] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [symbolic = constants.%Convert.bound] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%N) [symbolic = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %Int = call %Convert.specific_fn(%int_1) [symbolic = constants.%int.convert_checked] +// CHECK:STDOUT: %.loc9_17.2: init %i32 = converted %int_1, %int.convert_checked [symbolic = constants.%int.convert_checked] // CHECK:STDOUT: %.loc9_17.3: ref %i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc9_17.4: init %i32 = initialize_from %.loc9_17.2 to %.loc9_17.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_17.5: init %CompleteClass.2 = class_init (%.loc9_17.4), %return [template = constants.%CompleteClass.val] -// CHECK:STDOUT: %.loc9_18: init %CompleteClass.2 = converted %.loc9_17.1, %.loc9_17.5 [template = constants.%CompleteClass.val] +// CHECK:STDOUT: %.loc9_17.4: init %i32 = initialize_from %.loc9_17.2 to %.loc9_17.3 [symbolic = constants.%int.convert_checked] +// CHECK:STDOUT: %.loc9_17.5: init %CompleteClass.2 = class_init (%.loc9_17.4), %return [symbolic = constants.%CompleteClass.val] +// CHECK:STDOUT: %.loc9_18: init %CompleteClass.2 = converted %.loc9_17.1, %.loc9_17.5 [symbolic = constants.%CompleteClass.val] // CHECK:STDOUT: return %.loc9_18 to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index 59fddc73c517..0402bca79648 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -337,14 +337,12 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %complete_type.loc8_1.2 => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Get.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @Get(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class => constants.%Class.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@GetAddr.%T) {} +// CHECK:STDOUT: specific @Class(@Get.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GetAddr(constants.%T) { // CHECK:STDOUT: %T => constants.%T @@ -353,6 +351,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %ptr.loc7_38.1 => constants.%ptr.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(@GetAddr.%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(%T.loc2_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%i32) { @@ -535,8 +535,6 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Make => constants.%Make // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Make.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @Make(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class.loc5_23.1 => constants.%Class @@ -546,9 +544,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class.val => constants.%Class.val // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc4_13.2) {} +// CHECK:STDOUT: specific @Class(@Make.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@StaticMemberFunctionCall.%T.loc8_29.2) {} +// CHECK:STDOUT: specific @Class(%T.loc4_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @StaticMemberFunctionCall(constants.%T) { // CHECK:STDOUT: %T.loc8_29.2 => constants.%T @@ -556,5 +554,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class.loc8_49.2 => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(@StaticMemberFunctionCall.%T.loc8_29.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Make(@StaticMemberFunctionCall.%T.loc8_29.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index 28241c4879c4..70568599af86 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -188,13 +188,13 @@ class C(T:! type) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@G.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(@G.%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(%T.loc4_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_member_inline.carbon diff --git a/toolchain/check/testdata/class/generic/member_lookup.carbon b/toolchain/check/testdata/class/generic/member_lookup.carbon index 71a799cc4643..a526c11a87b0 100644 --- a/toolchain/check/testdata/class/generic/member_lookup.carbon +++ b/toolchain/check/testdata/class/generic/member_lookup.carbon @@ -347,15 +347,13 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Derived(%T.loc8_15.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Derived(@AccessDerived.%T.loc13_18.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @AccessDerived(constants.%T) { // CHECK:STDOUT: %T.loc13_18.2 => constants.%T // CHECK:STDOUT: %T.patt.loc13_18.2 => constants.%T // CHECK:STDOUT: %Derived.loc13_40.2 => constants.%Derived.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Derived(@AccessBase.%T.loc17_15.2) {} +// CHECK:STDOUT: specific @Derived(@AccessDerived.%T.loc13_18.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AccessBase(constants.%T) { // CHECK:STDOUT: %T.loc17_15.2 => constants.%T @@ -363,6 +361,8 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Derived.loc17_37.2 => constants.%Derived.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Derived(@AccessBase.%T.loc17_15.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Base(@AccessBase.%T.loc17_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Derived(constants.%i32) { @@ -656,15 +656,13 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Derived(%T.loc8_15.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Base(@AccessMissingBase.%T.loc13_22.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @AccessMissingBase(constants.%T) { // CHECK:STDOUT: %T.loc13_22.2 => constants.%T // CHECK:STDOUT: %T.patt.loc13_22.2 => constants.%T // CHECK:STDOUT: %Base.loc13_41.2 => constants.%Base.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Derived(@AccessMissingDerived.%T.loc21_25.2) {} +// CHECK:STDOUT: specific @Base(@AccessMissingBase.%T.loc13_22.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AccessMissingDerived(constants.%T) { // CHECK:STDOUT: %T.loc21_25.2 => constants.%T @@ -672,6 +670,8 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Derived.loc21_47.2 => constants.%Derived.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Derived(@AccessMissingDerived.%T.loc21_25.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Base(@AccessMissingDerived.%T.loc21_25.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Derived(constants.%i32) { diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index 187d26afc2ba..5a4978535b1b 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -288,13 +288,13 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %T.loc5 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@G.%T.loc6) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T.loc6 => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(@G.%T.loc6) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(%T.loc4_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- nested.carbon @@ -456,14 +456,14 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %F => constants.%F // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @B(@F.%T.loc6, @F.%N.loc6) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc6 => constants.%T // CHECK:STDOUT: %N.loc6 => constants.%N // CHECK:STDOUT: %B => constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @B(@F.%T.loc6, @F.%N.loc6) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @B(%T, %N.loc5_11.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @A(%T.loc4_9.2) {} diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index fc9b75f2f6e3..157507ab6abb 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -188,8 +188,6 @@ class Class(T:! type) { // CHECK:STDOUT: %F => constants.%F // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@MakeSelf.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @MakeSelf(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class => constants.%Class @@ -199,7 +197,7 @@ class Class(T:! type) { // CHECK:STDOUT: %Class.val => constants.%Class.val // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@MakeClass.%T) {} +// CHECK:STDOUT: specific @Class(@MakeSelf.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @MakeClass(constants.%T) { // CHECK:STDOUT: %T => constants.%T @@ -210,6 +208,8 @@ class Class(T:! type) { // CHECK:STDOUT: %Class.val => constants.%Class.val // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(@MakeClass.%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(%T.loc11_13.2) {} diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index 8f4dbb12437f..40a20ce0bd9a 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -380,9 +380,9 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] @@ -459,7 +459,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc24_53.1: %struct_type.a.b.2 = struct_literal (%int_3, %int_4) // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %impl.elem0.loc24_53.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_53.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_53.1: = bound_method %int_3, %impl.elem0.loc24_53.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc24_53.1: = specific_function %Convert.bound.loc24_53.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc24_53.1: init %i32 = call %Convert.specific_fn.loc24_53.1(%int_3) [template = constants.%int_3.2] @@ -467,7 +467,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %.loc24_53.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc24_53.4: ref %i32 = class_element_access %.loc24_53.3, element0 // CHECK:STDOUT: %.loc24_53.5: init %i32 = initialize_from %.loc24_53.2 to %.loc24_53.4 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc24_53.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_53.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_53.2: = bound_method %int_4, %impl.elem0.loc24_53.2 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc24_53.2: = specific_function %Convert.bound.loc24_53.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc24_53.2: init %i32 = call %Convert.specific_fn.loc24_53.2(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/class/generic_method.carbon b/toolchain/check/testdata/class/generic_method.carbon index 6d9474a92a28..bee25bbdd809 100644 --- a/toolchain/check/testdata/class/generic_method.carbon +++ b/toolchain/check/testdata/class/generic_method.carbon @@ -141,12 +141,12 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %complete_type.loc14_1.2 => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@F.%T.loc13) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc13 => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(@F.%T.loc13) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(%T.loc11_13.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 4c9dc7b15202..d5be6b77c7e9 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -166,9 +166,9 @@ fn Run() { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.22), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -204,14 +204,14 @@ fn Run() { // CHECK:STDOUT: %import_ref.10: = import_ref Main//a, loc9_1, loaded [template = constants.%complete_type.3] // CHECK:STDOUT: %import_ref.11 = import_ref Main//a, inst21 [no loc], unloaded // CHECK:STDOUT: %import_ref.12: %Field.elem = import_ref Main//a, loc8_8, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.237: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.238 = import_ref Main//a, inst56 [no loc], unloaded -// CHECK:STDOUT: %import_ref.239: %F.type = import_ref Main//a, loc14_21, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.240: %G.type = import_ref Main//a, loc15_27, loaded [template = constants.%G] -// CHECK:STDOUT: %import_ref.241: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.242 = import_ref Main//a, inst56 [no loc], unloaded -// CHECK:STDOUT: %import_ref.243 = import_ref Main//a, loc14_21, unloaded -// CHECK:STDOUT: %import_ref.244 = import_ref Main//a, loc15_27, unloaded +// CHECK:STDOUT: %import_ref.260: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.261 = import_ref Main//a, inst56 [no loc], unloaded +// CHECK:STDOUT: %import_ref.262: %F.type = import_ref Main//a, loc14_21, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.263: %G.type = import_ref Main//a, loc15_27, loaded [template = constants.%G] +// CHECK:STDOUT: %import_ref.264: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.265 = import_ref Main//a, inst56 [no loc], unloaded +// CHECK:STDOUT: %import_ref.266 = import_ref Main//a, loc14_21, unloaded +// CHECK:STDOUT: %import_ref.267 = import_ref Main//a, loc15_27, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -243,18 +243,18 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDeclared.1 [from "a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.238 -// CHECK:STDOUT: .F = imports.%import_ref.239 -// CHECK:STDOUT: .G = imports.%import_ref.240 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.237 +// CHECK:STDOUT: .Self = imports.%import_ref.261 +// CHECK:STDOUT: .F = imports.%import_ref.262 +// CHECK:STDOUT: .G = imports.%import_ref.263 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.260 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDeclared.2 [from "a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.242 -// CHECK:STDOUT: .F = imports.%import_ref.243 -// CHECK:STDOUT: .G = imports.%import_ref.244 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.241 +// CHECK:STDOUT: .Self = imports.%import_ref.265 +// CHECK:STDOUT: .F = imports.%import_ref.266 +// CHECK:STDOUT: .G = imports.%import_ref.267 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.264 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Incomplete [from "a.carbon"]; @@ -271,7 +271,7 @@ fn Run() { // CHECK:STDOUT: %b: ref %Field = bind_name b, %b.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc9_25.1: %struct_type.x.2 = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_1, %impl.elem0.loc9 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.specific_fn.loc9(%int_1) [template = constants.%int_1.2] @@ -285,7 +285,7 @@ fn Run() { // CHECK:STDOUT: %x.ref: %Field.elem = name_ref x, imports.%import_ref.12 [template = imports.%.1] // CHECK:STDOUT: %.loc10_4: ref %i32 = class_element_access %b.ref, element0 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc10: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10: = bound_method %int_2, %impl.elem0.loc10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10: = specific_function %Convert.bound.loc10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %Convert.specific_fn.loc10(%int_2) [template = constants.%int_2.2] @@ -298,12 +298,12 @@ fn Run() { // CHECK:STDOUT: %.loc12_30: init %ForwardDeclared.1 = converted %.loc12_29.1, %.loc12_29.2 [template = constants.%ForwardDeclared.val] // CHECK:STDOUT: assign %c.var, %.loc12_30 // CHECK:STDOUT: %c.ref.loc13: ref %ForwardDeclared.1 = name_ref c, %c -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.239 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.262 [template = constants.%F] // CHECK:STDOUT: %F.bound: = bound_method %c.ref.loc13, %F.ref // CHECK:STDOUT: %.loc13: %ForwardDeclared.1 = bind_value %c.ref.loc13 // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.bound(%.loc13) // CHECK:STDOUT: %c.ref.loc14: ref %ForwardDeclared.1 = name_ref c, %c -// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.240 [template = constants.%G] +// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.263 [template = constants.%G] // CHECK:STDOUT: %G.bound: = bound_method %c.ref.loc14, %G.ref // CHECK:STDOUT: %addr.loc14: %ptr.3 = addr_of %c.ref.loc14 // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.bound(%addr.loc14) @@ -319,5 +319,5 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared.1]() [from "a.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr .inst990: %ptr.3]() [from "a.carbon"]; +// CHECK:STDOUT: fn @G[addr .inst1019: %ptr.3]() [from "a.carbon"]; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index 5c5b923dea1c..6537229e5a31 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -139,9 +139,9 @@ fn Run() { // CHECK:STDOUT: %struct_type.x.unused.2: type = struct_type {.x: Core.IntLiteral, .unused: Core.IntLiteral} [template] // CHECK:STDOUT: %struct_type.base.3: type = struct_type {.base: %struct_type.x.unused.2} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.26), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -217,7 +217,7 @@ fn Run() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc7_47.1: %struct_type.x.unused.2 = struct_literal (%int_0, %int_1) // CHECK:STDOUT: %.loc7_48.1: %struct_type.base.3 = struct_literal (%.loc7_47.1) -// CHECK:STDOUT: %impl.elem0.loc7_47.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_47.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_47.1: = bound_method %int_0, %impl.elem0.loc7_47.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc7_47.1: = specific_function %Convert.bound.loc7_47.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc7_47.1: init %i32 = call %Convert.specific_fn.loc7_47.1(%int_0) [template = constants.%int_0.2] @@ -225,7 +225,7 @@ fn Run() { // CHECK:STDOUT: %.loc7_48.2: ref %Base = class_element_access %a.var, element0 // CHECK:STDOUT: %.loc7_47.3: ref %i32 = class_element_access %.loc7_48.2, element0 // CHECK:STDOUT: %.loc7_47.4: init %i32 = initialize_from %.loc7_47.2 to %.loc7_47.3 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc7_47.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_47.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_47.2: = bound_method %int_1, %impl.elem0.loc7_47.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_47.2: = specific_function %Convert.bound.loc7_47.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_47.2: init %i32 = call %Convert.specific_fn.loc7_47.2(%int_1) [template = constants.%int_1.2] @@ -243,7 +243,7 @@ fn Run() { // CHECK:STDOUT: %.loc8_4.2: ref %Base = converted %a.ref.loc8, %.loc8_4.1 // CHECK:STDOUT: %.loc8_4.3: ref %i32 = class_element_access %.loc8_4.2, element0 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_2, %impl.elem0.loc8 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index 64b38201d71b..a8899e5c7f88 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -461,16 +461,16 @@ class B { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %SomeProtectedFunction.type: type = fn_type @SomeProtectedFunction [template] // CHECK:STDOUT: %SomeProtectedFunction: %SomeProtectedFunction.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -478,7 +478,7 @@ class B { // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.base [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -503,7 +503,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -519,7 +519,7 @@ class B { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -549,7 +549,7 @@ class B { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.4] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -563,7 +563,7 @@ class B { // CHECK:STDOUT: fn @SomeProtectedFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -927,14 +927,14 @@ class B { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Internal: type = class_type @Internal [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %Internal [template] @@ -943,7 +943,7 @@ class B { // CHECK:STDOUT: %SomeFunc.type: type = fn_type @SomeFunc [template] // CHECK:STDOUT: %SomeFunc: %SomeFunc.type = struct_value () [template] // CHECK:STDOUT: %struct_type.internal.1: type = struct_type {.internal: %Internal} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.internal.1 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.internal.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -970,7 +970,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_5.loc5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_5.loc5) [template = constants.%int_5.2] @@ -978,14 +978,14 @@ class B { // CHECK:STDOUT: %.loc5_49.2: %i32 = converted %int_5.loc5, %.loc5_49.1 [template = constants.%int_5.2] // CHECK:STDOUT: %SOME_PROTECTED_CONSTANT: %i32 = bind_name SOME_PROTECTED_CONSTANT, %.loc5_49.2 // CHECK:STDOUT: %int_5.loc6: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_5.loc6) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc6_45.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc6_45.2: %i32 = converted %int_5.loc6, %.loc6_45.1 [template = constants.%int_5.2] // CHECK:STDOUT: %SOME_PRIVATE_CONSTANT: %i32 = bind_name SOME_PRIVATE_CONSTANT, %.loc6_45.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -996,14 +996,14 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @Internal { // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc10_43.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.2] // CHECK:STDOUT: %.loc10_43.2: %i32 = converted %int_5, %.loc10_43.1 [template = constants.%int_5.2] // CHECK:STDOUT: %INTERNAL_CONSTANT: %i32 = bind_name INTERNAL_CONSTANT, %.loc10_43.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Internal @@ -1036,7 +1036,7 @@ class B { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.internal.1 [template = constants.%complete_type.4] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.internal.1 [template = constants.%complete_type.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index 0ef7565e3dbf..6348a65008b9 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -32,9 +32,9 @@ fn F() -> i32 { // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -90,7 +90,7 @@ fn F() -> i32 { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc17_26.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0.loc17_26.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_26.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_26.1: = bound_method %int_1, %impl.elem0.loc17_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc17_26.1: = specific_function %Convert.bound.loc17_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc17_26.1: init %i32 = call %Convert.specific_fn.loc17_26.1(%int_1) [template = constants.%int_1.2] @@ -98,7 +98,7 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc17_26.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc17_26.4: ref %i32 = class_element_access %.loc17_26.3, element0 // CHECK:STDOUT: %.loc17_26.5: init %i32 = initialize_from %.loc17_26.2 to %.loc17_26.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc17_26.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_26.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_26.2: = bound_method %int_2, %impl.elem0.loc17_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_26.2: = specific_function %Convert.bound.loc17_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_26.2: init %i32 = call %Convert.specific_fn.loc17_26.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 40164647e8b6..a33f735c2dde 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -81,9 +81,9 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.k.2: type = struct_type {.k: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -334,7 +334,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc35_18.1: %struct_type.k.2 = struct_literal (%int_1) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index b9b2976748e9..cf1fd87e92fd 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -32,9 +32,9 @@ class Class { // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -99,7 +99,7 @@ class Class { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 0bef8c616cea..a7b4375d458f 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -81,9 +81,9 @@ class A { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.a.2: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -194,7 +194,7 @@ class A { // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc29_25.1: %struct_type.a.2 = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_1, %impl.elem0.loc29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_1) [template = constants.%int_1.2] @@ -208,7 +208,7 @@ class A { // CHECK:STDOUT: %b: ref %B = bind_name b, %b.var // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc30_25.1: %struct_type.b.2 = struct_literal (%int_2) -// CHECK:STDOUT: %impl.elem0.loc30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc30: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30: = bound_method %int_2, %impl.elem0.loc30 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc30: = specific_function %Convert.bound.loc30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc30: init %i32 = call %Convert.specific_fn.loc30(%int_2) [template = constants.%int_2.2] @@ -222,7 +222,7 @@ class A { // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc31_25.1: %struct_type.c.2 = struct_literal (%int_3) -// CHECK:STDOUT: %impl.elem0.loc31: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc31: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc31: = bound_method %int_3, %impl.elem0.loc31 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc31: = specific_function %Convert.bound.loc31, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc31: init %i32 = call %Convert.specific_fn.loc31(%int_3) [template = constants.%int_3.2] @@ -236,7 +236,7 @@ class A { // CHECK:STDOUT: %d: ref %D = bind_name d, %d.var // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc32_25.1: %struct_type.d.2 = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc32: = bound_method %int_4, %impl.elem0.loc32 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc32: = specific_function %Convert.bound.loc32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %Convert.specific_fn.loc32(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 1f517cea69c2..9e31b03998de 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -41,9 +41,9 @@ fn Run() { // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -118,7 +118,7 @@ fn Run() { // CHECK:STDOUT: fn @F.1() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -139,7 +139,7 @@ fn Run() { // CHECK:STDOUT: fn @F.2() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index 894b2340a5fd..324f2b2ad577 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -53,9 +53,9 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -194,7 +194,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12 [template = @Base.%.loc12] // CHECK:STDOUT: %.loc27_10: ref %i32 = class_element_access %.loc27_4, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 881a14635035..6587fb1b6694 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -44,9 +44,9 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1000.1: Core.IntLiteral = int_value 1000 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1000.2: %i32 = int_value 1000 [template] @@ -93,7 +93,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc5_20.1: type = splice_block %C.loc5 [template = constants.%C.2] { // CHECK:STDOUT: %C.ref.loc5: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000.loc5: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_1000.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_1000.loc5) [template = constants.%int_1000.2] @@ -111,7 +111,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc6_20.1: type = splice_block %C.loc6 [template = constants.%C.2] { // CHECK:STDOUT: %C.ref.loc6: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000.loc6: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_1000.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_1000.loc6) [template = constants.%int_1000.2] @@ -182,9 +182,9 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1000.1: Core.IntLiteral = int_value 1000 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1000.2: %i32 = int_value 1000 [template] @@ -233,7 +233,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc5_19.1: type = splice_block %C [template = constants.%C.2] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] @@ -251,7 +251,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc12_20.1: type = splice_block %C [template = constants.%C.2] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index 2e84dc9a26c1..d302c06ff964 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -508,9 +508,9 @@ class Derived { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] @@ -567,7 +567,7 @@ class Derived { // CHECK:STDOUT: %i.var: ref %i32 = var i // CHECK:STDOUT: %i: ref %i32 = bind_name i, %i.var // CHECK:STDOUT: %int_3.loc12: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_3.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_3.loc12) [template = constants.%int_3.2] @@ -598,14 +598,14 @@ class Derived { // CHECK:STDOUT: %.loc15_35.2: ref %ptr.1 = class_element_access %b2.var, element0 // CHECK:STDOUT: %.loc15_35.3: ref %ptr.1 = vtable_ptr // CHECK:STDOUT: %.loc15_35.4: init %ptr.1 = initialize_from %.loc15_35.3 to %.loc15_35.2 -// CHECK:STDOUT: %impl.elem0.loc15_35.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_35.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_35.1: = bound_method %int_5, %impl.elem0.loc15_35.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_35.1: = specific_function %Convert.bound.loc15_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_35.1: init %i32 = call %Convert.specific_fn.loc15_35.1(%int_5) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc15_35.5: init %i32 = converted %int_5, %int.convert_checked.loc15_35.1 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc15_35.6: ref %i32 = class_element_access %b2.var, element2 // CHECK:STDOUT: %.loc15_35.7: init %i32 = initialize_from %.loc15_35.5 to %.loc15_35.6 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc15_35.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_35.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_35.2: = bound_method %int_3.loc15, %impl.elem0.loc15_35.2 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15_35.2: = specific_function %Convert.bound.loc15_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15_35.2: init %i32 = call %Convert.specific_fn.loc15_35.2(%int_3.loc15) [template = constants.%int_3.2] @@ -619,7 +619,7 @@ class Derived { // CHECK:STDOUT: %m2.ref: %Base.elem = name_ref m2, @Base.%.loc6 [template = @Base.%.loc6] // CHECK:STDOUT: %.loc18_5: ref %i32 = class_element_access %b1.ref, element2 // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_4, %impl.elem0.loc18 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 1465c11285a3..5b8e79fb4e88 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -115,9 +115,9 @@ fn G() -> C { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -130,7 +130,7 @@ fn G() -> C { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array: %array_type.2 = tuple_value (%C.val, %C.val, %C.val) [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%C) [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %array_type.2 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %array_type.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -205,7 +205,7 @@ fn G() -> C { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -263,7 +263,7 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc6_27 => constants.%complete_type.1 -// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.4 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_bound_only.carbon @@ -277,9 +277,9 @@ fn G() -> C { // CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.18), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] @@ -335,7 +335,7 @@ fn G() -> C { // CHECK:STDOUT: %.loc10_23: type = splice_block %array_type [template = ] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc10_22.1: = bound_method %N.ref.loc10_22, %impl.elem0 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] // CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.1(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] @@ -430,9 +430,9 @@ fn G() -> C { // CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 1 [symbolic] // CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.18), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] @@ -491,7 +491,7 @@ fn G() -> C { // CHECK:STDOUT: %.loc10_33: type = splice_block %array_type [template = ] { // CHECK:STDOUT: %T.ref.loc10_29: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc10_16.1 [symbolic = %N.loc10_16.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc10_32.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc10_32.2 (constants.%Convert.bound)] // CHECK:STDOUT: %Convert.specific_fn.loc10_32.1: = specific_function %Convert.bound.loc10_32.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_32.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_32.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_32.1(%N.ref) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] @@ -589,9 +589,9 @@ fn G() -> C { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -605,7 +605,7 @@ fn G() -> C { // CHECK:STDOUT: %array: %array_type.2 = tuple_value (%C.val, %C.val, %C.val) [template] // CHECK:STDOUT: %array_type.3: type = array_type %int_2, %C [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%C) [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %array_type.3 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %array_type.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -680,7 +680,7 @@ fn G() -> C { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -738,7 +738,7 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc6_27 => constants.%complete_type.1 -// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.4 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_type_mismatch.carbon @@ -753,9 +753,9 @@ fn G() -> C { // CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.18), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] @@ -813,7 +813,7 @@ fn G() -> C { // CHECK:STDOUT: %.loc10_23: type = splice_block %array_type [template = ] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc10_22.1: = bound_method %N.ref.loc10_22, %impl.elem0 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] // CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.1(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index 450517531a51..47e114287d78 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -213,8 +213,6 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@F.%T.loc7_6.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T // CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T @@ -226,6 +224,8 @@ fn G() -> i32 { // CHECK:STDOUT: %F.specific_fn.loc7_39.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @C(@F.%T.loc7_6.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F(%T.loc7_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%D) { @@ -391,8 +391,6 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@F.%T.loc7_6.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T // CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T @@ -403,6 +401,8 @@ fn G() -> i32 { // CHECK:STDOUT: %F.specific_fn.loc7_39.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @I(@F.%T.loc7_6.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F(%T.loc7_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%C) { @@ -669,10 +669,6 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(%T.loc4_13.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(@F.%T.loc13_6.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(@F.%T.loc13_6.2, @F.%U.loc13_16.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc13_6.2 => constants.%T // CHECK:STDOUT: %T.patt.loc13_6.2 => constants.%T @@ -693,6 +689,10 @@ fn G() -> i32 { // CHECK:STDOUT: %require_complete.loc13_70.2 => constants.%require_complete.5 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Outer(@F.%T.loc13_6.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Inner(@F.%T.loc13_6.2, @F.%U.loc13_16.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F(%T.loc13_6.2, %U.loc13_16.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%C) { @@ -750,9 +750,9 @@ fn G() -> i32 { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -862,7 +862,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc9_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %WithNontype.ref: %WithNontype.type = name_ref WithNontype, file.%WithNontype.decl [template = constants.%WithNontype.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -888,14 +888,14 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @WithNontype(@F.%N.loc6_6.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N.2) { // CHECK:STDOUT: %N.loc6_6.2 => constants.%N.2 // CHECK:STDOUT: %N.patt.loc6_6.2 => constants.%N.2 // CHECK:STDOUT: %WithNontype.loc6_31.2 => constants.%WithNontype.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @WithNontype(@F.%N.loc6_6.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @WithNontype(constants.%int_0.2) { // CHECK:STDOUT: %N.loc4_19.2 => constants.%int_0.2 // CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%int_0.2 diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 3a6772554d80..53b8668efccc 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -246,9 +246,9 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -346,13 +346,13 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc8_22.1: %tuple.type.3 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc8_22.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_22.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_22.1: = bound_method %int_1, %impl.elem0.loc8_22.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_22.1: = specific_function %Convert.bound.loc8_22.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_22.1: init %i32 = call %Convert.specific_fn.loc8_22.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_22.2: %i32 = value_of_initializer %int.convert_checked.loc8_22.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_22.3: %i32 = converted %int_1, %.loc8_22.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_22.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_22.2: = bound_method %int_2, %impl.elem0.loc8_22.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_22.2: = specific_function %Convert.bound.loc8_22.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_22.2: init %i32 = call %Convert.specific_fn.loc8_22.2(%int_2) [template = constants.%int_2.2] @@ -424,8 +424,6 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @HasPair(@F.%tuple.loc6_40.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%A, constants.%B) { // CHECK:STDOUT: %A.loc6_6.2 => constants.%A // CHECK:STDOUT: %A.patt.loc6_6.2 => constants.%A @@ -435,6 +433,8 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %HasPair.loc6_41.2 => constants.%HasPair.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @HasPair(@F.%tuple.loc6_40.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @HasPair(constants.%tuple.2) { // CHECK:STDOUT: %Pair.loc4_15.2 => constants.%tuple.2 // CHECK:STDOUT: %Pair.patt.loc4_15.2 => constants.%tuple.2 diff --git a/toolchain/check/testdata/eval/aggregate.carbon b/toolchain/check/testdata/eval/aggregate.carbon index 70a434c41180..3aa2699675e8 100644 --- a/toolchain/check/testdata/eval/aggregate.carbon +++ b/toolchain/check/testdata/eval/aggregate.carbon @@ -27,9 +27,9 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -101,13 +101,13 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %i32.loc11_46: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc11_49.1: %tuple.type.1 = tuple_literal (%i32.loc11_41, %i32.loc11_46) // CHECK:STDOUT: %.loc11_49.2: type = converted %.loc11_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %impl.elem0.loc11_35.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_35.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_35.1: = bound_method %int_1.loc11, %impl.elem0.loc11_35.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_35.1: = specific_function %Convert.bound.loc11_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_35.1: init %i32 = call %Convert.specific_fn.loc11_35.1(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_35.2: %i32 = value_of_initializer %int.convert_checked.loc11_35.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_35.3: %i32 = converted %int_1.loc11, %.loc11_35.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_35.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_35.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_35.2: = bound_method %int_2.loc11, %impl.elem0.loc11_35.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_35.2: = specific_function %Convert.bound.loc11_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_35.2: init %i32 = call %Convert.specific_fn.loc11_35.2(%int_2.loc11) [template = constants.%int_2.2] @@ -135,19 +135,19 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %int_32.loc13_99: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13_99: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.b.a.c: type = struct_type {.b: %i32, .a: %i32, .c: %i32} [template = constants.%struct_type.b.a.c] -// CHECK:STDOUT: %impl.elem0.loc13_71.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_71.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_71.1: = bound_method %int_2.loc13, %impl.elem0.loc13_71.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_71.1: = specific_function %Convert.bound.loc13_71.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_71.1: init %i32 = call %Convert.specific_fn.loc13_71.1(%int_2.loc13) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc13_71.2: %i32 = value_of_initializer %int.convert_checked.loc13_71.1 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc13_71.3: %i32 = converted %int_2.loc13, %.loc13_71.2 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc13_71.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_71.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_71.2: = bound_method %int_1.loc13, %impl.elem0.loc13_71.2 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_71.2: = specific_function %Convert.bound.loc13_71.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_71.2: init %i32 = call %Convert.specific_fn.loc13_71.2(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_71.4: %i32 = value_of_initializer %int.convert_checked.loc13_71.2 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_71.5: %i32 = converted %int_1.loc13, %.loc13_71.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_71.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_71.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_71.3: = bound_method %int_3.loc13, %impl.elem0.loc13_71.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_71.3: = specific_function %Convert.bound.loc13_71.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_71.3: init %i32 = call %Convert.specific_fn.loc13_71.3(%int_3.loc13) [template = constants.%int_3.2] @@ -181,7 +181,7 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %.loc15_54.2: %tuple.type.5 = converted %.loc15_54.1, %tuple.loc15 [template = constants.%tuple.2] // CHECK:STDOUT: %tuple.elem2: Core.IntLiteral = tuple_access %.loc15_54.2, element2 [template = constants.%int_1.1] // CHECK:STDOUT: %array_type.loc15: type = array_type %tuple.elem2, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_0.loc15_30, %impl.elem0.loc15 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_0.loc15_30) [template = constants.%int_0.2] @@ -204,7 +204,7 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %.loc17_60.2: %struct_type.a.b = converted %.loc17_60.1, %struct.loc17 [template = constants.%struct.3] // CHECK:STDOUT: %.loc17_61: Core.IntLiteral = struct_access %.loc17_60.2, element1 [template = constants.%int_1.1] // CHECK:STDOUT: %array_type.loc17: type = array_type %.loc17_61, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_0.loc17_32, %impl.elem0.loc17 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_0.loc17_32) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index 7e338948cb12..06c14996a320 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -31,9 +31,9 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %array_type.2: type = array_type %int_4, %i32 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] @@ -88,7 +88,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %i32.loc16_61: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4] // CHECK:STDOUT: %array_type: type = array_type %int_4, %i32 [template = constants.%array_type.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_55.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.1: = bound_method %int_5, %impl.elem0.loc16_55.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.1: = specific_function %Convert.bound.loc16_55.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16_55.1: init %i32 = call %Convert.specific_fn.loc16_55.1(%int_5) [template = constants.%int_5.2] @@ -97,7 +97,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_0.loc16_55: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc16_55.4: ref %i32 = array_index %.loc16_55.3, %int_0.loc16_55 // CHECK:STDOUT: %.loc16_55.5: init %i32 = initialize_from %.loc16_55.2 to %.loc16_55.4 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_55.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.2: = bound_method %int_7, %impl.elem0.loc16_55.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.2: = specific_function %Convert.bound.loc16_55.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16_55.2: init %i32 = call %Convert.specific_fn.loc16_55.2(%int_7) [template = constants.%int_7.2] @@ -105,7 +105,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_1.loc16_55: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc16_55.7: ref %i32 = array_index %.loc16_55.3, %int_1.loc16_55 // CHECK:STDOUT: %.loc16_55.8: init %i32 = initialize_from %.loc16_55.6 to %.loc16_55.7 [template = constants.%int_7.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_55.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.3: = bound_method %int_1.loc16_51, %impl.elem0.loc16_55.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.3: = specific_function %Convert.bound.loc16_55.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc16_55.3: init %i32 = call %Convert.specific_fn.loc16_55.3(%int_1.loc16_51) [template = constants.%int_1.2] @@ -113,7 +113,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_2.loc16_55: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc16_55.10: ref %i32 = array_index %.loc16_55.3, %int_2.loc16_55 // CHECK:STDOUT: %.loc16_55.11: init %i32 = initialize_from %.loc16_55.9 to %.loc16_55.10 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.4: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_55.4: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.4: = bound_method %int_9, %impl.elem0.loc16_55.4 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.4: = specific_function %Convert.bound.loc16_55.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc16_55.4: init %i32 = call %Convert.specific_fn.loc16_55.4(%int_9) [template = constants.%int_9.2] @@ -127,7 +127,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %.loc16_57.2: ref %array_type.2 = temporary %.loc16_55.3, %.loc16_57.1 // CHECK:STDOUT: %int_32.loc16_71: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc16_71: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc16_70: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_70: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_70: = bound_method %int_2.loc16_70, %impl.elem0.loc16_70 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc16_70: = specific_function %Convert.bound.loc16_70, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc16_70: init %i32 = call %Convert.specific_fn.loc16_70(%int_2.loc16_70) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index 837849b12aad..af968e3b967a 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -30,10 +30,10 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %assoc0.1: %F.assoc_type = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %i32, %i32 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %i32, %impl_witness.1 [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: } @@ -42,7 +42,7 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.229 +// CHECK:STDOUT: .ImplicitAs = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -61,6 +61,7 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%F.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: } @@ -129,11 +130,10 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) { diff --git a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon index d8dc3ca5204d..a59dd514e325 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon @@ -85,37 +85,37 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %assoc0.3: %Convert.assoc_type.2 = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %i32.builtin, %i32.builtin [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.2) [template] +// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %i32.builtin, %impl_witness.1 [template] // CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%i32.builtin)> [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @As(%i32.builtin) [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.3: type = assoc_entity_type %As.type.3, %Convert.type.3 [template] // CHECK:STDOUT: %assoc0.4: %Convert.assoc_type.3 = assoc_entity element0, @As.%Convert.decl [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] -// CHECK:STDOUT: %As.facet: %As.type.2 = facet_value Core.IntLiteral, Core.IntLiteral [symbolic] -// CHECK:STDOUT: %interface.2: = interface_witness (%Convert.4) [template] +// CHECK:STDOUT: %As.facet: %As.type.2 = facet_value Core.IntLiteral, %impl_witness.2 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.2, @ImplicitAs(%i32.builtin) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.5 [template] // CHECK:STDOUT: %assoc0.5: %Convert.assoc_type.4 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (@impl.3.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.1: %ImplicitAs.type.2 = facet_value Core.IntLiteral, Core.IntLiteral [symbolic] -// CHECK:STDOUT: %interface.3: = interface_witness (%Convert.6) [template] +// CHECK:STDOUT: %ImplicitAs.facet.1: %ImplicitAs.type.2 = facet_value Core.IntLiteral, %impl_witness.3 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.5: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.7 [template] // CHECK:STDOUT: %assoc0.6: %Convert.assoc_type.5 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] +// CHECK:STDOUT: %impl_witness.4: = impl_witness (@impl.4.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.2: %ImplicitAs.type.2 = facet_value %i32.builtin, %i32.builtin [symbolic] -// CHECK:STDOUT: %interface.4: = interface_witness (%Convert.8) [template] +// CHECK:STDOUT: %ImplicitAs.facet.2: %ImplicitAs.type.2 = facet_value %i32.builtin, %impl_witness.4 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -172,6 +172,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc19_6.2: type = converted %int.make_type_signed, %.loc19_6.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc19: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] @@ -184,6 +185,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc23_28.2: type = converted %int.make_type_signed, %.loc23_28.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%i32.builtin)> [template = constants.%As.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc23: = impl_witness (@impl.2.%Convert.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: impl_decl @impl.3 [template] {} { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] @@ -196,6 +198,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc27_36.2: type = converted %int.make_type_signed, %.loc27_36.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32.builtin)> [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc27: = impl_witness (@impl.3.%Convert.decl) [template = constants.%impl_witness.3] // CHECK:STDOUT: impl_decl @impl.4 [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] @@ -208,6 +211,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc31_36.2: type = converted %int_literal.make_type, %.loc31_36.1 [template = Core.IntLiteral] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc31: = impl_witness (@impl.4.%Convert.decl) [template = constants.%impl_witness.4] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { @@ -349,11 +353,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %.loc23_17.2 as %As.type { @@ -373,11 +376,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.3: %.loc27_17.2 as %ImplicitAs.type { @@ -397,11 +399,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.4: %.loc31_6.2 as %ImplicitAs.type { @@ -421,11 +422,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; @@ -475,8 +475,6 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@Convert.1.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self.2) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %As.type => constants.%As.type.2 @@ -484,6 +482,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self.as_type.loc12_20.1 => constants.%Self.as_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.1.%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(%T.loc11_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%T) { @@ -491,8 +491,6 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T.patt.loc15_22.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.2(constants.%T, constants.%Self.3) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 @@ -500,6 +498,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self.as_type.loc16_20.1 => constants.%Self.as_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%T.loc15_22.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%Add.facet) { @@ -609,22 +609,20 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.5: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.5 [template] // CHECK:STDOUT: %assoc0.6: %Convert.assoc_type.5 = assoc_entity element0, imports.%import_ref.28 [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (imports.%import_ref.29) [template] // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Convert.6) [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] // CHECK:STDOUT: %Self.as_type.3: type = facet_access_type %Self.2 [symbolic] // CHECK:STDOUT: %Op.assoc_type: type = assoc_entity_type %Add.type, %Op.type.1 [template] -// CHECK:STDOUT: %assoc0.7: %Op.assoc_type = assoc_entity element0, imports.%import_ref.30 [template] +// CHECK:STDOUT: %assoc0.7: %Op.assoc_type = assoc_entity element0, imports.%import_ref.31 [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (imports.%import_ref.32) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.2) [template] // CHECK:STDOUT: %int_3.1: %i32.builtin = int_value 3 [template] -// CHECK:STDOUT: %assoc0.8: %Convert.assoc_type.3 = assoc_entity element0, imports.%import_ref.32 [symbolic] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.4 [template] -// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [template] -// CHECK:STDOUT: %interface.3: = interface_witness (%Convert.7) [template] +// CHECK:STDOUT: %assoc0.8: %Convert.assoc_type.3 = assoc_entity element0, imports.%import_ref.34 [symbolic] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (imports.%import_ref.35) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32.builtin [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] @@ -635,9 +633,9 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %int_7: %i32.builtin = int_value 7 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, %i32.builtin) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %impl_witness.4: = impl_witness (imports.%import_ref.36) [template] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [template] -// CHECK:STDOUT: %interface.4: = interface_witness (%Convert.8) [template] // CHECK:STDOUT: %Convert.bound.6: = bound_method %int_3.2, %Convert.8 [template] // CHECK:STDOUT: %Convert.bound.7: = bound_method %int_4.1, %Convert.8 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_3.1, %int_4.2, %int_7) [template] @@ -647,33 +645,33 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.2 -// CHECK:STDOUT: .Add = %import_ref.29 -// CHECK:STDOUT: .ImplicitAs = %import_ref.31 +// CHECK:STDOUT: .Add = %import_ref.30 +// CHECK:STDOUT: .ImplicitAs = %import_ref.33 // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst85 [no loc], unloaded // CHECK:STDOUT: %import_ref.4: @As.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, loc12_32, loaded [symbolic = @As.%assoc0 (constants.%assoc0.3)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//default, Convert, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//default, loc12_32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Core//default, inst39 [no loc], unloaded -// CHECK:STDOUT: %import_ref.9: %Op.assoc_type = import_ref Core//default, loc8_41, loaded [template = constants.%assoc0.7] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//default, Op, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//default, loc19_6, loaded [template = constants.%i32.builtin] -// CHECK:STDOUT: %import_ref.12: type = import_ref Core//default, loc19_13, loaded [template = constants.%Add.type] -// CHECK:STDOUT: %import_ref.13: = import_ref Core//default, loc19_17, loaded [template = constants.%interface.2] -// CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, loc23_17, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.15: type = import_ref Core//default, loc23_28, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.16: = import_ref Core//default, loc23_30, loaded [template = constants.%interface.1] -// CHECK:STDOUT: %import_ref.17 = import_ref Core//default, inst128 [no loc], unloaded -// CHECK:STDOUT: %import_ref.18: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.3) = import_ref Core//default, loc16_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.8)] -// CHECK:STDOUT: %import_ref.19 = import_ref Core//default, Convert, unloaded -// CHECK:STDOUT: %import_ref.20: type = import_ref Core//default, loc27_17, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.21: type = import_ref Core//default, loc27_36, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.22: = import_ref Core//default, loc27_38, loaded [template = constants.%interface.4] +// CHECK:STDOUT: %import_ref.8: = import_ref Core//default, loc19_17, loaded [template = constants.%impl_witness.2] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//default, inst39 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10: %Op.assoc_type = import_ref Core//default, loc8_41, loaded [template = constants.%assoc0.7] +// CHECK:STDOUT: %import_ref.11 = import_ref Core//default, Op, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//default, loc19_6, loaded [template = constants.%i32.builtin] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//default, loc19_13, loaded [template = constants.%Add.type] +// CHECK:STDOUT: %import_ref.14: = import_ref Core//default, loc23_30, loaded [template = constants.%impl_witness.1] +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//default, loc23_17, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//default, loc23_28, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.17: = import_ref Core//default, loc27_38, loaded [template = constants.%impl_witness.4] +// CHECK:STDOUT: %import_ref.18 = import_ref Core//default, inst128 [no loc], unloaded +// CHECK:STDOUT: %import_ref.19: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.3) = import_ref Core//default, loc16_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.8)] +// CHECK:STDOUT: %import_ref.20 = import_ref Core//default, Convert, unloaded +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//default, loc27_17, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//default, loc27_36, loaded [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: %import_ref.23 = import_ref Core//default, loc16_32, unloaded -// CHECK:STDOUT: %import_ref.25: type = import_ref Core//default, loc31_6, loaded [template = constants.%i32.builtin] -// CHECK:STDOUT: %import_ref.26: type = import_ref Core//default, loc31_36, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.27: = import_ref Core//default, loc31_38, loaded [template = constants.%interface.3] +// CHECK:STDOUT: %import_ref.25: = import_ref Core//default, loc31_38, loaded [template = constants.%impl_witness.3] +// CHECK:STDOUT: %import_ref.26: type = import_ref Core//default, loc31_6, loaded [template = constants.%i32.builtin] +// CHECK:STDOUT: %import_ref.27: type = import_ref Core//default, loc31_36, loaded [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -708,9 +706,9 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: // CHECK:STDOUT: interface @Add [from "core.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: .Op = imports.%import_ref.9 -// CHECK:STDOUT: witness = (imports.%import_ref.10) +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .Op = imports.%import_ref.10 +// CHECK:STDOUT: witness = (imports.%import_ref.11) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%T: type) [from "core.carbon"] { @@ -727,30 +725,30 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.17 -// CHECK:STDOUT: .Convert = imports.%import_ref.18 -// CHECK:STDOUT: witness = (imports.%import_ref.19) +// CHECK:STDOUT: .Self = imports.%import_ref.18 +// CHECK:STDOUT: .Convert = imports.%import_ref.19 +// CHECK:STDOUT: witness = (imports.%import_ref.20) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.11 as imports.%import_ref.12 [from "core.carbon"] { +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.12 as imports.%import_ref.13 [from "core.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: witness = imports.%import_ref.8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: imports.%import_ref.14 as imports.%import_ref.15 [from "core.carbon"] { +// CHECK:STDOUT: impl @impl.2: imports.%import_ref.15 as imports.%import_ref.16 [from "core.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3: imports.%import_ref.20 as imports.%import_ref.21 [from "core.carbon"] { +// CHECK:STDOUT: impl @impl.3: imports.%import_ref.21 as imports.%import_ref.22 [from "core.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.25 as imports.%import_ref.26 [from "core.carbon"] { +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.26 as imports.%import_ref.27 [from "core.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.27 +// CHECK:STDOUT: witness = imports.%import_ref.25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "core.carbon"]; @@ -797,7 +795,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %int.make_type_signed.loc4_56: init type = call constants.%Int(%int_32.loc4_56) [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc4_56.1: type = value_of_initializer %int.make_type_signed.loc4_56 [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc4_56.2: type = converted %int.make_type_signed.loc4_56, %.loc4_56.1 [template = constants.%i32.builtin] -// CHECK:STDOUT: %impl.elem0.loc4_53: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.6] +// CHECK:STDOUT: %impl.elem0.loc4_53: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.6] // CHECK:STDOUT: %Convert.bound.loc4_53: = bound_method %int_3.loc4_51, %impl.elem0.loc4_53 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %int.convert_checked.loc4_53: init %i32.builtin = call %Convert.bound.loc4_53(%int_3.loc4_51) [template = constants.%int_3.1] // CHECK:STDOUT: %.loc4_53.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_53 [template = constants.%int_3.1] @@ -807,23 +805,23 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %int.make_type_signed.loc4_69: init type = call constants.%Int(%int_32.loc4_69) [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc4_69.1: type = value_of_initializer %int.make_type_signed.loc4_69 [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc4_69.2: type = converted %int.make_type_signed.loc4_69, %.loc4_69.1 [template = constants.%i32.builtin] -// CHECK:STDOUT: %impl.elem0.loc4_66: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.6] +// CHECK:STDOUT: %impl.elem0.loc4_66: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.6] // CHECK:STDOUT: %Convert.bound.loc4_66: = bound_method %int_4.loc4_64, %impl.elem0.loc4_66 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %int.convert_checked.loc4_66: init %i32.builtin = call %Convert.bound.loc4_66(%int_4.loc4_64) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc4_66.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_66 [template = constants.%int_4.2] // CHECK:STDOUT: %.loc4_66.2: %i32.builtin = converted %int_4.loc4_64, %.loc4_66.1 [template = constants.%int_4.2] -// CHECK:STDOUT: %impl.elem0.loc4_61: %Op.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.2] +// CHECK:STDOUT: %impl.elem0.loc4_61: %Op.type.1 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %.loc4_53.2, %impl.elem0.loc4_61 [template = constants.%Op.bound.2] // CHECK:STDOUT: %int.sadd: init %i32.builtin = call %Op.bound(%.loc4_53.2, %.loc4_66.2) [template = constants.%int_7] // CHECK:STDOUT: %.loc4_73.1: %tuple.type = tuple_literal (%int_3.loc4_44, %int_4.loc4_47, %int.sadd) -// CHECK:STDOUT: %impl.elem0.loc4_73.1: %Convert.type.4 = interface_witness_access constants.%interface.4, element0 [template = constants.%Convert.8] +// CHECK:STDOUT: %impl.elem0.loc4_73.1: %Convert.type.4 = impl_witness_access constants.%impl_witness.4, element0 [template = constants.%Convert.8] // CHECK:STDOUT: %Convert.bound.loc4_73.1: = bound_method %int_3.loc4_44, %impl.elem0.loc4_73.1 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %int.convert_checked.loc4_73.1: init %i32.builtin = call %Convert.bound.loc4_73.1(%int_3.loc4_44) [template = constants.%int_3.1] // CHECK:STDOUT: %.loc4_73.2: init %i32.builtin = converted %int_3.loc4_44, %int.convert_checked.loc4_73.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc4_73.3: ref %i32.builtin = array_index file.%arr.var, %int_0 // CHECK:STDOUT: %.loc4_73.4: init %i32.builtin = initialize_from %.loc4_73.2 to %.loc4_73.3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc4_73.2: %Convert.type.4 = interface_witness_access constants.%interface.4, element0 [template = constants.%Convert.8] +// CHECK:STDOUT: %impl.elem0.loc4_73.2: %Convert.type.4 = impl_witness_access constants.%impl_witness.4, element0 [template = constants.%Convert.8] // CHECK:STDOUT: %Convert.bound.loc4_73.2: = bound_method %int_4.loc4_47, %impl.elem0.loc4_73.2 [template = constants.%Convert.bound.7] // CHECK:STDOUT: %int.convert_checked.loc4_73.2: init %i32.builtin = call %Convert.bound.loc4_73.2(%int_4.loc4_47) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc4_73.5: init %i32.builtin = converted %int_4.loc4_47, %int.convert_checked.loc4_73.2 [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 875c108d45cd..3b2d98d41a66 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -27,9 +27,9 @@ fn Main() { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -83,7 +83,7 @@ fn Main() { // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %Echo.ref: %Echo.type = name_ref Echo, file.%Echo.decl [template = constants.%Echo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index 6d9db96b7fff..25b3dacbed20 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -30,9 +30,9 @@ fn Main() { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -93,7 +93,7 @@ fn Main() { // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_22.1: %tuple.type.3 = tuple_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1, %impl.elem0.loc14 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1) [template = constants.%int_1.2] @@ -107,7 +107,7 @@ fn Main() { // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %x.ref, element0 // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc16_8: %i32 = bind_value %tuple.elem0 -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_6, %impl.elem0.loc16 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index 06ff140bb796..90db41610f77 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -26,9 +26,9 @@ fn Main() { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -73,7 +73,7 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index 52f00c4fa41b..60b7ce1b0fff 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -27,9 +27,9 @@ fn Main() { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -74,7 +74,7 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Foo.ref.loc14: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1.loc14) [template = constants.%int_1.2] @@ -83,7 +83,7 @@ fn Main() { // CHECK:STDOUT: %Foo.call.loc14: init %empty_tuple.type = call %Foo.ref.loc14(%.loc14_7.2) // CHECK:STDOUT: %Foo.ref.loc15: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_1.loc15) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index 8d60586684cd..f3b6b69ef948 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -27,9 +27,9 @@ fn Main() { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -86,13 +86,13 @@ fn Main() { // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_7: = bound_method %int_1, %impl.elem0.loc14_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_7: = specific_function %Convert.bound.loc14_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %Convert.specific_fn.loc14_7(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1, %.loc14_7.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_10: = bound_method %int_2, %impl.elem0.loc14_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_10: = specific_function %Convert.bound.loc14_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %Convert.specific_fn.loc14_10(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index 7e5416fda511..e16668823daa 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -28,9 +28,9 @@ fn Main() { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -87,13 +87,13 @@ fn Main() { // CHECK:STDOUT: %Foo.ref.loc14: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_7: = bound_method %int_1.loc14, %impl.elem0.loc14_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_7: = specific_function %Convert.bound.loc14_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %Convert.specific_fn.loc14_7(%int_1.loc14) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1.loc14, %.loc14_7.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_10: = bound_method %int_2.loc14, %impl.elem0.loc14_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_10: = specific_function %Convert.bound.loc14_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %Convert.specific_fn.loc14_10(%int_2.loc14) [template = constants.%int_2.2] @@ -103,13 +103,13 @@ fn Main() { // CHECK:STDOUT: %Foo.ref.loc15: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc15: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc15_7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_7: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_7: = bound_method %int_1.loc15, %impl.elem0.loc15_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15_7: = specific_function %Convert.bound.loc15_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15_7: init %i32 = call %Convert.specific_fn.loc15_7(%int_1.loc15) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_7.1: %i32 = value_of_initializer %int.convert_checked.loc15_7 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_7.2: %i32 = converted %int_1.loc15, %.loc15_7.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc15_10: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_10: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_10: = bound_method %int_2.loc15, %impl.elem0.loc15_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_10: = specific_function %Convert.bound.loc15_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_10: init %i32 = call %Convert.specific_fn.loc15_10(%int_2.loc15) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon index d6d0457d52af..beda23a9f9e0 100644 --- a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon +++ b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon @@ -43,9 +43,9 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -147,7 +147,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: fn() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index d275a48cb7d6..de17d799b2b8 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -453,9 +453,9 @@ import library "extern_api"; // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.20), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -534,7 +534,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7: = bound_method %int_1.loc7, %impl.elem0.loc7 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc7: = specific_function %Convert.bound.loc7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %Convert.specific_fn.loc7(%int_1.loc7) [template = constants.%int_1.2] @@ -545,7 +545,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.2 = tuple_literal (%int_1.loc8) -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.2] @@ -586,9 +586,9 @@ import library "extern_api"; // CHECK:STDOUT: %E: %E.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.20), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -684,7 +684,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc53: = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2] @@ -695,7 +695,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.3 = tuple_literal (%int_1.loc54) -// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc54: = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.2] @@ -736,9 +736,9 @@ import library "extern_api"; // CHECK:STDOUT: %E: %E.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.20), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -834,7 +834,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_1.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_1.loc13) [template = constants.%int_1.2] @@ -845,7 +845,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_25.1: %tuple.type.3 = tuple_literal (%int_1.loc14) -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1.loc14) [template = constants.%int_1.2] @@ -877,9 +877,9 @@ import library "extern_api"; // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.25), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -958,7 +958,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc53: = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2] @@ -969,7 +969,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.2 = tuple_literal (%int_1.loc54) -// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc54: = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.2] @@ -1001,9 +1001,9 @@ import library "extern_api"; // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.25), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -1082,7 +1082,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc52: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc52: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc52: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc52: = bound_method %int_1.loc52, %impl.elem0.loc52 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc52: = specific_function %Convert.bound.loc52, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc52: init %i32 = call %Convert.specific_fn.loc52(%int_1.loc52) [template = constants.%int_1.2] @@ -1093,7 +1093,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc53_25.1: %tuple.type.2 = tuple_literal (%int_1.loc53) -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc53: = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index c2b1054fb71b..cd6df661e822 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -247,9 +247,9 @@ fn D() {} // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.18), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -308,7 +308,7 @@ fn D() {} // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7: = bound_method %int_1.loc7, %impl.elem0.loc7 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc7: = specific_function %Convert.bound.loc7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %Convert.specific_fn.loc7(%int_1.loc7) [template = constants.%int_1.2] @@ -319,7 +319,7 @@ fn D() {} // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.2 = tuple_literal (%int_1.loc8) -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 835b05a327f2..dad3c2dabb10 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -785,14 +785,14 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %tuple.type.4: type = tuple_type (Core.IntLiteral, %i32) [template] // CHECK:STDOUT: %TupleParam.specific_fn: = specific_function %TupleParam, @TupleParam(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %tuple: %tuple.type.4 = tuple_value (%int_1, %int_2.2) [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %tuple.type.4 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %tuple.type.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -853,7 +853,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc7_19.1: %tuple.type.3 = tuple_literal (%int_1, %int_2) // CHECK:STDOUT: %TupleParam.specific_fn: = specific_function %TupleParam.ref, @TupleParam(Core.IntLiteral) [template = constants.%TupleParam.specific_fn] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -877,7 +877,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- deduce_nested_struct.carbon @@ -900,14 +900,14 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.a.b.3: type = struct_type {.a: Core.IntLiteral, .b: %i32} [template] // CHECK:STDOUT: %StructParam.specific_fn: = specific_function %StructParam, @StructParam(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %struct: %struct_type.a.b.3 = struct_value (%int_1, %int_2.2) [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.3 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.a.b.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -967,7 +967,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc7_30.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %StructParam.specific_fn: = specific_function %StructParam.ref, @StructParam(Core.IntLiteral) [template = constants.%StructParam.specific_fn] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -991,7 +991,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.a.b.loc4_44.2 => constants.%struct_type.a.b.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduce_bigger_struct.carbon diff --git a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon index bc7f9411918c..5d1407c16530 100644 --- a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon @@ -21,9 +21,9 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.18), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] @@ -63,7 +63,7 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: %int_32.loc14_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc14_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc14_24.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc14_24.2 (constants.%Convert.bound)] // CHECK:STDOUT: %Convert.specific_fn.loc14_24.1: = specific_function %Convert.bound.loc14_24.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc14_24.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc14_24.1: init Core.IntLiteral = call %Convert.specific_fn.loc14_24.1(%N.ref) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index 1f767fe2abaf..bb6c228d68fd 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -66,9 +66,9 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.27), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -139,7 +139,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -180,14 +180,14 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.27), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Defined.specific_fn: = specific_function %Defined, @Defined(%i32) [template] -// CHECK:STDOUT: %require_complete.3: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.5: = require_complete_type %T [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -256,7 +256,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt.loc4: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Defined.%T.loc4_12.2 (%T) [symbolic = %require_complete (constants.%require_complete.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Defined.%T.loc4_12.2 (%T) [symbolic = %require_complete (constants.%require_complete.5)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: %T) -> %T { // CHECK:STDOUT: !entry: @@ -271,7 +271,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -310,9 +310,9 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %CallUndefined: %CallUndefined.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.27), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -376,7 +376,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/global/simple_init.carbon b/toolchain/check/testdata/global/simple_init.carbon index b5746a1114b9..839b51c676ed 100644 --- a/toolchain/check/testdata/global/simple_init.carbon +++ b/toolchain/check/testdata/global/simple_init.carbon @@ -16,9 +16,9 @@ var a: i32 = 0; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -46,7 +46,7 @@ var a: i32 = 0; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/global/simple_with_fun.carbon b/toolchain/check/testdata/global/simple_with_fun.carbon index 46ee685e4a70..9f9e07a0ccf8 100644 --- a/toolchain/check/testdata/global/simple_with_fun.carbon +++ b/toolchain/check/testdata/global/simple_with_fun.carbon @@ -23,9 +23,9 @@ var a: i32 = test_a(); // CHECK:STDOUT: %test_a: %test_a.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -63,7 +63,7 @@ var a: i32 = test_a(); // CHECK:STDOUT: fn @test_a() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index 3626ea143603..50a8963a14f7 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -50,9 +50,9 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %If1: %If1.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.15), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -147,7 +147,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -171,7 +171,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -189,7 +189,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index d7e75f91ce37..d95df7dcc605 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -30,9 +30,9 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %VarScope: %VarScope.type = struct_value () [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.15), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -83,7 +83,7 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index 50bfbc4f745c..ea4acaed24b3 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -28,9 +28,9 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: %If: %If.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.15), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -83,7 +83,7 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_1, %impl.elem0.loc13 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_1) [template = constants.%int_1.2] @@ -93,7 +93,7 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_2, %impl.elem0.loc15 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index 9d1025d37148..3bb6ffd023f4 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -27,9 +27,9 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.15), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -94,7 +94,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %x: ref %array_type = bind_name x, %x.var // CHECK:STDOUT: %int_0.loc12_22: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_24.1: %tuple.type = tuple_literal (%int_0.loc12_22) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.loc12_22, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0.loc12_22) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index 35f6efb91d91..b27c7c2d47ad 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -40,9 +40,9 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -148,7 +148,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -160,7 +160,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: fn @B() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -222,7 +222,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -245,7 +245,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index 704a40a6f9f2..8a03e8f91d06 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -24,9 +24,9 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -46,7 +46,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Bool = %import_ref.229 +// CHECK:STDOUT: .Bool = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -101,7 +101,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -113,7 +113,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: fn @B() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index 6d2dcd0d3689..8f6703416cbe 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -60,14 +60,14 @@ class C { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Float = %import_ref.229 +// CHECK:STDOUT: .Float = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -96,7 +96,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %.loc49: %C.elem = field_decl n, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index 94d51d7d02f0..930c504e65c5 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -23,9 +23,9 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.15), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -110,7 +110,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc12_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc12_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_25: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_25: = bound_method %int_1, %impl.elem0.loc12_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_25: = specific_function %Convert.bound.loc12_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_25: init %i32 = call %Convert.specific_fn.loc12_25(%int_1) [template = constants.%int_1.2] @@ -120,7 +120,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc12_20: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_32: = bound_method %int_2, %impl.elem0.loc12_32 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_32: = specific_function %Convert.bound.loc12_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %Convert.specific_fn.loc12_32(%int_2) [template = constants.%int_2.2] @@ -140,7 +140,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_32.loc12_49: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12_49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc12_49: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_49: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_49: = bound_method %int_3, %impl.elem0.loc12_49 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_49: = specific_function %Convert.bound.loc12_49, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_49: init %i32 = call %Convert.specific_fn.loc12_49(%int_3) [template = constants.%int_3.2] @@ -150,7 +150,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc12_44: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc12_56: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_56: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_56: = bound_method %int_4, %impl.elem0.loc12_56 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc12_56: = specific_function %Convert.bound.loc12_56, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc12_56: init %i32 = call %Convert.specific_fn.loc12_56(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index a0a4364b89a5..a6791fd763fb 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -32,9 +32,9 @@ fn F(cond: bool) { // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.15), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -98,14 +98,14 @@ fn F(cond: bool) { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc14_46.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc14_46.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_46.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_46.1: = bound_method %int_1, %impl.elem0.loc14_46.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_46.1: = specific_function %Convert.bound.loc14_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_46.1: init %i32 = call %Convert.specific_fn.loc14_46.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_46.2: init %i32 = converted %int_1, %int.convert_checked.loc14_46.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_46.3: ref %i32 = struct_access %a.var, element0 // CHECK:STDOUT: %.loc14_46.4: init %i32 = initialize_from %.loc14_46.2 to %.loc14_46.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_46.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_46.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_46.2: = bound_method %int_2, %impl.elem0.loc14_46.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_46.2: = specific_function %Convert.bound.loc14_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_46.2: init %i32 = call %Convert.specific_fn.loc14_46.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index 675578567709..b2b224106bb6 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -51,12 +51,12 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %assoc1: %G.assoc_type = assoc_entity element1, @Simple.%G.decl [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%F.decl, @impl.1.%G.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] -// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, %i32 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%F.2, %G.2) [template] +// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, %impl_witness.1 [template] // CHECK:STDOUT: %NonInstanceCall.type: type = fn_type @NonInstanceCall [template] // CHECK:STDOUT: %NonInstanceCall: %NonInstanceCall.type = struct_value () [template] // CHECK:STDOUT: %InstanceCall.type: type = fn_type @InstanceCall [template] @@ -92,6 +92,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%F.decl, @impl.1.%G.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: %NonInstanceCall.decl: %NonInstanceCall.type = fn_decl @NonInstanceCall [template = constants.%NonInstanceCall] { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 @@ -178,12 +179,11 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: } // CHECK:STDOUT: %self: %i32 = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%F.decl, %G.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.1(@Simple.%Self: %Simple.type) { @@ -207,7 +207,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @Simple.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface.1, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -217,7 +217,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %G.ref: %G.assoc_type = name_ref G, @Simple.%assoc1 [template = constants.%assoc1] -// CHECK:STDOUT: %impl.elem1: %G.type.1 = interface_witness_access constants.%interface.1, element1 [template = constants.%G.2] +// CHECK:STDOUT: %impl.elem1: %G.type.1 = impl_witness_access constants.%impl_witness.1, element1 [template = constants.%G.2] // CHECK:STDOUT: %G.bound: = bound_method %n.ref, %impl.elem1 // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.bound(%n.ref) // CHECK:STDOUT: return @@ -229,7 +229,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @Simple.%assoc0 [template = constants.%assoc0.1] // CHECK:STDOUT: %.loc30: ref %i32 = deref %p.ref -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface.1, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -240,7 +240,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %G.ref: %G.assoc_type = name_ref G, @Simple.%assoc1 [template = constants.%assoc1] // CHECK:STDOUT: %.loc34_4.1: ref %i32 = deref %p.ref -// CHECK:STDOUT: %impl.elem1: %G.type.1 = interface_witness_access constants.%interface.1, element1 [template = constants.%G.2] +// CHECK:STDOUT: %impl.elem1: %G.type.1 = impl_witness_access constants.%impl_witness.1, element1 [template = constants.%G.2] // CHECK:STDOUT: %G.bound: = bound_method %.loc34_4.1, %impl.elem1 // CHECK:STDOUT: %.loc34_4.2: %i32 = bind_value %.loc34_4.1 // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.bound(%.loc34_4.2) diff --git a/toolchain/check/testdata/impl/declaration.carbon b/toolchain/check/testdata/impl/declaration.carbon index 2d9d98a9a42c..bf1d666d4910 100644 --- a/toolchain/check/testdata/impl/declaration.carbon +++ b/toolchain/check/testdata/impl/declaration.carbon @@ -21,7 +21,7 @@ impl i32 as I {} // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -44,6 +44,7 @@ impl i32 as I {} // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] @@ -60,9 +61,7 @@ impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %i32.loc13 as %I.ref.loc13 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/empty.carbon b/toolchain/check/testdata/impl/empty.carbon index 320a54113318..a97b9f60702e 100644 --- a/toolchain/check/testdata/impl/empty.carbon +++ b/toolchain/check/testdata/impl/empty.carbon @@ -21,7 +21,7 @@ impl i32 as Empty { // CHECK:STDOUT: %Self: %Empty.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -44,6 +44,7 @@ impl i32 as Empty { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Empty { @@ -55,9 +56,7 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %i32 as %Empty.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/extend_impl.carbon b/toolchain/check/testdata/impl/extend_impl.carbon index 35dd68abf52a..e1bdcb6d3c6d 100644 --- a/toolchain/check/testdata/impl/extend_impl.carbon +++ b/toolchain/check/testdata/impl/extend_impl.carbon @@ -34,10 +34,10 @@ fn G(c: C) { // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %HasF.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -84,11 +84,10 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %Self.ref as %HasF.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @C.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -96,6 +95,7 @@ fn G(c: C) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -118,11 +118,11 @@ fn G(c: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %F.ref.loc22: %F.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc22: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0.loc22: %F.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc22: init %empty_tuple.type = call %impl.elem0.loc22() // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %F.ref.loc23: %F.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc23: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0.loc23: %F.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc23: init %empty_tuple.type = call %impl.elem0.loc23() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index 4a3303e73655..529f622d9f91 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -72,18 +72,18 @@ class X(U:! type) { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %HasF.type.3, %F.type.2 [template] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, @HasF.%F.decl [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%F.decl) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %HasF.facet: %HasF.type.2 = facet_value %C, %C [symbolic] -// CHECK:STDOUT: %interface.1: = interface_witness (%F.3) [template] +// CHECK:STDOUT: %HasF.facet: %HasF.type.2 = facet_value %C, %impl_witness.1 [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.20: = impl_witness (imports.%import_ref.14), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.20: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -169,11 +169,10 @@ class X(U:! type) { // CHECK:STDOUT: %return.param: ref %Param = out_param runtime_param0 // CHECK:STDOUT: %return: ref %Param = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @C.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Param { @@ -193,6 +192,7 @@ class X(U:! type) { // CHECK:STDOUT: %Param.ref: type = name_ref Param, file.%Param.decl [template = constants.%Param] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%Param)> [template = constants.%HasF.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%F.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -211,7 +211,7 @@ class X(U:! type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc15_21.1: %struct_type.x.2 = struct_literal (%int_2) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.20, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -228,7 +228,7 @@ class X(U:! type) { // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21_17: %F.assoc_type.2 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param) [template = constants.%assoc0.2] // CHECK:STDOUT: %F.ref.loc21: %F.assoc_type.2 = name_ref F, %.loc21_17 [template = constants.%assoc0.2] -// CHECK:STDOUT: %impl.elem0.loc21: %F.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%F.3] +// CHECK:STDOUT: %impl.elem0.loc21: %F.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%F.3] // CHECK:STDOUT: %.loc21_20.1: ref %Param = temporary_storage // CHECK:STDOUT: %F.call.loc21: init %Param = call %impl.elem0.loc21() to %.loc21_20.1 // CHECK:STDOUT: %.loc21_20.2: ref %Param = temporary %.loc21_20.1, %F.call.loc21 @@ -241,7 +241,7 @@ class X(U:! type) { // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %.loc22_17: %F.assoc_type.2 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param) [template = constants.%assoc0.2] // CHECK:STDOUT: %F.ref.loc22: %F.assoc_type.2 = name_ref F, %.loc22_17 [template = constants.%assoc0.2] -// CHECK:STDOUT: %impl.elem0.loc22: %F.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%F.3] +// CHECK:STDOUT: %impl.elem0.loc22: %F.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%F.3] // CHECK:STDOUT: %.loc22_20.1: ref %Param = temporary_storage // CHECK:STDOUT: %F.call.loc22: init %Param = call %impl.elem0.loc22() to %.loc22_20.1 // CHECK:STDOUT: %.loc22_20.2: ref %Param = temporary %.loc22_20.1, %F.call.loc22 @@ -305,10 +305,10 @@ class X(U:! type) { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %I.type.3, %F.type.2 [symbolic] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, @I.%F.decl [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(%U) [symbolic] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2, @impl(%U) [symbolic] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %I.facet: %I.type.2 = facet_value %X, %X [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%F.3) [symbolic] +// CHECK:STDOUT: %I.facet: %I.type.2 = facet_value %X, %impl_witness [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %require_complete.2: = require_complete_type %X [symbolic] @@ -390,11 +390,12 @@ class X(U:! type) { // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %X: type = class_type @X, @X(%U) [symbolic = %X (constants.%X)] // CHECK:STDOUT: %I.type.loc9_21.2: type = facet_type <@I, @I(%U)> [symbolic = %I.type.loc9_21.2 (constants.%I.type.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%I.type.loc9_21.2 (%I.type.3) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%U) [symbolic = %impl_witness (constants.%impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%U) [symbolic = %F.type (constants.%F.type.3)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.3) = struct_value () [symbolic = %F (constants.%F.3)] -// CHECK:STDOUT: %interface.loc9_23.2: = interface_witness (%F) [symbolic = %interface.loc9_23.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %Self.ref as %I.type.loc9_21.1 { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.3) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.3)] { @@ -413,11 +414,10 @@ class X(U:! type) { // CHECK:STDOUT: %U.ref: type = name_ref U, @X.%U.loc8_9.1 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %t: @F.2.%U (%U) = bind_name t, %t.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface.loc9_23.1: = interface_witness (%F.decl) [symbolic = %interface.loc9_23.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface.loc9_23.1 +// CHECK:STDOUT: witness = @X.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -427,7 +427,6 @@ class X(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U.loc8_9.2)> [symbolic = %I.type (constants.%I.type.3)] -// CHECK:STDOUT: %require_complete: = require_complete_type @X.%I.type (%I.type.3) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: impl_decl @impl [template] {} { @@ -436,6 +435,7 @@ class X(U:! type) { // CHECK:STDOUT: %U.ref: type = name_ref U, @X.%U.loc8_9.1 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %I.type.loc9_21.1: type = facet_type <@I, @I(constants.%U)> [symbolic = %I.type.loc9_21.2 (constants.%I.type.3)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%U) [symbolic = @impl.%impl_witness (constants.%impl_witness)] // CHECK:STDOUT: %.loc9: type = specific_constant @impl.%I.type.loc9_21.1, @impl(constants.%U) [symbolic = %I.type (constants.%I.type.3)] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: @@ -476,8 +476,6 @@ class X(U:! type) { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@F.1.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %I.type => constants.%I.type.2 @@ -485,6 +483,8 @@ class X(U:! type) { // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @I(@F.1.%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @I(%T.loc4_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @X(constants.%U) { @@ -493,7 +493,6 @@ class X(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type => constants.%I.type.3 -// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%U) { @@ -509,24 +508,23 @@ class X(U:! type) { // CHECK:STDOUT: %assoc0.loc5_25.2 => constants.%assoc0.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(@impl.%U) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.%U) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%U) { // CHECK:STDOUT: %U => constants.%U // CHECK:STDOUT: %X => constants.%X // CHECK:STDOUT: %I.type.loc9_21.2 => constants.%I.type.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.3 // CHECK:STDOUT: %F => constants.%F.3 -// CHECK:STDOUT: %interface.loc9_23.2 => constants.%interface // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(@F.2.%U) {} +// CHECK:STDOUT: specific @X(@impl.%U) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@F.2.%U) {} +// CHECK:STDOUT: specific @I(@impl.%U) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%U) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%U) { // CHECK:STDOUT: %U => constants.%U @@ -535,6 +533,10 @@ class X(U:! type) { // CHECK:STDOUT: %require_complete.loc10_25 => constants.%require_complete.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @X(@F.2.%U) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @I(@F.2.%U) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%U, constants.%I.facet) { // CHECK:STDOUT: %T => constants.%U // CHECK:STDOUT: %I.type => constants.%I.type.3 @@ -542,7 +544,5 @@ class X(U:! type) { // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%U) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @I(@X.%U.loc8_9.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index 7851c1c8c308..8cc8c0824564 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -35,9 +35,10 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %assoc0.1: %G.assoc_type = assoc_entity element0, @Simple.%G.decl [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness () [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] -// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, %i32 [template] +// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, %impl_witness.1 [template] // CHECK:STDOUT: %InstanceCall.type: type = fn_type @InstanceCall [template] // CHECK:STDOUT: %InstanceCall: %InstanceCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -63,6 +64,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.1] // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [template = constants.%InstanceCall] { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 @@ -107,11 +109,10 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %Undeclared.ref: = name_ref Undeclared, [template = ] // CHECK:STDOUT: %self: = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G.1(@Simple.%Self: %Simple.type) { @@ -128,7 +129,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %G.ref: %G.assoc_type = name_ref G, @Simple.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %impl.elem0: %G.type.1 = interface_witness_access , element0 [template = ] +// CHECK:STDOUT: %impl.elem0: %G.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = ] // CHECK:STDOUT: %G.bound: = bound_method %n.ref, %impl.elem0 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index ed1328a11718..c83c57395d02 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -35,10 +35,11 @@ class C { // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %GenericInterface.type.2, %F.type.1 [symbolic] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @GenericInterface.%F.decl [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %GenericInterface.type.2 [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %GenericInterface.facet: %GenericInterface.type.2 = facet_value %C, %C [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %GenericInterface.facet: %GenericInterface.type.2 = facet_value %C, %impl_witness [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] @@ -103,11 +104,12 @@ class C { // CHECK:STDOUT: %T.loc19_23.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc19_23.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc19_23.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_23.2 (constants.%T.patt)] // CHECK:STDOUT: %GenericInterface.type.loc19_54.2: type = facet_type <@GenericInterface, @GenericInterface(%T.loc19_23.2)> [symbolic = %GenericInterface.type.loc19_54.2 (constants.%GenericInterface.type.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%GenericInterface.type.loc19_54.2 (%GenericInterface.type.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%T.loc19_23.2) [symbolic = %impl_witness (constants.%impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc19_23.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] -// CHECK:STDOUT: %interface.loc19_56.2: = interface_witness (%F) [symbolic = %interface.loc19_56.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %Self.ref as %GenericInterface.type.loc19_54.1 { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] { @@ -118,11 +120,10 @@ class C { // CHECK:STDOUT: %T.ref: type = name_ref T, @impl.%T.loc19_23.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %x: @F.2.%T (%T) = bind_name x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface.loc19_56.1: = interface_witness (%F.decl) [symbolic = %interface.loc19_56.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface.loc19_56.1 +// CHECK:STDOUT: witness = @C.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -138,6 +139,7 @@ class C { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc19_23.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc19_23.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] // CHECK:STDOUT: %.loc19: type = specific_constant @impl.%GenericInterface.type.loc19_54.1, @impl(constants.%T) [symbolic = constants.%GenericInterface.type.2] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: @@ -184,19 +186,22 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericInterface(%T.loc11_28.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @GenericInterface(@impl.%T.loc19_23.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc19_23.2 => constants.%T // CHECK:STDOUT: %T.patt.loc19_23.2 => constants.%T // CHECK:STDOUT: %GenericInterface.type.loc19_54.2 => constants.%GenericInterface.type.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 -// CHECK:STDOUT: %interface.loc19_56.2 => constants.%interface // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @GenericInterface(@impl.%T.loc19_23.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc19_23.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } @@ -205,5 +210,3 @@ class C { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc19_23.2) {} -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index 49164232a411..642c26326b35 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -22,7 +22,7 @@ extend impl i32 as I {} // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -45,6 +45,7 @@ extend impl i32 as I {} // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -56,9 +57,7 @@ extend impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %i32 as %I.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon index f4d54622a79b..5a756509b3b0 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -51,7 +51,7 @@ class E { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %D: type = class_type @D [template] @@ -90,19 +90,15 @@ class E { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %i32 as %I.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @C.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %D.ref as %I.ref; // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.3: %Self.ref as %I.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @E.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -111,6 +107,7 @@ class E { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -124,6 +121,7 @@ class E { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -137,6 +135,7 @@ class E { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [template = constants.%E] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon index 680d7ed772a6..2209bfcc4e2a 100644 --- a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon @@ -89,10 +89,10 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@impl.%Self) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @C(@impl.%Self) {} +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index 60604e2c5f13..393a866eb34e 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -28,9 +28,9 @@ impl as Simple { // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %Simple.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @Simple.%F.decl [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -51,6 +51,7 @@ impl as Simple { // CHECK:STDOUT: %Self.ref: type = name_ref Self, [template = ] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { @@ -66,11 +67,10 @@ impl as Simple { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %Self.ref as %Simple.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.1(@Simple.%Self: %Simple.type) { diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index bfb04150d0f3..7b72bd3dcfc3 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -223,27 +223,33 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %F.assoc_type.1: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0.1: %F.assoc_type.1 = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %NoF: type = class_type @NoF [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %FNotFunction: type = class_type @FNotFunction [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness () [template] // CHECK:STDOUT: %F.2: type = class_type @F.16 [template] // CHECK:STDOUT: %PossiblyF.type: type = fn_type @PossiblyF [template] // CHECK:STDOUT: %PossiblyF: %PossiblyF.type = struct_value () [template] // CHECK:STDOUT: %FAlias: type = class_type @FAlias [template] +// CHECK:STDOUT: %impl_witness.3: = impl_witness () [template] // CHECK:STDOUT: %FExtraParam: type = class_type @FExtraParam [template] +// CHECK:STDOUT: %impl_witness.4: = impl_witness () [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %I.facet.1: %I.type = facet_value %FExtraParam, %FExtraParam [template] +// CHECK:STDOUT: %I.facet.1: %I.type = facet_value %FExtraParam, %impl_witness.4 [template] // CHECK:STDOUT: %FExtraImplicitParam: type = class_type @FExtraImplicitParam [template] +// CHECK:STDOUT: %impl_witness.5: = impl_witness () [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.4: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %I.facet.2: %I.type = facet_value %FExtraImplicitParam, %FExtraImplicitParam [template] +// CHECK:STDOUT: %I.facet.2: %I.type = facet_value %FExtraImplicitParam, %impl_witness.5 [template] // CHECK:STDOUT: %FExtraReturnType: type = class_type @FExtraReturnType [template] +// CHECK:STDOUT: %impl_witness.6: = impl_witness () [template] // CHECK:STDOUT: %F.type.4: type = fn_type @F.4 [template] // CHECK:STDOUT: %F.5: %F.type.4 = struct_value () [template] -// CHECK:STDOUT: %I.facet.3: %I.type = facet_value %FExtraReturnType, %FExtraReturnType [template] +// CHECK:STDOUT: %I.facet.3: %I.type = facet_value %FExtraReturnType, %impl_witness.6 [template] // CHECK:STDOUT: %J.type: type = facet_type <@J> [template] // CHECK:STDOUT: %Self.2: %J.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %F.type.5: type = fn_type @F.5 [template] @@ -251,33 +257,40 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %J.type, %F.type.5 [template] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, @J.%F.decl [template] // CHECK:STDOUT: %FMissingParam: type = class_type @FMissingParam [template] +// CHECK:STDOUT: %impl_witness.7: = impl_witness () [template] // CHECK:STDOUT: %F.type.6: type = fn_type @F.6 [template] // CHECK:STDOUT: %F.7: %F.type.6 = struct_value () [template] -// CHECK:STDOUT: %J.facet.1: %J.type = facet_value %FMissingParam, %FMissingParam [template] +// CHECK:STDOUT: %J.facet.1: %J.type = facet_value %FMissingParam, %impl_witness.7 [template] // CHECK:STDOUT: %FMissingImplicitParam: type = class_type @FMissingImplicitParam [template] +// CHECK:STDOUT: %impl_witness.8: = impl_witness () [template] // CHECK:STDOUT: %F.type.7: type = fn_type @F.7 [template] // CHECK:STDOUT: %F.8: %F.type.7 = struct_value () [template] -// CHECK:STDOUT: %J.facet.2: %J.type = facet_value %FMissingImplicitParam, %FMissingImplicitParam [template] +// CHECK:STDOUT: %J.facet.2: %J.type = facet_value %FMissingImplicitParam, %impl_witness.8 [template] // CHECK:STDOUT: %FMissingReturnType: type = class_type @FMissingReturnType [template] +// CHECK:STDOUT: %impl_witness.9: = impl_witness () [template] // CHECK:STDOUT: %F.type.8: type = fn_type @F.8 [template] // CHECK:STDOUT: %F.9: %F.type.8 = struct_value () [template] -// CHECK:STDOUT: %J.facet.3: %J.type = facet_value %FMissingReturnType, %FMissingReturnType [template] +// CHECK:STDOUT: %J.facet.3: %J.type = facet_value %FMissingReturnType, %impl_witness.9 [template] // CHECK:STDOUT: %FDifferentParamType: type = class_type @FDifferentParamType [template] +// CHECK:STDOUT: %impl_witness.10: = impl_witness () [template] // CHECK:STDOUT: %F.type.9: type = fn_type @F.9 [template] // CHECK:STDOUT: %F.10: %F.type.9 = struct_value () [template] -// CHECK:STDOUT: %J.facet.4: %J.type = facet_value %FDifferentParamType, %FDifferentParamType [template] +// CHECK:STDOUT: %J.facet.4: %J.type = facet_value %FDifferentParamType, %impl_witness.10 [template] // CHECK:STDOUT: %FDifferentImplicitParamType: type = class_type @FDifferentImplicitParamType [template] +// CHECK:STDOUT: %impl_witness.11: = impl_witness () [template] // CHECK:STDOUT: %F.type.10: type = fn_type @F.10 [template] // CHECK:STDOUT: %F.11: %F.type.10 = struct_value () [template] -// CHECK:STDOUT: %J.facet.5: %J.type = facet_value %FDifferentImplicitParamType, %FDifferentImplicitParamType [template] +// CHECK:STDOUT: %J.facet.5: %J.type = facet_value %FDifferentImplicitParamType, %impl_witness.11 [template] // CHECK:STDOUT: %FDifferentReturnType: type = class_type @FDifferentReturnType [template] +// CHECK:STDOUT: %impl_witness.12: = impl_witness () [template] // CHECK:STDOUT: %F.type.11: type = fn_type @F.11 [template] // CHECK:STDOUT: %F.12: %F.type.11 = struct_value () [template] -// CHECK:STDOUT: %J.facet.6: %J.type = facet_value %FDifferentReturnType, %FDifferentReturnType [template] +// CHECK:STDOUT: %J.facet.6: %J.type = facet_value %FDifferentReturnType, %impl_witness.12 [template] // CHECK:STDOUT: %FDifferentParamName: type = class_type @FDifferentParamName [template] +// CHECK:STDOUT: %impl_witness.13: = impl_witness () [template] // CHECK:STDOUT: %F.type.12: type = fn_type @F.12 [template] // CHECK:STDOUT: %F.13: %F.type.12 = struct_value () [template] -// CHECK:STDOUT: %J.facet.7: %J.type = facet_value %FDifferentParamName, %FDifferentParamName [template] +// CHECK:STDOUT: %J.facet.7: %J.type = facet_value %FDifferentParamName, %impl_witness.13 [template] // CHECK:STDOUT: %SelfNested.type: type = facet_type <@SelfNested> [template] // CHECK:STDOUT: %Self.3: %SelfNested.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.3 [symbolic] @@ -294,22 +307,24 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %F.assoc_type.3: type = assoc_entity_type %SelfNested.type, %F.type.13 [template] // CHECK:STDOUT: %assoc0.3: %F.assoc_type.3 = assoc_entity element0, @SelfNested.%F.decl [template] // CHECK:STDOUT: %SelfNestedBadParam: type = class_type @SelfNestedBadParam [template] +// CHECK:STDOUT: %impl_witness.14: = impl_witness () [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %SelfNestedBadParam [template] // CHECK:STDOUT: %struct_type.x.y.2: type = struct_type {.x: %i32, .y: %i32} [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%ptr.2, %struct_type.x.y.2) [template] // CHECK:STDOUT: %array_type.2: type = array_type %int_4, %SelfNestedBadParam [template] // CHECK:STDOUT: %F.type.14: type = fn_type @F.14 [template] // CHECK:STDOUT: %F.15: %F.type.14 = struct_value () [template] -// CHECK:STDOUT: %SelfNested.facet.1: %SelfNested.type = facet_value %SelfNestedBadParam, %SelfNestedBadParam [template] +// CHECK:STDOUT: %SelfNested.facet.1: %SelfNested.type = facet_value %SelfNestedBadParam, %impl_witness.14 [template] // CHECK:STDOUT: %struct_type.x.y.3: type = struct_type {.x: %SelfNestedBadParam, .y: %i32} [template] // CHECK:STDOUT: %tuple.type.4: type = tuple_type (%ptr.2, %struct_type.x.y.3) [template] // CHECK:STDOUT: %SelfNestedBadReturnType: type = class_type @SelfNestedBadReturnType [template] +// CHECK:STDOUT: %impl_witness.15: = impl_witness () [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %SelfNestedBadReturnType [template] // CHECK:STDOUT: %struct_type.x.y.4: type = struct_type {.x: %SelfNestedBadReturnType, .y: %i32} [template] // CHECK:STDOUT: %tuple.type.5: type = tuple_type (%ptr.3, %struct_type.x.y.4) [template] // CHECK:STDOUT: %F.type.15: type = fn_type @F.15 [template] // CHECK:STDOUT: %F.16: %F.type.15 = struct_value () [template] -// CHECK:STDOUT: %SelfNested.facet.2: %SelfNested.type = facet_value %SelfNestedBadReturnType, %SelfNestedBadReturnType [template] +// CHECK:STDOUT: %SelfNested.facet.2: %SelfNested.type = facet_value %SelfNestedBadReturnType, %impl_witness.15 [template] // CHECK:STDOUT: %array_type.3: type = array_type %int_4, %SelfNestedBadReturnType [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -457,29 +472,25 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %Self.ref as %I.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = ] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @NoF.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %Self.ref as %I.ref { // CHECK:STDOUT: %F.decl: type = class_decl @F.16 [template = constants.%F.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FNotFunction.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.3: %Self.ref as %I.ref { // CHECK:STDOUT: %PossiblyF.ref: %PossiblyF.type = name_ref PossiblyF, file.%PossiblyF.decl [template = constants.%PossiblyF] // CHECK:STDOUT: %F: %PossiblyF.type = bind_alias F, file.%PossiblyF.decl [template = constants.%PossiblyF] -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FAlias.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.4: %Self.ref as %I.ref { @@ -495,11 +506,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FExtraParam.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.5: %Self.ref as %I.ref { @@ -511,11 +521,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam] // CHECK:STDOUT: %self: %FExtraImplicitParam = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FExtraImplicitParam.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.6: %Self.ref as %I.ref { @@ -529,11 +538,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param0 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FExtraReturnType.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.7: %Self.ref as %J.ref { @@ -556,11 +564,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FMissingParam.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.8: %Self.ref as %J.ref { @@ -583,11 +590,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FMissingImplicitParam.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.9: %Self.ref as %J.ref { @@ -612,11 +618,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FMissingReturnType.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.10: %Self.ref as %J.ref { @@ -644,11 +649,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FDifferentParamType.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.11: %Self.ref as %J.ref { @@ -676,11 +680,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FDifferentImplicitParamType.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.12: %Self.ref as %J.ref { @@ -710,11 +713,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref %FDifferentReturnType = out_param runtime_param2 // CHECK:STDOUT: %return: ref %FDifferentReturnType = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FDifferentReturnType.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.13: %Self.ref as %J.ref { @@ -746,11 +748,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @FDifferentParamName.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.14: %Self.ref as %SelfNested.ref { @@ -779,11 +780,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref %array_type.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %array_type.2 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @SelfNestedBadParam.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.15: %Self.ref as %SelfNested.ref { @@ -811,11 +811,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref %array_type.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %array_type.2 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @SelfNestedBadReturnType.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NoF { @@ -823,6 +822,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%NoF [template = constants.%NoF] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.1] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -835,6 +835,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FNotFunction [template = constants.%FNotFunction] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.2] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -849,6 +850,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FAlias [template = constants.%FAlias] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.3] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -861,6 +863,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraParam [template = constants.%FExtraParam] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.4] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -873,6 +876,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.5] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -885,6 +889,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraReturnType [template = constants.%FExtraReturnType] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.6] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -897,6 +902,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingParam [template = constants.%FMissingParam] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.7] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -909,6 +915,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingImplicitParam [template = constants.%FMissingImplicitParam] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.8] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -921,6 +928,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingReturnType [template = constants.%FMissingReturnType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.9] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -933,6 +941,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [template = constants.%FDifferentParamType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.10] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -945,6 +954,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.11] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -957,6 +967,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [template = constants.%FDifferentReturnType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.12] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -969,6 +980,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamName [template = constants.%FDifferentParamName] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.13] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -981,6 +993,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadParam [template = constants.%SelfNestedBadParam] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%SelfNested.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.14] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -993,6 +1006,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%SelfNested.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.15] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index 3de08eae5367..e6f009a07d87 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -27,6 +27,7 @@ impl i32 as I {} // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -49,6 +50,7 @@ impl i32 as I {} // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] @@ -66,6 +68,6 @@ impl i32 as I {} // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %i32.loc13 as %I.ref.loc13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = .inst47.loc13_15 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon index f7321d9e6a46..7f820277bd50 100644 --- a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon +++ b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon @@ -45,10 +45,11 @@ impl i32 as I { // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(type, %i32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %i32, %i32 [template] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %i32, %impl_witness [template] // CHECK:STDOUT: %C.4: type = class_type @C, @C(%I.type, %I.facet) [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -85,6 +86,7 @@ impl i32 as I { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -123,11 +125,10 @@ impl i32 as I { // CHECK:STDOUT: } // CHECK:STDOUT: %c: %C.3 = bind_name c, %c.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness () [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc11_9.1: type, %X.loc11_19.1: @C.%T.loc11_9.2 (%T)) { @@ -170,13 +171,13 @@ impl i32 as I { // CHECK:STDOUT: %X.patt.loc11_19.2 => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%I.type, @F.1.%Self) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: %C.loc14_17.1 => constants.%C.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%I.type, @F.1.%Self) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @C(type, constants.%i32) { // CHECK:STDOUT: %T.loc11_9.2 => type // CHECK:STDOUT: %T.patt.loc11_9.2 => type diff --git a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon index b7159555b4cd..e5ccef2753c2 100644 --- a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon @@ -26,7 +26,7 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = bool> [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -54,7 +54,7 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %T.ref: %assoc_type = name_ref T, @I.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %bool.make_type.loc16_27: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %bool.make_type.loc16_27 [template = bool] // CHECK:STDOUT: %.loc16_27.2: type = converted %bool.make_type.loc16_27, %.loc16_27.1 [template = bool] diff --git a/toolchain/check/testdata/impl/impl_as.carbon b/toolchain/check/testdata/impl/impl_as.carbon index da8b9aadd91a..931d0e6b57a2 100644 --- a/toolchain/check/testdata/impl/impl_as.carbon +++ b/toolchain/check/testdata/impl/impl_as.carbon @@ -31,10 +31,10 @@ class C { // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %Simple.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @Simple.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] @@ -71,11 +71,10 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %Self.ref as %Simple.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @C.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -83,6 +82,7 @@ class C { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/impl/impl_forall.carbon b/toolchain/check/testdata/impl/impl_forall.carbon index 4b6f232d837e..06e79aa2aadc 100644 --- a/toolchain/check/testdata/impl/impl_forall.carbon +++ b/toolchain/check/testdata/impl/impl_forall.carbon @@ -27,10 +27,10 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @Simple.%F.decl [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %T, %T [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %T, %impl_witness [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -56,6 +56,7 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc15_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc15_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { @@ -72,19 +73,18 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: generic impl @impl(%T.loc15_14.1: type) { // CHECK:STDOUT: %T.loc15_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc15_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%T.loc15_14.2) [symbolic = %impl_witness (constants.%impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc15_14.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] -// CHECK:STDOUT: %interface.loc15_36.2: = interface_witness (%F) [symbolic = %interface.loc15_36.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %Simple.ref { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {} -// CHECK:STDOUT: %interface.loc15_36.1: = interface_witness (%F.decl) [symbolic = %interface.loc15_36.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface.loc15_36.1 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -107,16 +107,16 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc15_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc15_14.2 => constants.%T +// CHECK:STDOUT: %impl_witness => constants.%impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 -// CHECK:STDOUT: %interface.loc15_36.2 => constants.%interface // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc15_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Simple.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc15_14.2) {} -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/alias.carbon b/toolchain/check/testdata/impl/lookup/alias.carbon index a71fc77e050b..a134b8ec4cd6 100644 --- a/toolchain/check/testdata/impl/lookup/alias.carbon +++ b/toolchain/check/testdata/impl/lookup/alias.carbon @@ -38,10 +38,10 @@ fn G(c: C) { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } @@ -67,6 +67,7 @@ fn G(c: C) { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 @@ -90,11 +91,10 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref as %HasF.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -123,11 +123,11 @@ fn G(c: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %G.ref.loc24: %F.assoc_type = name_ref G, @C.%G [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc24: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0.loc24: %F.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc24: init %empty_tuple.type = call %impl.elem0.loc24() // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %G.ref.loc25: %F.assoc_type = name_ref G, @C.%G [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc25: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0.loc25: %F.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc25: init %empty_tuple.type = call %impl.elem0.loc25() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon index 308a5385b1f6..cf3427973682 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -13,6 +13,8 @@ interface I { } class C { + // This doesn't match `impl C as I` below under proposal #3763. + // CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE+4]]:3: error: impl declared but not defined [MissingImplDefinition] // CHECK:STDERR: extend impl as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ @@ -21,13 +23,14 @@ class C { } fn F() -> i32 { - // TODO: This should produce a more useful error message. - // CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `I` in type `C` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE+3]]:10: error: accessing member from impl before the end of its definition [ImplAccessMemberBeforeComplete] // CHECK:STDERR: return C.F(); // CHECK:STDERR: ^~~ return C.F(); } +// TODO: This should be written `impl C.(Self as I)` or `impl C.(as I)`, once +// that is supported. impl C as I { fn F() {} } @@ -42,16 +45,17 @@ impl C as I { // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%F.decl) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.3) [template] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -85,6 +89,7 @@ impl C as I { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.2.%F.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -102,11 +107,10 @@ impl C as I { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -114,6 +118,7 @@ impl C as I { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.1] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -131,6 +136,7 @@ impl C as I { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index aa9a3ff1538e..cf7ba66d2aa1 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -133,16 +133,16 @@ fn G(x: A) { // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %T, %T [symbolic] -// CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %T, %impl_witness.1 [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%F.3) [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.3, @F.2(%empty_struct_type) [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -170,6 +170,7 @@ fn G(x: A) { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_struct_type = value_param_pattern %x.patt, runtime_param0 @@ -197,19 +198,18 @@ fn G(x: A) { // CHECK:STDOUT: generic impl @impl(%T.loc8_14.1: type) { // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%T.loc8_14.2) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] -// CHECK:STDOUT: %interface.loc8_34.2: = interface_witness (%F) [symbolic = %interface.loc8_34.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %HasF.ref { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {} -// CHECK:STDOUT: %interface.loc8_34.1: = interface_witness (%F.decl) [symbolic = %interface.loc8_34.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface.loc8_34.1 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -232,7 +232,7 @@ fn G(x: A) { // CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%F.3] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%F.3] // CHECK:STDOUT: %F.specific_fn: = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn() // CHECK:STDOUT: return @@ -243,27 +243,27 @@ fn G(x: A) { // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 -// CHECK:STDOUT: %interface.loc8_34.2 => constants.%interface.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%empty_struct_type // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%empty_struct_type +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.3 // CHECK:STDOUT: %F => constants.%F.3 -// CHECK:STDOUT: %interface.loc8_34.2 => constants.%interface.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%empty_struct_type) { @@ -282,17 +282,17 @@ fn G(x: A) { // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %T, %T [symbolic] -// CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %T, %impl_witness.1 [symbolic] // CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%F.3) [template] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } @@ -321,6 +321,7 @@ fn G(x: A) { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_struct_type = value_param_pattern %x.patt, runtime_param0 @@ -372,11 +373,11 @@ fn G(x: A) { // CHECK:STDOUT: generic impl @impl(%T.loc8_14.1: type) { // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%T.loc8_14.2) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] -// CHECK:STDOUT: %interface.loc8_34.2: = interface_witness (%F) [symbolic = %interface.loc8_34.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %HasF.ref { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] { @@ -392,11 +393,10 @@ fn G(x: A) { // CHECK:STDOUT: %return.param: ref @F.2.%T (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.2.%T (%T) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface.loc8_34.1: = interface_witness (%F.decl) [symbolic = %interface.loc8_34.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface.loc8_34.1 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -425,7 +425,7 @@ fn G(x: A) { // CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%F.3] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%F.3] // CHECK:STDOUT: %F.bound: = bound_method %x.ref, %impl.elem0 // CHECK:STDOUT: %F.specific_fn: = specific_function %F.bound, @F.2(constants.%empty_struct_type) // CHECK:STDOUT: %F.call: init %empty_struct_type = call %F.specific_fn(%x.ref) @@ -444,13 +444,15 @@ fn G(x: A) { // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 -// CHECK:STDOUT: %interface.loc8_34.2 => constants.%interface.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } @@ -460,16 +462,14 @@ fn G(x: A) { // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%empty_struct_type // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%empty_struct_type +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.3 // CHECK:STDOUT: %F => constants.%F.3 -// CHECK:STDOUT: %interface.loc8_34.2 => constants.%interface.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%empty_struct_type) { @@ -496,16 +496,16 @@ fn G(x: A) { // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C.1, %C.1 [symbolic] -// CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C.1, %impl_witness.1 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%empty_struct_type) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%F.3) [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.3, @F.2(%empty_struct_type) [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -543,6 +543,7 @@ fn G(x: A) { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc10_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %C.2 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C.2 = value_param_pattern %x.patt, runtime_param0 @@ -573,19 +574,18 @@ fn G(x: A) { // CHECK:STDOUT: %T.loc10_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc10_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_14.2 (constants.%T.patt)] // CHECK:STDOUT: %C.loc10_27.2: type = class_type @C, @C(%T.loc10_14.2) [symbolic = %C.loc10_27.2 (constants.%C.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%T.loc10_14.2) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc10_14.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] -// CHECK:STDOUT: %interface.loc10_37.2: = interface_witness (%F) [symbolic = %interface.loc10_37.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.loc10_27.1 as %HasF.ref { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {} -// CHECK:STDOUT: %interface.loc10_37.1: = interface_witness (%F.decl) [symbolic = %interface.loc10_37.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface.loc10_37.1 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -623,7 +623,7 @@ fn G(x: A) { // CHECK:STDOUT: %x.ref: %C.2 = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%F.3] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%F.3] // CHECK:STDOUT: %F.specific_fn: = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn() // CHECK:STDOUT: return @@ -636,25 +636,25 @@ fn G(x: A) { // CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc10_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%T // CHECK:STDOUT: %C.loc10_27.2 => constants.%C.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 -// CHECK:STDOUT: %interface.loc10_37.2 => constants.%interface.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc10_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc10_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%empty_struct_type // CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%empty_struct_type @@ -666,11 +666,11 @@ fn G(x: A) { // CHECK:STDOUT: %T.loc10_14.2 => constants.%empty_struct_type // CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%empty_struct_type // CHECK:STDOUT: %C.loc10_27.2 => constants.%C.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.3 // CHECK:STDOUT: %F => constants.%F.3 -// CHECK:STDOUT: %interface.loc10_37.2 => constants.%interface.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%empty_struct_type) { @@ -692,10 +692,11 @@ fn G(x: A) { // CHECK:STDOUT: %F.assoc_type.1: type = assoc_entity_type %HasF.type.2, %F.type.1 [symbolic] // CHECK:STDOUT: %assoc0.1: %F.assoc_type.1 = assoc_entity element0, @HasF.%F.decl [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %HasF.type.2 [symbolic] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %HasF.facet: %HasF.type.2 = facet_value %empty_struct_type, %empty_struct_type [symbolic] -// CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %HasF.facet: %HasF.type.2 = facet_value %empty_struct_type, %impl_witness.1 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %HasF.type.3: type = facet_type <@HasF, @HasF(%empty_struct_type)> [template] @@ -703,9 +704,10 @@ fn G(x: A) { // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %HasF.type.3, %F.type.3 [template] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, @HasF.%F.decl [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %HasF.type.3 [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.4: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%F.4) [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.4, @F.2(%empty_struct_type) [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -742,6 +744,7 @@ fn G(x: A) { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_struct_type = value_param_pattern %x.patt, runtime_param0 @@ -783,19 +786,19 @@ fn G(x: A) { // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] // CHECK:STDOUT: %HasF.type.loc8_36.2: type = facet_type <@HasF, @HasF(%T.loc8_14.2)> [symbolic = %HasF.type.loc8_36.2 (constants.%HasF.type.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%HasF.type.loc8_36.2 (%HasF.type.2) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%T.loc8_14.2) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] -// CHECK:STDOUT: %interface.loc8_38.2: = interface_witness (%F) [symbolic = %interface.loc8_38.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc8_25.2 as %HasF.type.loc8_36.1 { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {} -// CHECK:STDOUT: %interface.loc8_38.1: = interface_witness (%F.decl) [symbolic = %interface.loc8_38.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface.loc8_38.1 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -822,7 +825,7 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%empty_struct_type)> [template = constants.%HasF.type.3] // CHECK:STDOUT: %.loc13_14: %F.assoc_type.2 = specific_constant @HasF.%assoc0.loc5_9.1, @HasF(constants.%empty_struct_type) [template = constants.%assoc0.2] // CHECK:STDOUT: %F.ref: %F.assoc_type.2 = name_ref F, %.loc13_14 [template = constants.%assoc0.2] -// CHECK:STDOUT: %impl.elem0: %F.type.3 = interface_witness_access constants.%interface.2, element0 [template = constants.%F.4] +// CHECK:STDOUT: %impl.elem0: %F.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%F.4] // CHECK:STDOUT: %F.specific_fn: = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn() // CHECK:STDOUT: return @@ -845,25 +848,26 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(%T.loc4_16.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: %HasF.type.loc8_36.2 => constants.%HasF.type.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 -// CHECK:STDOUT: %interface.loc8_38.2 => constants.%interface.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%HasF.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%empty_struct_type // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%empty_struct_type @@ -881,11 +885,12 @@ fn G(x: A) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%empty_struct_type // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%empty_struct_type // CHECK:STDOUT: %HasF.type.loc8_36.2 => constants.%HasF.type.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.4 // CHECK:STDOUT: %F => constants.%F.4 -// CHECK:STDOUT: %interface.loc8_38.2 => constants.%interface.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%empty_struct_type) { @@ -905,10 +910,10 @@ fn G(x: A) { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(%T, %U) [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T, %U) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %T, %T [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %T, %impl_witness [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] @@ -942,6 +947,7 @@ fn G(x: A) { // CHECK:STDOUT: %U.param: type = value_param runtime_param // CHECK:STDOUT: %U.loc9_24.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc9_24.2 (constants.%U)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%T, constants.%U) [symbolic = @impl.%impl_witness (constants.%impl_witness)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_struct_type = value_param_pattern %x.patt, runtime_param0 @@ -971,19 +977,18 @@ fn G(x: A) { // CHECK:STDOUT: %T.patt.loc9_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_14.2 (constants.%T.patt)] // CHECK:STDOUT: %U.loc9_24.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc9_24.2 (constants.%U)] // CHECK:STDOUT: %U.patt.loc9_24.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc9_24.2 (constants.%U.patt)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%T.loc9_14.2, %U.loc9_24.2) [symbolic = %impl_witness (constants.%impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc9_14.2, %U.loc9_24.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] -// CHECK:STDOUT: %interface.loc9_44.2: = interface_witness (%F) [symbolic = %interface.loc9_44.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %HasF.ref { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {} -// CHECK:STDOUT: %interface.loc9_44.1: = interface_witness (%F.decl) [symbolic = %interface.loc9_44.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface.loc9_44.1 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1016,19 +1021,19 @@ fn G(x: A) { // CHECK:STDOUT: %T.patt.loc9_14.2 => constants.%T // CHECK:STDOUT: %U.loc9_24.2 => constants.%U // CHECK:STDOUT: %U.patt.loc9_24.2 => constants.%U +// CHECK:STDOUT: %impl_witness => constants.%impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 -// CHECK:STDOUT: %interface.loc9_44.2 => constants.%interface // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc9_14.2, %U.loc9_24.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T, constants.%U) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc9_14.2, %U.loc9_24.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: --- fail_inconsistent_deduction.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1042,10 +1047,11 @@ fn G(x: A) { // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %F.assoc_type.1: type = assoc_entity_type %HasF.type.2, %F.type.1 [symbolic] // CHECK:STDOUT: %assoc0.1: %F.assoc_type.1 = assoc_entity element0, @HasF.%F.decl [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %HasF.type.2 [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %HasF.facet: %HasF.type.2 = facet_value %T, %T [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %HasF.facet: %HasF.type.2 = facet_value %T, %impl_witness [symbolic] // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] @@ -1093,6 +1099,7 @@ fn G(x: A) { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { @@ -1133,19 +1140,19 @@ fn G(x: A) { // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] // CHECK:STDOUT: %HasF.type.loc8_35.2: type = facet_type <@HasF, @HasF(%T.loc8_14.2)> [symbolic = %HasF.type.loc8_35.2 (constants.%HasF.type.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%HasF.type.loc8_35.2 (%HasF.type.2) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%T.loc8_14.2) [symbolic = %impl_witness (constants.%impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] -// CHECK:STDOUT: %interface.loc8_37.2: = interface_witness (%F) [symbolic = %interface.loc8_37.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref.loc8_24 as %HasF.type.loc8_35.1 { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {} -// CHECK:STDOUT: %interface.loc8_37.1: = interface_witness (%F.decl) [symbolic = %interface.loc8_37.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface.loc8_37.1 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1207,25 +1214,26 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(%T.loc4_16.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: %HasF.type.loc8_35.2 => constants.%HasF.type.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %impl_witness => constants.%impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 -// CHECK:STDOUT: %interface.loc8_37.2 => constants.%interface // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%HasF.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%B) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%B // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%B diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index 5b9fbfaf8329..565dc6d434f1 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -37,10 +37,10 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] @@ -125,11 +125,10 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @C.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -137,6 +136,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -158,7 +158,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.bound: = bound_method %c.ref, %impl.elem0 // CHECK:STDOUT: %F.call: init %i32 = call %F.bound(%c.ref) // CHECK:STDOUT: %.loc24_15.1: %i32 = value_of_initializer %F.call diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon index a3b59f8ec8c1..f7c5b756c278 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon @@ -59,14 +59,15 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %V.patt: type = symbolic_binding_pattern V, 0 [symbolic] // CHECK:STDOUT: %A.2: type = class_type @A, @A(%V) [symbolic] // CHECK:STDOUT: %I.type.3: type = facet_type <@I, @I(%V)> [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %I.type.3 [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @I(%V) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %I.type.3, %F.type.2 [symbolic] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, @I.%F.decl [symbolic] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.%F.decl), @impl(%V) [symbolic] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2, @impl(%V) [symbolic] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %I.facet: %I.type.2 = facet_value %A.2, %A.2 [symbolic] -// CHECK:STDOUT: %interface.1: = interface_witness (%F.3) [symbolic] +// CHECK:STDOUT: %I.facet: %I.type.2 = facet_value %A.2, %impl_witness.1 [symbolic] // CHECK:STDOUT: %require_complete.3: = require_complete_type %V [symbolic] // CHECK:STDOUT: %A.elem.2: type = unbound_element_type %A.2, %V [symbolic] // CHECK:STDOUT: %struct_type.n.2: type = struct_type {.n: %V} [symbolic] @@ -88,9 +89,9 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [symbolic] // CHECK:STDOUT: %F.assoc_type.3: type = assoc_entity_type %I.type.4, %F.type.4 [symbolic] // CHECK:STDOUT: %assoc0.3: %F.assoc_type.3 = assoc_entity element0, @I.%F.decl [symbolic] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.%F.decl), @impl(%W) [symbolic] // CHECK:STDOUT: %F.type.5: type = fn_type @F.2, @impl(%W) [symbolic] // CHECK:STDOUT: %F.5: %F.type.5 = struct_value () [symbolic] -// CHECK:STDOUT: %interface.2: = interface_witness (%F.5) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %A.4: type = class_type @A, @A(%empty_struct_type) [template] // CHECK:STDOUT: %TestSpecific.type: type = fn_type @TestSpecific [template] @@ -104,9 +105,10 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %F.6: %F.type.6 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type.4: type = assoc_entity_type %I.type.5, %F.type.6 [template] // CHECK:STDOUT: %assoc0.4: %F.assoc_type.4 = assoc_entity element0, @I.%F.decl [template] +// CHECK:STDOUT: %complete_type.6: = complete_type_witness %I.type.5 [template] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.7: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.7: %F.type.7 = struct_value () [template] -// CHECK:STDOUT: %interface.3: = interface_witness (%F.7) [template] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -144,6 +146,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %V.param: type = value_param runtime_param // CHECK:STDOUT: %V.loc10_14.1: type = bind_symbolic_name V, 0, %V.param [symbolic = %V.loc10_14.2 (constants.%V)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%V) [symbolic = @impl.%impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: %TestGeneric.decl: %TestGeneric.type = fn_decl @TestGeneric [template = constants.%TestGeneric] { // CHECK:STDOUT: %W.patt.loc16_16.1: type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc16_16.2 (constants.%W.patt)] // CHECK:STDOUT: %W.param_patt: type = value_param_pattern %W.patt.loc16_16.1, runtime_param [symbolic = %W.patt.loc16_16.2 (constants.%W.patt)] @@ -232,11 +235,12 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %V.patt.loc10_14.2: type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc10_14.2 (constants.%V.patt)] // CHECK:STDOUT: %A.loc10_27.2: type = class_type @A, @A(%V.loc10_14.2) [symbolic = %A.loc10_27.2 (constants.%A.2)] // CHECK:STDOUT: %I.type.loc10_35.2: type = facet_type <@I, @I(%V.loc10_14.2)> [symbolic = %I.type.loc10_35.2 (constants.%I.type.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%I.type.loc10_35.2 (%I.type.3) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%V.loc10_14.2) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%V.loc10_14.2) [symbolic = %F.type (constants.%F.type.3)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.3) = struct_value () [symbolic = %F (constants.%F.3)] -// CHECK:STDOUT: %interface.loc10_37.2: = interface_witness (%F) [symbolic = %interface.loc10_37.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %A.loc10_27.1 as %I.type.loc10_35.1 { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.3) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.3)] { @@ -252,11 +256,10 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %return.param: ref @F.2.%V (%V) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.2.%V (%V) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface.loc10_37.1: = interface_witness (%F.decl) [symbolic = %interface.loc10_37.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface.loc10_37.1 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -334,7 +337,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %I.type.loc17_16.1: type = facet_type <@I, @I(constants.%W)> [symbolic = %I.type.loc17_16.2 (constants.%I.type.4)] // CHECK:STDOUT: %.loc17_17: @TestGeneric.%F.assoc_type (%F.assoc_type.3) = specific_constant @I.%assoc0.loc7_26.1, @I(constants.%W) [symbolic = %assoc0 (constants.%assoc0.3)] // CHECK:STDOUT: %F.ref: @TestGeneric.%F.assoc_type (%F.assoc_type.3) = name_ref F, %.loc17_17 [symbolic = %assoc0 (constants.%assoc0.3)] -// CHECK:STDOUT: %impl.elem0: @TestGeneric.%F.type.loc17_17 (%F.type.4) = interface_witness_access constants.%interface.2, element0 [symbolic = %F (constants.%F.5)] +// CHECK:STDOUT: %impl.elem0: @TestGeneric.%F.type.loc17_17 (%F.type.4) = impl_witness_access constants.%impl_witness.2, element0 [symbolic = %F (constants.%F.5)] // CHECK:STDOUT: %F.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %F.specific_fn: = specific_function %F.bound, @F.2(constants.%W) // CHECK:STDOUT: %F.call: init @TestGeneric.%W.loc16_16.2 (%W) = call %F.specific_fn(%a.ref) @@ -353,7 +356,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%empty_struct_type)> [template = constants.%I.type.5] // CHECK:STDOUT: %.loc21_18: %F.assoc_type.4 = specific_constant @I.%assoc0.loc7_26.1, @I(constants.%empty_struct_type) [template = constants.%assoc0.4] // CHECK:STDOUT: %F.ref: %F.assoc_type.4 = name_ref F, %.loc21_18 [template = constants.%assoc0.4] -// CHECK:STDOUT: %impl.elem0: %F.type.6 = interface_witness_access constants.%interface.3, element0 [template = constants.%F.7] +// CHECK:STDOUT: %impl.elem0: %F.type.6 = impl_witness_access constants.%impl_witness.3, element0 [template = constants.%F.7] // CHECK:STDOUT: %F.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %F.specific_fn: = specific_function %F.bound, @F.2(constants.%empty_struct_type) // CHECK:STDOUT: %F.call: init %empty_struct_type = call %F.specific_fn(%a.ref) @@ -376,8 +379,6 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@F.1.%U) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%U, constants.%Self) { // CHECK:STDOUT: %U => constants.%U // CHECK:STDOUT: %I.type => constants.%I.type.2 @@ -385,6 +386,8 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @I(@F.1.%U) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @I(%U.loc6_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%V) { @@ -412,29 +415,32 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %assoc0.loc7_26.2 => constants.%assoc0.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(@impl.%V.loc10_14.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.%V.loc10_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%V) { // CHECK:STDOUT: %V.loc10_14.2 => constants.%V // CHECK:STDOUT: %V.patt.loc10_14.2 => constants.%V // CHECK:STDOUT: %A.loc10_27.2 => constants.%A.2 // CHECK:STDOUT: %I.type.loc10_35.2 => constants.%I.type.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.3 // CHECK:STDOUT: %F => constants.%F.3 -// CHECK:STDOUT: %interface.loc10_37.2 => constants.%interface.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(@F.2.%V) {} +// CHECK:STDOUT: specific @A(@impl.%V.loc10_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @I(@impl.%V.loc10_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%V.loc10_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%V) { // CHECK:STDOUT: %V => constants.%V // CHECK:STDOUT: %A => constants.%A.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @A(@F.2.%V) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%V, constants.%I.facet) { // CHECK:STDOUT: %U => constants.%V // CHECK:STDOUT: %I.type => constants.%I.type.3 @@ -442,8 +448,6 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%A.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%V.loc10_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%W) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%W // CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%W @@ -456,14 +460,14 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %complete_type.loc4_1.2 => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(@TestGeneric.%W.loc16_16.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @TestGeneric(constants.%W) { // CHECK:STDOUT: %W.loc16_16.2 => constants.%W // CHECK:STDOUT: %W.patt.loc16_16.2 => constants.%W // CHECK:STDOUT: %A.loc16_32.2 => constants.%A.3 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @A(@TestGeneric.%W.loc16_16.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%W) { // CHECK:STDOUT: %U.loc6_13.2 => constants.%W // CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%W @@ -482,11 +486,12 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %V.patt.loc10_14.2 => constants.%W // CHECK:STDOUT: %A.loc10_27.2 => constants.%A.3 // CHECK:STDOUT: %I.type.loc10_35.2 => constants.%I.type.4 +// CHECK:STDOUT: %require_complete => constants.%require_complete.7 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.5 // CHECK:STDOUT: %F => constants.%F.5 -// CHECK:STDOUT: %interface.loc10_37.2 => constants.%interface.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%W) { @@ -533,11 +538,12 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %V.patt.loc10_14.2 => constants.%empty_struct_type // CHECK:STDOUT: %A.loc10_27.2 => constants.%A.4 // CHECK:STDOUT: %I.type.loc10_35.2 => constants.%I.type.5 +// CHECK:STDOUT: %require_complete => constants.%complete_type.6 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.7 // CHECK:STDOUT: %F => constants.%F.7 -// CHECK:STDOUT: %interface.loc10_37.2 => constants.%interface.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%empty_struct_type) { diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index b748b2d67b94..bf688e029749 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -201,10 +201,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -218,6 +218,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { @@ -233,11 +234,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref as %HasF.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -275,22 +275,22 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%G.decl) [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] -// CHECK:STDOUT: %HasG.facet.1: %HasG.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%G.2) [template] +// CHECK:STDOUT: %HasG.facet.1: %HasG.type = facet_value %C, %impl_witness.1 [template] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template] // CHECK:STDOUT: %Self.2: %HasF.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %D, %D [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%F.1) [template] +// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %D, %impl_witness.2 [template] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (@impl.3.%G.decl) [template] // CHECK:STDOUT: %G.type.3: type = fn_type @G.3 [template] // CHECK:STDOUT: %G.3: %G.type.3 = struct_value () [template] -// CHECK:STDOUT: %HasG.facet.2: %HasG.type = facet_value %D, %D [template] -// CHECK:STDOUT: %interface.3: = interface_witness (%G.3) [template] +// CHECK:STDOUT: %HasG.facet.2: %HasG.type = facet_value %D, %impl_witness.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -305,7 +305,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %import_ref.4: type = import_ref PackageA//default, HasF, loaded [template = constants.%HasF.type] // CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst15 [no loc], unloaded // CHECK:STDOUT: %import_ref.6 = import_ref PackageA//default, loc5_9, unloaded -// CHECK:STDOUT: %import_ref.7: %F.type.2 = import_ref PackageA//default, F, loaded [template = constants.%F.2] +// CHECK:STDOUT: %import_ref.7: %F.type.1 = import_ref PackageA//default, F, loaded [template = constants.%F.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -322,15 +322,18 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, file.%HasG.decl [template = constants.%HasG.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc13: = impl_witness (@impl.1.%G.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %PackageA.ref: = name_ref PackageA, imports.%PackageA [template = imports.%PackageA] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.4 [template = constants.%HasF.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc18: = impl_witness (@impl.2.%F.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: impl_decl @impl.3 [template] {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, file.%HasG.decl [template = constants.%HasG.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc23: = impl_witness (@impl.3.%G.decl) [template = constants.%impl_witness.3] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasG { @@ -353,29 +356,26 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %HasG.ref { // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%G.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %D.ref as %HasF.ref { -// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface.2] +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.3: %D.ref as %HasG.ref { // CHECK:STDOUT: %G.decl: %G.type.3 = fn_decl @G.3 [template = constants.%G.3] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%G.decl) [template = constants.%interface.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -402,16 +402,16 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.2(constants.%Self.2: %HasF.type) [from "package_a.carbon"] { +// CHECK:STDOUT: generic fn @F.1(constants.%Self.2: %HasF.type) [from "package_a.carbon"] { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @F.2() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @G.3() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return @@ -421,9 +421,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @G.1(constants.%HasG.facet.1) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.2(constants.%Self.2) {} +// CHECK:STDOUT: specific @F.1(constants.%Self.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.2(constants.%HasF.facet) {} +// CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G.1(constants.%HasG.facet.2) {} // CHECK:STDOUT: @@ -441,9 +441,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %HasF.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, imports.%import_ref.8 [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.12) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -459,9 +459,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst15 [no loc], unloaded // CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref PackageA//default, loc5_9, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.7 = import_ref PackageA//default, F, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.10: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.11: = import_ref PackageA//default, loc11_16, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.9: = import_ref PackageA//default, loc11_16, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.10: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.11: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -490,9 +490,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: witness = (imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.9 as imports.%import_ref.10 [from "package_a.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.10 as imports.%import_ref.11 [from "package_a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "package_a.carbon"] { @@ -507,7 +507,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageA.ref.loc7: = name_ref PackageA, imports.%PackageA [template = imports.%PackageA] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.4 [template = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, imports.%import_ref.6 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -537,9 +537,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.26) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -558,23 +558,23 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst15 [no loc], unloaded // CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref PackageA//default, loc5_9, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.7 = import_ref PackageA//default, F, unloaded -// CHECK:STDOUT: %import_ref.9: = import_ref PackageA//default, loc8_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.10 = import_ref PackageA//default, inst25 [no loc], unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.12: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.13 = import_ref PackageA//default, loc11_16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, inst17 [no loc], unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref PackageB//default, loc7_9, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref PackageB//default, G, unloaded -// CHECK:STDOUT: %import_ref.17: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, loc13_25, unloaded -// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.22: = import_ref PackageB//default, loc18_25, loaded [template = constants.%interface] -// CHECK:STDOUT: %import_ref.23: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.24: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.25 = import_ref PackageB//default, loc23_16, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref PackageA//default, loc11_16, unloaded +// CHECK:STDOUT: %import_ref.10: = import_ref PackageA//default, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.11 = import_ref PackageA//default, inst25 [no loc], unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.13: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, loc13_25, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref PackageB//default, inst17 [no loc], unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref PackageB//default, loc7_9, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref PackageB//default, G, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.19: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.20: = import_ref PackageB//default, loc18_25, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.22: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.23 = import_ref PackageB//default, loc23_16, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.25: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -607,29 +607,29 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface @HasG [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.14 -// CHECK:STDOUT: .G = imports.%import_ref.15 -// CHECK:STDOUT: witness = (imports.%import_ref.16) +// CHECK:STDOUT: .Self = imports.%import_ref.15 +// CHECK:STDOUT: .G = imports.%import_ref.16 +// CHECK:STDOUT: witness = (imports.%import_ref.17) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.11 as imports.%import_ref.12 [from "package_a.carbon"] { +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.12 as imports.%import_ref.13 [from "package_a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: imports.%import_ref.17 as imports.%import_ref.18 [from "package_b.carbon"] { +// CHECK:STDOUT: impl @impl.2: imports.%import_ref.18 as imports.%import_ref.19 [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3: imports.%import_ref.20 as imports.%import_ref.21 [from "package_b.carbon"] { +// CHECK:STDOUT: impl @impl.3: imports.%import_ref.21 as imports.%import_ref.22 [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: witness = imports.%import_ref.20 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.23 as imports.%import_ref.24 [from "package_b.carbon"] { +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.24 as imports.%import_ref.25 [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: witness = imports.%import_ref.23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D [from "package_b.carbon"] { @@ -640,8 +640,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "package_a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.10 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.9 +// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestDF(%d.param_patt: %D) { @@ -650,7 +650,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageA.ref: = name_ref PackageA, imports.%PackageA [template = imports.%PackageA] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.4 [template = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, imports.%import_ref.6 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -680,9 +680,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %assoc0: %G.assoc_type = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template] // CHECK:STDOUT: %D: type = class_type @D [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.26) [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%G.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -701,23 +701,23 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %import_ref.5 = import_ref PackageB//default, inst17 [no loc], unloaded // CHECK:STDOUT: %import_ref.6: %G.assoc_type = import_ref PackageB//default, loc7_9, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.7 = import_ref PackageB//default, G, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref PackageA//default, inst15 [no loc], unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref PackageA//default, loc5_9, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref PackageA//default, F, unloaded -// CHECK:STDOUT: %import_ref.12: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.13: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.14 = import_ref PackageA//default, loc11_16, unloaded -// CHECK:STDOUT: %import_ref.15: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.16: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.17: = import_ref PackageB//default, loc13_25, loaded [template = constants.%interface] -// CHECK:STDOUT: %import_ref.18: = import_ref PackageB//default, loc10_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, inst27 [no loc], unloaded -// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.22 = import_ref PackageB//default, loc18_25, unloaded -// CHECK:STDOUT: %import_ref.23: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.24: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.25 = import_ref PackageB//default, loc23_16, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref PackageA//default, loc11_16, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref PackageA//default, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref PackageA//default, loc5_9, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref PackageA//default, F, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.14: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.15: = import_ref PackageB//default, loc13_25, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.16: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.17: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.18 = import_ref PackageB//default, loc18_25, unloaded +// CHECK:STDOUT: %import_ref.19: = import_ref PackageB//default, loc10_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.20 = import_ref PackageB//default, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.22: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.23 = import_ref PackageB//default, loc23_16, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.25: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -750,29 +750,29 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF [from "package_a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.9 -// CHECK:STDOUT: .F = imports.%import_ref.10 -// CHECK:STDOUT: witness = (imports.%import_ref.11) +// CHECK:STDOUT: .Self = imports.%import_ref.10 +// CHECK:STDOUT: .F = imports.%import_ref.11 +// CHECK:STDOUT: witness = (imports.%import_ref.12) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.12 as imports.%import_ref.13 [from "package_a.carbon"] { +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.13 as imports.%import_ref.14 [from "package_a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: imports.%import_ref.15 as imports.%import_ref.16 [from "package_b.carbon"] { +// CHECK:STDOUT: impl @impl.2: imports.%import_ref.16 as imports.%import_ref.17 [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: witness = imports.%import_ref.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3: imports.%import_ref.20 as imports.%import_ref.21 [from "package_b.carbon"] { +// CHECK:STDOUT: impl @impl.3: imports.%import_ref.21 as imports.%import_ref.22 [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: witness = imports.%import_ref.18 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.23 as imports.%import_ref.24 [from "package_b.carbon"] { +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.24 as imports.%import_ref.25 [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: witness = imports.%import_ref.23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "package_a.carbon"] { @@ -783,8 +783,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: class @D [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.19 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.18 +// CHECK:STDOUT: .Self = imports.%import_ref.20 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestCG(%c.param_patt: %C) { @@ -793,7 +793,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.ref: = name_ref PackageB, imports.%PackageB [template = imports.%PackageB] // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%import_ref.4 [template = constants.%HasG.type] // CHECK:STDOUT: %G.ref: %G.assoc_type = name_ref G, imports.%import_ref.6 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %G.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%G.2] +// CHECK:STDOUT: %impl.elem0: %G.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.2] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -823,9 +823,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %assoc0: %G.assoc_type = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.23) [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%G.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -841,20 +841,20 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %import_ref.5 = import_ref PackageB//default, inst17 [no loc], unloaded // CHECK:STDOUT: %import_ref.6: %G.assoc_type = import_ref PackageB//default, loc7_9, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.7 = import_ref PackageB//default, G, unloaded -// CHECK:STDOUT: %import_ref.9: = import_ref PackageB//default, inst35 [indirect], loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.10 = import_ref PackageB//default, inst36 [indirect], unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.12: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.13 = import_ref PackageB//default, loc13_25, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, inst53 [indirect], unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref PackageB//default, inst54 [indirect], unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref PackageB//default, F, unloaded -// CHECK:STDOUT: %import_ref.17: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, loc18_25, unloaded -// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.22: = import_ref PackageB//default, loc23_16, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.9 = import_ref PackageB//default, loc13_25, unloaded +// CHECK:STDOUT: %import_ref.10: = import_ref PackageB//default, inst35 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.11 = import_ref PackageB//default, inst36 [indirect], unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.13: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, loc18_25, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref PackageB//default, inst53 [indirect], unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref PackageB//default, inst54 [indirect], unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref PackageB//default, F, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.19: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.20: = import_ref PackageB//default, loc23_16, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.22: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -885,24 +885,24 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.14 -// CHECK:STDOUT: .F = imports.%import_ref.15 -// CHECK:STDOUT: witness = (imports.%import_ref.16) +// CHECK:STDOUT: .Self = imports.%import_ref.15 +// CHECK:STDOUT: .F = imports.%import_ref.16 +// CHECK:STDOUT: witness = (imports.%import_ref.17) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.11 as imports.%import_ref.12 [from "package_b.carbon"] { +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.12 as imports.%import_ref.13 [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: imports.%import_ref.17 as imports.%import_ref.18 [from "package_b.carbon"] { +// CHECK:STDOUT: impl @impl.2: imports.%import_ref.18 as imports.%import_ref.19 [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3: imports.%import_ref.20 as imports.%import_ref.21 [from "package_b.carbon"] { +// CHECK:STDOUT: impl @impl.3: imports.%import_ref.21 as imports.%import_ref.22 [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: witness = imports.%import_ref.20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D [from "package_b.carbon"] { @@ -913,8 +913,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "package_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.10 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.9 +// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestDG(%d.param_patt: %D) { @@ -923,7 +923,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.ref.loc7: = name_ref PackageB, imports.%PackageB [template = imports.%PackageB] // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%import_ref.4 [template = constants.%HasG.type] // CHECK:STDOUT: %G.ref: %G.assoc_type = name_ref G, imports.%import_ref.6 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %G.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%G.2] +// CHECK:STDOUT: %impl.elem0: %G.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.2] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -947,10 +947,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %H.1: %H.type.1 = struct_value () [template] // CHECK:STDOUT: %H.assoc_type: type = assoc_entity_type %Z.type, %H.type.1 [template] // CHECK:STDOUT: %assoc0: %H.assoc_type = assoc_entity element0, @Z.%H.decl [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%H.decl) [template] // CHECK:STDOUT: %H.type.2: type = fn_type @H.2 [template] // CHECK:STDOUT: %H.2: %H.type.2 = struct_value () [template] -// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %empty_tuple.type, %empty_tuple.type [template] -// CHECK:STDOUT: %interface: = interface_witness (%H.2) [template] +// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %empty_tuple.type, %impl_witness [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -963,6 +963,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [template = constants.%Z.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%H.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Z { @@ -978,11 +979,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %.loc8_7.2 as %Z.ref { // CHECK:STDOUT: %H.decl: %H.type.2 = fn_decl @H.2 [template = constants.%H.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%H.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .H = %H.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @H.1(@Z.%Self: %Z.type) { @@ -1010,9 +1010,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %H.type.1: type = fn_type @H.1 [template] // CHECK:STDOUT: %H.assoc_type: type = assoc_entity_type %Z.type, %H.type.1 [template] // CHECK:STDOUT: %assoc0: %H.assoc_type = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.9) [template] // CHECK:STDOUT: %H.type.2: type = fn_type @H.2 [template] // CHECK:STDOUT: %H.2: %H.type.2 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%H.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1024,9 +1024,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %import_ref.2 = import_ref PackageAssociatedInterface//default, inst15 [no loc], unloaded // CHECK:STDOUT: %import_ref.3: %H.assoc_type = import_ref PackageAssociatedInterface//default, loc5_9, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.4 = import_ref PackageAssociatedInterface//default, H, unloaded -// CHECK:STDOUT: %import_ref.6: type = import_ref PackageAssociatedInterface//default, loc8_7, loaded [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %import_ref.7: type = import_ref PackageAssociatedInterface//default, loc8_12, loaded [template = constants.%Z.type] -// CHECK:STDOUT: %import_ref.8: = import_ref PackageAssociatedInterface//default, loc8_14, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.6: = import_ref PackageAssociatedInterface//default, loc8_14, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.7: type = import_ref PackageAssociatedInterface//default, loc8_7, loaded [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %import_ref.8: type = import_ref PackageAssociatedInterface//default, loc8_12, loaded [template = constants.%Z.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1045,9 +1045,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.6 as imports.%import_ref.7 [from "associated_interface.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.7 as imports.%import_ref.8 [from "associated_interface.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.8 +// CHECK:STDOUT: witness = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @J() { @@ -1056,7 +1056,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageAssociatedInterface.ref: = name_ref PackageAssociatedInterface, imports.%PackageAssociatedInterface [template = imports.%PackageAssociatedInterface] // CHECK:STDOUT: %Z.ref: type = name_ref Z, imports.%import_ref.1 [template = constants.%Z.type] // CHECK:STDOUT: %H.ref: %H.assoc_type = name_ref H, imports.%import_ref.3 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %H.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%H.2] +// CHECK:STDOUT: %impl.elem0: %H.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%H.2] // CHECK:STDOUT: %H.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1179,14 +1179,14 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.2: %Y.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %K.type.1: type = fn_type @K.1 [template] // CHECK:STDOUT: %K.1: %K.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%K.decl) [template] // CHECK:STDOUT: %K.type.2: type = fn_type @K.2 [template] // CHECK:STDOUT: %K.2: %K.type.2 = struct_value () [template] -// CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.2, %AnyParam.2 [template] -// CHECK:STDOUT: %interface: = interface_witness (%K.1) [template] +// CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.2, %impl_witness [template] // CHECK:STDOUT: %L.type: type = fn_type @L [template] // CHECK:STDOUT: %L: %L.type = struct_value () [template] // CHECK:STDOUT: %AnyParam.val: %AnyParam.2 = struct_value () [template] -// CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type %Y.type, %K.type.2 [template] +// CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type %Y.type, %K.type.1 [template] // CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1202,7 +1202,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %import_ref.4: type = import_ref PackageHasParam//default, Y, loaded [template = constants.%Y.type] // CHECK:STDOUT: %import_ref.5 = import_ref PackageHasParam//default, inst40 [no loc], unloaded // CHECK:STDOUT: %import_ref.6: %K.assoc_type = import_ref PackageHasParam//default, loc7_10, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.7: %K.type.2 = import_ref PackageHasParam//default, K, loaded [template = constants.%K.2] +// CHECK:STDOUT: %import_ref.7: %K.type.1 = import_ref PackageHasParam//default, K, loaded [template = constants.%K.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1227,6 +1227,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.ref.loc8_52: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.4 [template = constants.%Y.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%K.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [template = constants.%L] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1255,12 +1256,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %AnyParam as %Y.ref { -// CHECK:STDOUT: %K.decl: %K.type.1 = fn_decl @K.1 [template = constants.%K.1] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%K.decl) [template = constants.%interface] +// CHECK:STDOUT: %K.decl: %K.type.2 = fn_decl @K.2 [template = constants.%K.2] {} {} // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .K = %K.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @AnyParam(constants.%T: type, constants.%X: %T) [from "has_param.carbon"] { @@ -1278,17 +1278,17 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @K.1() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @K.2(constants.%Self.2: %Y.type) [from "has_param.carbon"] { +// CHECK:STDOUT: generic fn @K.1(constants.%Self.2: %Y.type) [from "has_param.carbon"] { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @K.2() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @L() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %obj.var: ref %AnyParam.2 = var obj @@ -1301,7 +1301,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.ref: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.4 [template = constants.%Y.type] // CHECK:STDOUT: %K.ref: %K.assoc_type = name_ref K, imports.%import_ref.6 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %K.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%K.1] +// CHECK:STDOUT: %impl.elem0: %K.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.2] // CHECK:STDOUT: %K.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1329,9 +1329,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @K.2(constants.%Self.2) {} +// CHECK:STDOUT: specific @K.1(constants.%Self.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @K.2(constants.%Y.facet) {} +// CHECK:STDOUT: specific @K.1(constants.%Y.facet) {} // CHECK:STDOUT: // CHECK:STDOUT: --- use_generic_interface_as_param.carbon // CHECK:STDOUT: @@ -1358,9 +1358,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %K.type.1: type = fn_type @K.1 [template] // CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type %Y.type, %K.type.1 [template] // CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.14) [template] // CHECK:STDOUT: %K.type.2: type = fn_type @K.2 [template] // CHECK:STDOUT: %K.2: %K.type.2 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%K.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1380,9 +1380,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %import_ref.7 = import_ref PackageHasParam//default, inst40 [no loc], unloaded // CHECK:STDOUT: %import_ref.8: %K.assoc_type = import_ref PackageHasParam//default, loc7_10, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.9 = import_ref PackageHasParam//default, K, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref PackageGenericInterface//default, loc8_47, loaded [template = constants.%AnyParam.2] -// CHECK:STDOUT: %import_ref.12: type = import_ref PackageGenericInterface//default, loc8_67, loaded [template = constants.%Y.type] -// CHECK:STDOUT: %import_ref.13: = import_ref PackageGenericInterface//default, loc8_70, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.11: = import_ref PackageGenericInterface//default, loc8_70, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.12: type = import_ref PackageGenericInterface//default, loc8_47, loaded [template = constants.%AnyParam.2] +// CHECK:STDOUT: %import_ref.13: type = import_ref PackageGenericInterface//default, loc8_67, loaded [template = constants.%Y.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1418,9 +1418,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: witness = (imports.%import_ref.9) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.11 as imports.%import_ref.12 [from "has_generic_interface.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.12 as imports.%import_ref.13 [from "has_generic_interface.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: witness = imports.%import_ref.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @AnyParam(constants.%T: type, constants.%X: %T) [from "has_param.carbon"] { @@ -1450,7 +1450,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.ref: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.6 [template = constants.%Y.type] // CHECK:STDOUT: %K.ref: %K.assoc_type = name_ref K, imports.%import_ref.8 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %K.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%K.2] +// CHECK:STDOUT: %impl.elem0: %K.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.2] // CHECK:STDOUT: %K.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1523,10 +1523,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type, type, type, type, type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%Extra1.type, %Extra2.type, %Extra3.type, %Extra4.type, %Extra5.type, %Extra6.type, %Extra7.type, %Extra8.type) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%tuple.type.2) [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %C.2, %C.2 [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C.2, %impl_witness [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1573,6 +1573,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.type.2) [template = constants.%C.2] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra1 { @@ -1652,11 +1653,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc13_9.1: type) { @@ -1740,17 +1740,17 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %import_ref.5 = import_ref HasExtraInterfaces//default, inst63 [no loc], unloaded // CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref HasExtraInterfaces//default, loc14_21, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.7 = import_ref HasExtraInterfaces//default, F, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref HasExtraInterfaces//default, inst43 [no loc], unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref HasExtraInterfaces//default, inst39 [no loc], unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref HasExtraInterfaces//default, inst35 [no loc], unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref HasExtraInterfaces//default, inst31 [no loc], unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref HasExtraInterfaces//default, inst27 [no loc], unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref HasExtraInterfaces//default, inst23 [no loc], unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref HasExtraInterfaces//default, inst19 [no loc], unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref HasExtraInterfaces//default, inst15 [no loc], unloaded -// CHECK:STDOUT: %import_ref.17: type = import_ref HasExtraInterfaces//default, loc16_72, loaded [template = constants.%C.3] -// CHECK:STDOUT: %import_ref.18: type = import_ref HasExtraInterfaces//default, loc16_77, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.19 = import_ref HasExtraInterfaces//default, loc16_79, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref HasExtraInterfaces//default, loc16_79, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref HasExtraInterfaces//default, inst43 [no loc], unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref HasExtraInterfaces//default, inst39 [no loc], unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref HasExtraInterfaces//default, inst35 [no loc], unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref HasExtraInterfaces//default, inst31 [no loc], unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref HasExtraInterfaces//default, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref HasExtraInterfaces//default, inst23 [no loc], unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref HasExtraInterfaces//default, inst19 [no loc], unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref HasExtraInterfaces//default, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref HasExtraInterfaces//default, loc16_72, loaded [template = constants.%C.3] +// CHECK:STDOUT: %import_ref.19: type = import_ref HasExtraInterfaces//default, loc16_77, loaded [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1782,55 +1782,55 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra8 [from "has_extra_interfaces.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .Self = imports.%import_ref.10 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra7 [from "has_extra_interfaces.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.10 +// CHECK:STDOUT: .Self = imports.%import_ref.11 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra6 [from "has_extra_interfaces.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: .Self = imports.%import_ref.12 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra5 [from "has_extra_interfaces.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.12 +// CHECK:STDOUT: .Self = imports.%import_ref.13 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra4 [from "has_extra_interfaces.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.13 +// CHECK:STDOUT: .Self = imports.%import_ref.14 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra3 [from "has_extra_interfaces.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.14 +// CHECK:STDOUT: .Self = imports.%import_ref.15 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra2 [from "has_extra_interfaces.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.15 +// CHECK:STDOUT: .Self = imports.%import_ref.16 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra1 [from "has_extra_interfaces.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.16 +// CHECK:STDOUT: .Self = imports.%import_ref.17 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.17 as imports.%import_ref.18 [from "has_extra_interfaces.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.18 as imports.%import_ref.19 [from "has_extra_interfaces.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%T: type) [from "has_extra_interfaces.carbon"] { diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon index 723df87dde21..cd26a7fd0cb5 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon @@ -183,10 +183,10 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %I.type.3, %F.type.2 [template] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type.2 = facet_value %X, %X [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%F.3) [template] +// CHECK:STDOUT: %I.facet: %I.type.2 = facet_value %X, %impl_witness [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -216,6 +216,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %InInterfaceArgs.ref: type = name_ref InInterfaceArgs, file.%InInterfaceArgs.decl [template = constants.%InInterfaceArgs] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%InInterfaceArgs)> [template = constants.%I.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(constants.%T: type) [from "types.carbon"] { @@ -240,11 +241,10 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %X.ref as %I.type { // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.2 [template = constants.%F.3] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @InInterfaceArgs { @@ -321,9 +321,9 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %I.type.3, %F.type.2 [template] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %assoc0.3: %F.assoc_type.1 = assoc_entity element0, imports.%import_ref.13 [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.17) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -339,9 +339,9 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %import_ref.10 = import_ref Main//types, loc4_31, unloaded // CHECK:STDOUT: %import_ref.11: = import_ref Main//impl_in_interface_args, loc5_24, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.12 = import_ref Main//impl_in_interface_args, inst18 [no loc], unloaded -// CHECK:STDOUT: %import_ref.14: type = import_ref Main//impl_in_interface_args, loc7_6, loaded [template = constants.%X] -// CHECK:STDOUT: %import_ref.15: type = import_ref Main//impl_in_interface_args, loc7_28, loaded [template = constants.%I.type.3] -// CHECK:STDOUT: %import_ref.16: = import_ref Main//impl_in_interface_args, loc7_30, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.14: = import_ref Main//impl_in_interface_args, loc7_30, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//impl_in_interface_args, loc7_6, loaded [template = constants.%X] +// CHECK:STDOUT: %import_ref.16: type = import_ref Main//impl_in_interface_args, loc7_28, loaded [template = constants.%I.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -383,9 +383,9 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.14 as imports.%import_ref.15 [from "impl_in_interface_args.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.15 as imports.%import_ref.16 [from "impl_in_interface_args.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X [from "types.carbon"] { @@ -408,7 +408,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%InInterfaceArgs)> [template = constants.%I.type.3] // CHECK:STDOUT: %.loc6: %F.assoc_type.2 = specific_constant imports.%import_ref.8, @I(constants.%InInterfaceArgs) [template = constants.%assoc0.2] // CHECK:STDOUT: %F.ref: %F.assoc_type.2 = name_ref F, %.loc6 [template = constants.%assoc0.2] -// CHECK:STDOUT: %impl.elem0: %F.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%F.3] +// CHECK:STDOUT: %impl.elem0: %F.type.2 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.3] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -467,10 +467,10 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %I.type.3, %F.type.2 [template] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type.2 = facet_value %C.2, %C.2 [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%F.3) [template] +// CHECK:STDOUT: %I.facet: %I.type.2 = facet_value %C.2, %impl_witness [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -504,6 +504,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %X.ref: type = name_ref X, imports.%import_ref.3 [template = constants.%X] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%X)> [template = constants.%I.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(constants.%T: type) [from "types.carbon"] { @@ -528,11 +529,10 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %I.type { // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.2 [template = constants.%F.3] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @InClassArgs { @@ -635,9 +635,9 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %I.type.3, %F.type.2 [template] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, imports.%import_ref.12 [template] // CHECK:STDOUT: %assoc0.3: %F.assoc_type.1 = assoc_entity element0, imports.%import_ref.15 [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.19) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -655,9 +655,9 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %import_ref.12 = import_ref Main//types, loc4_31, unloaded // CHECK:STDOUT: %import_ref.13: = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.14 = import_ref Main//types, inst54 [no loc], unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Main//impl_in_class_args, loc7_19, loaded [template = constants.%C.2] -// CHECK:STDOUT: %import_ref.17: type = import_ref Main//impl_in_class_args, loc7_27, loaded [template = constants.%I.type.3] -// CHECK:STDOUT: %import_ref.18: = import_ref Main//impl_in_class_args, loc7_29, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.16: = import_ref Main//impl_in_class_args, loc7_29, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.17: type = import_ref Main//impl_in_class_args, loc7_19, loaded [template = constants.%C.2] +// CHECK:STDOUT: %import_ref.18: type = import_ref Main//impl_in_class_args, loc7_27, loaded [template = constants.%I.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -703,9 +703,9 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.16 as imports.%import_ref.17 [from "impl_in_class_args.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.17 as imports.%import_ref.18 [from "impl_in_class_args.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: witness = imports.%import_ref.16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%T: type) [from "types.carbon"] { @@ -741,7 +741,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%X)> [template = constants.%I.type.3] // CHECK:STDOUT: %.loc6_34: %F.assoc_type.2 = specific_constant imports.%import_ref.10, @I(constants.%X) [template = constants.%assoc0.2] // CHECK:STDOUT: %F.ref: %F.assoc_type.2 = name_ref F, %.loc6_34 [template = constants.%assoc0.2] -// CHECK:STDOUT: %impl.elem0: %F.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%F.3] +// CHECK:STDOUT: %impl.elem0: %F.type.2 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.3] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/transitive.carbon b/toolchain/check/testdata/impl/lookup/transitive.carbon index 4131827c5d13..10d8339142c0 100644 --- a/toolchain/check/testdata/impl/lookup/transitive.carbon +++ b/toolchain/check/testdata/impl/lookup/transitive.carbon @@ -98,10 +98,10 @@ fn Call() { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.1) [template] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -112,7 +112,7 @@ fn Call() { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.2 = import_ref Main//i, inst17 [no loc], unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Main//i, loc4_21, unloaded -// CHECK:STDOUT: %import_ref.4: %F.type.2 = import_ref Main//i, F, loaded [template = constants.%F.2] +// CHECK:STDOUT: %import_ref.4: %F.type.1 = import_ref Main//i, F, loaded [template = constants.%F.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -128,6 +128,7 @@ fn Call() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.1 [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I [from "i.carbon"] { @@ -138,12 +139,11 @@ fn Call() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref as %I.ref { -// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] +// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -154,19 +154,19 @@ fn Call() { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.2(constants.%Self: %I.type) [from "i.carbon"] { +// CHECK:STDOUT: generic fn @F.1(constants.%Self: %I.type) [from "i.carbon"] { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.2(constants.%Self) {} +// CHECK:STDOUT: fn @F.2() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.2(constants.%I.facet) {} +// CHECK:STDOUT: specific @F.1(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%I.facet) {} // CHECK:STDOUT: // CHECK:STDOUT: --- get.carbon // CHECK:STDOUT: @@ -230,9 +230,9 @@ fn Call() { // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, imports.%import_ref.8 [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.12) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -247,9 +247,9 @@ fn Call() { // CHECK:STDOUT: %import_ref.5 = import_ref Main//i, inst17 [no loc], unloaded // CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref Main//i, loc4_21, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.7 = import_ref Main//i, F, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//c, loc7_6, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//c, loc7_11, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.11: = import_ref Main//c, loc7_13, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.9: = import_ref Main//c, loc7_13, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//c, loc7_6, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//c, loc7_11, loaded [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -271,9 +271,9 @@ fn Call() { // CHECK:STDOUT: witness = (imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.9 as imports.%import_ref.10 [from "c.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.10 as imports.%import_ref.11 [from "c.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "get.carbon"] { @@ -289,7 +289,7 @@ fn Call() { // CHECK:STDOUT: %Get.call: init %C = call %Get.ref() to %.loc9 // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.2 [template = constants.%I.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, imports.%import_ref.6 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/multiple_extend.carbon b/toolchain/check/testdata/impl/multiple_extend.carbon index afdd102bce30..2791e5bb8cd5 100644 --- a/toolchain/check/testdata/impl/multiple_extend.carbon +++ b/toolchain/check/testdata/impl/multiple_extend.carbon @@ -176,14 +176,14 @@ fn P(o: O) { // CHECK:STDOUT: %G.assoc_type: type = assoc_entity_type %HasG.type, %G.type.1 [template] // CHECK:STDOUT: %assoc0.2: %G.assoc_type = assoc_entity element0, @HasG.%G.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %impl_witness.1 [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%G.decl) [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] -// CHECK:STDOUT: %HasG.facet: %HasG.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%G.2) [template] +// CHECK:STDOUT: %HasG.facet: %HasG.type = facet_value %C, %impl_witness.2 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] @@ -243,20 +243,18 @@ fn P(o: O) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %Self.ref as %HasF.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @C.%impl_witness.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %Self.ref as %HasG.ref { // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%G.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @C.%impl_witness.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -264,10 +262,12 @@ fn P(o: O) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc13: = impl_witness (@impl.1.%F.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, file.%HasG.decl [template = constants.%HasG.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc16: = impl_witness (@impl.2.%G.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -301,19 +301,19 @@ fn P(o: O) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %F.ref.loc22: %F.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %impl.elem0.loc22: %F.type.1 = interface_witness_access constants.%interface.1, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0.loc22: %F.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc22: init %empty_tuple.type = call %impl.elem0.loc22() // CHECK:STDOUT: %c.ref.loc23: %C = name_ref c, %c // CHECK:STDOUT: %F.ref.loc23: %F.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %impl.elem0.loc23: %F.type.1 = interface_witness_access constants.%interface.1, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0.loc23: %F.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc23: init %empty_tuple.type = call %impl.elem0.loc23() // CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %G.ref.loc24: %G.assoc_type = name_ref G, @HasG.%assoc0 [template = constants.%assoc0.2] -// CHECK:STDOUT: %impl.elem0.loc24: %G.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%G.2] +// CHECK:STDOUT: %impl.elem0.loc24: %G.type.1 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%G.2] // CHECK:STDOUT: %G.call.loc24: init %empty_tuple.type = call %impl.elem0.loc24() // CHECK:STDOUT: %c.ref.loc25: %C = name_ref c, %c // CHECK:STDOUT: %G.ref.loc25: %G.assoc_type = name_ref G, @HasG.%assoc0 [template = constants.%assoc0.2] -// CHECK:STDOUT: %impl.elem0.loc25: %G.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%G.2] +// CHECK:STDOUT: %impl.elem0.loc25: %G.type.1 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%G.2] // CHECK:STDOUT: %G.call.loc25: init %empty_tuple.type = call %impl.elem0.loc25() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -342,14 +342,14 @@ fn P(o: O) { // CHECK:STDOUT: %A.assoc_type.2: type = assoc_entity_type %HasA2.type, %A.type.2 [template] // CHECK:STDOUT: %assoc0.2: %A.assoc_type.2 = assoc_entity element0, @HasA2.%A.decl [template] // CHECK:STDOUT: %D: type = class_type @D [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%A.decl) [template] // CHECK:STDOUT: %A.type.3: type = fn_type @A.3 [template] // CHECK:STDOUT: %A.3: %A.type.3 = struct_value () [template] -// CHECK:STDOUT: %HasA1.facet: %HasA1.type = facet_value %D, %D [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%A.3) [template] +// CHECK:STDOUT: %HasA1.facet: %HasA1.type = facet_value %D, %impl_witness.1 [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%A.decl) [template] // CHECK:STDOUT: %A.type.4: type = fn_type @A.4 [template] // CHECK:STDOUT: %A.4: %A.type.4 = struct_value () [template] -// CHECK:STDOUT: %HasA2.facet: %HasA2.type = facet_value %D, %D [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%A.4) [template] +// CHECK:STDOUT: %HasA2.facet: %HasA2.type = facet_value %D, %impl_witness.2 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] @@ -409,20 +409,18 @@ fn P(o: O) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %Self.ref as %HasA1.ref { // CHECK:STDOUT: %A.decl: %A.type.3 = fn_decl @A.3 [template = constants.%A.3] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%A.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @D.%impl_witness.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %Self.ref as %HasA2.ref { // CHECK:STDOUT: %A.decl: %A.type.4 = fn_decl @A.4 [template = constants.%A.4] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%A.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @D.%impl_witness.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -430,10 +428,12 @@ fn P(o: O) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [template = constants.%D] // CHECK:STDOUT: %HasA1.ref: type = name_ref HasA1, file.%HasA1.decl [template = constants.%HasA1.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc13: = impl_witness (@impl.1.%A.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [template = constants.%D] // CHECK:STDOUT: %HasA2.ref: type = name_ref HasA2, file.%HasA2.decl [template = constants.%HasA2.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc16: = impl_witness (@impl.2.%A.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -497,10 +497,10 @@ fn P(o: O) { // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %E: type = class_type @E [template] // CHECK:STDOUT: %E.elem: type = unbound_element_type %E, %B [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%I.decl) [template] // CHECK:STDOUT: %I.type.2: type = fn_type @I.2 [template] // CHECK:STDOUT: %I.2: %I.type.2 = struct_value () [template] -// CHECK:STDOUT: %HasI.facet: %HasI.type = facet_value %E, %E [template] -// CHECK:STDOUT: %interface: = interface_witness (%I.2) [template] +// CHECK:STDOUT: %HasI.facet: %HasI.type = facet_value %E, %impl_witness [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %B} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] @@ -549,11 +549,10 @@ fn P(o: O) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %Self.ref as %HasI.ref { // CHECK:STDOUT: %I.decl: %I.type.2 = fn_decl @I.2 [template = constants.%I.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%I.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @E.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { @@ -573,6 +572,7 @@ fn P(o: O) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [template = constants.%E] // CHECK:STDOUT: %HasI.ref: type = name_ref HasI, file.%HasI.decl [template = constants.%HasI.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%I.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -602,11 +602,11 @@ fn P(o: O) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %E.ref.loc20: type = name_ref E, file.%E.decl [template = constants.%E] // CHECK:STDOUT: %I.ref.loc20: %I.assoc_type = name_ref I, @HasI.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc20: %I.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%I.2] +// CHECK:STDOUT: %impl.elem0.loc20: %I.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%I.2] // CHECK:STDOUT: %I.call.loc20: init %empty_tuple.type = call %impl.elem0.loc20() // CHECK:STDOUT: %e.ref.loc21: %E = name_ref e, %e // CHECK:STDOUT: %I.ref.loc21: %I.assoc_type = name_ref I, @HasI.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc21: %I.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%I.2] +// CHECK:STDOUT: %impl.elem0.loc21: %I.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%I.2] // CHECK:STDOUT: %I.call.loc21: init %empty_tuple.type = call %impl.elem0.loc21() // CHECK:STDOUT: %E.ref.loc22: type = name_ref E, file.%E.decl [template = constants.%E] // CHECK:STDOUT: %J.ref.loc22: %J.type = name_ref J, @B.%J.decl [template = constants.%J] @@ -637,10 +637,10 @@ fn P(o: O) { // CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @HasK.%K.decl [template] // CHECK:STDOUT: %L: type = class_type @L [template] // CHECK:STDOUT: %L.elem: type = unbound_element_type %L, %Base [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%K.decl) [template] // CHECK:STDOUT: %K.type.3: type = fn_type @K.3 [template] // CHECK:STDOUT: %K.3: %K.type.3 = struct_value () [template] -// CHECK:STDOUT: %HasK.facet: %HasK.type = facet_value %L, %L [template] -// CHECK:STDOUT: %interface: = interface_witness (%K.3) [template] +// CHECK:STDOUT: %HasK.facet: %HasK.type = facet_value %L, %impl_witness [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Base} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %M.type: type = fn_type @M [template] @@ -689,11 +689,10 @@ fn P(o: O) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %Self.ref as %HasK.ref { // CHECK:STDOUT: %K.decl: %K.type.3 = fn_decl @K.3 [template = constants.%K.3] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%K.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .K = %K.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @L.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { @@ -713,6 +712,7 @@ fn P(o: O) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%L [template = constants.%L] // CHECK:STDOUT: %HasK.ref: type = name_ref HasK, file.%HasK.decl [template = constants.%HasK.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%K.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -774,14 +774,14 @@ fn P(o: O) { // CHECK:STDOUT: %assoc0.2: %N.assoc_type.2 = assoc_entity element0, @HasN2.%N.decl [template] // CHECK:STDOUT: %O: type = class_type @O [template] // CHECK:STDOUT: %O.elem: type = unbound_element_type %O, %NBase [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%N.decl) [template] // CHECK:STDOUT: %N.type.4: type = fn_type @N.4 [template] // CHECK:STDOUT: %N.4: %N.type.4 = struct_value () [template] -// CHECK:STDOUT: %HasN1.facet: %HasN1.type = facet_value %O, %O [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%N.4) [template] +// CHECK:STDOUT: %HasN1.facet: %HasN1.type = facet_value %O, %impl_witness.1 [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%N.decl) [template] // CHECK:STDOUT: %N.type.5: type = fn_type @N.5 [template] // CHECK:STDOUT: %N.5: %N.type.5 = struct_value () [template] -// CHECK:STDOUT: %HasN2.facet: %HasN2.type = facet_value %O, %O [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%N.5) [template] +// CHECK:STDOUT: %HasN2.facet: %HasN2.type = facet_value %O, %impl_witness.2 [template] // CHECK:STDOUT: %N.type.6: type = fn_type @N.6 [template] // CHECK:STDOUT: %N.6: %N.type.6 = struct_value () [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %NBase} [template] @@ -845,20 +845,18 @@ fn P(o: O) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %Self.ref as %HasN1.ref { // CHECK:STDOUT: %N.decl: %N.type.4 = fn_decl @N.4 [template = constants.%N.4] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%N.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .N = %N.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @O.%impl_witness.loc18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %Self.ref as %HasN2.ref { // CHECK:STDOUT: %N.decl: %N.type.5 = fn_decl @N.5 [template = constants.%N.5] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%N.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .N = %N.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @O.%impl_witness.loc21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NBase { @@ -878,10 +876,12 @@ fn P(o: O) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%O [template = constants.%O] // CHECK:STDOUT: %HasN1.ref: type = name_ref HasN1, file.%HasN1.decl [template = constants.%HasN1.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc18: = impl_witness (@impl.1.%N.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%O [template = constants.%O] // CHECK:STDOUT: %HasN2.ref: type = name_ref HasN2, file.%HasN2.decl [template = constants.%HasN2.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc21: = impl_witness (@impl.2.%N.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %N.decl: %N.type.6 = fn_decl @N.6 [template = constants.%N.6] {} {} // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/basic.carbon b/toolchain/check/testdata/impl/no_prelude/basic.carbon index b5eac3f30240..722e3c451a74 100644 --- a/toolchain/check/testdata/impl/no_prelude/basic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/basic.carbon @@ -30,10 +30,10 @@ impl C as Simple { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -47,6 +47,7 @@ impl C as Simple { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { @@ -62,11 +63,10 @@ impl C as Simple { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref as %Simple.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon b/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon index a0dbffd769dd..378c379b601b 100644 --- a/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon +++ b/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon @@ -26,7 +26,7 @@ impl forall [T: type] C as I { } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -40,6 +40,7 @@ impl forall [T: type] C as I { } // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -51,10 +52,8 @@ impl forall [T: type] C as I { } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref as %I.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon b/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon index 0d08142659ce..ca15f0b3ecc4 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon +++ b/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon @@ -32,6 +32,7 @@ impl AC as AI {} // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -51,6 +52,7 @@ impl AC as AI {} // CHECK:STDOUT: %AC.ref.loc17: type = name_ref AC, file.%AC [template = constants.%C] // CHECK:STDOUT: %AI.ref.loc17: type = name_ref AI, file.%AI [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %AC.ref.loc25: type = name_ref AC, file.%AC [template = constants.%C] // CHECK:STDOUT: %AI.ref.loc25: type = name_ref AI, file.%AI [template = constants.%I.type] @@ -67,7 +69,7 @@ impl AC as AI {} // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %AC.ref.loc17 as %AI.ref.loc17 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = .inst30.loc17_15 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon index a907205b5f13..cf5e9756a8f1 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon +++ b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon @@ -21,7 +21,7 @@ impl true as I {} // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %true: bool = bool_literal true [template] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -34,6 +34,7 @@ impl true as I {} // CHECK:STDOUT: %.loc16: type = converted %true, [template = ] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -45,9 +46,7 @@ impl true as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: as %I.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon index dce411f353de..35a2534736ed 100644 --- a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon +++ b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon @@ -79,16 +79,19 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.1: %I.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt.1: %I.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.1: type = facet_access_type %T.1 [symbolic] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (), @impl.1(%T.1) [symbolic] // CHECK:STDOUT: %T.2: %J.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt.2: %J.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.2: type = facet_access_type %T.2 [symbolic] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (), @impl.2(%T.2) [symbolic] // CHECK:STDOUT: %T.3: %K.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt.3: %K.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.3: type = facet_access_type %T.3 [symbolic] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (), @impl.3(%T.3) [symbolic] // CHECK:STDOUT: %T.4: %L.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt.4: %L.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.4: type = facet_access_type %T.4 [symbolic] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness.4: = impl_witness (), @impl.4(%T.4) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -116,6 +119,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %T.loc11_14.1: %I.type = bind_symbolic_name T, 0, %T.param.loc11 [symbolic = %T.loc11_14.2 (constants.%T.1)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc11: = impl_witness (), @impl.1(constants.%T.1) [symbolic = @impl.1.%impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: impl_decl @impl.2 [template] { // CHECK:STDOUT: %T.patt.loc12_14.1: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: %T.param_patt: %J.type = value_param_pattern %T.patt.loc12_14.1, runtime_param [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] @@ -128,6 +132,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %J.ref.loc12: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: %T.loc12_14.1: %J.type = bind_symbolic_name T, 0, %T.param.loc12 [symbolic = %T.loc12_14.2 (constants.%T.2)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc12: = impl_witness (), @impl.2(constants.%T.2) [symbolic = @impl.2.%impl_witness (constants.%impl_witness.2)] // CHECK:STDOUT: impl_decl @impl.3 [template] { // CHECK:STDOUT: %T.patt.loc13_14.1: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: %T.param_patt: %K.type = value_param_pattern %T.patt.loc13_14.1, runtime_param [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] @@ -140,6 +145,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %K.ref.loc13: type = name_ref K, file.%K.decl [template = constants.%K.type] // CHECK:STDOUT: %T.loc13_14.1: %K.type = bind_symbolic_name T, 0, %T.param.loc13 [symbolic = %T.loc13_14.2 (constants.%T.3)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc13: = impl_witness (), @impl.3(constants.%T.3) [symbolic = @impl.3.%impl_witness (constants.%impl_witness.3)] // CHECK:STDOUT: impl_decl @impl.4 [template] { // CHECK:STDOUT: %T.patt.loc14_14.1: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] // CHECK:STDOUT: %T.param_patt: %L.type = value_param_pattern %T.patt.loc14_14.1, runtime_param [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] @@ -152,6 +158,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %L.ref.loc14: type = name_ref L, file.%L.decl [template = constants.%L.type] // CHECK:STDOUT: %T.loc14_14.1: %L.type = bind_symbolic_name T, 0, %T.param.loc14 [symbolic = %T.loc14_14.2 (constants.%T.4)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc14: = impl_witness (), @impl.4(constants.%T.4) [symbolic = @impl.4.%impl_witness (constants.%impl_witness.4)] // CHECK:STDOUT: impl_decl @impl.1 [template] { // CHECK:STDOUT: %T.patt.loc11_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc11_14.1, runtime_param [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] @@ -246,14 +253,13 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.loc11_14.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc11_14.2 (constants.%T.1)] // CHECK:STDOUT: %T.patt.loc11_14.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: %T.as_type.loc11_21.2: type = facet_access_type %T.loc11_14.2 [symbolic = %T.as_type.loc11_21.2 (constants.%T.as_type.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.1(%T.loc11_14.2) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc11 as %Interface.ref.loc11 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -261,14 +267,13 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.loc12_14.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.2 (constants.%T.2)] // CHECK:STDOUT: %T.patt.loc12_14.2: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: %T.as_type.loc12_21.2: type = facet_access_type %T.loc12_14.2 [symbolic = %T.as_type.loc12_21.2 (constants.%T.as_type.2)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.2(%T.loc12_14.2) [symbolic = %impl_witness (constants.%impl_witness.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc12 as %Interface.ref.loc12 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -276,14 +281,13 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.loc13_14.2: %K.type = bind_symbolic_name T, 0 [symbolic = %T.loc13_14.2 (constants.%T.3)] // CHECK:STDOUT: %T.patt.loc13_14.2: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: %T.as_type.loc13_21.2: type = facet_access_type %T.loc13_14.2 [symbolic = %T.as_type.loc13_21.2 (constants.%T.as_type.3)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.3(%T.loc13_14.2) [symbolic = %impl_witness (constants.%impl_witness.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc13 as %Interface.ref.loc13 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -291,14 +295,13 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.loc14_14.2: %L.type = bind_symbolic_name T, 0 [symbolic = %T.loc14_14.2 (constants.%T.4)] // CHECK:STDOUT: %T.patt.loc14_14.2: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] // CHECK:STDOUT: %T.as_type.loc14_21.2: type = facet_access_type %T.loc14_14.2 [symbolic = %T.as_type.loc14_21.2 (constants.%T.as_type.4)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.4(%T.loc14_14.2) [symbolic = %impl_witness (constants.%impl_witness.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc14 as %Interface.ref.loc14 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -306,26 +309,38 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.loc11_14.2 => constants.%T.1 // CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%T.1 // CHECK:STDOUT: %T.as_type.loc11_21.2 => constants.%T.as_type.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%T.loc11_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T.2) { // CHECK:STDOUT: %T.loc12_14.2 => constants.%T.2 // CHECK:STDOUT: %T.patt.loc12_14.2 => constants.%T.2 // CHECK:STDOUT: %T.as_type.loc12_21.2 => constants.%T.as_type.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(%T.loc12_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.3(constants.%T.3) { // CHECK:STDOUT: %T.loc13_14.2 => constants.%T.3 // CHECK:STDOUT: %T.patt.loc13_14.2 => constants.%T.3 // CHECK:STDOUT: %T.as_type.loc13_21.2 => constants.%T.as_type.3 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.3 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(%T.loc13_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.4(constants.%T.4) { // CHECK:STDOUT: %T.loc14_14.2 => constants.%T.4 // CHECK:STDOUT: %T.patt.loc14_14.2 => constants.%T.4 // CHECK:STDOUT: %T.as_type.loc14_21.2 => constants.%T.as_type.4 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.4 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.4(%T.loc14_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_same_self_and_interface_redefined.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -336,6 +351,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T: %I.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: %I.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -357,6 +373,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %T.loc7_14.1: %I.type = bind_symbolic_name T, 0, %T.param.loc7 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] // CHECK:STDOUT: impl_decl @impl [template] { // CHECK:STDOUT: %T.patt.loc7_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc7_14.1, runtime_param [symbolic = %T.patt.loc7_14.2 (constants.%T.patt)] @@ -391,12 +408,13 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.loc7_14.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc7_14.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.as_type.loc7_21.2: type = facet_access_type %T.loc7_14.2 [symbolic = %T.as_type.loc7_21.2 (constants.%T.as_type)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl(%T.loc7_14.2) [symbolic = %impl_witness (constants.%impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc7 as %J.ref.loc7 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = .inst38.loc7_28 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -404,15 +422,18 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.loc7_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc7_14.2 => constants.%T // CHECK:STDOUT: %T.as_type.loc7_21.2 => constants.%T.as_type +// CHECK:STDOUT: %impl_witness => constants.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc7_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: --- same_type_different_spelling.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (type, type) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%C, %C) [template] @@ -429,6 +450,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc13: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref.loc14_7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc14_10: type = name_ref C, file.%C.decl [template = constants.%C] @@ -439,6 +461,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %tuple.elem0: type = tuple_access %.loc14_11.2, element0 [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc14: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -450,17 +473,13 @@ impl (C, C).0 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %I.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %tuple.elem0 as %I.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; diff --git a/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon b/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon index 94272ad3fabb..bce6db755d02 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon @@ -98,11 +98,11 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %require_complete.1: = require_complete_type %iN.builtin [symbolic] // CHECK:STDOUT: %complete_type: = complete_type_witness %iN.builtin [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(%N) [symbolic] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2, @impl(%N) [symbolic] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %require_complete.2: = require_complete_type %MyInt [symbolic] -// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt, %MyInt [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%Op.2) [symbolic] +// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt, %impl_witness [symbolic] // CHECK:STDOUT: %Double.type: type = fn_type @Double [template] // CHECK:STDOUT: %Double: %Double.type = struct_value () [template] // CHECK:STDOUT: } @@ -170,6 +170,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc15_14.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc15_14.2 (constants.%N)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(constants.%N) [symbolic = @impl.%impl_witness (constants.%impl_witness)] // CHECK:STDOUT: %Double.decl: %Double.type = fn_decl @Double [template = constants.%Double] { // CHECK:STDOUT: %N.patt.loc19_11.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc19_11.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc19_11.1, runtime_param [symbolic = %N.patt.loc19_11.2 (constants.%N.patt)] @@ -243,12 +244,12 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %N.loc15_14.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc15_14.2 (constants.%N)] // CHECK:STDOUT: %N.patt.loc15_14.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc15_14.2 (constants.%N.patt)] // CHECK:STDOUT: %MyInt.loc15_39.2: type = class_type @MyInt, @MyInt(%N.loc15_14.2) [symbolic = %MyInt.loc15_39.2 (constants.%MyInt)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%Op.decl), @impl(%N.loc15_14.2) [symbolic = %impl_witness (constants.%impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N.loc15_14.2) [symbolic = %Op.type (constants.%Op.type.2)] // CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.2) = struct_value () [symbolic = %Op (constants.%Op.2)] // CHECK:STDOUT: %require_complete: = require_complete_type @impl.%MyInt.loc15_39.2 (%MyInt) [symbolic = %require_complete (constants.%require_complete.2)] -// CHECK:STDOUT: %interface.loc15_48.2: = interface_witness (%Op) [symbolic = %interface.loc15_48.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %MyInt.loc15_39.1 as %Add.ref { // CHECK:STDOUT: %Op.decl: @impl.%Op.type (%Op.type.2) = fn_decl @Op.2 [symbolic = @impl.%Op (constants.%Op.2)] { @@ -269,11 +270,10 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.param: ref @Op.2.%MyInt (%MyInt) = out_param runtime_param2 // CHECK:STDOUT: %return: ref @Op.2.%MyInt (%MyInt) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface.loc15_48.1: = interface_witness (%Op.decl) [symbolic = %interface.loc15_48.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface.loc15_48.1 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -336,7 +336,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %x.ref.loc20_10: @Double.%MyInt.loc19_39.2 (%MyInt) = name_ref x, %x // CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type] // CHECK:STDOUT: %Op.ref: %Op.assoc_type = name_ref Op, @Add.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %Op.type.1 = interface_witness_access constants.%interface, element0 [symbolic = %Op (constants.%Op.2)] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness, element0 [symbolic = %Op (constants.%Op.2)] // CHECK:STDOUT: %Op.bound: = bound_method %x.ref.loc20_10, %impl.elem0 // CHECK:STDOUT: %x.ref.loc20_21: @Double.%MyInt.loc19_39.2 (%MyInt) = name_ref x, %x // CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.bound, @Op.2(constants.%N) @@ -362,21 +362,21 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt(@impl.%N.loc15_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%N) { // CHECK:STDOUT: %N.loc15_14.2 => constants.%N // CHECK:STDOUT: %N.patt.loc15_14.2 => constants.%N // CHECK:STDOUT: %MyInt.loc15_39.2 => constants.%MyInt +// CHECK:STDOUT: %impl_witness => constants.%impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Op.type => constants.%Op.type.2 // CHECK:STDOUT: %Op => constants.%Op.2 // CHECK:STDOUT: %require_complete => constants.%require_complete.2 -// CHECK:STDOUT: %interface.loc15_48.2 => constants.%interface // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt(@Op.2.%N) {} +// CHECK:STDOUT: specific @MyInt(@impl.%N.loc15_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%N.loc15_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N @@ -385,21 +385,21 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(@Op.2.%N) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%Add.facet) { // CHECK:STDOUT: %Self => constants.%Add.facet // CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%MyInt // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%N.loc15_14.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt(@Double.%N.loc19_11.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @Double(constants.%N) { // CHECK:STDOUT: %N.loc19_11.2 => constants.%N // CHECK:STDOUT: %N.patt.loc19_11.2 => constants.%N // CHECK:STDOUT: %MyInt.loc19_39.2 => constants.%MyInt // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(@Double.%N.loc19_11.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@Double.%N.loc19_11.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- use_generic_impl.carbon @@ -425,13 +425,14 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] // CHECK:STDOUT: %Op.assoc_type: type = assoc_entity_type %Add.type, %Op.type.1 [template] // CHECK:STDOUT: %assoc0: %Op.assoc_type = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (imports.%import_ref.16), @impl(%N) [symbolic] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2, @impl(%N) [symbolic] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %require_complete.2: = require_complete_type %MyInt.1 [symbolic] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.2) [symbolic] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (imports.%import_ref.16), @impl(%int_64) [template] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (imports.%import_ref.17), @impl(%N) [symbolic] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.2, @impl(%int_64) [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %CallImportedDouble.type: type = fn_type @CallImportedDouble [template] // CHECK:STDOUT: %CallImportedDouble: %CallImportedDouble.type = struct_value () [template] // CHECK:STDOUT: %Double.type: type = fn_type @Double [template] @@ -450,9 +451,10 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %import_ref.9 = import_ref Main//generic_impl, inst15 [no loc], unloaded // CHECK:STDOUT: %import_ref.10: %Op.assoc_type = import_ref Main//generic_impl, loc5_41, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.11 = import_ref Main//generic_impl, Op, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Main//generic_impl, loc15_39, loaded [symbolic = @impl.%MyInt (constants.%MyInt.1)] -// CHECK:STDOUT: %import_ref.14: type = import_ref Main//generic_impl, loc15_44, loaded [template = constants.%Add.type] -// CHECK:STDOUT: %import_ref.15: = import_ref Main//generic_impl, loc15_48, loaded [symbolic = @impl.%interface (constants.%interface.1)] +// CHECK:STDOUT: %import_ref.13: = import_ref Main//generic_impl, loc15_48, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.3)] +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//generic_impl, loc15_39, loaded [symbolic = @impl.%MyInt (constants.%MyInt.1)] +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//generic_impl, loc15_44, loaded [template = constants.%Add.type] +// CHECK:STDOUT: %import_ref.16: @impl.%Op.type (%Op.type.2) = import_ref Main//generic_impl, loc16_42, loaded [symbolic = @impl.%Op (constants.%Op.2)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -517,16 +519,16 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] // CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.16), @impl(%N) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N) [symbolic = %Op.type (constants.%Op.type.2)] // CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.2) = struct_value () [symbolic = %Op (constants.%Op.2)] // CHECK:STDOUT: %require_complete: = require_complete_type @impl.%MyInt (%MyInt.1) [symbolic = %require_complete (constants.%require_complete.2)] -// CHECK:STDOUT: %interface: = interface_witness (%Op) [symbolic = %interface (constants.%interface.1)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: witness = imports.%import_ref.13 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -551,7 +553,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %x.ref.loc9_10: %MyInt.2 = name_ref x, %x // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%Add.type] // CHECK:STDOUT: %Op.ref: %Op.assoc_type = name_ref Op, imports.%import_ref.10 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %Op.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.3] // CHECK:STDOUT: %Op.bound: = bound_method %x.ref.loc9_10, %impl.elem0 // CHECK:STDOUT: %x.ref.loc9_21: %MyInt.2 = name_ref x, %x // CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.bound, @Op.2(constants.%int_64) @@ -626,20 +628,20 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt(@impl.%N) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N // CHECK:STDOUT: %MyInt => constants.%MyInt.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Op.type => constants.%Op.type.2 // CHECK:STDOUT: %Op => constants.%Op.2 // CHECK:STDOUT: %require_complete => constants.%require_complete.2 -// CHECK:STDOUT: %interface => constants.%interface.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(@impl.%N) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(%N) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @MyInt(@Op.2.%N) {} @@ -655,12 +657,12 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %N => constants.%int_64 // CHECK:STDOUT: %N.patt => constants.%int_64 // CHECK:STDOUT: %MyInt => constants.%MyInt.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Op.type => constants.%Op.type.3 // CHECK:STDOUT: %Op => constants.%Op.3 // CHECK:STDOUT: %require_complete => constants.%complete_type.2 -// CHECK:STDOUT: %interface => constants.%interface.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.2(constants.%int_64) { diff --git a/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon b/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon index 64f78a0faa33..244f4527d62a 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon @@ -43,10 +43,10 @@ fn G(c: C) { // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } @@ -73,11 +73,10 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %Self.ref as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @C.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -85,6 +84,7 @@ fn G(c: C) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -121,9 +121,9 @@ fn G(c: C) { // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.13) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -135,9 +135,9 @@ fn G(c: C) { // CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_impl_library, inst15 [no loc], unloaded // CHECK:STDOUT: %import_ref.7: %F.assoc_type = import_ref Main//extend_impl_library, loc5_9, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.8 = import_ref Main//extend_impl_library, F, unloaded -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//extend_impl_library, loc9_15, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//extend_impl_library, loc9_18, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.12: = import_ref Main//extend_impl_library, loc9_20, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.10: = import_ref Main//extend_impl_library, loc9_20, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//extend_impl_library, loc9_15, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//extend_impl_library, loc9_18, loaded [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -164,9 +164,9 @@ fn G(c: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.10 as imports.%import_ref.11 [from "extend_impl_library.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.11 as imports.%import_ref.12 [from "extend_impl_library.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.12 +// CHECK:STDOUT: witness = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "extend_impl_library.carbon"] { @@ -180,11 +180,11 @@ fn G(c: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %F.ref.loc7: %F.assoc_type = name_ref F, imports.%import_ref.7 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc7: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0.loc7: %F.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc7: init %empty_tuple.type = call %impl.elem0.loc7() // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %F.ref.loc8: %F.assoc_type = name_ref F, imports.%import_ref.7 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc8: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0.loc8: %F.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc8: init %empty_tuple.type = call %impl.elem0.loc8() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon index 625b71a12dfc..4e3c7bf12c79 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon @@ -108,9 +108,12 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %I.generic: %I.type.1 = struct_value () [template] // CHECK:STDOUT: %I.type.2: type = facet_type <@I, @I(%T)> [symbolic] // CHECK:STDOUT: %Self: %I.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %I.type.2 [symbolic] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (), @impl.1(%T) [symbolic] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] // CHECK:STDOUT: %I.type.3: type = facet_type <@I, @I(%ptr)> [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %I.type.3 [symbolic] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (), @impl.2(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -137,6 +140,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param.loc8: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param.loc8 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc8: = impl_witness (), @impl.1(constants.%T) [symbolic = @impl.1.%impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: impl_decl @impl.1 [template] { // CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc8_14.1, runtime_param [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] @@ -160,6 +164,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc12_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc12: = impl_witness (), @impl.2(constants.%T) [symbolic = @impl.2.%impl_witness (constants.%impl_witness.2)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(%T.loc5_13.1: type) { @@ -183,14 +188,14 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] // CHECK:STDOUT: %I.type.loc8_32.2: type = facet_type <@I, @I(%T.loc8_14.2)> [symbolic = %I.type.loc8_32.2 (constants.%I.type.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.1.%I.type.loc8_32.2 (%I.type.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.1(%T.loc8_14.2) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref.loc8 as %I.type.loc8_32.1 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc8 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -199,14 +204,14 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.patt.loc12_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt)] // CHECK:STDOUT: %ptr.loc12_32.2: type = ptr_type @impl.2.%T.loc12_14.2 (%T) [symbolic = %ptr.loc12_32.2 (constants.%ptr)] // CHECK:STDOUT: %I.type.loc12_33.2: type = facet_type <@I, @I(%ptr.loc12_32.2)> [symbolic = %I.type.loc12_33.2 (constants.%I.type.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.2.%I.type.loc12_33.2 (%I.type.3) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.2(%T.loc12_14.2) [symbolic = %impl_witness (constants.%impl_witness.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc12_33.1 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -229,14 +234,18 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I(%T.loc5_13.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.1.%T.loc8_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.1(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: %I.type.loc8_32.2 => constants.%I.type.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @I(@impl.1.%T.loc8_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%T.loc8_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%ptr) { // CHECK:STDOUT: %T.loc5_13.2 => constants.%ptr // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%ptr @@ -246,15 +255,19 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %Self.2 => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.2.%ptr.loc12_32.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T) { // CHECK:STDOUT: %T.loc12_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc12_14.2 => constants.%T // CHECK:STDOUT: %ptr.loc12_32.2 => constants.%ptr // CHECK:STDOUT: %I.type.loc12_33.2 => constants.%I.type.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @I(@impl.2.%ptr.loc12_32.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(%T.loc12_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_generic.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -267,23 +280,30 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %I.type.2 [symbolic] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (), @impl.1(%T) [symbolic] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] // CHECK:STDOUT: %I.type.3: type = facet_type <@I, @I(%ptr)> [symbolic] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %I.type.3 [symbolic] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (), @impl.2(%T) [symbolic] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (), @impl.3(%T) [symbolic] +// CHECK:STDOUT: %impl_witness.4: = impl_witness (), @impl.4(%T) [symbolic] +// CHECK:STDOUT: %impl_witness.5: = impl_witness (), @impl.5(%T) [symbolic] +// CHECK:STDOUT: %impl_witness.6: = impl_witness (), @impl.6(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//import_generic, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: %I.type.1 = import_ref Main//import_generic, I, loaded [template = constants.%I.generic] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst31 [no loc], unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref Main//import_generic, loc4_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst14 [no loc], unloaded -// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, loc8_24, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, loc8_32, loaded [symbolic = @impl.1.%I.type (constants.%I.type.2)] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//import_generic, loc9_34, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, loc12_24, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//import_generic, loc12_33, loaded [symbolic = @impl.2.%I.type (constants.%I.type.3)] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//import_generic, loc12_35, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, loc8_33, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//import_generic, inst31 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//import_generic, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//import_generic, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, loc8_24, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, loc8_32, loaded [symbolic = @impl.1.%I.type (constants.%I.type.2)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//import_generic, loc12_35, unloaded +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//import_generic, loc12_24, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//import_generic, loc12_33, loaded [symbolic = @impl.2.%I.type (constants.%I.type.3)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -304,6 +324,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc8: = impl_witness (), @impl.3(constants.%T) [symbolic = @impl.3.%impl_witness (constants.%impl_witness.3)] // CHECK:STDOUT: impl_decl @impl.4 [template] { // CHECK:STDOUT: %T.patt.loc14_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc14_14.1, runtime_param [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)] @@ -315,6 +336,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc14_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc14_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc14: = impl_witness (), @impl.4(constants.%T) [symbolic = @impl.4.%impl_witness (constants.%impl_witness.4)] // CHECK:STDOUT: impl_decl @impl.5 [template] { // CHECK:STDOUT: %T.patt.loc20_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc20_14.1, runtime_param [symbolic = %T.patt.loc20_14.2 (constants.%T.patt)] @@ -327,6 +349,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc20_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc20_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc20: = impl_witness (), @impl.5(constants.%T) [symbolic = @impl.5.%impl_witness (constants.%impl_witness.5)] // CHECK:STDOUT: impl_decl @impl.6 [template] { // CHECK:STDOUT: %T.patt.loc26_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc26_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc26_14.1, runtime_param [symbolic = %T.patt.loc26_14.2 (constants.%T.patt)] @@ -339,6 +362,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc26_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc26_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc26: = impl_witness (), @impl.6(constants.%T) [symbolic = @impl.6.%impl_witness (constants.%impl_witness.6)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(constants.%T: type) [from "import_generic.carbon"] { @@ -351,7 +375,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.4 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -360,12 +384,14 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.1.%I.type (%I.type.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.1(%T) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.6 as imports.%import_ref.7 { +// CHECK:STDOUT: impl: imports.%import_ref.7 as imports.%import_ref.8 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.8 +// CHECK:STDOUT: witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -374,12 +400,14 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: %ptr: type = ptr_type @impl.2.%T (%T) [symbolic = %ptr (constants.%ptr)] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%ptr)> [symbolic = %I.type (constants.%I.type.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.2.%I.type (%I.type.3) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.2(%T) [symbolic = %impl_witness (constants.%impl_witness.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.9 as imports.%import_ref.10 { +// CHECK:STDOUT: impl: imports.%import_ref.10 as imports.%import_ref.11 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -387,6 +415,8 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] // CHECK:STDOUT: %I.type.loc8_32.2: type = facet_type <@I, @I(%T.loc8_14.2)> [symbolic = %I.type.loc8_32.2 (constants.%I.type.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.3.%I.type.loc8_32.2 (%I.type.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.3(%T.loc8_14.2) [symbolic = %impl_witness (constants.%impl_witness.3)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc8_32.1; // CHECK:STDOUT: } @@ -395,14 +425,14 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.loc14_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc14_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)] // CHECK:STDOUT: %I.type.loc14_32.2: type = facet_type <@I, @I(%T.loc14_14.2)> [symbolic = %I.type.loc14_32.2 (constants.%I.type.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.4.%I.type.loc14_32.2 (%I.type.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.4(%T.loc14_14.2) [symbolic = %impl_witness (constants.%impl_witness.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc14_32.1 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -411,6 +441,8 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.patt.loc20_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt)] // CHECK:STDOUT: %ptr.loc20_32.2: type = ptr_type @impl.5.%T.loc20_14.2 (%T) [symbolic = %ptr.loc20_32.2 (constants.%ptr)] // CHECK:STDOUT: %I.type.loc20_33.2: type = facet_type <@I, @I(%ptr.loc20_32.2)> [symbolic = %I.type.loc20_33.2 (constants.%I.type.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.5.%I.type.loc20_33.2 (%I.type.3) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.5(%T.loc20_14.2) [symbolic = %impl_witness (constants.%impl_witness.5)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc20_33.1; // CHECK:STDOUT: } @@ -420,21 +452,21 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.patt.loc26_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc26_14.2 (constants.%T.patt)] // CHECK:STDOUT: %ptr.loc26_32.2: type = ptr_type @impl.6.%T.loc26_14.2 (%T) [symbolic = %ptr.loc26_32.2 (constants.%ptr)] // CHECK:STDOUT: %I.type.loc26_33.2: type = facet_type <@I, @I(%ptr.loc26_32.2)> [symbolic = %I.type.loc26_33.2 (constants.%I.type.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.6.%I.type.loc26_33.2 (%I.type.3) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.6(%T.loc26_14.2) [symbolic = %impl_witness (constants.%impl_witness.6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc26_33.1 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc26 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "import_generic.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%T) { @@ -448,14 +480,18 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I(%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.1.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.1(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %I.type => constants.%I.type.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @I(@impl.1.%T) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%ptr) { // CHECK:STDOUT: %T => constants.%ptr // CHECK:STDOUT: %T.patt => constants.%ptr @@ -465,49 +501,69 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.2.%ptr) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %ptr => constants.%ptr // CHECK:STDOUT: %I.type => constants.%I.type.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.3.%T.loc8_14.2) {} +// CHECK:STDOUT: specific @I(@impl.2.%ptr) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.3(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: %I.type.loc8_32.2 => constants.%I.type.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.4.%T.loc14_14.2) {} +// CHECK:STDOUT: specific @I(@impl.3.%T.loc8_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(%T.loc8_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.4(constants.%T) { // CHECK:STDOUT: %T.loc14_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc14_14.2 => constants.%T // CHECK:STDOUT: %I.type.loc14_32.2 => constants.%I.type.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.5.%ptr.loc20_32.2) {} +// CHECK:STDOUT: specific @I(@impl.4.%T.loc14_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.4(%T.loc14_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.5(constants.%T) { // CHECK:STDOUT: %T.loc20_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc20_14.2 => constants.%T // CHECK:STDOUT: %ptr.loc20_32.2 => constants.%ptr // CHECK:STDOUT: %I.type.loc20_33.2 => constants.%I.type.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.6.%ptr.loc26_32.2) {} +// CHECK:STDOUT: specific @I(@impl.5.%ptr.loc20_32.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%T.loc20_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.6(constants.%T) { // CHECK:STDOUT: %T.loc26_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc26_14.2 => constants.%T // CHECK:STDOUT: %ptr.loc26_32.2 => constants.%ptr // CHECK:STDOUT: %I.type.loc26_33.2 => constants.%I.type.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.6 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @I(@impl.6.%ptr.loc26_32.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(%T.loc26_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_generic_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -520,8 +576,12 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %J.generic: %J.type.1 = struct_value () [template] // CHECK:STDOUT: %J.type.2: type = facet_type <@J, @J(%T)> [symbolic] // CHECK:STDOUT: %Self: %J.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %J.type.2 [symbolic] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (), @impl.1(%T) [symbolic] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] // CHECK:STDOUT: %J.type.3: type = facet_type <@J, @J(%ptr)> [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %J.type.3 [symbolic] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (), @impl.2(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -548,6 +608,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc11_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc11: = impl_witness (), @impl.1(constants.%T) [symbolic = @impl.1.%impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: impl_decl @impl.2 [template] { // CHECK:STDOUT: %T.patt.loc17_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc17_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc17_14.1, runtime_param [symbolic = %T.patt.loc17_14.2 (constants.%T.patt)] @@ -560,6 +621,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc17_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc17_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (), @impl.2(constants.%T) [symbolic = @impl.2.%impl_witness (constants.%impl_witness.2)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @J(%T.loc5_13.1: type) { @@ -583,6 +645,8 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.loc11_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc11_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt)] // CHECK:STDOUT: %J.type.loc11_32.2: type = facet_type <@J, @J(%T.loc11_14.2)> [symbolic = %J.type.loc11_32.2 (constants.%J.type.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.1.%J.type.loc11_32.2 (%J.type.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.1(%T.loc11_14.2) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %D.ref as %J.type.loc11_32.1; // CHECK:STDOUT: } @@ -592,6 +656,8 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.patt.loc17_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc17_14.2 (constants.%T.patt)] // CHECK:STDOUT: %ptr.loc17_32.2: type = ptr_type @impl.2.%T.loc17_14.2 (%T) [symbolic = %ptr.loc17_32.2 (constants.%ptr)] // CHECK:STDOUT: %J.type.loc17_33.2: type = facet_type <@J, @J(%ptr.loc17_32.2)> [symbolic = %J.type.loc17_33.2 (constants.%J.type.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.2.%J.type.loc17_33.2 (%J.type.3) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.2(%T.loc17_14.2) [symbolic = %impl_witness (constants.%impl_witness.2)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %D.ref as %J.type.loc17_33.1; // CHECK:STDOUT: } @@ -615,14 +681,18 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @J(%T.loc5_13.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @J(@impl.1.%T.loc11_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.1(constants.%T) { // CHECK:STDOUT: %T.loc11_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%T // CHECK:STDOUT: %J.type.loc11_32.2 => constants.%J.type.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @J(@impl.1.%T.loc11_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%T.loc11_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @J(constants.%ptr) { // CHECK:STDOUT: %T.loc5_13.2 => constants.%ptr // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%ptr @@ -632,15 +702,19 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %Self.2 => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @J(@impl.2.%ptr.loc17_32.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T) { // CHECK:STDOUT: %T.loc17_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc17_14.2 => constants.%T // CHECK:STDOUT: %ptr.loc17_32.2 => constants.%ptr // CHECK:STDOUT: %J.type.loc17_33.2 => constants.%J.type.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @J(@impl.2.%ptr.loc17_32.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(%T.loc17_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_generic_decl.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -653,21 +727,28 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %J.type.2 [symbolic] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (), @impl.1(%T) [symbolic] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] // CHECK:STDOUT: %J.type.3: type = facet_type <@J, @J(%ptr)> [symbolic] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %J.type.3 [symbolic] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (), @impl.2(%T) [symbolic] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (), @impl.3(%T) [symbolic] +// CHECK:STDOUT: %impl_witness.4: = impl_witness (), @impl.4(%T) [symbolic] +// CHECK:STDOUT: %impl_witness.5: = impl_witness (), @impl.5(%T) [symbolic] +// CHECK:STDOUT: %impl_witness.6: = impl_witness (), @impl.6(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//import_generic_decl, D, loaded [template = constants.%D] // CHECK:STDOUT: %import_ref.2: %J.type.1 = import_ref Main//import_generic_decl, J, loaded [template = constants.%J.generic] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic_decl, inst31 [no loc], unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref Main//import_generic_decl, loc4_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic_decl, inst14 [no loc], unloaded -// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic_decl, loc11_24, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic_decl, loc11_32, loaded [symbolic = @impl.1.%J.type (constants.%J.type.2)] -// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic_decl, loc17_24, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic_decl, loc17_33, loaded [symbolic = @impl.2.%J.type (constants.%J.type.3)] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//import_generic_decl, inst31 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//import_generic_decl, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//import_generic_decl, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic_decl, loc11_24, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic_decl, loc11_32, loaded [symbolic = @impl.1.%J.type (constants.%J.type.2)] +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//import_generic_decl, loc17_24, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//import_generic_decl, loc17_33, loaded [symbolic = @impl.2.%J.type (constants.%J.type.3)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -688,6 +769,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc8: = impl_witness (), @impl.3(constants.%T) [symbolic = @impl.3.%impl_witness (constants.%impl_witness.3)] // CHECK:STDOUT: impl_decl @impl.4 [template] { // CHECK:STDOUT: %T.patt.loc14_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc14_14.1, runtime_param [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)] @@ -699,6 +781,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc14_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc14_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc14: = impl_witness (), @impl.4(constants.%T) [symbolic = @impl.4.%impl_witness (constants.%impl_witness.4)] // CHECK:STDOUT: impl_decl @impl.5 [template] { // CHECK:STDOUT: %T.patt.loc20_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc20_14.1, runtime_param [symbolic = %T.patt.loc20_14.2 (constants.%T.patt)] @@ -711,6 +794,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc20_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc20_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc20: = impl_witness (), @impl.5(constants.%T) [symbolic = @impl.5.%impl_witness (constants.%impl_witness.5)] // CHECK:STDOUT: impl_decl @impl.6 [template] { // CHECK:STDOUT: %T.patt.loc25_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc25_14.1, runtime_param [symbolic = %T.patt.loc25_14.2 (constants.%T.patt)] @@ -723,6 +807,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc25_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc25_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc25: = impl_witness (), @impl.6(constants.%T) [symbolic = @impl.6.%impl_witness (constants.%impl_witness.6)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @J(constants.%T: type) [from "fail_import_generic_decl.carbon"] { @@ -735,7 +820,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.4 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -744,8 +829,10 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: %J.type: type = facet_type <@J, @J(%T)> [symbolic = %J.type (constants.%J.type.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.1.%J.type (%J.type.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.1(%T) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.6 as imports.%import_ref.7; +// CHECK:STDOUT: impl: imports.%import_ref.7 as imports.%import_ref.8; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%T: type) [from "fail_import_generic_decl.carbon"] { @@ -753,14 +840,18 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: %ptr: type = ptr_type @impl.2.%T (%T) [symbolic = %ptr (constants.%ptr)] // CHECK:STDOUT: %J.type: type = facet_type <@J, @J(%ptr)> [symbolic = %J.type (constants.%J.type.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.2.%J.type (%J.type.3) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.2(%T) [symbolic = %impl_witness (constants.%impl_witness.2)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9; +// CHECK:STDOUT: impl: imports.%import_ref.10 as imports.%import_ref.11; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(%T.loc8_14.1: type) { // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] // CHECK:STDOUT: %J.type.loc8_32.2: type = facet_type <@J, @J(%T.loc8_14.2)> [symbolic = %J.type.loc8_32.2 (constants.%J.type.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.3.%J.type.loc8_32.2 (%J.type.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.3(%T.loc8_14.2) [symbolic = %impl_witness (constants.%impl_witness.3)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %D.ref as %J.type.loc8_32.1; // CHECK:STDOUT: } @@ -769,14 +860,14 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.loc14_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc14_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)] // CHECK:STDOUT: %J.type.loc14_32.2: type = facet_type <@J, @J(%T.loc14_14.2)> [symbolic = %J.type.loc14_32.2 (constants.%J.type.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.4.%J.type.loc14_32.2 (%J.type.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.4(%T.loc14_14.2) [symbolic = %impl_witness (constants.%impl_witness.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %D.ref as %J.type.loc14_32.1 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -785,6 +876,8 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.patt.loc20_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt)] // CHECK:STDOUT: %ptr.loc20_32.2: type = ptr_type @impl.5.%T.loc20_14.2 (%T) [symbolic = %ptr.loc20_32.2 (constants.%ptr)] // CHECK:STDOUT: %J.type.loc20_33.2: type = facet_type <@J, @J(%ptr.loc20_32.2)> [symbolic = %J.type.loc20_33.2 (constants.%J.type.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.5.%J.type.loc20_33.2 (%J.type.3) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.5(%T.loc20_14.2) [symbolic = %impl_witness (constants.%impl_witness.5)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %D.ref as %J.type.loc20_33.1; // CHECK:STDOUT: } @@ -794,21 +887,21 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %T.patt.loc25_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_14.2 (constants.%T.patt)] // CHECK:STDOUT: %ptr.loc25_32.2: type = ptr_type @impl.6.%T.loc25_14.2 (%T) [symbolic = %ptr.loc25_32.2 (constants.%ptr)] // CHECK:STDOUT: %J.type.loc25_33.2: type = facet_type <@J, @J(%ptr.loc25_32.2)> [symbolic = %J.type.loc25_33.2 (constants.%J.type.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.6.%J.type.loc25_33.2 (%J.type.3) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.6(%T.loc25_14.2) [symbolic = %impl_witness (constants.%impl_witness.6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %D.ref as %J.type.loc25_33.1 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc25 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D [from "fail_import_generic_decl.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @J(constants.%T) { @@ -822,14 +915,18 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @J(%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @J(@impl.1.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.1(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %J.type => constants.%J.type.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @J(@impl.1.%T) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @J(constants.%ptr) { // CHECK:STDOUT: %T => constants.%ptr // CHECK:STDOUT: %T.patt => constants.%ptr @@ -839,46 +936,66 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @J(@impl.2.%ptr) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %ptr => constants.%ptr // CHECK:STDOUT: %J.type => constants.%J.type.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @J(@impl.3.%T.loc8_14.2) {} +// CHECK:STDOUT: specific @J(@impl.2.%ptr) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.3(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: %J.type.loc8_32.2 => constants.%J.type.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @J(@impl.4.%T.loc14_14.2) {} +// CHECK:STDOUT: specific @J(@impl.3.%T.loc8_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(%T.loc8_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.4(constants.%T) { // CHECK:STDOUT: %T.loc14_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc14_14.2 => constants.%T // CHECK:STDOUT: %J.type.loc14_32.2 => constants.%J.type.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @J(@impl.5.%ptr.loc20_32.2) {} +// CHECK:STDOUT: specific @J(@impl.4.%T.loc14_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.4(%T.loc14_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.5(constants.%T) { // CHECK:STDOUT: %T.loc20_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc20_14.2 => constants.%T // CHECK:STDOUT: %ptr.loc20_32.2 => constants.%ptr // CHECK:STDOUT: %J.type.loc20_33.2 => constants.%J.type.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @J(@impl.6.%ptr.loc25_32.2) {} +// CHECK:STDOUT: specific @J(@impl.5.%ptr.loc20_32.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%T.loc20_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.6(constants.%T) { // CHECK:STDOUT: %T.loc25_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc25_14.2 => constants.%T // CHECK:STDOUT: %ptr.loc25_32.2 => constants.%ptr // CHECK:STDOUT: %J.type.loc25_33.2 => constants.%J.type.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.6 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @J(@impl.6.%ptr.loc25_32.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(%T.loc25_14.2) {} +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/import_self.carbon b/toolchain/check/testdata/impl/no_prelude/import_self.carbon index 13c1f1a06b6a..bf8bd300cca1 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_self.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_self.carbon @@ -107,15 +107,15 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] -// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %empty_tuple.type, %empty_tuple.type [template] -// CHECK:STDOUT: %interface: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %empty_tuple.type, %impl_witness [template] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %Op.assoc_type: type = assoc_entity_type %Add.type, %Op.type.2 [template] +// CHECK:STDOUT: %Op.assoc_type: type = assoc_entity_type %Add.type, %Op.type.1 [template] // CHECK:STDOUT: %assoc0: %Op.assoc_type = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -123,7 +123,7 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, Add, loaded [template = constants.%Add.type] // CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst15 [no loc], unloaded // CHECK:STDOUT: %import_ref.3: %Op.assoc_type = import_ref Main//a, loc5_41, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Main//a, Op, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.4: %Op.type.1 = import_ref Main//a, Op, loaded [template = constants.%Op.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -137,6 +137,7 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%Add.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %x.patt: %empty_tuple.type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_tuple.type = value_param_pattern %x.patt, runtime_param0 @@ -172,7 +173,7 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %.loc6_7.2 as %Add.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %empty_tuple.type = binding_pattern self // CHECK:STDOUT: %self.param_patt: %empty_tuple.type = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %empty_tuple.type = binding_pattern other @@ -190,14 +191,20 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param2 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %empty_tuple.type](%other.param_patt: %empty_tuple.type) -> %empty_tuple.type { +// CHECK:STDOUT: generic fn @Op.1(constants.%Self: %Add.type) [from "a.carbon"] { +// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type (%Self.as_type)](%other.param_patt: @Op.1.%Self.as_type (%Self.as_type)) -> @Op.1.%Self.as_type (%Self.as_type); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %empty_tuple.type](%other.param_patt: %empty_tuple.type) -> %empty_tuple.type { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc7_52: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] @@ -205,19 +212,12 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: return %.loc7_53 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %Add.type) [from "a.carbon"] { -// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self.as_type (%Self.as_type)](%other.param_patt: @Op.2.%Self.as_type (%Self.as_type)) -> @Op.2.%Self.as_type (%Self.as_type); -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: fn @F(%x.param_patt: %empty_tuple.type, %y.param_patt: %empty_tuple.type) -> %empty_tuple.type { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, %x // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%Add.type] // CHECK:STDOUT: %Op.ref: %Op.assoc_type = name_ref Op, imports.%import_ref.3 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %x.ref, %impl.elem0 // CHECK:STDOUT: %y.ref: %empty_tuple.type = name_ref y, %y // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%x.ref, %y.ref) @@ -228,12 +228,12 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: return %.loc11_23 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.2(constants.%Self) { +// CHECK:STDOUT: specific @Op.1(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.2(constants.%Add.facet) { +// CHECK:STDOUT: specific @Op.1(constants.%Add.facet) { // CHECK:STDOUT: %Self => constants.%Add.facet // CHECK:STDOUT: %Self.as_type => constants.%empty_tuple.type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon index e05631774081..3f8f48c391e5 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon @@ -55,10 +55,10 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %C [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -85,6 +85,7 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc10_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_14.2 (constants.%T)] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -102,19 +103,18 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %T.loc10_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_14.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc10_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_14.2 (constants.%T.patt)] // CHECK:STDOUT: %C.loc10_27.2: type = class_type @C, @C(%T.loc10_14.2) [symbolic = %C.loc10_27.2 (constants.%C)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%T.loc10_14.2) [symbolic = %impl_witness (constants.%impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc10_14.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] -// CHECK:STDOUT: %interface.loc10_34.2: = interface_witness (%F) [symbolic = %interface.loc10_34.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.loc10_27.1 as %I.ref { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {} -// CHECK:STDOUT: %interface.loc10_34.1: = interface_witness (%F.decl) [symbolic = %interface.loc10_34.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface.loc10_34.1 +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,25 +154,25 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc10_14.2 => constants.%T // CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%T // CHECK:STDOUT: %C.loc10_27.2 => constants.%C +// CHECK:STDOUT: %impl_witness => constants.%impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 -// CHECK:STDOUT: %interface.loc10_34.2 => constants.%interface // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc10_14.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%I.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc10_14.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: --- fail_use_in_fn_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -191,12 +191,13 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, imports.%import_ref.8 [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (imports.%import_ref.12), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (imports.%import_ref.12), @impl(%empty_struct_type) [template] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (imports.%import_ref.13), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%F.3) [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.3, @F.2(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.4: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [template] @@ -210,9 +211,10 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst31 [no loc], unloaded // CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref Main//import_generic, loc7_9, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.7 = import_ref Main//import_generic, F, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, loc10_27, loaded [symbolic = @impl.%C (constants.%C.1)] -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//import_generic, loc10_32, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.11: = import_ref Main//import_generic, loc10_34, loaded [symbolic = @impl.%interface (constants.%interface.1)] +// CHECK:STDOUT: %import_ref.9: = import_ref Main//import_generic, loc10_34, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.3)] +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//import_generic, loc10_27, loaded [symbolic = @impl.%C (constants.%C.1)] +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//import_generic, loc10_32, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.12: @impl.%F.type (%F.type.2) = import_ref Main//import_generic, loc11_10, loaded [symbolic = @impl.%F (constants.%F.2)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -232,7 +234,7 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %c.ref: ref %C.2 = name_ref c, file.%c // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.2 [template = constants.%I.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, imports.%import_ref.6 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%F.3] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%F.3] // CHECK:STDOUT: %F.specific_fn: = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn() // CHECK:STDOUT: %.loc15_19.1: ref %empty_tuple.type = temporary_storage @@ -254,15 +256,15 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.1)] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.12), @impl(%T) [symbolic = %impl_witness (constants.%impl_witness.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] -// CHECK:STDOUT: %interface: = interface_witness (%F) [symbolic = %interface (constants.%interface.1)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.9 as imports.%import_ref.10 { +// CHECK:STDOUT: impl: imports.%import_ref.10 as imports.%import_ref.11 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -317,19 +319,19 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@impl.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %C => constants.%C.1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 -// CHECK:STDOUT: %interface => constants.%interface.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @C(@impl.%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @impl(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) {} @@ -338,11 +340,11 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %T => constants.%empty_struct_type // CHECK:STDOUT: %T.patt => constants.%empty_struct_type // CHECK:STDOUT: %C => constants.%C.2 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.3 // CHECK:STDOUT: %F => constants.%F.3 -// CHECK:STDOUT: %interface => constants.%interface.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%empty_struct_type) { diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index 8f22f1f3724c..e316c0d14868 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -102,10 +102,10 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %Op.assoc_type.2: type = assoc_entity_type %Action.type.3, %Op.type.2 [template] // CHECK:STDOUT: %assoc0.2: %Op.assoc_type.2 = assoc_entity element0, @Action.%Op.decl [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl) [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] -// CHECK:STDOUT: %Action.facet: %Action.type.2 = facet_value %A, %A [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Action.facet: %Action.type.2 = facet_value %A, %impl_witness [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } @@ -134,6 +134,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [template = constants.%Action.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: %A = binding_pattern a // CHECK:STDOUT: %a.param_patt: %A = value_param_pattern %a.patt, runtime_param0 @@ -170,11 +171,10 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %A.ref as %Action.type { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.2 [template = constants.%Op.3] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -219,7 +219,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [template = constants.%Action.type.3] // CHECK:STDOUT: %.loc16: %Op.assoc_type.2 = specific_constant @Action.%assoc0.loc5_10.1, @Action(constants.%B) [template = constants.%assoc0.2] // CHECK:STDOUT: %Op.ref: %Op.assoc_type.2 = name_ref Op, %.loc16 [template = constants.%assoc0.2] -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.2 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.3] // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -274,9 +274,9 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %assoc0.3: %Op.assoc_type.1 = assoc_entity element0, imports.%import_ref.19 [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.20) [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%Op.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -285,16 +285,16 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %import_ref.3: type = import_ref Main//action, B, loaded [template = constants.%B] // CHECK:STDOUT: %import_ref.4 = import_ref Main//action, C, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Main//action, F, unloaded -// CHECK:STDOUT: %import_ref.6: = import_ref Main//action, loc9_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst46 [no loc], unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst26 [no loc], unloaded -// CHECK:STDOUT: %import_ref.9: @Action.%Op.assoc_type (%Op.assoc_type.1) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.3)] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, Op, unloaded -// CHECK:STDOUT: %import_ref.11: = import_ref Main//action, loc8_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst41 [no loc], unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Main//action, loc12_6, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.14: type = import_ref Main//action, loc12_19, loaded [template = constants.%Action.type.3] -// CHECK:STDOUT: %import_ref.15: = import_ref Main//action, loc12_21, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.6: = import_ref Main//action, loc12_21, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.7: = import_ref Main//action, loc9_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst46 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//action, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10: @Action.%Op.assoc_type (%Op.assoc_type.1) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.3)] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//action, Op, unloaded +// CHECK:STDOUT: %import_ref.12: = import_ref Main//action, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//action, inst41 [no loc], unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//action, loc12_6, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//action, loc12_19, loaded [template = constants.%Action.type.3] // CHECK:STDOUT: %import_ref.16 = import_ref Main//action, loc13_11, unloaded // CHECK:STDOUT: %import_ref.17 = import_ref Main//action, loc5_10, unloaded // CHECK:STDOUT: } @@ -334,28 +334,28 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: .Op = imports.%import_ref.9 -// CHECK:STDOUT: witness = (imports.%import_ref.10) +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .Op = imports.%import_ref.10 +// CHECK:STDOUT: witness = (imports.%import_ref.11) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.13 as imports.%import_ref.14 [from "action.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.14 as imports.%import_ref.15 [from "action.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = imports.%import_ref.16 -// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: witness = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B [from "action.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A [from "action.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.12 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.11 +// CHECK:STDOUT: .Self = imports.%import_ref.13 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.1(constants.%T: type, constants.%Self: %Action.type.2) [from "action.carbon"] { @@ -369,9 +369,9 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Action.ref: %Action.type.1 = name_ref Action, imports.%import_ref.1 [template = constants.%Action.generic] // CHECK:STDOUT: %B.ref: type = name_ref B, imports.%import_ref.3 [template = constants.%B] // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [template = constants.%Action.type.3] -// CHECK:STDOUT: %.loc4: %Op.assoc_type.2 = specific_constant imports.%import_ref.9, @Action(constants.%B) [template = constants.%assoc0.2] +// CHECK:STDOUT: %.loc4: %Op.assoc_type.2 = specific_constant imports.%import_ref.10, @Action(constants.%B) [template = constants.%assoc0.2] // CHECK:STDOUT: %Op.ref: %Op.assoc_type.2 = name_ref Op, %.loc4 [template = constants.%assoc0.2] -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.2 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.3] // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -439,16 +439,16 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %import_ref.3 = import_ref Main//action, B, unloaded // CHECK:STDOUT: %import_ref.4: type = import_ref Main//action, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.5 = import_ref Main//action, F, unloaded -// CHECK:STDOUT: %import_ref.6: = import_ref Main//action, loc9_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst46 [no loc], unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst26 [no loc], unloaded -// CHECK:STDOUT: %import_ref.9: @Action.%Op.assoc_type (%Op.assoc_type.1) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.4)] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, Op, unloaded -// CHECK:STDOUT: %import_ref.11: = import_ref Main//action, loc8_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst41 [no loc], unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Main//action, loc12_6, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.14: type = import_ref Main//action, loc12_19, loaded [template = constants.%Action.type.3] -// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, loc12_21, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//action, loc12_21, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//action, loc9_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst46 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//action, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10: @Action.%Op.assoc_type (%Op.assoc_type.1) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.4)] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//action, Op, unloaded +// CHECK:STDOUT: %import_ref.12: = import_ref Main//action, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//action, inst41 [no loc], unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//action, loc12_6, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//action, loc12_19, loaded [template = constants.%Action.type.3] // CHECK:STDOUT: %import_ref.16 = import_ref Main//action, loc13_11, unloaded // CHECK:STDOUT: %import_ref.17 = import_ref Main//action, loc5_10, unloaded // CHECK:STDOUT: %import_ref.19: = import_ref Main//action, loc10_10, loaded [template = constants.%complete_type] @@ -490,28 +490,28 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: .Op = imports.%import_ref.9 -// CHECK:STDOUT: witness = (imports.%import_ref.10) +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .Op = imports.%import_ref.10 +// CHECK:STDOUT: witness = (imports.%import_ref.11) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.13 as imports.%import_ref.14 [from "action.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.14 as imports.%import_ref.15 [from "action.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = imports.%import_ref.16 -// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: witness = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B [from "action.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A [from "action.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.12 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.11 +// CHECK:STDOUT: .Self = imports.%import_ref.13 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "action.carbon"] { @@ -531,7 +531,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Action.ref: %Action.type.1 = name_ref Action, imports.%import_ref.1 [template = constants.%Action.generic] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.4 [template = constants.%C] // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%C)> [template = constants.%Action.type.4] -// CHECK:STDOUT: %.loc8: %Op.assoc_type.3 = specific_constant imports.%import_ref.9, @Action(constants.%C) [template = constants.%assoc0.3] +// CHECK:STDOUT: %.loc8: %Op.assoc_type.3 = specific_constant imports.%import_ref.10, @Action(constants.%C) [template = constants.%assoc0.3] // CHECK:STDOUT: %Op.ref: %Op.assoc_type.3 = name_ref Op, %.loc8 [template = constants.%assoc0.3] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -593,10 +593,10 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template] // CHECK:STDOUT: %Make.assoc_type.2: type = assoc_entity_type %Factory.type.3, %Make.type.2 [template] // CHECK:STDOUT: %assoc0.2: %Make.assoc_type.2 = assoc_entity element0, @Factory.%Make.decl [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Make.decl) [template] // CHECK:STDOUT: %Make.type.3: type = fn_type @Make.2 [template] // CHECK:STDOUT: %Make.3: %Make.type.3 = struct_value () [template] -// CHECK:STDOUT: %Factory.facet: %Factory.type.2 = facet_value %A, %A [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%Make.3) [template] +// CHECK:STDOUT: %Factory.facet: %Factory.type.2 = facet_value %A, %impl_witness [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -620,6 +620,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%B)> [template = constants.%Factory.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Make.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Factory(%T.loc4_19.1: type) { @@ -662,11 +663,10 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %return.param: ref %B = out_param runtime_param0 // CHECK:STDOUT: %return: ref %B = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Make.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Make = %Make.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -746,25 +746,25 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %MakeB.type: type = fn_type @MakeB [template] // CHECK:STDOUT: %MakeB: %MakeB.type = struct_value () [template] // CHECK:STDOUT: %assoc0.3: %Make.assoc_type.1 = assoc_entity element0, imports.%import_ref.17 [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%import_ref.18) [template] // CHECK:STDOUT: %Make.type.3: type = fn_type @Make.2 [template] // CHECK:STDOUT: %Make.3: %Make.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%Make.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, Factory, loaded [template = constants.%Factory.generic] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, A, loaded [template = constants.%A] // CHECK:STDOUT: %import_ref.3: type = import_ref Main//factory, B, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.4: = import_ref Main//factory, loc9_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst52 [no loc], unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst26 [no loc], unloaded -// CHECK:STDOUT: %import_ref.7: @Factory.%Make.assoc_type (%Make.assoc_type.1) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.3)] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, Make, unloaded -// CHECK:STDOUT: %import_ref.9: = import_ref Main//factory, loc8_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst47 [no loc], unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//factory, loc11_6, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//factory, loc11_20, loaded [template = constants.%Factory.type.3] -// CHECK:STDOUT: %import_ref.13: = import_ref Main//factory, loc11_22, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//factory, loc11_22, loaded [template = constants.%impl_witness] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//factory, loc9_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst52 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//factory, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8: @Factory.%Make.assoc_type (%Make.assoc_type.1) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.3)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//factory, Make, unloaded +// CHECK:STDOUT: %import_ref.10: = import_ref Main//factory, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//factory, inst47 [no loc], unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//factory, loc11_6, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.13: type = import_ref Main//factory, loc11_20, loaded [template = constants.%Factory.type.3] // CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, loc12_17, unloaded // CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, loc5_17, unloaded // CHECK:STDOUT: } @@ -807,28 +807,28 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .Make = imports.%import_ref.7 -// CHECK:STDOUT: witness = (imports.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.7 +// CHECK:STDOUT: .Make = imports.%import_ref.8 +// CHECK:STDOUT: witness = (imports.%import_ref.9) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.11 as imports.%import_ref.12 [from "factory.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.12 as imports.%import_ref.13 [from "factory.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Make = imports.%import_ref.14 -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B [from "factory.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A [from "factory.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.10 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.9 +// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Make.1(constants.%T: type, constants.%Self: %Factory.type.2) [from "factory.carbon"] { @@ -843,9 +843,9 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Factory.ref: %Factory.type.1 = name_ref Factory, imports.%import_ref.1 [template = constants.%Factory.generic] // CHECK:STDOUT: %B.ref.loc5: type = name_ref B, imports.%import_ref.3 [template = constants.%B] // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%B)> [template = constants.%Factory.type.3] -// CHECK:STDOUT: %.loc5: %Make.assoc_type.2 = specific_constant imports.%import_ref.7, @Factory(constants.%B) [template = constants.%assoc0.2] +// CHECK:STDOUT: %.loc5: %Make.assoc_type.2 = specific_constant imports.%import_ref.8, @Factory(constants.%B) [template = constants.%assoc0.2] // CHECK:STDOUT: %Make.ref: %Make.assoc_type.2 = name_ref Make, %.loc5 [template = constants.%assoc0.2] -// CHECK:STDOUT: %impl.elem0: %Make.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Make.3] +// CHECK:STDOUT: %impl.elem0: %Make.type.2 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Make.3] // CHECK:STDOUT: %.loc4: ref %B = splice_block %return {} // CHECK:STDOUT: %Make.call: init %B = call %impl.elem0() to %.loc4 // CHECK:STDOUT: return %Make.call to %return @@ -914,16 +914,16 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, Factory, loaded [template = constants.%Factory.generic] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, A, loaded [template = constants.%A] // CHECK:STDOUT: %import_ref.3 = import_ref Main//factory, B, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref Main//factory, loc9_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst52 [no loc], unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst26 [no loc], unloaded -// CHECK:STDOUT: %import_ref.7: @Factory.%Make.assoc_type (%Make.assoc_type.1) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.4)] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, Make, unloaded -// CHECK:STDOUT: %import_ref.9: = import_ref Main//factory, loc8_10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst47 [no loc], unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//factory, loc11_6, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//factory, loc11_20, loaded [template = constants.%Factory.type.3] -// CHECK:STDOUT: %import_ref.13 = import_ref Main//factory, loc11_22, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//factory, loc11_22, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//factory, loc9_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst52 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//factory, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8: @Factory.%Make.assoc_type (%Make.assoc_type.1) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.4)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//factory, Make, unloaded +// CHECK:STDOUT: %import_ref.10: = import_ref Main//factory, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//factory, inst47 [no loc], unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//factory, loc11_6, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.13: type = import_ref Main//factory, loc11_20, loaded [template = constants.%Factory.type.3] // CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, loc12_17, unloaded // CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, loc5_17, unloaded // CHECK:STDOUT: } @@ -968,28 +968,28 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .Make = imports.%import_ref.7 -// CHECK:STDOUT: witness = (imports.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.7 +// CHECK:STDOUT: .Make = imports.%import_ref.8 +// CHECK:STDOUT: witness = (imports.%import_ref.9) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.11 as imports.%import_ref.12 [from "factory.carbon"] { +// CHECK:STDOUT: impl @impl: imports.%import_ref.12 as imports.%import_ref.13 [from "factory.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Make = imports.%import_ref.14 -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B [from "factory.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A [from "factory.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.10 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.9 +// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -1012,7 +1012,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Factory.ref: %Factory.type.1 = name_ref Factory, imports.%import_ref.1 [template = constants.%Factory.generic] // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%C)> [template = constants.%Factory.type.4] -// CHECK:STDOUT: %.loc10: %Make.assoc_type.3 = specific_constant imports.%import_ref.7, @Factory(constants.%C) [template = constants.%assoc0.3] +// CHECK:STDOUT: %.loc10: %Make.assoc_type.3 = specific_constant imports.%import_ref.8, @Factory(constants.%C) [template = constants.%assoc0.3] // CHECK:STDOUT: %Make.ref: %Make.assoc_type.3 = name_ref Make, %.loc10 [template = constants.%assoc0.3] // CHECK:STDOUT: return to %return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon index 40fb61b9b32b..9702b0814d03 100644 --- a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon @@ -105,6 +105,7 @@ impl () as D; // CHECK:STDOUT: %A.type: type = facet_type <@A> [template] // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -117,6 +118,7 @@ impl () as D; // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @A { @@ -134,14 +136,14 @@ impl () as D; // CHECK:STDOUT: constants { // CHECK:STDOUT: %A.type: type = facet_type <@A> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//decl_in_api_definition_in_impl, A, loaded [template = constants.%A.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//decl_in_api_definition_in_impl, inst15 [no loc], unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//decl_in_api_definition_in_impl, loc10_7, loaded [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_in_api_definition_in_impl, loc10_12, loaded [template = constants.%A.type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//decl_in_api_definition_in_impl, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_in_api_definition_in_impl, loc10_7, loaded [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Main//decl_in_api_definition_in_impl, loc10_12, loaded [template = constants.%A.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -155,28 +157,28 @@ impl () as D; // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.1 [template = constants.%A.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc8: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: impl_decl @impl.3 [template] {} { // CHECK:STDOUT: %.loc14_7.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc14_7.2: type = converted %.loc14_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.1 [template = constants.%A.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc14: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @A [from "fail_decl_in_api_definition_in_impl.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.3 as imports.%import_ref.4 [from "fail_decl_in_api_definition_in_impl.carbon"]; +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.4 as imports.%import_ref.5 [from "fail_decl_in_api_definition_in_impl.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %.loc8_7.2 as %A.ref; // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.3: %.loc14_7.2 as %A.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_decl_in_api.carbon @@ -205,6 +207,7 @@ impl () as D; // CHECK:STDOUT: %B.type: type = facet_type <@B> [template] // CHECK:STDOUT: %Self: %B.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -217,6 +220,7 @@ impl () as D; // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @B { @@ -238,9 +242,9 @@ impl () as D; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//decl_only_in_api, B, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//decl_only_in_api, inst15 [no loc], unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//decl_only_in_api, loc10_7, loaded [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_only_in_api, loc10_12, loaded [template = constants.%B.type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//decl_only_in_api, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_only_in_api, loc10_7, loaded [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Main//decl_only_in_api, loc10_12, loaded [template = constants.%B.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -253,11 +257,11 @@ impl () as D; // CHECK:STDOUT: // CHECK:STDOUT: interface @B [from "fail_decl_only_in_api.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.3 as imports.%import_ref.4 [from "fail_decl_only_in_api.carbon"]; +// CHECK:STDOUT: impl @impl: imports.%import_ref.4 as imports.%import_ref.5 [from "fail_decl_only_in_api.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_decl_in_api_decl_in_impl.carbon // CHECK:STDOUT: @@ -265,6 +269,7 @@ impl () as D; // CHECK:STDOUT: %C.type: type = facet_type <@C> [template] // CHECK:STDOUT: %Self: %C.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -277,6 +282,7 @@ impl () as D; // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @C { @@ -294,13 +300,14 @@ impl () as D; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C.type: type = facet_type <@C> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//decl_in_api_decl_in_impl, C, loaded [template = constants.%C.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//decl_in_api_decl_in_impl, inst15 [no loc], unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//decl_in_api_decl_in_impl, loc10_7, loaded [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_in_api_decl_in_impl, loc10_12, loaded [template = constants.%C.type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//decl_in_api_decl_in_impl, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_in_api_decl_in_impl, loc10_7, loaded [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Main//decl_in_api_decl_in_impl, loc10_12, loaded [template = constants.%C.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -314,15 +321,16 @@ impl () as D; // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @C [from "fail_decl_in_api_decl_in_impl.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.3 as imports.%import_ref.4 [from "fail_decl_in_api_decl_in_impl.carbon"]; +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.4 as imports.%import_ref.5 [from "fail_decl_in_api_decl_in_impl.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %.loc8_7.2 as %C.ref; // CHECK:STDOUT: @@ -338,6 +346,7 @@ impl () as D; // CHECK:STDOUT: %D.type: type = facet_type <@D> [template] // CHECK:STDOUT: %Self: %D.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -352,6 +361,7 @@ impl () as D; // CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @D { diff --git a/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon b/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon index cb64d0b2931b..64750bfd8c3b 100644 --- a/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon +++ b/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon @@ -36,10 +36,10 @@ class A { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %A: type = class_type @A [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Make.decl) [template] // CHECK:STDOUT: %Make.type.2: type = fn_type @Make.2 [template] // CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template] -// CHECK:STDOUT: %DefaultConstructible.facet: %DefaultConstructible.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface: = interface_witness (%Make.2) [template] +// CHECK:STDOUT: %DefaultConstructible.facet: %DefaultConstructible.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -83,11 +83,10 @@ class A { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Make.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Make = %Make.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @A.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -103,6 +102,7 @@ class A { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %DefaultConstructible.ref: type = name_ref DefaultConstructible, file.%DefaultConstructible.decl [template = constants.%DefaultConstructible.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Make.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon b/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon index 815b3a8d2722..284a519636b1 100644 --- a/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon +++ b/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon @@ -51,15 +51,15 @@ impl D as SelfNested { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %D: type = class_type @D [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %UseSelf.facet.1: %UseSelf.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %UseSelf.facet.1: %UseSelf.type = facet_value %C, %impl_witness.1 [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%F.decl) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %UseSelf.facet.2: %UseSelf.type = facet_value %D, %D [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%F.3) [template] +// CHECK:STDOUT: %UseSelf.facet.2: %UseSelf.type = facet_value %D, %impl_witness.2 [template] // CHECK:STDOUT: %D.val: %D = struct_value () [template] // CHECK:STDOUT: %SelfNested.type: type = facet_type <@SelfNested> [template] // CHECK:STDOUT: %Self.2: %SelfNested.type = bind_symbolic_name Self, 0 [symbolic] @@ -72,20 +72,20 @@ impl D as SelfNested { // CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %SelfNested.type, %F.type.4 [template] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, @SelfNested.%F.decl [template] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (@impl.3.%F.decl) [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %C [template] // CHECK:STDOUT: %struct_type.x.y.2: type = struct_type {.x: %C, .y: %empty_tuple.type} [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%ptr.3, %struct_type.x.y.2) [template] // CHECK:STDOUT: %F.type.5: type = fn_type @F.5 [template] // CHECK:STDOUT: %F.5: %F.type.5 = struct_value () [template] -// CHECK:STDOUT: %SelfNested.facet.1: %SelfNested.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface.3: = interface_witness (%F.5) [template] +// CHECK:STDOUT: %SelfNested.facet.1: %SelfNested.type = facet_value %C, %impl_witness.3 [template] +// CHECK:STDOUT: %impl_witness.4: = impl_witness (@impl.4.%F.decl) [template] // CHECK:STDOUT: %ptr.4: type = ptr_type %D [template] // CHECK:STDOUT: %struct_type.x.y.3: type = struct_type {.x: %D, .y: %empty_tuple.type} [template] // CHECK:STDOUT: %tuple.type.4: type = tuple_type (%ptr.4, %struct_type.x.y.3) [template] // CHECK:STDOUT: %F.type.6: type = fn_type @F.6 [template] // CHECK:STDOUT: %F.6: %F.type.6 = struct_value () [template] -// CHECK:STDOUT: %SelfNested.facet.2: %SelfNested.type = facet_value %D, %D [template] -// CHECK:STDOUT: %interface.4: = interface_witness (%F.6) [template] +// CHECK:STDOUT: %SelfNested.facet.2: %SelfNested.type = facet_value %D, %impl_witness.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -102,19 +102,23 @@ impl D as SelfNested { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %UseSelf.ref: type = name_ref UseSelf, file.%UseSelf.decl [template = constants.%UseSelf.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc19: = impl_witness (@impl.1.%F.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %UseSelf.ref: type = name_ref UseSelf, file.%UseSelf.decl [template = constants.%UseSelf.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc23: = impl_witness (@impl.2.%F.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%SelfNested.type] {} {} // CHECK:STDOUT: impl_decl @impl.3 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%SelfNested.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc31: = impl_witness (@impl.3.%F.decl) [template = constants.%impl_witness.3] // CHECK:STDOUT: impl_decl @impl.4 [template] {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%SelfNested.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc35: = impl_witness (@impl.4.%F.decl) [template = constants.%impl_witness.4] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @UseSelf { @@ -205,11 +209,10 @@ impl D as SelfNested { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %D.ref as %UseSelf.ref { @@ -231,11 +234,10 @@ impl D as SelfNested { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param2 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.3: %C.ref as %SelfNested.ref { @@ -256,11 +258,10 @@ impl D as SelfNested { // CHECK:STDOUT: } // CHECK:STDOUT: %x: %tuple.type.3 = bind_name x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.4: %D.ref as %SelfNested.ref { @@ -281,11 +282,10 @@ impl D as SelfNested { // CHECK:STDOUT: } // CHECK:STDOUT: %x: %tuple.type.4 = bind_name x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/redeclaration.carbon b/toolchain/check/testdata/impl/redeclaration.carbon index 067a171f2efd..81b1aada6cbd 100644 --- a/toolchain/check/testdata/impl/redeclaration.carbon +++ b/toolchain/check/testdata/impl/redeclaration.carbon @@ -25,10 +25,10 @@ impl i32 as I {} // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: %X: type = class_type @X [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %interface: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -52,6 +52,7 @@ impl i32 as I {} // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] @@ -69,10 +70,8 @@ impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %i32.loc13 as %I.ref.loc13 { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index 96f952a471d1..c309a27a9036 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -25,9 +25,9 @@ var d: i32 = a[b]; // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -77,7 +77,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_24: Core.IntLiteral = int_value 24 [template = constants.%int_24.1] // CHECK:STDOUT: %.loc11_26.1: %tuple.type = tuple_literal (%int_12, %int_24) -// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_12, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.1: = specific_function %Convert.bound.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_12) [template = constants.%int_12.2] @@ -85,7 +85,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc11_26.3: ref %i32 = array_index file.%a.var, %int_0.loc11 // CHECK:STDOUT: %.loc11_26.4: init %i32 = initialize_from %.loc11_26.2 to %.loc11_26.3 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_24, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.2: = specific_function %Convert.bound.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_24) [template = constants.%int_24.2] @@ -97,7 +97,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %.loc11_27: init %array_type = converted %.loc11_26.1, %.loc11_26.8 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_27 // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_1.loc12) [template = constants.%int_1.2] @@ -107,7 +107,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index dabeb1473091..1dd9276ed1aa 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -44,9 +44,9 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -135,7 +135,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_2.loc14_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc14: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc14_29.1: %tuple.type = tuple_literal (%int_1.loc14_22, %int_2.loc14_25, %int_3.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_29.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_29.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_29.1: = bound_method %int_1.loc14_22, %impl.elem0.loc14_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_29.1: = specific_function %Convert.bound.loc14_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_29.1: init %i32 = call %Convert.specific_fn.loc14_29.1(%int_1.loc14_22) [template = constants.%int_1.2] @@ -143,7 +143,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc14: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc14_29.3: ref %i32 = array_index %a.var, %int_0.loc14 // CHECK:STDOUT: %.loc14_29.4: init %i32 = initialize_from %.loc14_29.2 to %.loc14_29.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_29.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_29.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_29.2: = bound_method %int_2.loc14_25, %impl.elem0.loc14_29.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_29.2: = specific_function %Convert.bound.loc14_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_29.2: init %i32 = call %Convert.specific_fn.loc14_29.2(%int_2.loc14_25) [template = constants.%int_2.2] @@ -151,7 +151,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_1.loc14_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_29.6: ref %i32 = array_index %a.var, %int_1.loc14_29 // CHECK:STDOUT: %.loc14_29.7: init %i32 = initialize_from %.loc14_29.5 to %.loc14_29.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc14_29.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_29.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_29.3: = bound_method %int_3.loc14, %impl.elem0.loc14_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc14_29.3: = specific_function %Convert.bound.loc14_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc14_29.3: init %i32 = call %Convert.specific_fn.loc14_29.3(%int_3.loc14) [template = constants.%int_3.2] @@ -168,7 +168,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc17: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_0.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_0.loc17) [template = constants.%int_0.2] @@ -181,7 +181,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc18_5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_5: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_5: = bound_method %int_0.loc18, %impl.elem0.loc18_5 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc18_5: = specific_function %Convert.bound.loc18_5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc18_5: init %i32 = call %Convert.specific_fn.loc18_5(%int_0.loc18) [template = constants.%int_0.2] @@ -189,7 +189,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %.loc18_5.2: %i32 = converted %int_0.loc18, %.loc18_5.1 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc18_6: ref %i32 = array_index %a.ref.loc18, %.loc18_5.2 // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc18_8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_8: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_8: = bound_method %int_4, %impl.elem0.loc18_8 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc18_8: = specific_function %Convert.bound.loc18_8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc18_8: init %i32 = call %Convert.specific_fn.loc18_8(%int_4) [template = constants.%int_4.2] @@ -206,7 +206,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_2.loc22_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc22: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc22_29.1: %tuple.type = tuple_literal (%int_1.loc22_22, %int_2.loc22_25, %int_3.loc22) -// CHECK:STDOUT: %impl.elem0.loc22_29.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc22_29.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22_29.1: = bound_method %int_1.loc22_22, %impl.elem0.loc22_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc22_29.1: = specific_function %Convert.bound.loc22_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc22_29.1: init %i32 = call %Convert.specific_fn.loc22_29.1(%int_1.loc22_22) [template = constants.%int_1.2] @@ -214,7 +214,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc22_29.3: ref %i32 = array_index %a.var, %int_0.loc22 // CHECK:STDOUT: %.loc22_29.4: init %i32 = initialize_from %.loc22_29.2 to %.loc22_29.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc22_29.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc22_29.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22_29.2: = bound_method %int_2.loc22_25, %impl.elem0.loc22_29.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc22_29.2: = specific_function %Convert.bound.loc22_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc22_29.2: init %i32 = call %Convert.specific_fn.loc22_29.2(%int_2.loc22_25) [template = constants.%int_2.2] @@ -222,7 +222,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_1.loc22_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc22_29.6: ref %i32 = array_index %a.var, %int_1.loc22_29 // CHECK:STDOUT: %.loc22_29.7: init %i32 = initialize_from %.loc22_29.5 to %.loc22_29.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc22_29.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc22_29.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22_29.3: = bound_method %int_3.loc22, %impl.elem0.loc22_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc22_29.3: = specific_function %Convert.bound.loc22_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc22_29.3: init %i32 = call %Convert.specific_fn.loc22_29.3(%int_3.loc22) [template = constants.%int_3.2] @@ -237,7 +237,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc26: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_0.loc26, %impl.elem0.loc26 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_0.loc26) [template = constants.%int_0.2] @@ -248,7 +248,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc27: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_0.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_0.loc27) [template = constants.%int_0.2] @@ -264,7 +264,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %.loc28_5.2: ref %array_type = temporary %.loc28_5.1, %F.call // CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc28: = specific_function %Convert.bound.loc28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %Convert.specific_fn.loc28(%int_0.loc28) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index 206024057f0f..5b03e21951a5 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -32,9 +32,9 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -77,7 +77,7 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_12, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_12) [template = constants.%int_12.2] @@ -92,7 +92,7 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_1, %impl.elem0.loc17 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_1) [template = constants.%int_1.2] @@ -105,7 +105,7 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22: = bound_method %int_2147483647, %impl.elem0.loc22 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc22: = specific_function %Convert.bound.loc22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %Convert.specific_fn.loc22(%int_2147483647) [template = constants.%int_2147483647.2] diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index 61c08a7077c2..40125a73f4eb 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -28,9 +28,9 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -64,7 +64,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_12) [template = constants.%int_12.2] diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index 87556322401a..491ce866624d 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -25,9 +25,9 @@ var b: i32 = a[1]; // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -63,7 +63,7 @@ var b: i32 = a[1]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_12, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_12) [template = constants.%int_12.2] @@ -78,7 +78,7 @@ var b: i32 = a[1]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1, %impl.elem0.loc15 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 711664ad1cce..b010b9b2e7a0 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -50,9 +50,9 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %ptr.2: type = ptr_type %i32 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -114,7 +114,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc19: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_0.loc19, %impl.elem0.loc19 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_0.loc19) [template = constants.%int_0.2] @@ -129,7 +129,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc24: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc24_5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_5: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_5: = bound_method %int_0.loc24, %impl.elem0.loc24_5 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc24_5: = specific_function %Convert.bound.loc24_5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc24_5: init %i32 = call %Convert.specific_fn.loc24_5(%int_0.loc24) [template = constants.%int_0.2] @@ -139,7 +139,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc24_6.2: ref %i32 = array_index %.loc24_6.1, %.loc24_5.2 // CHECK:STDOUT: %.loc24_6.3: %i32 = bind_value %.loc24_6.2 // CHECK:STDOUT: %int_4.loc24: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc24_8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_8: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_8: = bound_method %int_4.loc24, %impl.elem0.loc24_8 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc24_8: = specific_function %Convert.bound.loc24_8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc24_8: init %i32 = call %Convert.specific_fn.loc24_8(%int_4.loc24) [template = constants.%int_4.2] @@ -154,7 +154,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc32_21.2: ref %array_type = temporary %.loc32_21.1, %F.call.loc32 // CHECK:STDOUT: %int_32.loc32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc32: = bound_method %int_0.loc32, %impl.elem0.loc32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc32: = specific_function %Convert.bound.loc32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %Convert.specific_fn.loc32(%int_0.loc32) [template = constants.%int_0.2] @@ -171,7 +171,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc36_5.2: ref %array_type = temporary %.loc36_5.1, %F.call.loc36 // CHECK:STDOUT: %int_32.loc36: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc36_7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc36_7: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc36_7: = bound_method %int_0.loc36, %impl.elem0.loc36_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc36_7: = specific_function %Convert.bound.loc36_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc36_7: init %i32 = call %Convert.specific_fn.loc36_7(%int_0.loc36) [template = constants.%int_0.2] @@ -180,7 +180,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc36_8.1: ref %i32 = array_index %.loc36_5.2, %.loc36_7.2 // CHECK:STDOUT: %.loc36_8.2: %i32 = bind_value %.loc36_8.1 // CHECK:STDOUT: %int_4.loc36: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc36_10: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc36_10: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc36_10: = bound_method %int_4.loc36, %impl.elem0.loc36_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc36_10: = specific_function %Convert.bound.loc36_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc36_10: init %i32 = call %Convert.specific_fn.loc36_10(%int_4.loc36) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index b6dcd848bb13..4d6f82cf46a1 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -26,9 +26,9 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_42.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.2: %i32 = int_value 42 [template] @@ -36,9 +36,9 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %array: %array_type = tuple_value (%int_42.2, %int_42.2) [template] // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template] // CHECK:STDOUT: %Op.type.13: type = fn_type @Op.13 [template] +// CHECK:STDOUT: %impl_witness.21: = impl_witness (imports.%import_ref.254) [template] // CHECK:STDOUT: %Op.type.14: type = fn_type @Op.14 [template] // CHECK:STDOUT: %Op.14: %Op.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.20: = interface_witness (%Op.14) [template] // CHECK:STDOUT: %Op.bound: = bound_method %int_10, %Op.14 [template] // CHECK:STDOUT: %int_-10.1: Core.IntLiteral = int_value -10 [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_-10.1, %Convert.10 [template] @@ -50,7 +50,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Negate = %import_ref.229 +// CHECK:STDOUT: .Negate = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -74,7 +74,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %int_42.loc11_20: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] // CHECK:STDOUT: %int_42.loc11_24: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] // CHECK:STDOUT: %.loc11_26.1: %tuple.type = tuple_literal (%int_42.loc11_20, %int_42.loc11_24) -// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_42.loc11_20, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.1: = specific_function %Convert.bound.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_42.loc11_20) [template = constants.%int_42.2] @@ -82,7 +82,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_26.3: ref %i32 = array_index file.%c.var, %int_0 // CHECK:STDOUT: %.loc11_26.4: init %i32 = initialize_from %.loc11_26.2 to %.loc11_26.3 [template = constants.%int_42.2] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_42.loc11_24, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.2: = specific_function %Convert.bound.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_42.loc11_24) [template = constants.%int_42.2] @@ -95,12 +95,12 @@ var d: i32 = c[-10]; // CHECK:STDOUT: assign file.%c.var, %.loc11_27 // CHECK:STDOUT: %c.ref: ref %array_type = name_ref c, file.%c // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10] -// CHECK:STDOUT: %impl.elem0.loc15_16.1: %Op.type.13 = interface_witness_access constants.%interface.20, element0 [template = constants.%Op.14] +// CHECK:STDOUT: %impl.elem0.loc15_16.1: %Op.type.13 = impl_witness_access constants.%impl_witness.21, element0 [template = constants.%Op.14] // CHECK:STDOUT: %Op.bound: = bound_method %int_10, %impl.elem0.loc15_16.1 [template = constants.%Op.bound] // CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %Op.bound(%int_10) [template = constants.%int_-10.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc15_16.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_16.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int.snegate, %impl.elem0.loc15_16.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %.loc15_16.1: Core.IntLiteral = value_of_initializer %int.snegate [template = constants.%int_-10.1] diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index ce907e890d96..a3f689fcf51f 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -33,9 +33,9 @@ interface I { // CHECK:STDOUT: %assoc0.1: %assoc_type.1 = assoc_entity element0, @I.%T [template] // CHECK:STDOUT: %int_42.1: Core.IntLiteral = int_value 42 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.2: %i32 = int_value 42 [template] @@ -72,7 +72,7 @@ interface I { // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc0: %assoc_type.1 = assoc_entity element0, %T [template = constants.%assoc0.1] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_42) [template = constants.%int_42.2] 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 ec0075c6a1b9..57503c1e8f68 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 @@ -331,8 +331,6 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %F => constants.%F // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@F.%Self) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self, constants.%U) { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: %C => constants.%C.2 @@ -340,5 +338,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %U.patt.loc14 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @C(@F.%Self) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @C(%Self) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/member_lookup.carbon b/toolchain/check/testdata/interface/member_lookup.carbon index b46c8254f870..95e73ffd078e 100644 --- a/toolchain/check/testdata/interface/member_lookup.carbon +++ b/toolchain/check/testdata/interface/member_lookup.carbon @@ -65,7 +65,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %AccessGeneric: %AccessGeneric.type = struct_value () [template] // CHECK:STDOUT: %require_complete.2: = require_complete_type %Interface.type.2 [symbolic] // CHECK:STDOUT: %I.as_wit.1: = facet_access_witness %I.1 [symbolic] -// CHECK:STDOUT: %impl.elem0.1: %T = interface_witness_access %I.as_wit.1, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0.1: %T = impl_witness_access %I.as_wit.1, element0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Interface.type.3: type = facet_type <@Interface, @Interface(%i32)> [template] @@ -78,7 +78,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %Interface.type.3, %i32 [template] // CHECK:STDOUT: %assoc0.2: %assoc_type.2 = assoc_entity element0, @Interface.%X [template] // CHECK:STDOUT: %I.as_wit.2: = facet_access_witness %I.2 [symbolic] -// CHECK:STDOUT: %impl.elem0.2: %i32 = interface_witness_access %I.as_wit.2, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0.2: %i32 = impl_witness_access %I.as_wit.2, element0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -181,7 +181,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %assoc_type: type = assoc_entity_type @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2), @AccessGeneric.%T.loc8_18.2 (%T) [symbolic = %assoc_type (constants.%assoc_type.1)] // CHECK:STDOUT: %assoc0: @AccessGeneric.%assoc_type (%assoc_type.1) = assoc_entity element0, @Interface.%X [symbolic = %assoc0 (constants.%assoc0.1)] // CHECK:STDOUT: %I.as_wit.loc9_11.2: = facet_access_witness %I.loc8_28.2 [symbolic = %I.as_wit.loc9_11.2 (constants.%I.as_wit.1)] -// CHECK:STDOUT: %impl.elem0.loc9_11.2: @AccessGeneric.%T.loc8_18.2 (%T) = interface_witness_access %I.as_wit.loc9_11.2, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0.1)] +// CHECK:STDOUT: %impl.elem0.loc9_11.2: @AccessGeneric.%T.loc8_18.2 (%T) = impl_witness_access %I.as_wit.loc9_11.2, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0.1)] // CHECK:STDOUT: %require_complete.loc9_13: = require_complete_type @AccessGeneric.%T.loc8_18.2 (%T) [symbolic = %require_complete.loc9_13 (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%I.param_patt: @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2)) -> @AccessGeneric.%T.loc8_18.2 (%T) { @@ -190,7 +190,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %.loc9: @AccessGeneric.%assoc_type (%assoc_type.1) = specific_constant @Interface.%assoc0.loc5_12.1, @Interface(constants.%T) [symbolic = %assoc0 (constants.%assoc0.1)] // CHECK:STDOUT: %X.ref: @AccessGeneric.%assoc_type (%assoc_type.1) = name_ref X, %.loc9 [symbolic = %assoc0 (constants.%assoc0.1)] // CHECK:STDOUT: %I.as_wit.loc9_11.1: = facet_access_witness %I.ref [symbolic = %I.as_wit.loc9_11.2 (constants.%I.as_wit.1)] -// CHECK:STDOUT: %impl.elem0.loc9_11.1: @AccessGeneric.%T.loc8_18.2 (%T) = interface_witness_access %I.as_wit.loc9_11.1, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0.1)] +// CHECK:STDOUT: %impl.elem0.loc9_11.1: @AccessGeneric.%T.loc8_18.2 (%T) = impl_witness_access %I.as_wit.loc9_11.1, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0.1)] // CHECK:STDOUT: return %impl.elem0.loc9_11.1 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -201,7 +201,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.as_wit.loc13_11.2: = facet_access_witness %I.loc12_19.2 [symbolic = %I.as_wit.loc13_11.2 (constants.%I.as_wit.2)] -// CHECK:STDOUT: %impl.elem0.loc13_11.2: %i32 = interface_witness_access %I.as_wit.loc13_11.2, element0 [symbolic = %impl.elem0.loc13_11.2 (constants.%impl.elem0.2)] +// CHECK:STDOUT: %impl.elem0.loc13_11.2: %i32 = impl_witness_access %I.as_wit.loc13_11.2, element0 [symbolic = %impl.elem0.loc13_11.2 (constants.%impl.elem0.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%I.param_patt: %Interface.type.3) -> %i32 { // CHECK:STDOUT: !entry: @@ -209,7 +209,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %.loc13: %assoc_type.2 = specific_constant @Interface.%assoc0.loc5_12.1, @Interface(constants.%i32) [template = constants.%assoc0.2] // CHECK:STDOUT: %X.ref: %assoc_type.2 = name_ref X, %.loc13 [template = constants.%assoc0.2] // CHECK:STDOUT: %I.as_wit.loc13_11.1: = facet_access_witness %I.ref [symbolic = %I.as_wit.loc13_11.2 (constants.%I.as_wit.2)] -// CHECK:STDOUT: %impl.elem0.loc13_11.1: %i32 = interface_witness_access %I.as_wit.loc13_11.1, element0 [symbolic = %impl.elem0.loc13_11.2 (constants.%impl.elem0.2)] +// CHECK:STDOUT: %impl.elem0.loc13_11.1: %i32 = impl_witness_access %I.as_wit.loc13_11.1, element0 [symbolic = %impl.elem0.loc13_11.2 (constants.%impl.elem0.2)] // CHECK:STDOUT: return %impl.elem0.loc13_11.1 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -228,8 +228,6 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Interface(%T.loc4_21.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Interface(@AccessGeneric.%T.loc8_18.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @AccessGeneric(constants.%T, constants.%I.1) { // CHECK:STDOUT: %T.loc8_18.2 => constants.%T // CHECK:STDOUT: %T.patt.loc8_18.2 => constants.%T @@ -238,6 +236,8 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %I.patt.loc8_28.2 => constants.%I.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Interface(@AccessGeneric.%T.loc8_18.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Interface(constants.%i32) { // CHECK:STDOUT: %T.loc4_21.2 => constants.%i32 // CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%i32 @@ -419,8 +419,6 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Interface(%T.loc4_21.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Interface(@AccessMissingGeneric.%T.loc8_25.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @AccessMissingGeneric(constants.%T, constants.%I.1) { // CHECK:STDOUT: %T.loc8_25.2 => constants.%T // CHECK:STDOUT: %T.patt.loc8_25.2 => constants.%T @@ -429,6 +427,8 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %I.patt.loc8_35.2 => constants.%I.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Interface(@AccessMissingGeneric.%T.loc8_25.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Interface(constants.%i32) { // CHECK:STDOUT: %T.loc4_21.2 => constants.%i32 // CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%i32 diff --git a/toolchain/check/testdata/interface/no_prelude/default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/default_fn.carbon index 55c787424d95..24ffce1c4a9f 100644 --- a/toolchain/check/testdata/interface/no_prelude/default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/default_fn.carbon @@ -34,10 +34,10 @@ class C { // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %C [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] @@ -63,11 +63,10 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @C.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -76,6 +75,7 @@ class C { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, @C.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -98,7 +98,7 @@ class C { // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c // CHECK:STDOUT: %I.ref: type = name_ref I, @C.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon index caeeef61eed9..07b7eb9cfd58 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon @@ -39,7 +39,7 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: %CallStatic.type: type = fn_type @CallStatic [template] // CHECK:STDOUT: %CallStatic: %CallStatic.type = struct_value () [template] // CHECK:STDOUT: %T.as_wit: = facet_access_witness %T [symbolic] -// CHECK:STDOUT: %impl.elem0: %F.type = interface_witness_access %T.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: %F.type = impl_witness_access %T.as_wit, element0 [symbolic] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] // CHECK:STDOUT: %CallFacet.type: type = fn_type @CallFacet [template] // CHECK:STDOUT: %CallFacet: %CallFacet.type = struct_value () [template] @@ -102,14 +102,14 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as_wit.loc18_4.2: = facet_access_witness %T.loc13_15.2 [symbolic = %T.as_wit.loc18_4.2 (constants.%T.as_wit)] -// CHECK:STDOUT: %impl.elem0.loc18_4.2: %F.type = interface_witness_access %T.as_wit.loc18_4.2, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc18_4.2: %F.type = impl_witness_access %T.as_wit.loc18_4.2, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: %Interface.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %T.ref: %Interface.type = name_ref T, %T.loc13_15.1 [symbolic = %T.loc13_15.2 (constants.%T)] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @Interface.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %T.as_wit.loc18_4.1: = facet_access_witness %T.ref [symbolic = %T.as_wit.loc18_4.2 (constants.%T.as_wit)] -// CHECK:STDOUT: %impl.elem0.loc18_4.1: %F.type = interface_witness_access %T.as_wit.loc18_4.1, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc18_4.1: %F.type = impl_witness_access %T.as_wit.loc18_4.1, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon index 4225c018cefc..2b0975629676 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon @@ -159,8 +159,6 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %assoc0.loc13_29.2 => constants.%assoc0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@F.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%Self) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %I.type => constants.%I.type.2 @@ -168,9 +166,9 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %Self.as_type.loc13_14.1 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T.loc11_13.2) {} +// CHECK:STDOUT: specific @I(@F.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@.1.%T.loc22_6.2) {} +// CHECK:STDOUT: specific @I(%T.loc11_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%Self) { // CHECK:STDOUT: %T.loc22_6.2 => constants.%T @@ -180,3 +178,5 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %Self.as_type.loc22_24.2 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @I(@.1.%T.loc22_6.2) {} +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index 13ad6649601e..9ff9625769fc 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -81,16 +81,16 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %assoc0.1: %F.assoc_type.1 = assoc_entity element0, @WithAssocFn.%F.decl [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %Simple.type.3: type = facet_type <@Simple, @Simple(%C)> [template] -// CHECK:STDOUT: %interface.1: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness () [template] // CHECK:STDOUT: %WithAssocFn.type.3: type = facet_type <@WithAssocFn, @WithAssocFn(%C)> [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @WithAssocFn(%C) [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %WithAssocFn.type.3, %F.type.2 [template] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, @WithAssocFn.%F.decl [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%F.decl) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %WithAssocFn.facet: %WithAssocFn.type.2 = facet_value %C, %C [symbolic] -// CHECK:STDOUT: %interface.2: = interface_witness (%F.3) [template] +// CHECK:STDOUT: %WithAssocFn.facet: %WithAssocFn.type.2 = facet_value %C, %impl_witness.2 [symbolic] // CHECK:STDOUT: %X.val: %X = struct_value () [template] // CHECK:STDOUT: %N: %T.1 = bind_symbolic_name N, 1 [symbolic] // CHECK:STDOUT: %N.patt: %T.1 = symbolic_binding_pattern N, 1 [symbolic] @@ -227,10 +227,8 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %Self.ref as %Simple.type { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface.1] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @C.%impl_witness.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %Self.ref as %WithAssocFn.type { @@ -242,11 +240,10 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %return.param: ref %X = out_param runtime_param0 // CHECK:STDOUT: %return: ref %X = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = @C.%impl_witness.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { @@ -264,12 +261,14 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [template = constants.%Simple.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc14: = impl_witness () [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %WithAssocFn.ref: %WithAssocFn.type.1 = name_ref WithAssocFn, file.%WithAssocFn.decl [template = constants.%WithAssocFn.generic] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %WithAssocFn.type: type = facet_type <@WithAssocFn, @WithAssocFn(constants.%C)> [template = constants.%WithAssocFn.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc15: = impl_witness (@impl.2.%F.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon index 49530e7d0cc3..0a716bbffcb7 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon @@ -114,10 +114,10 @@ impl C as AddWith(C) { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %AddWith.type.3, %F.type.2 [template] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %AddWith.facet: %AddWith.type.2 = facet_value %C, %C [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%F.3) [template] +// CHECK:STDOUT: %AddWith.facet: %AddWith.type.2 = facet_value %C, %impl_witness [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -141,6 +141,7 @@ impl C as AddWith(C) { // CHECK:STDOUT: %C.ref.loc7_19: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(constants.%C)> [template = constants.%AddWith.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @AddWith(constants.%T: type) [from "a.carbon"] { @@ -165,11 +166,10 @@ impl C as AddWith(C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref.loc7_6 as %AddWith.type { // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.2 [template = constants.%F.3] {} {} -// CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon index 51603b98e1d3..fc55808cd16e 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon @@ -77,7 +77,7 @@ interface A(T: type) {} // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %X: type = class_type @X [template] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: %GenericAndParams.type.5: type = facet_type <@GenericAndParams.1, @GenericAndParams.1(%X)> [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [template] // CHECK:STDOUT: %GenericAndParams.type.6: type = generic_interface_type @GenericAndParams.2, @C(%X) [template] @@ -114,17 +114,20 @@ interface A(T: type) {} // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %NotGenericNoParams.ref: type = name_ref NotGenericNoParams, file.%NotGenericNoParams.decl [template = constants.%NotGenericNoParams.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc14: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %NotGenericButParams.ref: %NotGenericButParams.type.1 = name_ref NotGenericButParams, file.%NotGenericButParams.decl [template = constants.%NotGenericButParams.generic] // CHECK:STDOUT: %NotGenericButParams.type: type = facet_type <@NotGenericButParams> [template = constants.%NotGenericButParams.type.2] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc15: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: impl_decl @impl.3 [template] {} { // CHECK:STDOUT: %X.ref.loc16_6: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %GenericAndParams.ref: %GenericAndParams.type.1 = name_ref GenericAndParams, file.%GenericAndParams.decl [template = constants.%GenericAndParams.generic.1] // CHECK:STDOUT: %X.ref.loc16_28: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %GenericAndParams.type: type = facet_type <@GenericAndParams.1, @GenericAndParams.1(constants.%X)> [template = constants.%GenericAndParams.type.5] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc16: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: impl_decl @impl.4 [template] {} { // CHECK:STDOUT: %X.ref.loc17_6: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] @@ -132,6 +135,7 @@ interface A(T: type) {} // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%X) [template = constants.%C.2] // CHECK:STDOUT: %GenericNoParams.ref: type = name_ref GenericNoParams, @C.%GenericNoParams.decl [template = constants.%GenericNoParams.type.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: impl_decl @impl.5 [template] {} { // CHECK:STDOUT: %X.ref.loc18_6: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] @@ -142,6 +146,7 @@ interface A(T: type) {} // CHECK:STDOUT: %X.ref.loc18_33: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %GenericAndParams.type: type = facet_type <@GenericAndParams.2, @GenericAndParams.2(constants.%X, constants.%X)> [template = constants.%GenericAndParams.type.7] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc18: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @NotGenericNoParams { @@ -211,38 +216,28 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %X.ref as %NotGenericNoParams.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %X.ref as %NotGenericButParams.type { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.3: %X.ref.loc16_6 as %GenericAndParams.type { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.4: %X.ref.loc17_6 as %GenericNoParams.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.5: %X.ref.loc18_6 as %GenericAndParams.type { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc8_9.1: type) { diff --git a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon b/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon index 9f8c7d28781c..03ede708a267 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon @@ -61,6 +61,7 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: %B.type: type = facet_type <@B> [template] // CHECK:STDOUT: %Self: %B.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -73,6 +74,7 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @B { @@ -94,9 +96,9 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//b, B, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst15 [no loc], unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//b, loc6_7, loaded [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//b, loc6_12, loaded [template = constants.%B.type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//b, loc6_7, loaded [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Main//b, loc6_12, loaded [template = constants.%B.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -109,9 +111,9 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: // CHECK:STDOUT: interface @B [from "fail_b.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.3 as imports.%import_ref.4 [from "fail_b.carbon"]; +// CHECK:STDOUT: impl @impl: imports.%import_ref.4 as imports.%import_ref.5 [from "fail_b.carbon"]; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/todo_define_not_default.carbon b/toolchain/check/testdata/interface/todo_define_not_default.carbon index aadc25380373..c7098d6f2fd7 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -40,9 +40,9 @@ interface I { // CHECK:STDOUT: %assoc2: %assoc_type.1 = assoc_entity element2, @I.%T [template] // CHECK:STDOUT: %int_42.1: Core.IntLiteral = int_value 42 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.2: %i32 = int_value 42 [template] @@ -107,7 +107,7 @@ interface I { // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc2: %assoc_type.1 = assoc_entity element2, %T [template = constants.%assoc2] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_42) [template = constants.%int_42.2] diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index b3f0993e818e..9c5dacccb6a7 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -20,9 +20,9 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -59,7 +59,7 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %n.var.loc11_26: ref %i32 = var n // CHECK:STDOUT: %n.loc11_26: ref %i32 = bind_name n, %n.var.loc11_26 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc11_36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_36: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_36: = bound_method %int_1, %impl.elem0.loc11_36 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_36: = specific_function %Convert.bound.loc11_36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_36: init %i32 = call %Convert.specific_fn.loc11_36(%int_1) [template = constants.%int_1.2] @@ -75,7 +75,7 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %n.var.loc11_56: ref %i32 = var n // CHECK:STDOUT: %n.loc11_56: ref %i32 = bind_name n, %n.var.loc11_56 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc11_66: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_66: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_66: = bound_method %int_2, %impl.elem0.loc11_66 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_66: = specific_function %Convert.bound.loc11_66, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_66: init %i32 = call %Convert.specific_fn.loc11_66(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 57bee077d95c..4ed69b143b4e 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -501,9 +501,9 @@ impl i32 as Empty { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -539,7 +539,7 @@ impl i32 as Empty { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -560,9 +560,9 @@ impl i32 as Empty { // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -606,7 +606,7 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_0, %impl.elem0.loc6 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_0) [template = constants.%int_0.2] @@ -618,7 +618,7 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_1, %impl.elem0.loc9 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.specific_fn.loc9(%int_1) [template = constants.%int_1.2] @@ -794,15 +794,15 @@ impl i32 as Empty { // CHECK:STDOUT: %Self.1: %Empty.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.20: = impl_witness (imports.%import_ref.14), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %interface.20: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -826,6 +826,7 @@ impl i32 as Empty { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Empty { @@ -838,17 +839,16 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %i32 as %Empty.ref { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.20, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc10_21.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] // CHECK:STDOUT: %.loc10_21.2: %i32 = converted %int_0, %.loc10_21.1 [template = constants.%int_0.2] // CHECK:STDOUT: %Zero: %i32 = bind_name Zero, %.loc10_21.2 -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface.20] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Zero = %Zero -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index 69dc672ca15b..1eb9a8d4dda6 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -28,9 +28,9 @@ fn F() -> i32 { // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -77,21 +77,21 @@ fn F() -> i32 { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc12_36.1: %tuple.type.3 = tuple_literal (%int_1.loc12, %int_2, %int_3) -// CHECK:STDOUT: %impl.elem0.loc12_36.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_36.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_36.1: = bound_method %int_1.loc12, %impl.elem0.loc12_36.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_36.1: = specific_function %Convert.bound.loc12_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_36.1: init %i32 = call %Convert.specific_fn.loc12_36.1(%int_1.loc12) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_36.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_36.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc12: ref %i32 = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc12_36.3: init %i32 = initialize_from %.loc12_36.2 to %tuple.elem0.loc12 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_36.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_36.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_36.2: = bound_method %int_2, %impl.elem0.loc12_36.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_36.2: = specific_function %Convert.bound.loc12_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_36.2: init %i32 = call %Convert.specific_fn.loc12_36.2(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc12_36.4: init %i32 = converted %int_2, %int.convert_checked.loc12_36.2 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem1.loc12: ref %i32 = tuple_access %v.var, element1 // CHECK:STDOUT: %.loc12_36.5: init %i32 = initialize_from %.loc12_36.4 to %tuple.elem1.loc12 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc12_36.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_36.3: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_36.3: = bound_method %int_3, %impl.elem0.loc12_36.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_36.3: = specific_function %Convert.bound.loc12_36.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_36.3: init %i32 = call %Convert.specific_fn.loc12_36.3(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 2e58b1f03331..60627b237ee1 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -28,9 +28,9 @@ fn F() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -61,7 +61,7 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1, %impl.elem0.loc12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_1) [template = constants.%int_1.2] @@ -69,7 +69,7 @@ fn F() { // CHECK:STDOUT: %.loc12_17.2: %i32 = converted %int_1, %.loc12_17.1 [template = constants.%int_1.2] // CHECK:STDOUT: %a.loc12: %i32 = bind_name a, %.loc12_17.2 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index 6fde88e5ab55..f358ff20069f 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -90,9 +90,9 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -125,7 +125,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_1.loc15) [template = constants.%int_1.2] @@ -133,7 +133,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc15_25.2: %i32 = converted %int_1.loc15, %.loc15_25.1 [template = constants.%int_1.2] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc15_25.2 // CHECK:STDOUT: %int_1.loc21: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_1.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_1.loc21) [template = constants.%int_1.2] @@ -141,7 +141,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc21_23.2: %i32 = converted %int_1.loc21, %.loc21_23.1 [template = constants.%int_1.2] // CHECK:STDOUT: %c: %i32 = bind_name c, %.loc21_23.2 // CHECK:STDOUT: %int_1.loc27: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_1.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_1.loc27) [template = constants.%int_1.2] @@ -149,7 +149,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc27_21.2: %i32 = converted %int_1.loc27, %.loc27_21.1 [template = constants.%int_1.2] // CHECK:STDOUT: %d: %i32 = bind_name d, %.loc27_21.2 // CHECK:STDOUT: %int_1.loc33: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc33: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc33: = bound_method %int_1.loc33, %impl.elem0.loc33 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc33: = specific_function %Convert.bound.loc33, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc33: init %i32 = call %Convert.specific_fn.loc33(%int_1.loc33) [template = constants.%int_1.2] @@ -157,7 +157,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc33_23.2: %i32 = converted %int_1.loc33, %.loc33_23.1 [template = constants.%int_1.2] // CHECK:STDOUT: %e: %i32 = bind_name e, %.loc33_23.2 // CHECK:STDOUT: %int_1.loc46: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc46: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc46: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc46: = bound_method %int_1.loc46, %impl.elem0.loc46 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc46: = specific_function %Convert.bound.loc46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc46: init %i32 = call %Convert.specific_fn.loc46(%int_1.loc46) [template = constants.%int_1.2] @@ -165,7 +165,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc46_29.2: %i32 = converted %int_1.loc46, %.loc46_29.1 [template = constants.%int_1.2] // CHECK:STDOUT: %f: %i32 = bind_name f, %.loc46_29.2 // CHECK:STDOUT: %int_1.loc59: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc59: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc59: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc59: = bound_method %int_1.loc59, %impl.elem0.loc59 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc59: = specific_function %Convert.bound.loc59, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc59: init %i32 = call %Convert.specific_fn.loc59(%int_1.loc59) [template = constants.%int_1.2] @@ -173,7 +173,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc59_31.2: %i32 = converted %int_1.loc59, %.loc59_31.1 [template = constants.%int_1.2] // CHECK:STDOUT: %g: %i32 = bind_name g, %.loc59_31.2 // CHECK:STDOUT: %int_1.loc72: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc72: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc72: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc72: = bound_method %int_1.loc72, %impl.elem0.loc72 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc72: = specific_function %Convert.bound.loc72, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc72: init %i32 = call %Convert.specific_fn.loc72(%int_1.loc72) [template = constants.%int_1.2] @@ -181,7 +181,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc72_33.2: %i32 = converted %int_1.loc72, %.loc72_33.1 [template = constants.%int_1.2] // CHECK:STDOUT: %h: %i32 = bind_name h, %.loc72_33.2 // CHECK:STDOUT: %int_1.loc84: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc84: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc84: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc84: = bound_method %int_1.loc84, %impl.elem0.loc84 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc84: = specific_function %Convert.bound.loc84, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc84: init %i32 = call %Convert.specific_fn.loc84(%int_1.loc84) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 2df28f3743dd..5750525495e9 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -19,9 +19,9 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -65,7 +65,7 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index a11c286dae19..d4ae1680f101 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -23,9 +23,9 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -68,7 +68,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: fn @F(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index 1b43f5b5ee99..0d99dd9023ae 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -49,9 +49,9 @@ var a: i32 = NS.A(); // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.15), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -95,7 +95,7 @@ var a: i32 = NS.A(); // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/namespace/alias.carbon b/toolchain/check/testdata/namespace/alias.carbon index 47b736a8ce0e..ab466e81d6db 100644 --- a/toolchain/check/testdata/namespace/alias.carbon +++ b/toolchain/check/testdata/namespace/alias.carbon @@ -29,9 +29,9 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -100,7 +100,7 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index 85debd7fb315..1ee8fb11c5d1 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -30,9 +30,9 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: %.1: %.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -71,7 +71,7 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: fn @.1() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index 4d72708f44cb..22a5ea9cb6f6 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -42,9 +42,9 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -101,7 +101,7 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %A.var: ref %i32 = var A // CHECK:STDOUT: %A: ref %i32 = bind_name A, %A.var // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22: = bound_method %int_0.loc22, %impl.elem0.loc22 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc22: = specific_function %Convert.bound.loc22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %Convert.specific_fn.loc22(%int_0.loc22) [template = constants.%int_0.2] @@ -113,7 +113,7 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_0.loc27: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_0.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_0.loc27) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index dcfdbe6d13d4..47ca549a7cbb 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -35,9 +35,9 @@ fn Main() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -103,7 +103,7 @@ fn Main() { // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_12, %impl.elem0.loc12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_12) [template = constants.%int_12.2] @@ -111,7 +111,7 @@ fn Main() { // CHECK:STDOUT: assign %a.var, %.loc12 // CHECK:STDOUT: %a.ref.loc13: ref %i32 = name_ref a, %a // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_9, %impl.elem0.loc13 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_9) [template = constants.%int_9.2] @@ -122,14 +122,14 @@ fn Main() { // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc15: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc15_28.1: %tuple.type.3 = tuple_literal (%int_1.loc15, %int_2.loc15) -// CHECK:STDOUT: %impl.elem0.loc15_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_28.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_28.1: = bound_method %int_1.loc15, %impl.elem0.loc15_28.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc15_28.1: = specific_function %Convert.bound.loc15_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc15_28.1: init %i32 = call %Convert.specific_fn.loc15_28.1(%int_1.loc15) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_28.2: init %i32 = converted %int_1.loc15, %int.convert_checked.loc15_28.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc15: ref %i32 = tuple_access %b.var, element0 // CHECK:STDOUT: %.loc15_28.3: init %i32 = initialize_from %.loc15_28.2 to %tuple.elem0.loc15 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc15_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_28.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_28.2: = bound_method %int_2.loc15, %impl.elem0.loc15_28.2 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc15_28.2: = specific_function %Convert.bound.loc15_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc15_28.2: init %i32 = call %Convert.specific_fn.loc15_28.2(%int_2.loc15) [template = constants.%int_2.2] @@ -143,7 +143,7 @@ fn Main() { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %tuple.elem0.loc16: ref %i32 = tuple_access %b.ref.loc16, element0 // CHECK:STDOUT: %int_3.loc16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_3.loc16, %impl.elem0.loc16 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_3.loc16) [template = constants.%int_3.2] @@ -153,7 +153,7 @@ fn Main() { // CHECK:STDOUT: %int_1.loc17: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %tuple.elem1.loc17: ref %i32 = tuple_access %b.ref.loc17, element1 // CHECK:STDOUT: %int_4.loc17: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_4.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_4.loc17) [template = constants.%int_4.2] @@ -164,14 +164,14 @@ fn Main() { // CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc19: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc19_46.1: %struct_type.a.b.2 = struct_literal (%int_1.loc19, %int_2.loc19) -// CHECK:STDOUT: %impl.elem0.loc19_46.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19_46.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_46.1: = bound_method %int_1.loc19, %impl.elem0.loc19_46.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc19_46.1: = specific_function %Convert.bound.loc19_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc19_46.1: init %i32 = call %Convert.specific_fn.loc19_46.1(%int_1.loc19) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc19_46.2: init %i32 = converted %int_1.loc19, %int.convert_checked.loc19_46.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc19_46.3: ref %i32 = struct_access %c.var, element0 // CHECK:STDOUT: %.loc19_46.4: init %i32 = initialize_from %.loc19_46.2 to %.loc19_46.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc19_46.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19_46.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_46.2: = bound_method %int_2.loc19, %impl.elem0.loc19_46.2 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc19_46.2: = specific_function %Convert.bound.loc19_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc19_46.2: init %i32 = call %Convert.specific_fn.loc19_46.2(%int_2.loc19) [template = constants.%int_2.2] @@ -184,7 +184,7 @@ fn Main() { // CHECK:STDOUT: %c.ref.loc20: ref %struct_type.a.b.1 = name_ref c, %c // CHECK:STDOUT: %.loc20_4: ref %i32 = struct_access %c.ref.loc20, element0 // CHECK:STDOUT: %int_3.loc20: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc20: = bound_method %int_3.loc20, %impl.elem0.loc20 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc20: = specific_function %Convert.bound.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %Convert.specific_fn.loc20(%int_3.loc20) [template = constants.%int_3.2] @@ -193,7 +193,7 @@ fn Main() { // CHECK:STDOUT: %c.ref.loc21: ref %struct_type.a.b.1 = name_ref c, %c // CHECK:STDOUT: %.loc21_4: ref %i32 = struct_access %c.ref.loc21, element1 // CHECK:STDOUT: %int_4.loc21: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_4.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_4.loc21) [template = constants.%int_4.2] @@ -208,7 +208,7 @@ fn Main() { // CHECK:STDOUT: %.loc24_4: %ptr.3 = bind_value %p.ref.loc24 // CHECK:STDOUT: %.loc24_3: ref %i32 = deref %.loc24_4 // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24: = bound_method %int_5, %impl.elem0.loc24 [template = constants.%Convert.bound.7] // CHECK:STDOUT: %Convert.specific_fn.loc24: = specific_function %Convert.bound.loc24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.7] // CHECK:STDOUT: %int.convert_checked.loc24: init %i32 = call %Convert.specific_fn.loc24(%int_5) [template = constants.%int_5.2] @@ -231,7 +231,7 @@ fn Main() { // CHECK:STDOUT: %.loc26_5: %ptr.3 = block_arg !if.expr.result // CHECK:STDOUT: %.loc26_3: ref %i32 = deref %.loc26_5 // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_10, %impl.elem0.loc26 [template = constants.%Convert.bound.8] // CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.8] // CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_10) [template = constants.%int_10.2] diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index 5b36957eee41..f0a4e0d62cac 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -68,9 +68,9 @@ fn Main() { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -140,7 +140,7 @@ fn Main() { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref() // CHECK:STDOUT: %int_1.loc23: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_1.loc23, %impl.elem0.loc23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_1.loc23) [template = constants.%int_1.2] @@ -164,7 +164,7 @@ fn Main() { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_0, %impl.elem0.loc29 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_0) [template = constants.%int_0.2] @@ -176,14 +176,14 @@ fn Main() { // CHECK:STDOUT: %int_1.loc34: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc34: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc34_17.1: %tuple.type.1 = tuple_literal (%int_1.loc34, %int_2.loc34) -// CHECK:STDOUT: %impl.elem0.loc34_17.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc34_17.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34_17.1: = bound_method %int_1.loc34, %impl.elem0.loc34_17.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc34_17.1: = specific_function %Convert.bound.loc34_17.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc34_17.1: init %i32 = call %Convert.specific_fn.loc34_17.1(%int_1.loc34) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc34_17.2: init %i32 = converted %int_1.loc34, %int.convert_checked.loc34_17.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc34: %i32 = tuple_access %.loc34_8.1, element0 // CHECK:STDOUT: %.loc34_17.3: init %i32 = initialize_from %.loc34_17.2 to %tuple.elem0.loc34 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc34_17.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc34_17.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34_17.2: = bound_method %int_2.loc34, %impl.elem0.loc34_17.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc34_17.2: = specific_function %Convert.bound.loc34_17.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc34_17.2: init %i32 = call %Convert.specific_fn.loc34_17.2(%int_2.loc34) [template = constants.%int_2.2] @@ -225,7 +225,7 @@ fn Main() { // CHECK:STDOUT: %int_1.loc49: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc49: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc49_12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc49_12: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc49_12: = bound_method %int_1.loc49, %impl.elem0.loc49_12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc49_12: = specific_function %Convert.bound.loc49_12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc49_12: init %i32 = call %Convert.specific_fn.loc49_12(%int_1.loc49) [template = constants.%int_1.2] @@ -235,7 +235,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc49: // CHECK:STDOUT: %int_2.loc49: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc49_19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc49_19: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc49_19: = bound_method %int_2.loc49, %impl.elem0.loc49_19 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc49_19: = specific_function %Convert.bound.loc49_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc49_19: init %i32 = call %Convert.specific_fn.loc49_19(%int_2.loc49) [template = constants.%int_2.2] @@ -246,7 +246,7 @@ fn Main() { // CHECK:STDOUT: !if.expr.result.loc49: // CHECK:STDOUT: %.loc49_4: %i32 = block_arg !if.expr.result.loc49 [template = constants.%int_1.2] // CHECK:STDOUT: %int_3.loc49: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc49_27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc49_27: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc49_27: = bound_method %int_3.loc49, %impl.elem0.loc49_27 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc49_27: = specific_function %Convert.bound.loc49_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc49_27: init %i32 = call %Convert.specific_fn.loc49_27(%int_3.loc49) [template = constants.%int_3.2] @@ -270,7 +270,7 @@ fn Main() { // CHECK:STDOUT: !if.expr.result.loc56: // CHECK:STDOUT: %.loc56_4: %i32 = block_arg !if.expr.result.loc56 // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc56: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc56: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc56: = bound_method %int_10, %impl.elem0.loc56 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc56: = specific_function %Convert.bound.loc56, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc56: init %i32 = call %Convert.specific_fn.loc56(%int_10) [template = constants.%int_10.2] diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index 3f195420be5c..127bc6067878 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -32,9 +32,9 @@ fn Main() { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -77,7 +77,7 @@ fn Main() { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -91,7 +91,7 @@ fn Main() { // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index 210415f238c7..7147f5402052 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -28,9 +28,9 @@ fn Main() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] @@ -60,7 +60,7 @@ fn Main() { // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon index 37bdaab74288..0ab32ccf824a 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -61,7 +61,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %.loc17: %empty_struct_type = struct_literal () // CHECK:STDOUT: %float: f64 = float_literal 3.4000000000000004 [template = constants.%float] // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12] -// CHECK:STDOUT: %impl.elem0: %Op.type = interface_witness_access , element0 [template = ] +// CHECK:STDOUT: %impl.elem0: %Op.type = impl_witness_access , element0 [template = ] // CHECK:STDOUT: %Op.bound: = bound_method , %impl.elem0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index 4694644e81fc..fa436f806396 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -40,16 +40,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %AddAssign.type: type = facet_type <@AddAssign> [template] -// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] +// CHECK:STDOUT: %ptr.3: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] @@ -81,11 +81,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%Add.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%AddAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc22: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -105,17 +107,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %ptr.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %ptr.3 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %a.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param +// CHECK:STDOUT: %a: %ptr.3 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param @@ -123,7 +125,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Add.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -141,36 +143,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %AddAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %self.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.3 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -181,7 +181,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -189,7 +189,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.2](%other.param_patt: %C) { +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.3](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -198,21 +198,21 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.2, %b.param_patt: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.3, %b.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %ptr.3 = name_ref a, %a // CHECK:STDOUT: %.loc31: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc31 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc31 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index 21f250e41624..70dff3b8d6e0 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -40,16 +40,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %BitAndAssign.type: type = facet_type <@BitAndAssign> [template] -// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] +// CHECK:STDOUT: %ptr.3: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] @@ -81,11 +81,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, imports.%import_ref.1 [template = constants.%BitAnd.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitAndAssign.ref: type = name_ref BitAndAssign, imports.%import_ref.5 [template = constants.%BitAndAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc22: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -105,17 +107,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %ptr.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %ptr.3 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %a.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param +// CHECK:STDOUT: %a: %ptr.3 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param @@ -123,7 +125,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %BitAnd.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -141,36 +143,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %BitAndAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %self.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.3 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -181,7 +181,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -189,7 +189,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.2](%other.param_patt: %C) { +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.3](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -198,21 +198,21 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.2, %b.param_patt: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.3, %b.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %ptr.3 = name_ref a, %a // CHECK:STDOUT: %.loc31: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc31 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc31 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index cb1d942f3162..1ec5372b950f 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -32,9 +32,9 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %BitComplement.type: type = facet_type <@BitComplement> [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] @@ -62,6 +62,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitComplement.ref: type = name_ref BitComplement, imports.%import_ref.1 [template = constants.%BitComplement.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -78,7 +79,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %BitComplement.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %C = return_slot_pattern @@ -91,11 +92,10 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -106,7 +106,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C]() -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C]() -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -117,7 +117,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: fn @TestOp(%a.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc23: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref) to %.loc23 diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index ab0e28ddc8d4..682754b8a940 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -40,16 +40,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %BitOr.type: type = facet_type <@BitOr> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %BitOrAssign.type: type = facet_type <@BitOrAssign> [template] -// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] +// CHECK:STDOUT: %ptr.3: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] @@ -81,11 +81,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitOr.ref: type = name_ref BitOr, imports.%import_ref.1 [template = constants.%BitOr.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitOrAssign.ref: type = name_ref BitOrAssign, imports.%import_ref.5 [template = constants.%BitOrAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc22: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -105,17 +107,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %ptr.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %ptr.3 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %a.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param +// CHECK:STDOUT: %a: %ptr.3 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param @@ -123,7 +125,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %BitOr.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -141,36 +143,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %BitOrAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %self.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.3 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -181,7 +181,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -189,7 +189,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.2](%other.param_patt: %C) { +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.3](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -198,21 +198,21 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.2, %b.param_patt: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.3, %b.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %ptr.3 = name_ref a, %a // CHECK:STDOUT: %.loc31: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc31 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc31 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index 09ce19784887..f85503a3d5ce 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -40,16 +40,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %BitXor.type: type = facet_type <@BitXor> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %BitXorAssign.type: type = facet_type <@BitXorAssign> [template] -// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] +// CHECK:STDOUT: %ptr.3: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] @@ -81,11 +81,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitXor.ref: type = name_ref BitXor, imports.%import_ref.1 [template = constants.%BitXor.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitXorAssign.ref: type = name_ref BitXorAssign, imports.%import_ref.5 [template = constants.%BitXorAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc22: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -105,17 +107,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %ptr.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %ptr.3 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %a.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param +// CHECK:STDOUT: %a: %ptr.3 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param @@ -123,7 +125,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %BitXor.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -141,36 +143,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %BitXorAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %self.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.3 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -181,7 +181,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -189,7 +189,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.2](%other.param_patt: %C) { +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.3](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -198,21 +198,21 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.2, %b.param_patt: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.3, %b.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %ptr.3 = name_ref a, %a // CHECK:STDOUT: %.loc31: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc31 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc31 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 036345b6a5e7..b9933733a45f 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -31,11 +31,11 @@ fn TestOp() { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Dec.type: type = facet_type <@Dec> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %ptr.1: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Op.decl) [template] +// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] @@ -63,27 +63,27 @@ fn TestOp() { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Dec.ref: type = name_ref Dec, imports.%import_ref.1 [template = constants.%Dec.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Dec.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { -// CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { +// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc18_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 -// CHECK:STDOUT: %.loc18_21: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_21: type = splice_block %ptr [template = constants.%ptr.2] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -94,7 +94,7 @@ fn TestOp() { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr %self.param_patt: %ptr.1](); +// CHECK:STDOUT: fn @Op.2[addr %self.param_patt: %ptr.2](); // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp() { // CHECK:STDOUT: !entry: @@ -105,9 +105,9 @@ fn TestOp() { // CHECK:STDOUT: %.loc22_16: init %C = converted %.loc22_15.1, %.loc22_15.2 [template = constants.%C.val] // CHECK:STDOUT: assign %c.var, %.loc22_16 // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %c.ref, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.1 = addr_of %c.ref +// CHECK:STDOUT: %addr: %ptr.2 = addr_of %c.ref // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index 89a5cf494ad0..c9d4e6f84c33 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -40,16 +40,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Div.type: type = facet_type <@Div> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %DivAssign.type: type = facet_type <@DivAssign> [template] -// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] +// CHECK:STDOUT: %ptr.3: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] @@ -81,11 +81,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Div.ref: type = name_ref Div, imports.%import_ref.1 [template = constants.%Div.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %DivAssign.ref: type = name_ref DivAssign, imports.%import_ref.5 [template = constants.%DivAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc22: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -105,17 +107,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %ptr.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %ptr.3 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %a.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param +// CHECK:STDOUT: %a: %ptr.3 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param @@ -123,7 +125,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Div.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -141,36 +143,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %DivAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %self.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.3 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -181,7 +181,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -189,7 +189,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.2](%other.param_patt: %C) { +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.3](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -198,21 +198,21 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.2, %b.param_patt: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.3, %b.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %ptr.3 = name_ref a, %a // CHECK:STDOUT: %.loc31: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc31 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc31 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 0a6cbd1a8a9b..f4bf03c0f68a 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -89,15 +89,15 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Eq.type: type = facet_type <@Eq> [template] +// CHECK:STDOUT: %Equal.type.1: type = fn_type @Equal.1 [template] +// CHECK:STDOUT: %NotEqual.type.1: type = fn_type @NotEqual.1 [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Equal.decl, @impl.1.%NotEqual.decl) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Equal.type.1: type = fn_type @Equal.1 [template] -// CHECK:STDOUT: %Equal.1: %Equal.type.1 = struct_value () [template] -// CHECK:STDOUT: %NotEqual.type.1: type = fn_type @NotEqual.1 [template] -// CHECK:STDOUT: %NotEqual.1: %NotEqual.type.1 = struct_value () [template] // CHECK:STDOUT: %Equal.type.2: type = fn_type @Equal.2 [template] +// CHECK:STDOUT: %Equal.2: %Equal.type.2 = struct_value () [template] // CHECK:STDOUT: %NotEqual.type.2: type = fn_type @NotEqual.2 [template] -// CHECK:STDOUT: %interface: = interface_witness (%Equal.1, %NotEqual.1) [template] +// CHECK:STDOUT: %NotEqual.2: %NotEqual.type.2 = struct_value () [template] // CHECK:STDOUT: %TestEqual.type: type = fn_type @TestEqual [template] // CHECK:STDOUT: %TestEqual: %TestEqual.type = struct_value () [template] // CHECK:STDOUT: %TestNotEqual.type: type = fn_type @TestNotEqual [template] @@ -128,6 +128,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%Eq.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Equal.decl, @impl.1.%NotEqual.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [template = constants.%TestEqual] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -171,7 +172,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Eq.ref { -// CHECK:STDOUT: %Equal.decl: %Equal.type.1 = fn_decl @Equal.1 [template = constants.%Equal.1] { +// CHECK:STDOUT: %Equal.decl: %Equal.type.2 = fn_decl @Equal.2 [template = constants.%Equal.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -191,7 +192,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %NotEqual.decl: %NotEqual.type.1 = fn_decl @NotEqual.1 [template = constants.%NotEqual.1] { +// CHECK:STDOUT: %NotEqual.decl: %NotEqual.type.2 = fn_decl @NotEqual.2 [template = constants.%NotEqual.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -211,12 +212,11 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Equal = %Equal.decl // CHECK:STDOUT: .NotEqual = %NotEqual.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -227,15 +227,15 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Equal.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; +// CHECK:STDOUT: fn @Equal.2[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NotEqual.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; +// CHECK:STDOUT: fn @NotEqual.2[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: fn @TestEqual(%a.param_patt: %C, %b.param_patt: %C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Equal.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Equal.1] +// CHECK:STDOUT: %impl.elem0: %Equal.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.2] // CHECK:STDOUT: %Equal.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %Equal.call: init bool = call %Equal.bound(%a.ref, %b.ref) // CHECK:STDOUT: %.loc12_16.1: bool = value_of_initializer %Equal.call @@ -247,7 +247,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem1: %NotEqual.type.2 = interface_witness_access constants.%interface, element1 [template = constants.%NotEqual.1] +// CHECK:STDOUT: %impl.elem1: %NotEqual.type.1 = impl_witness_access constants.%impl_witness, element1 [template = constants.%NotEqual.2] // CHECK:STDOUT: %NotEqual.bound: = bound_method %a.ref, %impl.elem1 // CHECK:STDOUT: %NotEqual.call: init bool = call %NotEqual.bound(%a.ref, %b.ref) // CHECK:STDOUT: %.loc16_16.1: bool = value_of_initializer %NotEqual.call @@ -359,14 +359,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %Eq.type: type = facet_type <@Eq> [template] +// CHECK:STDOUT: %Equal.type.1: type = fn_type @Equal.1 [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Equal.decl, @impl.1.%NotEqual.decl) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Equal.type.1: type = fn_type @Equal.1 [template] -// CHECK:STDOUT: %Equal.1: %Equal.type.1 = struct_value () [template] -// CHECK:STDOUT: %NotEqual.type.1: type = fn_type @NotEqual.1 [template] -// CHECK:STDOUT: %NotEqual.1: %NotEqual.type.1 = struct_value () [template] // CHECK:STDOUT: %Equal.type.2: type = fn_type @Equal.2 [template] -// CHECK:STDOUT: %interface: = interface_witness (%Equal.1, %NotEqual.1) [template] +// CHECK:STDOUT: %Equal.2: %Equal.type.2 = struct_value () [template] +// CHECK:STDOUT: %NotEqual.type.2: type = fn_type @NotEqual.2 [template] +// CHECK:STDOUT: %NotEqual.2: %NotEqual.type.2 = struct_value () [template] // CHECK:STDOUT: %TestRhsBad.type: type = fn_type @TestRhsBad [template] // CHECK:STDOUT: %TestRhsBad: %TestRhsBad.type = struct_value () [template] // CHECK:STDOUT: %TestLhsBad.type: type = fn_type @TestLhsBad [template] @@ -400,6 +400,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%Eq.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Equal.decl, @impl.1.%NotEqual.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %TestRhsBad.decl: %TestRhsBad.type = fn_decl @TestRhsBad [template = constants.%TestRhsBad] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -443,7 +444,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Eq.ref { -// CHECK:STDOUT: %Equal.decl: %Equal.type.1 = fn_decl @Equal.1 [template = constants.%Equal.1] { +// CHECK:STDOUT: %Equal.decl: %Equal.type.2 = fn_decl @Equal.2 [template = constants.%Equal.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -463,7 +464,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %NotEqual.decl: %NotEqual.type.1 = fn_decl @NotEqual.1 [template = constants.%NotEqual.1] { +// CHECK:STDOUT: %NotEqual.decl: %NotEqual.type.2 = fn_decl @NotEqual.2 [template = constants.%NotEqual.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -483,12 +484,11 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Equal = %Equal.decl // CHECK:STDOUT: .NotEqual = %NotEqual.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -507,15 +507,15 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Equal.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; +// CHECK:STDOUT: fn @Equal.2[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NotEqual.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; +// CHECK:STDOUT: fn @NotEqual.2[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: fn @TestRhsBad(%a.param_patt: %C, %b.param_patt: %D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Equal.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Equal.1] +// CHECK:STDOUT: %impl.elem0: %Equal.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.2] // CHECK:STDOUT: %Equal.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc23_15: %C = converted %b.ref, [template = ] // CHECK:STDOUT: %Equal.call: init bool = call %Equal.bound(%a.ref, ) diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index 873c354de0c0..529c1053474b 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -48,16 +48,16 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Inc.type: type = facet_type <@Inc> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %ptr.1: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] +// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %AddAssign.type: type = facet_type <@AddAssign> [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %TestIncNonRef.type: type = fn_type @TestIncNonRef [template] // CHECK:STDOUT: %TestIncNonRef: %TestIncNonRef.type = struct_value () [template] // CHECK:STDOUT: %TestAddAssignNonRef.type: type = fn_type @TestAddAssignNonRef [template] @@ -89,11 +89,13 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%Inc.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc15: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%AddAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc18: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %TestIncNonRef.decl: %TestIncNonRef.type = fn_decl @TestIncNonRef [template = constants.%TestIncNonRef] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -118,48 +120,46 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Inc.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { -// CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { +// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc16_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 -// CHECK:STDOUT: %.loc16_21: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_21: type = splice_block %ptr [template = constants.%ptr.2] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %AddAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc19_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 -// CHECK:STDOUT: %.loc19_21: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19_21: type = splice_block %ptr [template = constants.%ptr.2] { // CHECK:STDOUT: %C.ref.loc19_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc19_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -170,14 +170,14 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr %self.param_patt: %ptr.1](); +// CHECK:STDOUT: fn @Op.2[addr %self.param_patt: %ptr.2](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.1](%other.param_patt: %C); +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.2](%other.param_patt: %C); // CHECK:STDOUT: // CHECK:STDOUT: fn @TestIncNonRef(%a.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound() // CHECK:STDOUT: return @@ -187,7 +187,7 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(, %b.ref) // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon b/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon index 7caf31184ebc..d169bdd8047a 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon @@ -37,9 +37,9 @@ fn G(n: i32) { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %impl_witness.23: = impl_witness (imports.%import_ref.98), @impl.13(%int_32) [template] // CHECK:STDOUT: %Op.type.14: type = fn_type @Op.2, @impl.13(%int_32) [template] // CHECK:STDOUT: %Op.14: %Op.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Op.14) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -76,7 +76,7 @@ fn G(n: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %undeclared.ref: = name_ref undeclared, [template = ] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %impl.elem0: %Op.type.1 = interface_witness_access , element0 [template = ] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access , element0 [template = ] // CHECK:STDOUT: %Op.bound: = bound_method %undeclared.ref, %impl.elem0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -85,7 +85,7 @@ fn G(n: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %undeclared.ref: = name_ref undeclared, [template = ] -// CHECK:STDOUT: %impl.elem0: %Op.type.1 = interface_witness_access constants.%interface.19, element0 [template = constants.%Op.14] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.23, element0 [template = constants.%Op.14] // CHECK:STDOUT: %Op.bound: = bound_method %n.ref, %impl.elem0 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index e3fabdff6aea..3225ceee44bb 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -58,15 +58,15 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %AddAssign.type: type = facet_type <@AddAssign> [template] -// CHECK:STDOUT: %ptr.1: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] +// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] @@ -102,11 +102,13 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%Add.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc16: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%AddAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc19: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -136,7 +138,7 @@ fn TestAssign(b: D) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Add.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -154,36 +156,34 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %AddAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc20_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 -// CHECK:STDOUT: %.loc20_21: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20_21: type = splice_block %ptr [template = constants.%ptr.2] { // CHECK:STDOUT: %C.ref.loc20_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc20_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -202,15 +202,15 @@ fn TestAssign(b: D) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %C; +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C](%other.param_patt: %C) -> %C; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.1](%other.param_patt: %C); +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.2](%other.param_patt: %C); // CHECK:STDOUT: // CHECK:STDOUT: fn @Test(%a.param_patt: %C, %b.param_patt: %D) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc23: ref %C = splice_block %return {} // CHECK:STDOUT: %.loc34: %C = converted %b.ref, [template = ] @@ -228,9 +228,9 @@ fn TestAssign(b: D) { // CHECK:STDOUT: assign %a.var, %.loc38_16 // CHECK:STDOUT: %a.ref: ref %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.1 = addr_of %a.ref +// CHECK:STDOUT: %addr: %ptr.2 = addr_of %a.ref // CHECK:STDOUT: %.loc48: %C = converted %b.ref, [template = ] // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, ) // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index 315a18084c1a..b3c9cc684662 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -47,14 +47,14 @@ fn Test() { // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.1 = struct_value () [template] // CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%X)> [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%X) [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Convert.3) [template] // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Convert.5) [template] // CHECK:STDOUT: %Sink_i32.type: type = fn_type @Sink_i32 [template] // CHECK:STDOUT: %Sink_i32: %Sink_i32.type = struct_value () [template] // CHECK:STDOUT: %Sink_X.type: type = fn_type @Sink_X [template] @@ -100,6 +100,7 @@ fn Test() { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%X)> [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc15: = impl_witness (@impl.1.%Convert.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] @@ -108,6 +109,7 @@ fn Test() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc19: = impl_witness (@impl.2.%Convert.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %Sink_i32.decl: %Sink_i32.type = fn_decl @Sink_i32 [template = constants.%Sink_i32] { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 @@ -159,11 +161,10 @@ fn Test() { // CHECK:STDOUT: %return.param: ref %X = out_param runtime_param1 // CHECK:STDOUT: %return: ref %X = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %X.ref as %ImplicitAs.type { @@ -181,11 +182,10 @@ fn Test() { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { @@ -250,7 +250,7 @@ fn Test() { // CHECK:STDOUT: %Source.specific_fn.loc30: = specific_function %Source.ref.loc30, @Source(constants.%X) [template = constants.%Source.specific_fn.2] // CHECK:STDOUT: %.loc30_20.1: ref %X = temporary_storage // CHECK:STDOUT: %Source.call.loc30: init %X = call %Source.specific_fn.loc30() to %.loc30_20.1 -// CHECK:STDOUT: %impl.elem0.loc30: %Convert.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Convert.5] +// CHECK:STDOUT: %impl.elem0.loc30: %Convert.type.4 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Convert.5] // CHECK:STDOUT: %Convert.bound.loc30: = bound_method %Source.call.loc30, %impl.elem0.loc30 // CHECK:STDOUT: %.loc30_20.2: ref %X = temporary %.loc30_20.1, %Source.call.loc30 // CHECK:STDOUT: %.loc30_20.3: %X = bind_value %.loc30_20.2 @@ -264,7 +264,7 @@ fn Test() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Source.specific_fn.loc31: = specific_function %Source.ref.loc31, @Source(constants.%i32) [template = constants.%Source.specific_fn.3] // CHECK:STDOUT: %Source.call.loc31: init %i32 = call %Source.specific_fn.loc31() -// CHECK:STDOUT: %impl.elem0.loc31: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc31: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc31: = bound_method %Source.call.loc31, %impl.elem0.loc31 // CHECK:STDOUT: %.loc31_20.1: ref %X = temporary_storage // CHECK:STDOUT: %.loc31_20.2: %i32 = value_of_initializer %Source.call.loc31 diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 87045188460c..320ab4ecac44 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -31,11 +31,11 @@ fn TestOp() { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Inc.type: type = facet_type <@Inc> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %ptr.1: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Op.decl) [template] +// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] @@ -63,27 +63,27 @@ fn TestOp() { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%Inc.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Inc.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { -// CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { +// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc18_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 -// CHECK:STDOUT: %.loc18_21: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_21: type = splice_block %ptr [template = constants.%ptr.2] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -94,7 +94,7 @@ fn TestOp() { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr %self.param_patt: %ptr.1](); +// CHECK:STDOUT: fn @Op.2[addr %self.param_patt: %ptr.2](); // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp() { // CHECK:STDOUT: !entry: @@ -105,9 +105,9 @@ fn TestOp() { // CHECK:STDOUT: %.loc22_16: init %C = converted %.loc22_15.1, %.loc22_15.2 [template = constants.%C.val] // CHECK:STDOUT: assign %c.var, %.loc22_16 // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %c.ref, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.1 = addr_of %c.ref +// CHECK:STDOUT: %addr: %ptr.2 = addr_of %c.ref // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index b78c3dbacb29..9b5a370bc6d7 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -88,9 +88,9 @@ let x: i32 = c[0]; // CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.1 = struct_value () [template] // CHECK:STDOUT: %IndexWith.type.3: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.1, %ElementType.1)> [template] // CHECK:STDOUT: %At.type.2: type = fn_type @At.1, @IndexWith(%SubscriptType.1, %ElementType.1) [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%At.decl) [template] // CHECK:STDOUT: %At.type.3: type = fn_type @At.2 [template] // CHECK:STDOUT: %At.3: %At.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%At.3) [template] // CHECK:STDOUT: %ElementType.val: %ElementType.1 = struct_value () [template] // CHECK:STDOUT: %SubscriptType.val: %SubscriptType.1 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] @@ -127,6 +127,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [template = constants.%ElementType.1] // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%SubscriptType.1, constants.%ElementType.1)> [template = constants.%IndexWith.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%At.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref as %IndexWith.type { @@ -148,11 +149,10 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.param: ref %ElementType.1 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %ElementType.1 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%At.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .At = %At.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -205,7 +205,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %c: %C = bind_name c, %.loc15_14.2 // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %s.ref: %SubscriptType.1 = name_ref s, %s -// CHECK:STDOUT: %impl.elem0: %At.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%At.3] +// CHECK:STDOUT: %impl.elem0: %At.type.2 = impl_witness_access constants.%impl_witness, element0 [template = constants.%At.3] // CHECK:STDOUT: %At.bound: = bound_method %c.ref, %impl.elem0 // CHECK:STDOUT: %.loc16_25.1: ref %ElementType.1 = temporary_storage // CHECK:STDOUT: %At.call: init %ElementType.1 = call %At.bound(%c.ref, %s.ref) to %.loc16_25.1 @@ -226,17 +226,17 @@ let x: i32 = c[0]; // CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.1 = struct_value () [template] // CHECK:STDOUT: %IndexWith.type.3: type = facet_type <@IndexWith, @IndexWith(%i32, %i32)> [template] // CHECK:STDOUT: %At.type.2: type = fn_type @At.1, @IndexWith(%i32, %i32) [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%At.decl) [template] // CHECK:STDOUT: %At.type.3: type = fn_type @At.2 [template] // CHECK:STDOUT: %At.3: %At.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%At.3) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.20: = impl_witness (imports.%import_ref.19), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.20: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -282,6 +282,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %i32.loc4_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%i32, constants.%i32)> [template = constants.%IndexWith.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%At.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %.loc4_15.2 as %IndexWith.type { @@ -307,11 +308,10 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%At.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .At = %At.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @At.2[%self.param_patt: %tuple.type.2](%subscript.param_patt: %i32) -> %i32 { @@ -327,13 +327,13 @@ let x: i32 = c[0]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc10_26.1: %tuple.type.3 = tuple_literal (%int_1, %int_5) -// CHECK:STDOUT: %impl.elem0.loc10_26.1: %Convert.type.2 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_26.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.20, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26.1: = bound_method %int_1, %impl.elem0.loc10_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_26.1: = specific_function %Convert.bound.loc10_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_26.1: init %i32 = call %Convert.specific_fn.loc10_26.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_26.2: %i32 = value_of_initializer %int.convert_checked.loc10_26.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_26.3: %i32 = converted %int_1, %.loc10_26.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_26.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.20, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26.2: = bound_method %int_5, %impl.elem0.loc10_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10_26.2: = specific_function %Convert.bound.loc10_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10_26.2: init %i32 = call %Convert.specific_fn.loc10_26.2(%int_5) [template = constants.%int_5.2] @@ -344,13 +344,13 @@ let x: i32 = c[0]; // CHECK:STDOUT: %s: %tuple.type.2 = bind_name s, %.loc10_27 // CHECK:STDOUT: %s.ref: %tuple.type.2 = name_ref s, %s // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_17.1: %Convert.type.2 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_17.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.20, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_0, %impl.elem0.loc11_17.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc11_17.1: %i32 = value_of_initializer %int.convert_checked.loc11 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc11_17.2: %i32 = converted %int_0, %.loc11_17.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc11_17.2: %At.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%At.3] +// CHECK:STDOUT: %impl.elem0.loc11_17.2: %At.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%At.3] // CHECK:STDOUT: %At.bound: = bound_method %s.ref, %impl.elem0.loc11_17.2 // CHECK:STDOUT: %At.call: init %i32 = call %At.bound(%s.ref, %.loc11_17.2) // CHECK:STDOUT: %.loc11_18.1: %i32 = value_of_initializer %At.call @@ -371,9 +371,9 @@ let x: i32 = c[0]; // CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.1 = struct_value () [template] // CHECK:STDOUT: %IndexWith.type.3: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.1, %ElementType.1)> [template] // CHECK:STDOUT: %At.type.2: type = fn_type @At.1, @IndexWith(%SubscriptType.1, %ElementType.1) [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%At.decl) [template] // CHECK:STDOUT: %At.type.3: type = fn_type @At.2 [template] // CHECK:STDOUT: %At.3: %At.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%At.3) [template] // CHECK:STDOUT: %ElementType.val: %ElementType.1 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] @@ -410,6 +410,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [template = constants.%ElementType.1] // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%SubscriptType.1, constants.%ElementType.1)> [template = constants.%IndexWith.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%At.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref as %IndexWith.type { @@ -431,11 +432,10 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.param: ref %ElementType.1 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %ElementType.1 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%At.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .At = %At.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -482,7 +482,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc22_25.1: %SubscriptType.1 = converted %int_0, [template = ] -// CHECK:STDOUT: %impl.elem0: %At.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%At.3] +// CHECK:STDOUT: %impl.elem0: %At.type.2 = impl_witness_access constants.%impl_witness, element0 [template = constants.%At.3] // CHECK:STDOUT: %At.bound: = bound_method %c.ref, %impl.elem0 // CHECK:STDOUT: %.loc22_25.2: ref %ElementType.1 = temporary_storage // CHECK:STDOUT: %At.call: init %ElementType.1 = call %At.bound(%c.ref, ) to %.loc22_25.2 diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index f73575e5a417..3d0b94af1380 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -40,16 +40,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %LeftShift.type: type = facet_type <@LeftShift> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %LeftShiftAssign.type: type = facet_type <@LeftShiftAssign> [template] -// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] +// CHECK:STDOUT: %ptr.3: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] @@ -81,11 +81,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %LeftShift.ref: type = name_ref LeftShift, imports.%import_ref.1 [template = constants.%LeftShift.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %LeftShiftAssign.ref: type = name_ref LeftShiftAssign, imports.%import_ref.5 [template = constants.%LeftShiftAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc22: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -105,17 +107,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %ptr.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %ptr.3 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %a.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param +// CHECK:STDOUT: %a: %ptr.3 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param @@ -123,7 +125,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %LeftShift.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -141,36 +143,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %LeftShiftAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %self.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.3 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -181,7 +181,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -189,7 +189,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.2](%other.param_patt: %C) { +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.3](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -198,21 +198,21 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.2, %b.param_patt: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.3, %b.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %ptr.3 = name_ref a, %a // CHECK:STDOUT: %.loc31: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc31 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc31 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index 61b8a4a51408..4c7f471051aa 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -40,16 +40,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Mod.type: type = facet_type <@Mod> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %ModAssign.type: type = facet_type <@ModAssign> [template] -// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] +// CHECK:STDOUT: %ptr.3: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] @@ -81,11 +81,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Mod.ref: type = name_ref Mod, imports.%import_ref.1 [template = constants.%Mod.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ModAssign.ref: type = name_ref ModAssign, imports.%import_ref.5 [template = constants.%ModAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc22: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -105,17 +107,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %ptr.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %ptr.3 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %a.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param +// CHECK:STDOUT: %a: %ptr.3 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param @@ -123,7 +125,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Mod.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -141,36 +143,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %ModAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %self.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.3 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -181,7 +181,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -189,7 +189,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.2](%other.param_patt: %C) { +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.3](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -198,21 +198,21 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.2, %b.param_patt: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.3, %b.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %ptr.3 = name_ref a, %a // CHECK:STDOUT: %.loc31: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc31 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc31 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index ed21aa4d5d8e..4c56da54c62a 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -40,16 +40,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Mul.type: type = facet_type <@Mul> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %MulAssign.type: type = facet_type <@MulAssign> [template] -// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] +// CHECK:STDOUT: %ptr.3: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] @@ -81,11 +81,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Mul.ref: type = name_ref Mul, imports.%import_ref.1 [template = constants.%Mul.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %MulAssign.ref: type = name_ref MulAssign, imports.%import_ref.5 [template = constants.%MulAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc22: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -105,17 +107,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %ptr.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %ptr.3 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %a.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param +// CHECK:STDOUT: %a: %ptr.3 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param @@ -123,7 +125,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Mul.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -141,36 +143,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %MulAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %self.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.3 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -181,7 +181,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -189,7 +189,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.2](%other.param_patt: %C) { +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.3](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -198,21 +198,21 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.2, %b.param_patt: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.3, %b.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %ptr.3 = name_ref a, %a // CHECK:STDOUT: %.loc31: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc31 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc31 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index 532c6cf0faa0..ce280557ee3c 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -32,9 +32,9 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] @@ -62,6 +62,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Negate.ref: type = name_ref Negate, imports.%import_ref.1 [template = constants.%Negate.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -78,7 +79,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Negate.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %C = return_slot_pattern @@ -91,11 +92,10 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -106,7 +106,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C]() -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C]() -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -117,7 +117,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: fn @TestOp(%a.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc23: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref) to %.loc23 diff --git a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon b/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon index 68f4c5e92cb0..694186312020 100644 --- a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon @@ -132,10 +132,10 @@ fn F() { ()[()]; } // CHECK:STDOUT: %At.2: %At.type.2 = struct_value () [template] // CHECK:STDOUT: %At.assoc_type.2: type = assoc_entity_type %IndexWith.type.3, %At.type.2 [template] // CHECK:STDOUT: %assoc0.2: %At.assoc_type.2 = assoc_entity element0, @IndexWith.%At.decl [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%At.decl) [template] // CHECK:STDOUT: %At.type.3: type = fn_type @At.2 [template] // CHECK:STDOUT: %At.3: %At.type.3 = struct_value () [template] -// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.2 = facet_value %empty_tuple.type, %empty_tuple.type [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%At.3) [template] +// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.2 = facet_value %empty_tuple.type, %impl_witness [symbolic] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -166,6 +166,7 @@ fn F() { ()[()]; } // CHECK:STDOUT: %.loc9_29: type = converted %.loc9_28, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%empty_tuple.type)> [template = constants.%IndexWith.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%At.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -239,11 +240,10 @@ fn F() { ()[()]; } // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param2 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%At.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .At = %At.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @At.1(@IndexWith.%SubscriptType.loc5_26.1: type, @IndexWith.%Self.1: @IndexWith.%IndexWith.type (%IndexWith.type.2)) { @@ -271,7 +271,7 @@ fn F() { ()[()]; } // CHECK:STDOUT: %.loc15_11.2: %empty_tuple.type = converted %.loc15_11.1, %empty_tuple.loc15_11 [template = constants.%empty_tuple] // CHECK:STDOUT: %empty_tuple.loc15_14: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc15_15: %empty_tuple.type = converted %.loc15_14, %empty_tuple.loc15_14 [template = constants.%empty_tuple] -// CHECK:STDOUT: %impl.elem0: %At.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%At.3] +// CHECK:STDOUT: %impl.elem0: %At.type.2 = impl_witness_access constants.%impl_witness, element0 [template = constants.%At.3] // CHECK:STDOUT: %At.bound: = bound_method %.loc15_11.2, %impl.elem0 [template = constants.%At.bound] // CHECK:STDOUT: %At.call: init %empty_tuple.type = call %At.bound(%.loc15_11.2, %.loc15_15) // CHECK:STDOUT: return @@ -282,8 +282,6 @@ fn F() { ()[()]; } // CHECK:STDOUT: %SubscriptType.patt.loc5_26.2 => constants.%SubscriptType // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @IndexWith(@At.1.%SubscriptType) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @At.1(constants.%SubscriptType, constants.%Self) { // CHECK:STDOUT: %SubscriptType => constants.%SubscriptType // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.2 @@ -291,6 +289,8 @@ fn F() { ()[()]; } // CHECK:STDOUT: %Self.as_type.loc6_15.1 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @IndexWith(@At.1.%SubscriptType) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @IndexWith(%SubscriptType.loc5_26.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @IndexWith(constants.%empty_tuple.type) { diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index c031b4f32103..dfa1cdd704c3 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -81,21 +81,21 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Ordered.type: type = facet_type <@Ordered> [template] +// CHECK:STDOUT: %Less.type.1: type = fn_type @Less.1 [template] +// CHECK:STDOUT: %LessOrEquivalent.type.1: type = fn_type @LessOrEquivalent.1 [template] +// CHECK:STDOUT: %Greater.type.1: type = fn_type @Greater.1 [template] +// CHECK:STDOUT: %GreaterOrEquivalent.type.1: type = fn_type @GreaterOrEquivalent.1 [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Less.decl, @impl.1.%LessOrEquivalent.decl, @impl.1.%Greater.decl, @impl.1.%GreaterOrEquivalent.decl) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Less.type.1: type = fn_type @Less.1 [template] -// CHECK:STDOUT: %Less.1: %Less.type.1 = struct_value () [template] -// CHECK:STDOUT: %LessOrEquivalent.type.1: type = fn_type @LessOrEquivalent.1 [template] -// CHECK:STDOUT: %LessOrEquivalent.1: %LessOrEquivalent.type.1 = struct_value () [template] -// CHECK:STDOUT: %Greater.type.1: type = fn_type @Greater.1 [template] -// CHECK:STDOUT: %Greater.1: %Greater.type.1 = struct_value () [template] -// CHECK:STDOUT: %GreaterOrEquivalent.type.1: type = fn_type @GreaterOrEquivalent.1 [template] -// CHECK:STDOUT: %GreaterOrEquivalent.1: %GreaterOrEquivalent.type.1 = struct_value () [template] // CHECK:STDOUT: %Less.type.2: type = fn_type @Less.2 [template] +// CHECK:STDOUT: %Less.2: %Less.type.2 = struct_value () [template] // CHECK:STDOUT: %LessOrEquivalent.type.2: type = fn_type @LessOrEquivalent.2 [template] +// CHECK:STDOUT: %LessOrEquivalent.2: %LessOrEquivalent.type.2 = struct_value () [template] // CHECK:STDOUT: %Greater.type.2: type = fn_type @Greater.2 [template] +// CHECK:STDOUT: %Greater.2: %Greater.type.2 = struct_value () [template] // CHECK:STDOUT: %GreaterOrEquivalent.type.2: type = fn_type @GreaterOrEquivalent.2 [template] -// CHECK:STDOUT: %interface: = interface_witness (%Less.1, %LessOrEquivalent.1, %Greater.1, %GreaterOrEquivalent.1) [template] +// CHECK:STDOUT: %GreaterOrEquivalent.2: %GreaterOrEquivalent.type.2 = struct_value () [template] // CHECK:STDOUT: %TestLess.type: type = fn_type @TestLess [template] // CHECK:STDOUT: %TestLess: %TestLess.type = struct_value () [template] // CHECK:STDOUT: %TestLessEqual.type: type = fn_type @TestLessEqual [template] @@ -132,6 +132,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Ordered.ref: type = name_ref Ordered, imports.%import_ref.1 [template = constants.%Ordered.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Less.decl, @impl.1.%LessOrEquivalent.decl, @impl.1.%Greater.decl, @impl.1.%GreaterOrEquivalent.decl) [template = constants.%impl_witness] // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [template = constants.%TestLess] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -215,7 +216,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Ordered.ref { -// CHECK:STDOUT: %Less.decl: %Less.type.1 = fn_decl @Less.1 [template = constants.%Less.1] { +// CHECK:STDOUT: %Less.decl: %Less.type.2 = fn_decl @Less.2 [template = constants.%Less.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -235,7 +236,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %LessOrEquivalent.decl: %LessOrEquivalent.type.1 = fn_decl @LessOrEquivalent.1 [template = constants.%LessOrEquivalent.1] { +// CHECK:STDOUT: %LessOrEquivalent.decl: %LessOrEquivalent.type.2 = fn_decl @LessOrEquivalent.2 [template = constants.%LessOrEquivalent.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -255,7 +256,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Greater.decl: %Greater.type.1 = fn_decl @Greater.1 [template = constants.%Greater.1] { +// CHECK:STDOUT: %Greater.decl: %Greater.type.2 = fn_decl @Greater.2 [template = constants.%Greater.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -275,7 +276,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %GreaterOrEquivalent.decl: %GreaterOrEquivalent.type.1 = fn_decl @GreaterOrEquivalent.1 [template = constants.%GreaterOrEquivalent.1] { +// CHECK:STDOUT: %GreaterOrEquivalent.decl: %GreaterOrEquivalent.type.2 = fn_decl @GreaterOrEquivalent.2 [template = constants.%GreaterOrEquivalent.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -295,14 +296,13 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Less.decl, %LessOrEquivalent.decl, %Greater.decl, %GreaterOrEquivalent.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Less = %Less.decl // CHECK:STDOUT: .LessOrEquivalent = %LessOrEquivalent.decl // CHECK:STDOUT: .Greater = %Greater.decl // CHECK:STDOUT: .GreaterOrEquivalent = %GreaterOrEquivalent.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -313,19 +313,19 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Less.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; +// CHECK:STDOUT: fn @Less.2[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @LessOrEquivalent.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; +// CHECK:STDOUT: fn @LessOrEquivalent.2[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Greater.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; +// CHECK:STDOUT: fn @Greater.2[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GreaterOrEquivalent.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; +// CHECK:STDOUT: fn @GreaterOrEquivalent.2[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: fn @TestLess(%a.param_patt: %C, %b.param_patt: %C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Less.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Less.1] +// CHECK:STDOUT: %impl.elem0: %Less.type.1 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Less.2] // CHECK:STDOUT: %Less.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %Less.call: init bool = call %Less.bound(%a.ref, %b.ref) // CHECK:STDOUT: %.loc14_15.1: bool = value_of_initializer %Less.call @@ -337,7 +337,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem1: %LessOrEquivalent.type.2 = interface_witness_access constants.%interface, element1 [template = constants.%LessOrEquivalent.1] +// CHECK:STDOUT: %impl.elem1: %LessOrEquivalent.type.1 = impl_witness_access constants.%impl_witness, element1 [template = constants.%LessOrEquivalent.2] // CHECK:STDOUT: %LessOrEquivalent.bound: = bound_method %a.ref, %impl.elem1 // CHECK:STDOUT: %LessOrEquivalent.call: init bool = call %LessOrEquivalent.bound(%a.ref, %b.ref) // CHECK:STDOUT: %.loc18_16.1: bool = value_of_initializer %LessOrEquivalent.call @@ -349,7 +349,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem2: %Greater.type.2 = interface_witness_access constants.%interface, element2 [template = constants.%Greater.1] +// CHECK:STDOUT: %impl.elem2: %Greater.type.1 = impl_witness_access constants.%impl_witness, element2 [template = constants.%Greater.2] // CHECK:STDOUT: %Greater.bound: = bound_method %a.ref, %impl.elem2 // CHECK:STDOUT: %Greater.call: init bool = call %Greater.bound(%a.ref, %b.ref) // CHECK:STDOUT: %.loc22_15.1: bool = value_of_initializer %Greater.call @@ -361,7 +361,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem3: %GreaterOrEquivalent.type.2 = interface_witness_access constants.%interface, element3 [template = constants.%GreaterOrEquivalent.1] +// CHECK:STDOUT: %impl.elem3: %GreaterOrEquivalent.type.1 = impl_witness_access constants.%impl_witness, element3 [template = constants.%GreaterOrEquivalent.2] // CHECK:STDOUT: %GreaterOrEquivalent.bound: = bound_method %a.ref, %impl.elem3 // CHECK:STDOUT: %GreaterOrEquivalent.call: init bool = call %GreaterOrEquivalent.bound(%a.ref, %b.ref) // CHECK:STDOUT: %.loc26_16.1: bool = value_of_initializer %GreaterOrEquivalent.call diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index e5ccf7c2a2c8..b345cb4e98bf 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -40,16 +40,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %RightShift.type: type = facet_type <@RightShift> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %RightShiftAssign.type: type = facet_type <@RightShiftAssign> [template] -// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] +// CHECK:STDOUT: %ptr.3: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] @@ -81,11 +81,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %RightShift.ref: type = name_ref RightShift, imports.%import_ref.1 [template = constants.%RightShift.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %RightShiftAssign.ref: type = name_ref RightShiftAssign, imports.%import_ref.5 [template = constants.%RightShiftAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc22: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -105,17 +107,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %ptr.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %ptr.3 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %a.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param +// CHECK:STDOUT: %a: %ptr.3 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param @@ -123,7 +125,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %RightShift.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -141,36 +143,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %RightShiftAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %self.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.3 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -181,7 +181,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -189,7 +189,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.2](%other.param_patt: %C) { +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.3](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -198,21 +198,21 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.2, %b.param_patt: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.3, %b.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %ptr.3 = name_ref a, %a // CHECK:STDOUT: %.loc31: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc31 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc31 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 8266dc4f419e..d2729da4e91a 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -40,16 +40,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Sub.type: type = facet_type <@Sub> [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %SubAssign.type: type = facet_type <@SubAssign> [template] -// CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] -// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Op.decl) [template] +// CHECK:STDOUT: %ptr.3: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] @@ -81,11 +81,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Sub.ref: type = name_ref Sub, imports.%import_ref.1 [template = constants.%Sub.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness.1] // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %SubAssign.ref: type = name_ref SubAssign, imports.%import_ref.5 [template = constants.%SubAssign.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc22: = impl_witness (@impl.2.%Op.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 @@ -105,17 +107,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { -// CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %ptr.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %ptr.3 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %a.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param +// CHECK:STDOUT: %a: %ptr.3 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param @@ -123,7 +125,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %Sub.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other @@ -141,36 +143,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %SubAssign.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { -// CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %Op.decl: %Op.type.4 = fn_decl @Op.4 [template = constants.%Op.4] { +// CHECK:STDOUT: %self.patt: %ptr.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ptr.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %self.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param +// CHECK:STDOUT: %self: %ptr.3 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -181,7 +181,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C](%other.param_patt: %C) -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val] @@ -189,7 +189,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %ptr.2](%other.param_patt: %C) { +// CHECK:STDOUT: fn @Op.4[addr %self.param_patt: %ptr.3](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -198,21 +198,21 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Op.1] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} // CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.2, %b.param_patt: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %ptr.3, %b.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %ptr.3 = name_ref a, %a // CHECK:STDOUT: %.loc31: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Op.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %impl.elem0: %Op.type.3 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Op.4] // CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 -// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc31 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc31 // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index 4e1f4d57f902..a160ae989ded 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -48,9 +48,9 @@ fn Main() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -81,7 +81,7 @@ fn Main() { // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -101,9 +101,9 @@ fn Main() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -141,7 +141,7 @@ fn Main() { // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -159,7 +159,7 @@ fn Main() { // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index 1b170c1d4c4c..3f4c52b85f76 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -29,9 +29,9 @@ var b: i32 = a; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -59,7 +59,7 @@ var b: i32 = a; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -78,7 +78,7 @@ var b: i32 = a; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: ref %i32 = import_ref Main//lib, a, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.227 +// CHECK:STDOUT: .Int = %import_ref.249 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index ea1e0122d59a..6a91c48b2d62 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -22,9 +22,9 @@ fn F() -> i32 { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -62,7 +62,7 @@ fn F() -> i32 { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index e49a1151c2ae..8053038d01a7 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -33,9 +33,9 @@ fn F() { // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -75,14 +75,14 @@ fn F() { // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc12: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc12_46.1: %struct_type.a.b.2 = struct_literal (%int_1.loc12, %int_2.loc12) -// CHECK:STDOUT: %impl.elem0.loc12_46.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_46.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_46.1: = bound_method %int_1.loc12, %impl.elem0.loc12_46.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_46.1: = specific_function %Convert.bound.loc12_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_46.1: init %i32 = call %Convert.specific_fn.loc12_46.1(%int_1.loc12) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_46.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_46.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_46.3: ref %i32 = struct_access %s.var, element0 // CHECK:STDOUT: %.loc12_46.4: init %i32 = initialize_from %.loc12_46.2 to %.loc12_46.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_46.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_46.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_46.2: = bound_method %int_2.loc12, %impl.elem0.loc12_46.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_46.2: = specific_function %Convert.bound.loc12_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_46.2: init %i32 = call %Convert.specific_fn.loc12_46.2(%int_2.loc12) [template = constants.%int_2.2] @@ -114,14 +114,14 @@ fn F() { // CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc18: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc18_28.1: %tuple.type.3 = tuple_literal (%int_1.loc18, %int_2.loc18) -// CHECK:STDOUT: %impl.elem0.loc18_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_28.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_28.1: = bound_method %int_1.loc18, %impl.elem0.loc18_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18_28.1: = specific_function %Convert.bound.loc18_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18_28.1: init %i32 = call %Convert.specific_fn.loc18_28.1(%int_1.loc18) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_28.2: init %i32 = converted %int_1.loc18, %int.convert_checked.loc18_28.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc18: ref %i32 = tuple_access %t.var, element0 // CHECK:STDOUT: %.loc18_28.3: init %i32 = initialize_from %.loc18_28.2 to %tuple.elem0.loc18 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_28.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_28.2: = bound_method %int_2.loc18, %impl.elem0.loc18_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc18_28.2: = specific_function %Convert.bound.loc18_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc18_28.2: init %i32 = call %Convert.specific_fn.loc18_28.2(%int_2.loc18) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index 197a07f38f87..8c3030552550 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -24,9 +24,9 @@ fn F() -> i32 { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -64,7 +64,7 @@ fn F() -> i32 { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index 6818ae8c6d3c..f9faf4706146 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -28,9 +28,9 @@ var a: i32* = a_ref; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -62,7 +62,7 @@ var a: i32* = a_ref; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -86,7 +86,7 @@ var a: i32* = a_ref; // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, a_orig, unloaded // CHECK:STDOUT: %import_ref.2: ref %ptr = import_ref Implicit//default, a_ref, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.228 +// CHECK:STDOUT: .Int = %import_ref.250 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index c0f43675d5c3..b1f99ead09af 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -31,9 +31,9 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.15), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -78,7 +78,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: fn @F(%b.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index e0f594d83f42..55a8f25ddfc9 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -41,9 +41,9 @@ fn G() -> C { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -51,7 +51,7 @@ fn G() -> C { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] @@ -105,7 +105,7 @@ fn G() -> C { // CHECK:STDOUT: class @C { // CHECK:STDOUT: %.loc23_16: %C.elem = field_decl a, element0 [template] // CHECK:STDOUT: %.loc23_28: %C.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -119,7 +119,7 @@ fn G() -> C { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -135,14 +135,14 @@ fn G() -> C { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc25_38.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc25_38.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc25_38.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_38.1: = bound_method %int_1, %impl.elem0.loc25_38.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc25_38.1: = specific_function %Convert.bound.loc25_38.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc25_38.1: init %i32 = call %Convert.specific_fn.loc25_38.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc25_38.2: init %i32 = converted %int_1, %int.convert_checked.loc25_38.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc25_38.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc25_38.4: init %i32 = initialize_from %.loc25_38.2 to %.loc25_38.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc25_38.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc25_38.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_38.2: = bound_method %int_2, %impl.elem0.loc25_38.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc25_38.2: = specific_function %Convert.bound.loc25_38.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc25_38.2: init %i32 = call %Convert.specific_fn.loc25_38.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index a0ee4366af09..61cb4555e715 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -49,9 +49,9 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -108,7 +108,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.2] @@ -117,7 +117,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_1, %impl.elem0.loc21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_1) [template = constants.%int_1.2] @@ -127,7 +127,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_0.loc23: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_0.loc23, %impl.elem0.loc23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_0.loc23) [template = constants.%int_0.2] @@ -145,7 +145,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc28: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc28: = specific_function %Convert.bound.loc28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %Convert.specific_fn.loc28(%int_0.loc28) [template = constants.%int_0.2] @@ -158,7 +158,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc36: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc36: = bound_method %int_1, %impl.elem0.loc36 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc36: = specific_function %Convert.bound.loc36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc36: init %i32 = call %Convert.specific_fn.loc36(%int_1) [template = constants.%int_1.2] @@ -171,7 +171,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc27: // CHECK:STDOUT: %int_0.loc39: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc39: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc39: = bound_method %int_0.loc39, %impl.elem0.loc39 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc39: = specific_function %Convert.bound.loc39, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc39: init %i32 = call %Convert.specific_fn.loc39(%int_0.loc39) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon index 73441ca242c5..2d32fa8c95b7 100644 --- a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon +++ b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon @@ -87,10 +87,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.2: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] // CHECK:STDOUT: %assoc0.2: %Convert.assoc_type.2 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.2 = facet_value Core.IntLiteral, Core.IntLiteral [symbolic] -// CHECK:STDOUT: %interface: = interface_witness (%Convert.3) [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.2 = facet_value Core.IntLiteral, %impl_witness [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -142,6 +142,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc12_36.2: type = converted %int.make_type_signed, %.loc12_36.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32.builtin)> [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Convert.decl) [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(%T.loc8_22.1: type) { @@ -202,11 +203,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; @@ -229,8 +229,6 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 @@ -238,6 +236,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self.as_type.loc9_20.1 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%T.loc8_22.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%i32.builtin) { @@ -299,9 +299,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.assoc_type.2: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] // CHECK:STDOUT: %assoc0.2: %Convert.assoc_type.2 = assoc_entity element0, imports.%import_ref.6 [template] // CHECK:STDOUT: %assoc0.3: %Convert.assoc_type.1 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (imports.%import_ref.11) [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Convert.3) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.3 [template] // CHECK:STDOUT: %int_0.2: %i32.builtin = int_value 0 [template] // CHECK:STDOUT: %D.val: %D = struct_value (%int_0.2, %int_0.2) [template] @@ -311,66 +311,66 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.3: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.4 [template] // CHECK:STDOUT: %assoc0.4: %Convert.assoc_type.3 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (@impl.2.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.1: %ImplicitAs.type.2 = facet_value %C.2, %C.2 [symbolic] -// CHECK:STDOUT: %interface.2: = interface_witness (%Convert.5) [template] +// CHECK:STDOUT: %ImplicitAs.facet.1: %ImplicitAs.type.2 = facet_value %C.2, %impl_witness.2 [symbolic] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.3 [template] // CHECK:STDOUT: %int_1.2: %i32.builtin = int_value 1 [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%int_1.2) [template] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (@impl.3.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.2: %ImplicitAs.type.2 = facet_value %C.3, %C.3 [symbolic] -// CHECK:STDOUT: %interface.3: = interface_witness (%Convert.6) [template] +// CHECK:STDOUT: %ImplicitAs.facet.2: %ImplicitAs.type.2 = facet_value %C.3, %impl_witness.3 [symbolic] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.3 [template] // CHECK:STDOUT: %int_2.2: %i32.builtin = int_value 2 [template] // CHECK:STDOUT: %C.4: type = class_type @C, @C(%int_2.2) [template] +// CHECK:STDOUT: %impl_witness.4: = impl_witness (@impl.4.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.3: %ImplicitAs.type.2 = facet_value %C.4, %C.4 [symbolic] -// CHECK:STDOUT: %interface.4: = interface_witness (%Convert.7) [template] +// CHECK:STDOUT: %ImplicitAs.facet.3: %ImplicitAs.type.2 = facet_value %C.4, %impl_witness.4 [symbolic] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %Convert.bound.4: = bound_method %int_3.1, %Convert.3 [template] // CHECK:STDOUT: %int_3.2: %i32.builtin = int_value 3 [template] // CHECK:STDOUT: %C.5: type = class_type @C, @C(%int_3.2) [template] +// CHECK:STDOUT: %impl_witness.5: = impl_witness (@impl.5.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6 [template] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.4: %ImplicitAs.type.2 = facet_value %C.5, %C.5 [symbolic] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.8) [template] +// CHECK:STDOUT: %ImplicitAs.facet.4: %ImplicitAs.type.2 = facet_value %C.5, %impl_witness.5 [symbolic] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.bound.5: = bound_method %int_4.1, %Convert.3 [template] // CHECK:STDOUT: %int_4.2: %i32.builtin = int_value 4 [template] // CHECK:STDOUT: %C.6: type = class_type @C, @C(%int_4.2) [template] +// CHECK:STDOUT: %impl_witness.6: = impl_witness (@impl.6.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.7 [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.5: %ImplicitAs.type.2 = facet_value %C.6, %C.6 [symbolic] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %ImplicitAs.facet.5: %ImplicitAs.type.2 = facet_value %C.6, %impl_witness.6 [symbolic] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.bound.6: = bound_method %int_5.1, %Convert.3 [template] // CHECK:STDOUT: %int_5.2: %i32.builtin = int_value 5 [template] // CHECK:STDOUT: %C.7: type = class_type @C, @C(%int_5.2) [template] +// CHECK:STDOUT: %impl_witness.7: = impl_witness (@impl.7.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.8 [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.6: %ImplicitAs.type.2 = facet_value %C.7, %C.7 [symbolic] -// CHECK:STDOUT: %interface.7: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %ImplicitAs.facet.6: %ImplicitAs.type.2 = facet_value %C.7, %impl_witness.7 [symbolic] // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %Convert.bound.7: = bound_method %int_6.1, %Convert.3 [template] // CHECK:STDOUT: %int_6.2: %i32.builtin = int_value 6 [template] // CHECK:STDOUT: %C.8: type = class_type @C, @C(%int_6.2) [template] +// CHECK:STDOUT: %impl_witness.8: = impl_witness (@impl.8.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.9 [template] // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.7: %ImplicitAs.type.2 = facet_value %C.8, %C.8 [symbolic] -// CHECK:STDOUT: %interface.8: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %ImplicitAs.facet.7: %ImplicitAs.type.2 = facet_value %C.8, %impl_witness.8 [symbolic] // CHECK:STDOUT: %int_7.1: Core.IntLiteral = int_value 7 [template] // CHECK:STDOUT: %Convert.bound.8: = bound_method %int_7.1, %Convert.3 [template] // CHECK:STDOUT: %int_7.2: %i32.builtin = int_value 7 [template] // CHECK:STDOUT: %C.9: type = class_type @C, @C(%int_7.2) [template] +// CHECK:STDOUT: %impl_witness.9: = impl_witness (@impl.9.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10 [template] // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.8: %ImplicitAs.type.2 = facet_value %C.9, %C.9 [symbolic] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.12) [template] +// CHECK:STDOUT: %ImplicitAs.facet.8: %ImplicitAs.type.2 = facet_value %C.9, %impl_witness.9 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -384,9 +384,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %import_ref.4: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, loc9_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.3)] // CHECK:STDOUT: %import_ref.5: @ImplicitAs.%Convert.type (%Convert.type.1) = import_ref Core//default, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] // CHECK:STDOUT: %import_ref.6 = import_ref Core//default, loc9_32, unloaded -// CHECK:STDOUT: %import_ref.8: type = import_ref Core//default, loc12_17, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//default, loc12_36, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.10: = import_ref Core//default, loc12_38, loaded [template = constants.%interface.1] +// CHECK:STDOUT: %import_ref.8: = import_ref Core//default, loc12_38, loaded [template = constants.%impl_witness.1] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//default, loc12_17, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.10: type = import_ref Core//default, loc12_36, loaded [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -422,7 +422,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc10_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_0.2] @@ -433,10 +433,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc10: = impl_witness (@impl.2.%Convert.decl) [template = constants.%impl_witness.2] // CHECK:STDOUT: impl_decl @impl.3 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_1.2] @@ -447,10 +448,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc11: = impl_witness (@impl.3.%Convert.decl) [template = constants.%impl_witness.3] // CHECK:STDOUT: impl_decl @impl.4 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc12_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_2.2] @@ -461,10 +463,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc12: = impl_witness (@impl.4.%Convert.decl) [template = constants.%impl_witness.4] // CHECK:STDOUT: impl_decl @impl.5 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_3) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc13_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_3.2] @@ -475,10 +478,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc13: = impl_witness (@impl.5.%Convert.decl) [template = constants.%impl_witness.5] // CHECK:STDOUT: impl_decl @impl.6 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_4) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc14_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_4.2] @@ -489,10 +493,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc14: = impl_witness (@impl.6.%Convert.decl) [template = constants.%impl_witness.6] // CHECK:STDOUT: impl_decl @impl.7 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_5) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc15_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_5.2] @@ -503,10 +508,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc15: = impl_witness (@impl.7.%Convert.decl) [template = constants.%impl_witness.7] // CHECK:STDOUT: impl_decl @impl.8 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_6, %impl.elem0 [template = constants.%Convert.bound.7] // CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_6) [template = constants.%int_6.2] // CHECK:STDOUT: %.loc16_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_6.2] @@ -517,10 +523,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc16: = impl_witness (@impl.8.%Convert.decl) [template = constants.%impl_witness.8] // CHECK:STDOUT: impl_decl @impl.9 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_7, %impl.elem0 [template = constants.%Convert.bound.8] // CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_7) [template = constants.%int_7.2] // CHECK:STDOUT: %.loc17_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_7.2] @@ -531,6 +538,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.9.%Convert.decl) [template = constants.%impl_witness.9] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%T: type) [from "core.carbon"] { @@ -553,9 +561,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 [from "core.carbon"] { +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.9 as imports.%import_ref.10 [from "core.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: witness = imports.%import_ref.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C as %ImplicitAs.type { @@ -572,11 +580,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.3: %C as %ImplicitAs.type { @@ -593,11 +600,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.4: %C as %ImplicitAs.type { @@ -614,11 +620,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.5: %C as %ImplicitAs.type { @@ -635,11 +640,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.6: %C as %ImplicitAs.type { @@ -656,11 +660,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.7: %C as %ImplicitAs.type { @@ -677,11 +680,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.8: %C as %ImplicitAs.type { @@ -698,11 +700,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.9: %C as %ImplicitAs.type { @@ -719,11 +720,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%N.loc6_9.1: %i32.builtin) { @@ -760,13 +760,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_0.loc8_31: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_0.loc8_39: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc8_40.1: %struct_type.n.m.2 = struct_literal (%int_0.loc8_31, %int_0.loc8_39) -// CHECK:STDOUT: %impl.elem0.loc8_40.1: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc8_40.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc8_40.1: = bound_method %int_0.loc8_31, %impl.elem0.loc8_40.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %int.convert_checked.loc8_40.1: init %i32.builtin = call %Convert.bound.loc8_40.1(%int_0.loc8_31) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc8_40.2: init %i32.builtin = converted %int_0.loc8_31, %int.convert_checked.loc8_40.1 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc8_40.3: ref %i32.builtin = class_element_access %return, element0 // CHECK:STDOUT: %.loc8_40.4: init %i32.builtin = initialize_from %.loc8_40.2 to %.loc8_40.3 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc8_40.2: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc8_40.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc8_40.2: = bound_method %int_0.loc8_39, %impl.elem0.loc8_40.2 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %int.convert_checked.loc8_40.2: init %i32.builtin = call %Convert.bound.loc8_40.2(%int_0.loc8_39) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc8_40.5: init %i32.builtin = converted %int_0.loc8_39, %int.convert_checked.loc8_40.2 [template = constants.%int_0.2] @@ -1046,9 +1046,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.assoc_type.2: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] // CHECK:STDOUT: %assoc0.2: %Convert.assoc_type.2 = assoc_entity element0, imports.%import_ref.14 [template] // CHECK:STDOUT: %assoc0.3: %Convert.assoc_type.1 = assoc_entity element0, imports.%import_ref.15 [symbolic] +// CHECK:STDOUT: %impl_witness.1: = impl_witness (imports.%import_ref.19) [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Convert.3) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.3 [template] // CHECK:STDOUT: %int_0.2: %i32.builtin = int_value 0 [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%int_0.2) [template] @@ -1072,51 +1072,51 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %C.8: type = class_type @C, @C(%int_6.1) [template] // CHECK:STDOUT: %int_7.1: %i32.builtin = int_value 7 [template] // CHECK:STDOUT: %C.9: type = class_type @C, @C(%int_7.1) [template] +// CHECK:STDOUT: %impl_witness.2: = impl_witness (imports.%import_ref.44) [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %interface.2: = interface_witness (%Convert.5) [template] // CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.2, %Convert.3 [template] // CHECK:STDOUT: %C.val.2: %C.3 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.3: = impl_witness (imports.%import_ref.45) [template] // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] -// CHECK:STDOUT: %interface.3: = interface_witness (%Convert.6) [template] // CHECK:STDOUT: %int_2.2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.2, %Convert.3 [template] // CHECK:STDOUT: %C.val.3: %C.4 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.4: = impl_witness (imports.%import_ref.46) [template] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [template] -// CHECK:STDOUT: %interface.4: = interface_witness (%Convert.7) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %Convert.bound.4: = bound_method %int_3.2, %Convert.3 [template] // CHECK:STDOUT: %C.val.4: %C.5 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.5: = impl_witness (imports.%import_ref.47) [template] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6 [template] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.8) [template] // CHECK:STDOUT: %int_4.2: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.bound.5: = bound_method %int_4.2, %Convert.3 [template] // CHECK:STDOUT: %C.val.5: %C.6 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.6: = impl_witness (imports.%import_ref.48) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.7 [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %int_5.2: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.bound.6: = bound_method %int_5.2, %Convert.3 [template] // CHECK:STDOUT: %C.val.6: %C.7 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.7: = impl_witness (imports.%import_ref.49) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.8 [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.7: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %int_6.2: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %Convert.bound.7: = bound_method %int_6.2, %Convert.3 [template] // CHECK:STDOUT: %C.val.7: %C.8 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.8: = impl_witness (imports.%import_ref.50) [template] // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.9 [template] // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.8: = interface_witness (%Convert.11) [template] // CHECK:STDOUT: %int_7.2: Core.IntLiteral = int_value 7 [template] // CHECK:STDOUT: %Convert.bound.8: = bound_method %int_7.2, %Convert.3 [template] // CHECK:STDOUT: %C.val.8: %C.9 = struct_value () [template] +// CHECK:STDOUT: %impl_witness.9: = impl_witness (imports.%import_ref.51) [template] // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10 [template] // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.12) [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: } @@ -1125,7 +1125,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P: = namespace file.%P.import, [template] { // CHECK:STDOUT: .D = %import_ref.2 // CHECK:STDOUT: .C = %import_ref.7 -// CHECK:STDOUT: .Make = %import_ref.43 +// CHECK:STDOUT: .Make = %import_ref.52 // CHECK:STDOUT: import P//library // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { @@ -1145,34 +1145,34 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %import_ref.12: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, loc9_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.3)] // CHECK:STDOUT: %import_ref.13 = import_ref Core//default, Convert, unloaded // CHECK:STDOUT: %import_ref.14 = import_ref Core//default, loc9_32, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Core//default, loc12_17, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.17: type = import_ref Core//default, loc12_36, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.18: = import_ref Core//default, loc12_38, loaded [template = constants.%interface.1] -// CHECK:STDOUT: %import_ref.19: type = import_ref P//library, loc10_9, loaded [template = constants.%C.2] -// CHECK:STDOUT: %import_ref.20: type = import_ref P//library, loc10_31, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.21: = import_ref P//library, loc10_33, loaded [template = constants.%interface.2] -// CHECK:STDOUT: %import_ref.22: type = import_ref P//library, loc11_9, loaded [template = constants.%C.3] -// CHECK:STDOUT: %import_ref.23: type = import_ref P//library, loc11_31, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.24: = import_ref P//library, loc11_33, loaded [template = constants.%interface.3] -// CHECK:STDOUT: %import_ref.25: type = import_ref P//library, loc12_9, loaded [template = constants.%C.4] -// CHECK:STDOUT: %import_ref.26: type = import_ref P//library, loc12_31, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.27: = import_ref P//library, loc12_33, loaded [template = constants.%interface.4] -// CHECK:STDOUT: %import_ref.28: type = import_ref P//library, loc13_9, loaded [template = constants.%C.5] -// CHECK:STDOUT: %import_ref.29: type = import_ref P//library, loc13_31, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.30: = import_ref P//library, loc13_33, loaded [template = constants.%interface.5] -// CHECK:STDOUT: %import_ref.31: type = import_ref P//library, loc14_9, loaded [template = constants.%C.6] -// CHECK:STDOUT: %import_ref.32: type = import_ref P//library, loc14_31, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.33: = import_ref P//library, loc14_33, loaded [template = constants.%interface.6] -// CHECK:STDOUT: %import_ref.34: type = import_ref P//library, loc15_9, loaded [template = constants.%C.7] -// CHECK:STDOUT: %import_ref.35: type = import_ref P//library, loc15_31, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.36: = import_ref P//library, loc15_33, loaded [template = constants.%interface.7] -// CHECK:STDOUT: %import_ref.37: type = import_ref P//library, loc16_9, loaded [template = constants.%C.8] -// CHECK:STDOUT: %import_ref.38: type = import_ref P//library, loc16_31, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.39: = import_ref P//library, loc16_33, loaded [template = constants.%interface.8] -// CHECK:STDOUT: %import_ref.40: type = import_ref P//library, loc17_9, loaded [template = constants.%C.9] -// CHECK:STDOUT: %import_ref.41: type = import_ref P//library, loc17_31, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.42: = import_ref P//library, loc17_33, loaded [template = constants.%interface.9] -// CHECK:STDOUT: %import_ref.43: %Make.type = import_ref P//library, Make, loaded [template = constants.%Make] +// CHECK:STDOUT: %import_ref.16: = import_ref Core//default, loc12_38, loaded [template = constants.%impl_witness.1] +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//default, loc12_17, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//default, loc12_36, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref P//library, loc10_33, loaded [template = constants.%impl_witness.2] +// CHECK:STDOUT: %import_ref.21: type = import_ref P//library, loc10_9, loaded [template = constants.%C.2] +// CHECK:STDOUT: %import_ref.22: type = import_ref P//library, loc10_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.23: = import_ref P//library, loc11_33, loaded [template = constants.%impl_witness.3] +// CHECK:STDOUT: %import_ref.24: type = import_ref P//library, loc11_9, loaded [template = constants.%C.3] +// CHECK:STDOUT: %import_ref.25: type = import_ref P//library, loc11_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.26: = import_ref P//library, loc12_33, loaded [template = constants.%impl_witness.4] +// CHECK:STDOUT: %import_ref.27: type = import_ref P//library, loc12_9, loaded [template = constants.%C.4] +// CHECK:STDOUT: %import_ref.28: type = import_ref P//library, loc12_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.29: = import_ref P//library, loc13_33, loaded [template = constants.%impl_witness.5] +// CHECK:STDOUT: %import_ref.30: type = import_ref P//library, loc13_9, loaded [template = constants.%C.5] +// CHECK:STDOUT: %import_ref.31: type = import_ref P//library, loc13_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.32: = import_ref P//library, loc14_33, loaded [template = constants.%impl_witness.6] +// CHECK:STDOUT: %import_ref.33: type = import_ref P//library, loc14_9, loaded [template = constants.%C.6] +// CHECK:STDOUT: %import_ref.34: type = import_ref P//library, loc14_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.35: = import_ref P//library, loc15_33, loaded [template = constants.%impl_witness.7] +// CHECK:STDOUT: %import_ref.36: type = import_ref P//library, loc15_9, loaded [template = constants.%C.7] +// CHECK:STDOUT: %import_ref.37: type = import_ref P//library, loc15_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.38: = import_ref P//library, loc16_33, loaded [template = constants.%impl_witness.8] +// CHECK:STDOUT: %import_ref.39: type = import_ref P//library, loc16_9, loaded [template = constants.%C.8] +// CHECK:STDOUT: %import_ref.40: type = import_ref P//library, loc16_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.41: = import_ref P//library, loc17_33, loaded [template = constants.%impl_witness.9] +// CHECK:STDOUT: %import_ref.42: type = import_ref P//library, loc17_9, loaded [template = constants.%C.9] +// CHECK:STDOUT: %import_ref.43: type = import_ref P//library, loc17_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.52: %Make.type = import_ref P//library, Make, loaded [template = constants.%Make] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1224,49 +1224,49 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.16 as imports.%import_ref.17 [from "core.carbon"] { +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.17 as imports.%import_ref.18 [from "core.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: witness = imports.%import_ref.16 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: imports.%import_ref.19 as imports.%import_ref.20 [from "library.carbon"] { +// CHECK:STDOUT: impl @impl.2: imports.%import_ref.21 as imports.%import_ref.22 [from "library.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: witness = imports.%import_ref.20 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3: imports.%import_ref.22 as imports.%import_ref.23 [from "library.carbon"] { +// CHECK:STDOUT: impl @impl.3: imports.%import_ref.24 as imports.%import_ref.25 [from "library.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.24 +// CHECK:STDOUT: witness = imports.%import_ref.23 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.25 as imports.%import_ref.26 [from "library.carbon"] { +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.27 as imports.%import_ref.28 [from "library.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.27 +// CHECK:STDOUT: witness = imports.%import_ref.26 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.5: imports.%import_ref.28 as imports.%import_ref.29 [from "library.carbon"] { +// CHECK:STDOUT: impl @impl.5: imports.%import_ref.30 as imports.%import_ref.31 [from "library.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.30 +// CHECK:STDOUT: witness = imports.%import_ref.29 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.6: imports.%import_ref.31 as imports.%import_ref.32 [from "library.carbon"] { +// CHECK:STDOUT: impl @impl.6: imports.%import_ref.33 as imports.%import_ref.34 [from "library.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.33 +// CHECK:STDOUT: witness = imports.%import_ref.32 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.34 as imports.%import_ref.35 [from "library.carbon"] { +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.36 as imports.%import_ref.37 [from "library.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.36 +// CHECK:STDOUT: witness = imports.%import_ref.35 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.8: imports.%import_ref.37 as imports.%import_ref.38 [from "library.carbon"] { +// CHECK:STDOUT: impl @impl.8: imports.%import_ref.39 as imports.%import_ref.40 [from "library.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: witness = imports.%import_ref.38 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.9: imports.%import_ref.40 as imports.%import_ref.41 [from "library.carbon"] { +// CHECK:STDOUT: impl @impl.9: imports.%import_ref.42 as imports.%import_ref.43 [from "library.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.42 +// CHECK:STDOUT: witness = imports.%import_ref.41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D [from "library.carbon"] { @@ -1302,7 +1302,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.ref.loc8: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc8: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc8_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc8_34: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc8_34: = bound_method %int_0, %impl.elem0.loc8_34 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32.builtin = call %Convert.bound.loc8_34(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc8_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc8 [template = constants.%int_0.2] @@ -1312,7 +1312,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc8_24.3: init %C.2 = class_init (), %.loc8_24.2 [template = constants.%C.val.1] // CHECK:STDOUT: %.loc8_24.4: ref %C.2 = temporary %.loc8_24.2, %.loc8_24.3 // CHECK:STDOUT: %.loc8_26.1: ref %C.2 = converted %.loc8_24.1, %.loc8_24.4 -// CHECK:STDOUT: %impl.elem0.loc8_35: %Convert.type.4 = interface_witness_access constants.%interface.2, element0 [template = constants.%Convert.5] +// CHECK:STDOUT: %impl.elem0.loc8_35: %Convert.type.4 = impl_witness_access constants.%impl_witness.2, element0 [template = constants.%Convert.5] // CHECK:STDOUT: %Convert.bound.loc8_35: = bound_method %.loc8_26.1, %impl.elem0.loc8_35 // CHECK:STDOUT: %.loc8_35.1: ref %D = temporary_storage // CHECK:STDOUT: %.loc8_26.2: %C.2 = bind_value %.loc8_26.1 @@ -1329,7 +1329,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.ref.loc9: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc9: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.generic] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc9_34: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc9_34: = bound_method %int_1, %impl.elem0.loc9_34 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %int.convert_checked.loc9: init %i32.builtin = call %Convert.bound.loc9_34(%int_1) [template = constants.%int_1.1] // CHECK:STDOUT: %.loc9_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc9 [template = constants.%int_1.1] @@ -1339,7 +1339,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc9_24.3: init %C.3 = class_init (), %.loc9_24.2 [template = constants.%C.val.2] // CHECK:STDOUT: %.loc9_24.4: ref %C.3 = temporary %.loc9_24.2, %.loc9_24.3 // CHECK:STDOUT: %.loc9_26.1: ref %C.3 = converted %.loc9_24.1, %.loc9_24.4 -// CHECK:STDOUT: %impl.elem0.loc9_35: %Convert.type.4 = interface_witness_access constants.%interface.3, element0 [template = constants.%Convert.6] +// CHECK:STDOUT: %impl.elem0.loc9_35: %Convert.type.4 = impl_witness_access constants.%impl_witness.3, element0 [template = constants.%Convert.6] // CHECK:STDOUT: %Convert.bound.loc9_35: = bound_method %.loc9_26.1, %impl.elem0.loc9_35 // CHECK:STDOUT: %.loc9_35.1: ref %D = temporary_storage // CHECK:STDOUT: %.loc9_26.2: %C.3 = bind_value %.loc9_26.1 @@ -1356,7 +1356,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.ref.loc10: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.generic] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc10_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc10_34: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc10_34: = bound_method %int_2, %impl.elem0.loc10_34 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %int.convert_checked.loc10: init %i32.builtin = call %Convert.bound.loc10_34(%int_2) [template = constants.%int_2.1] // CHECK:STDOUT: %.loc10_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc10 [template = constants.%int_2.1] @@ -1366,7 +1366,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc10_24.3: init %C.4 = class_init (), %.loc10_24.2 [template = constants.%C.val.3] // CHECK:STDOUT: %.loc10_24.4: ref %C.4 = temporary %.loc10_24.2, %.loc10_24.3 // CHECK:STDOUT: %.loc10_26.1: ref %C.4 = converted %.loc10_24.1, %.loc10_24.4 -// CHECK:STDOUT: %impl.elem0.loc10_35: %Convert.type.4 = interface_witness_access constants.%interface.4, element0 [template = constants.%Convert.7] +// CHECK:STDOUT: %impl.elem0.loc10_35: %Convert.type.4 = impl_witness_access constants.%impl_witness.4, element0 [template = constants.%Convert.7] // CHECK:STDOUT: %Convert.bound.loc10_35: = bound_method %.loc10_26.1, %impl.elem0.loc10_35 // CHECK:STDOUT: %.loc10_35.1: ref %D = temporary_storage // CHECK:STDOUT: %.loc10_26.2: %C.4 = bind_value %.loc10_26.1 @@ -1383,7 +1383,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.ref.loc11: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.generic] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc11_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc11_34: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc11_34: = bound_method %int_3, %impl.elem0.loc11_34 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32.builtin = call %Convert.bound.loc11_34(%int_3) [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc11 [template = constants.%int_3.1] @@ -1393,7 +1393,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc11_24.3: init %C.5 = class_init (), %.loc11_24.2 [template = constants.%C.val.4] // CHECK:STDOUT: %.loc11_24.4: ref %C.5 = temporary %.loc11_24.2, %.loc11_24.3 // CHECK:STDOUT: %.loc11_26.1: ref %C.5 = converted %.loc11_24.1, %.loc11_24.4 -// CHECK:STDOUT: %impl.elem0.loc11_35: %Convert.type.4 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.8] +// CHECK:STDOUT: %impl.elem0.loc11_35: %Convert.type.4 = impl_witness_access constants.%impl_witness.5, element0 [template = constants.%Convert.8] // CHECK:STDOUT: %Convert.bound.loc11_35: = bound_method %.loc11_26.1, %impl.elem0.loc11_35 // CHECK:STDOUT: %.loc11_35.1: ref %D = temporary_storage // CHECK:STDOUT: %.loc11_26.2: %C.5 = bind_value %.loc11_26.1 @@ -1410,7 +1410,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.ref.loc12: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.generic] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.2] -// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc12_34: = bound_method %int_4, %impl.elem0.loc12_34 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32.builtin = call %Convert.bound.loc12_34(%int_4) [template = constants.%int_4.1] // CHECK:STDOUT: %.loc12_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc12 [template = constants.%int_4.1] @@ -1420,7 +1420,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc12_24.3: init %C.6 = class_init (), %.loc12_24.2 [template = constants.%C.val.5] // CHECK:STDOUT: %.loc12_24.4: ref %C.6 = temporary %.loc12_24.2, %.loc12_24.3 // CHECK:STDOUT: %.loc12_26.1: ref %C.6 = converted %.loc12_24.1, %.loc12_24.4 -// CHECK:STDOUT: %impl.elem0.loc12_35: %Convert.type.4 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %impl.elem0.loc12_35: %Convert.type.4 = impl_witness_access constants.%impl_witness.6, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc12_35: = bound_method %.loc12_26.1, %impl.elem0.loc12_35 // CHECK:STDOUT: %.loc12_35.1: ref %D = temporary_storage // CHECK:STDOUT: %.loc12_26.2: %C.6 = bind_value %.loc12_26.1 @@ -1437,7 +1437,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.ref.loc13: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc13: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.generic] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc13_34: = bound_method %int_5, %impl.elem0.loc13_34 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32.builtin = call %Convert.bound.loc13_34(%int_5) [template = constants.%int_5.1] // CHECK:STDOUT: %.loc13_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc13 [template = constants.%int_5.1] @@ -1447,7 +1447,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc13_24.3: init %C.7 = class_init (), %.loc13_24.2 [template = constants.%C.val.6] // CHECK:STDOUT: %.loc13_24.4: ref %C.7 = temporary %.loc13_24.2, %.loc13_24.3 // CHECK:STDOUT: %.loc13_26.1: ref %C.7 = converted %.loc13_24.1, %.loc13_24.4 -// CHECK:STDOUT: %impl.elem0.loc13_35: %Convert.type.4 = interface_witness_access constants.%interface.7, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_35: %Convert.type.4 = impl_witness_access constants.%impl_witness.7, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_35: = bound_method %.loc13_26.1, %impl.elem0.loc13_35 // CHECK:STDOUT: %.loc13_35.1: ref %D = temporary_storage // CHECK:STDOUT: %.loc13_26.2: %C.7 = bind_value %.loc13_26.1 @@ -1464,7 +1464,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.ref.loc14: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.generic] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.2] -// CHECK:STDOUT: %impl.elem0.loc14_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc14_34: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc14_34: = bound_method %int_6, %impl.elem0.loc14_34 [template = constants.%Convert.bound.7] // CHECK:STDOUT: %int.convert_checked.loc14: init %i32.builtin = call %Convert.bound.loc14_34(%int_6) [template = constants.%int_6.1] // CHECK:STDOUT: %.loc14_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc14 [template = constants.%int_6.1] @@ -1474,7 +1474,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc14_24.3: init %C.8 = class_init (), %.loc14_24.2 [template = constants.%C.val.7] // CHECK:STDOUT: %.loc14_24.4: ref %C.8 = temporary %.loc14_24.2, %.loc14_24.3 // CHECK:STDOUT: %.loc14_26.1: ref %C.8 = converted %.loc14_24.1, %.loc14_24.4 -// CHECK:STDOUT: %impl.elem0.loc14_35: %Convert.type.4 = interface_witness_access constants.%interface.8, element0 [template = constants.%Convert.11] +// CHECK:STDOUT: %impl.elem0.loc14_35: %Convert.type.4 = impl_witness_access constants.%impl_witness.8, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc14_35: = bound_method %.loc14_26.1, %impl.elem0.loc14_35 // CHECK:STDOUT: %.loc14_35.1: ref %D = temporary_storage // CHECK:STDOUT: %.loc14_26.2: %C.8 = bind_value %.loc14_26.1 @@ -1491,7 +1491,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.ref.loc15: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc15: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.generic] // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7.2] -// CHECK:STDOUT: %impl.elem0.loc15_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %impl.elem0.loc15_34: %Convert.type.2 = impl_witness_access constants.%impl_witness.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc15_34: = bound_method %int_7, %impl.elem0.loc15_34 [template = constants.%Convert.bound.8] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32.builtin = call %Convert.bound.loc15_34(%int_7) [template = constants.%int_7.1] // CHECK:STDOUT: %.loc15_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_7.1] @@ -1501,7 +1501,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc15_24.3: init %C.9 = class_init (), %.loc15_24.2 [template = constants.%C.val.8] // CHECK:STDOUT: %.loc15_24.4: ref %C.9 = temporary %.loc15_24.2, %.loc15_24.3 // CHECK:STDOUT: %.loc15_26.1: ref %C.9 = converted %.loc15_24.1, %.loc15_24.4 -// CHECK:STDOUT: %impl.elem0.loc15_35: %Convert.type.4 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.12] +// CHECK:STDOUT: %impl.elem0.loc15_35: %Convert.type.4 = impl_witness_access constants.%impl_witness.9, element0 [template = constants.%Convert.12] // CHECK:STDOUT: %Convert.bound.loc15_35: = bound_method %.loc15_26.1, %impl.elem0.loc15_35 // CHECK:STDOUT: %.loc15_35.1: ref %D = temporary_storage // CHECK:STDOUT: %.loc15_26.2: %C.9 = bind_value %.loc15_26.1 @@ -1511,7 +1511,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc15: // CHECK:STDOUT: %P.ref.loc16: = name_ref P, imports.%P [template = imports.%P] -// CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, imports.%import_ref.43 [template = constants.%Make] +// CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, imports.%import_ref.52 [template = constants.%Make] // CHECK:STDOUT: %.loc7_15: ref %D = splice_block %return {} // CHECK:STDOUT: %Make.call: init %D = call %Make.ref() to %.loc7_15 // CHECK:STDOUT: return %Make.call to %return diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 6c1a6dd2f079..b3a5ebfc8908 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -38,9 +38,9 @@ fn G() -> i32 { // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -111,14 +111,14 @@ fn G() -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc17_43.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc17_43.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_43.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_43.1: = bound_method %int_1, %impl.elem0.loc17_43.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc17_43.1: = specific_function %Convert.bound.loc17_43.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc17_43.1: init %i32 = call %Convert.specific_fn.loc17_43.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_43.2: init %i32 = converted %int_1, %int.convert_checked.loc17_43.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_43.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc17_43.4: init %i32 = initialize_from %.loc17_43.2 to %.loc17_43.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc17_43.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_43.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_43.2: = bound_method %int_2, %impl.elem0.loc17_43.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_43.2: = specific_function %Convert.bound.loc17_43.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_43.2: init %i32 = call %Convert.specific_fn.loc17_43.2(%int_2) [template = constants.%int_2.2] @@ -136,7 +136,7 @@ fn G() -> i32 { // CHECK:STDOUT: %result.var: ref %i32 = var result // CHECK:STDOUT: %result: ref %i32 = bind_name result, %result.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index 1595999ccc5f..ab24ae8e6571 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -37,9 +37,9 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -57,7 +57,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Bool = %import_ref.229 +// CHECK:STDOUT: .Bool = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -108,7 +108,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.2] @@ -124,7 +124,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.2] @@ -134,7 +134,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc15: // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_0.loc18, %impl.elem0.loc18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_0.loc18) [template = constants.%int_0.2] @@ -152,7 +152,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_0, %impl.elem0.loc23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_0) [template = constants.%int_0.2] @@ -165,7 +165,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_1, %impl.elem0.loc26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index cabf00e7e138..76d9b355c20a 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -23,9 +23,9 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %struct_type.a.2: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] @@ -63,7 +63,7 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc12_17.1: %struct_type.a.2 = struct_literal (%int_3) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index 440d4e879487..2a96f04459fd 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -26,9 +26,9 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %int_35.1: Core.IntLiteral = int_value 35 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_15.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_15.2: %i32 = int_value 15 [template] @@ -73,14 +73,14 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %int_15: Core.IntLiteral = int_value 15 [template = constants.%int_15.1] // CHECK:STDOUT: %int_35: Core.IntLiteral = int_value 35 [template = constants.%int_35.1] // CHECK:STDOUT: %.loc13_17.1: %tuple.type.3 = tuple_literal (%int_15, %int_35) -// CHECK:STDOUT: %impl.elem0.loc13_17.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_17.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_17.1: = bound_method %int_15, %impl.elem0.loc13_17.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_17.1: = specific_function %Convert.bound.loc13_17.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_17.1: init %i32 = call %Convert.specific_fn.loc13_17.1(%int_15) [template = constants.%int_15.2] // CHECK:STDOUT: %.loc13_17.2: init %i32 = converted %int_15, %int.convert_checked.loc13_17.1 [template = constants.%int_15.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return, element0 // CHECK:STDOUT: %.loc13_17.3: init %i32 = initialize_from %.loc13_17.2 to %tuple.elem0 [template = constants.%int_15.2] -// CHECK:STDOUT: %impl.elem0.loc13_17.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_17.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_17.2: = bound_method %int_35, %impl.elem0.loc13_17.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_17.2: = specific_function %Convert.bound.loc13_17.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_17.2: init %i32 = call %Convert.specific_fn.loc13_17.2(%int_35) [template = constants.%int_35.2] diff --git a/toolchain/check/testdata/return/value.carbon b/toolchain/check/testdata/return/value.carbon index 4d36bb990a57..ac097e4af131 100644 --- a/toolchain/check/testdata/return/value.carbon +++ b/toolchain/check/testdata/return/value.carbon @@ -21,9 +21,9 @@ fn Main() -> i32 { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -58,7 +58,7 @@ fn Main() -> i32 { // CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index ef018b5ccd37..920cf175b327 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -23,9 +23,9 @@ var y: i32 = x.b; // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %struct_type.a.2: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -58,7 +58,7 @@ var y: i32 = x.b; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_27.1: %struct_type.a.2 = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index c65e6c5380ae..11d492e2f1ea 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -19,12 +19,19 @@ var b_ref: {.a: {.b: i32, .c: (i32,)}, .d: i32} = class C(S:! {.a: i32, .b: i32}) {} fn F() -> C({.a = 1, .b = 2}); -// --- implicit.impl.carbon +// --- fail_todo_implicit.impl.carbon impl package Implicit; var a: {.a: i32} = a_ref; var b: {.a: {.b: i32, .c: (i32,)}, .d: i32} = b_ref; +// CHECK:STDERR: fail_todo_implicit.impl.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C({.a = 1, .b = 2})` to `C({.a = , .b = })` [ImplicitAsConversionFailure] +// CHECK:STDERR: var c: C({.a = 1, .b = 2}) = F(); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_implicit.impl.carbon:[[@LINE+4]]:1: note: type `C({.a = 1, .b = 2})` does not implement interface `Core.ImplicitAs(C({.a = , .b = }))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: var c: C({.a = 1, .b = 2}) = F(); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var c: C({.a = 1, .b = 2}) = F(); // --- fail_bad_type.impl.carbon @@ -43,10 +50,10 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C({.a = 1, .b = 2})` to `C({.a = 3, .b = 4})` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C({.a = 1, .b = 2})` to `C({.a = , .b = })` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C({.a = 1, .b = 2})` does not implement interface `Core.ImplicitAs(C({.a = 3, .b = 4}))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C({.a = 1, .b = 2})` does not implement interface `Core.ImplicitAs(C({.a = , .b = }))` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C({.a = 3, .b = 4}) = F(); @@ -60,9 +67,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %struct_type.a.2: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -83,7 +90,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%S) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] @@ -143,13 +150,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc9_28.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_28.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_28.1: = bound_method %int_1, %impl.elem0.loc9_28.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_28.1: = specific_function %Convert.bound.loc9_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_28.1: init %i32 = call %Convert.specific_fn.loc9_28.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_28.2: %i32 = value_of_initializer %int.convert_checked.loc9_28.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_28.3: %i32 = converted %int_1, %.loc9_28.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_28.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_28.2: = bound_method %int_2, %impl.elem0.loc9_28.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc9_28.2: = specific_function %Convert.bound.loc9_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc9_28.2: init %i32 = call %Convert.specific_fn.loc9_28.2(%int_2) [template = constants.%int_2.2] @@ -170,7 +177,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 @@ -184,7 +191,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc4_31.1: %struct_type.a.2 = struct_literal (%int_0.loc4) -// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4: = specific_function %Convert.bound.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.2] @@ -198,7 +205,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_29.1: %struct_type.b.c.2 = struct_literal (%int_0.loc6_17, %.loc6_28.1) // CHECK:STDOUT: %int_0.loc6_37: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc6_38.1: %struct_type.a.d.3 = struct_literal (%.loc6_29.1, %int_0.loc6_37) -// CHECK:STDOUT: %impl.elem0.loc6_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_29: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_29: = bound_method %int_0.loc6_17, %impl.elem0.loc6_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_29: = specific_function %Convert.bound.loc6_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_29: init %i32 = call %Convert.specific_fn.loc6_29(%int_0.loc6_17) [template = constants.%int_0.2] @@ -206,7 +213,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_38.2: ref %struct_type.b.c.1 = struct_access file.%b_ref.var, element0 // CHECK:STDOUT: %.loc6_29.3: ref %i32 = struct_access %.loc6_38.2, element0 // CHECK:STDOUT: %.loc6_29.4: init %i32 = initialize_from %.loc6_29.2 to %.loc6_29.3 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc6_28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_28: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_28: = bound_method %int_0.loc6_26, %impl.elem0.loc6_28 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_28: = specific_function %Convert.bound.loc6_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6_28(%int_0.loc6_26) [template = constants.%int_0.2] @@ -217,7 +224,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_29.7: init %tuple.type.2 = initialize_from %.loc6_29.6 to %.loc6_29.5 [template = constants.%tuple] // CHECK:STDOUT: %.loc6_29.8: init %struct_type.b.c.1 = struct_init (%.loc6_29.4, %.loc6_29.7) to %.loc6_38.2 [template = constants.%struct.2] // CHECK:STDOUT: %.loc6_38.3: init %struct_type.b.c.1 = converted %.loc6_29.1, %.loc6_29.8 [template = constants.%struct.2] -// CHECK:STDOUT: %impl.elem0.loc6_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_38: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_38: = bound_method %int_0.loc6_37, %impl.elem0.loc6_38 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_38: = specific_function %Convert.bound.loc6_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_38: init %i32 = call %Convert.specific_fn.loc6_38(%int_0.loc6_37) [template = constants.%int_0.2] @@ -240,9 +247,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %S.patt.loc8_9.2 => constants.%struct.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- implicit.impl.carbon +// CHECK:STDOUT: --- fail_todo_implicit.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] @@ -256,12 +267,22 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %S: %struct_type.a.b.1 = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %S.patt: %struct_type.a.b.1 = symbolic_binding_pattern S, 0 [symbolic] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %struct_type.a.b.1 = struct_value (%int_1.2, %int_2.2) [template] -// CHECK:STDOUT: %C.2: type = class_type @C, @C(%struct) [template] +// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.2 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%N) [symbolic] +// CHECK:STDOUT: %int.convert_checked.1: init %Int = call %Convert.specific_fn.1(%int_1.1) [symbolic] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.2 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%N) [symbolic] +// CHECK:STDOUT: %int.convert_checked.2: init %Int = call %Convert.specific_fn.2(%int_2.1) [symbolic] +// CHECK:STDOUT: %struct.1: %struct_type.a.b.1 = struct_value (%int.convert_checked.1, %int.convert_checked.2) [symbolic] +// CHECK:STDOUT: %C.2: type = class_type @C, @C(%struct.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] +// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] +// CHECK:STDOUT: %struct.2: %struct_type.a.b.1 = struct_value (%int_1.2, %int_2.2) [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -270,13 +291,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.230 -// CHECK:STDOUT: .ImplicitAs = %import_ref.233 +// CHECK:STDOUT: .Int = %import_ref.252 +// CHECK:STDOUT: .ImplicitAs = %import_ref.255 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.231: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.232 = import_ref Implicit//default, inst988 [no loc], unloaded +// CHECK:STDOUT: %import_ref.253: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.254 = import_ref Implicit//default, inst1017 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -309,12 +330,12 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.232 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.231 +// CHECK:STDOUT: .Self = imports.%import_ref.254 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.253 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> %C.2 [from "implicit.carbon"]; +// CHECK:STDOUT: fn @F() -> %C.3 [from "implicit.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -348,9 +369,10 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc5_52: init %struct_type.a.d.1 = converted %b_ref.ref, %.loc5_47.19 // CHECK:STDOUT: assign file.%b.var, %.loc5_52 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] -// CHECK:STDOUT: %.loc6: ref %C.2 = splice_block file.%c.var {} -// CHECK:STDOUT: %F.call: init %C.2 = call %F.ref() to %.loc6 -// CHECK:STDOUT: assign file.%c.var, %F.call +// CHECK:STDOUT: %.loc13_32: ref %C.3 = temporary_storage +// CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc13_32 +// CHECK:STDOUT: %.loc13_33: %C.2 = converted %F.call, [template = ] +// CHECK:STDOUT: assign file.%c.var, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -359,9 +381,16 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %S.patt => constants.%S // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%struct) { -// CHECK:STDOUT: %S => constants.%struct -// CHECK:STDOUT: %S.patt => constants.%struct +// CHECK:STDOUT: specific @C(constants.%struct.1) { +// CHECK:STDOUT: %S => constants.%struct.1 +// CHECK:STDOUT: %S.patt => constants.%struct.1 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%struct.2) { +// CHECK:STDOUT: %S => constants.%struct.2 +// CHECK:STDOUT: %S.patt => constants.%struct.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -395,8 +424,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.230: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.231 = import_ref Implicit//default, inst988 [no loc], unloaded +// CHECK:STDOUT: %import_ref.252: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.253 = import_ref Implicit//default, inst1017 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -423,8 +452,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.231 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.230 +// CHECK:STDOUT: .Self = imports.%import_ref.253 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.252 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -454,6 +483,10 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: --- fail_bad_value.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] @@ -463,10 +496,16 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %S: %struct_type.a.b.1 = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %S.patt: %struct_type.a.b.1 = symbolic_binding_pattern S, 0 [symbolic] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] -// CHECK:STDOUT: %struct.1: %struct_type.a.b.1 = struct_value (%int_3.2, %int_4.2) [template] -// CHECK:STDOUT: %C.2: type = class_type @C, @C(%struct.1) [template] +// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3, %Convert.2 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%N) [symbolic] +// CHECK:STDOUT: %int.convert_checked.1: init %Int = call %Convert.specific_fn.1(%int_3) [symbolic] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_4, %Convert.2 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%N) [symbolic] +// CHECK:STDOUT: %int.convert_checked.2: init %Int = call %Convert.specific_fn.2(%int_4) [symbolic] +// CHECK:STDOUT: %struct.1: %struct_type.a.b.1 = struct_value (%int.convert_checked.1, %int.convert_checked.2) [symbolic] +// CHECK:STDOUT: %C.2: type = class_type @C, @C(%struct.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_2: %i32 = int_value 2 [template] @@ -481,12 +520,12 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.232 +// CHECK:STDOUT: .ImplicitAs = %import_ref.254 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.230: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.231 = import_ref Implicit//default, inst988 [no loc], unloaded +// CHECK:STDOUT: %import_ref.252: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.253 = import_ref Implicit//default, inst1017 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -513,8 +552,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.231 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.230 +// CHECK:STDOUT: .Self = imports.%import_ref.253 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.252 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index e189791d733b..19b9177ba7ad 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -22,9 +22,9 @@ var z: i32 = y; // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: f64, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.15), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -64,7 +64,7 @@ var z: i32 = y; // CHECK:STDOUT: %.loc11_46.1: %struct_type.a.b.2 = struct_literal (%float, %int_1) // CHECK:STDOUT: %.loc11_46.2: ref f64 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc11_46.3: init f64 = initialize_from %float to %.loc11_46.2 [template = constants.%float] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index 4c912e57e1c8..8dc1fafd4b4e 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -20,9 +20,9 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %struct_type.a.2: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -55,7 +55,7 @@ var y: {.a: i32} = x; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_27.1: %struct_type.a.2 = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/struct/partially_const.carbon b/toolchain/check/testdata/struct/partially_const.carbon index d6f2bc87fb4e..ca79c29015cf 100644 --- a/toolchain/check/testdata/struct/partially_const.carbon +++ b/toolchain/check/testdata/struct/partially_const.carbon @@ -23,9 +23,9 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %struct_type.a.b.c.2: type = struct_type {.a: Core.IntLiteral, .b: %i32, .c: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -76,7 +76,7 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %int_0.loc12_32: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_33.1: %struct_type.a.b.c.2 = struct_literal (%int_0.loc12_16, %n.ref, %int_0.loc12_32) -// CHECK:STDOUT: %impl.elem0.loc12_33.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_33.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_33.1: = bound_method %int_0.loc12_16, %impl.elem0.loc12_33.1 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc12_33.1: = specific_function %Convert.bound.loc12_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc12_33.1: init %i32 = call %Convert.specific_fn.loc12_33.1(%int_0.loc12_16) [template = constants.%int_0.2] @@ -85,7 +85,7 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %.loc12_33.4: init %i32 = initialize_from %.loc12_33.2 to %.loc12_33.3 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc12_33.5: ref %i32 = struct_access %return, element1 // CHECK:STDOUT: %.loc12_33.6: init %i32 = initialize_from %n.ref to %.loc12_33.5 -// CHECK:STDOUT: %impl.elem0.loc12_33.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_33.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_33.2: = bound_method %int_0.loc12_32, %impl.elem0.loc12_33.2 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc12_33.2: = specific_function %Convert.bound.loc12_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc12_33.2: init %i32 = call %Convert.specific_fn.loc12_33.2(%int_0.loc12_32) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index aafdf62c83dc..81f541141b3f 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -23,9 +23,9 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: %tuple.type.3} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -64,14 +64,14 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_49.1: %tuple.type.3 = tuple_literal (%int_2) // CHECK:STDOUT: %.loc11_50.1: %struct_type.a.b.2 = struct_literal (%int_1, %.loc11_49.1) -// CHECK:STDOUT: %impl.elem0.loc11_50: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_50: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_50: = bound_method %int_1, %impl.elem0.loc11_50 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_50: = specific_function %Convert.bound.loc11_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_50: init %i32 = call %Convert.specific_fn.loc11_50(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_50.2: init %i32 = converted %int_1, %int.convert_checked.loc11_50 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_50.3: ref %i32 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc11_50.4: init %i32 = initialize_from %.loc11_50.2 to %.loc11_50.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_49: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_49: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_49: = bound_method %int_2, %impl.elem0.loc11_49 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_49: = specific_function %Convert.bound.loc11_49, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_49: init %i32 = call %Convert.specific_fn.loc11_49(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index ccac7fa9a6e3..2c79a8c12666 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -24,9 +24,9 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -65,13 +65,13 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc11: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_44.1: %struct_type.a.b.2 = struct_literal (%int_1.loc11, %int_2.loc11) -// CHECK:STDOUT: %impl.elem0.loc11_44.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_44.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_44.1: = bound_method %int_1.loc11, %impl.elem0.loc11_44.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_44.1: = specific_function %Convert.bound.loc11_44.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_44.1: init %i32 = call %Convert.specific_fn.loc11_44.1(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_44.2: %i32 = value_of_initializer %int.convert_checked.loc11_44.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_44.3: %i32 = converted %int_1.loc11, %.loc11_44.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_44.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_44.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_44.2: = bound_method %int_2.loc11, %impl.elem0.loc11_44.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_44.2: = specific_function %Convert.bound.loc11_44.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_44.2: init %i32 = call %Convert.specific_fn.loc11_44.2(%int_2.loc11) [template = constants.%int_2.2] @@ -85,14 +85,14 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc14_44.1: %struct_type.a.b.2 = struct_literal (%int_1.loc14, %int_2.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_44.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_44.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_44.1: = bound_method %int_1.loc14, %impl.elem0.loc14_44.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_44.1: = specific_function %Convert.bound.loc14_44.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_44.1: init %i32 = call %Convert.specific_fn.loc14_44.1(%int_1.loc14) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_44.2: init %i32 = converted %int_1.loc14, %int.convert_checked.loc14_44.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_44.3: ref %i32 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc14_44.4: init %i32 = initialize_from %.loc14_44.2 to %.loc14_44.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_44.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_44.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_44.2: = bound_method %int_2.loc14, %impl.elem0.loc14_44.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_44.2: = specific_function %Convert.bound.loc14_44.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_44.2: init %i32 = call %Convert.specific_fn.loc14_44.2(%int_2.loc14) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/tuple/access/element_access.carbon b/toolchain/check/testdata/tuple/access/element_access.carbon index 4335eb8ebbcc..b349f83d4df1 100644 --- a/toolchain/check/testdata/tuple/access/element_access.carbon +++ b/toolchain/check/testdata/tuple/access/element_access.carbon @@ -21,9 +21,9 @@ var c: i32 = b.0; // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -60,7 +60,7 @@ var c: i32 = b.0; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.3 = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_12) [template = constants.%int_12.2] diff --git a/toolchain/check/testdata/tuple/access/fail_access_error.carbon b/toolchain/check/testdata/tuple/access/fail_access_error.carbon index 0648dc481271..6aff8d726a8a 100644 --- a/toolchain/check/testdata/tuple/access/fail_access_error.carbon +++ b/toolchain/check/testdata/tuple/access/fail_access_error.carbon @@ -24,9 +24,9 @@ var b: i32 = a.(oops); // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -63,14 +63,14 @@ var b: i32 = a.(oops); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/access/fail_large_index.carbon b/toolchain/check/testdata/tuple/access/fail_large_index.carbon index bec5ed2e097b..55ef25534fbd 100644 --- a/toolchain/check/testdata/tuple/access/fail_large_index.carbon +++ b/toolchain/check/testdata/tuple/access/fail_large_index.carbon @@ -29,9 +29,9 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -72,7 +72,7 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.3 = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_12) [template = constants.%int_12.2] diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index 2f507ee2ec84..6987daeb9c25 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -24,9 +24,9 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -36,9 +36,9 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_12.2, %int_6.2) [template] // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template] // CHECK:STDOUT: %Op.type.13: type = fn_type @Op.13 [template] +// CHECK:STDOUT: %impl_witness.21: = impl_witness (imports.%import_ref.254) [template] // CHECK:STDOUT: %Op.type.14: type = fn_type @Op.14 [template] // CHECK:STDOUT: %Op.14: %Op.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.20: = interface_witness (%Op.14) [template] // CHECK:STDOUT: %Op.bound: = bound_method %int_10, %Op.14 [template] // CHECK:STDOUT: %int_-10: Core.IntLiteral = int_value -10 [template] // CHECK:STDOUT: } @@ -47,7 +47,7 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Negate = %import_ref.229 +// CHECK:STDOUT: .Negate = %import_ref.252 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -71,14 +71,14 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] @@ -90,7 +90,7 @@ var b: i32 = a.(-10); // CHECK:STDOUT: assign file.%a.var, %.loc11_28 // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10] -// CHECK:STDOUT: %impl.elem0.loc15: %Op.type.13 = interface_witness_access constants.%interface.20, element0 [template = constants.%Op.14] +// CHECK:STDOUT: %impl.elem0.loc15: %Op.type.13 = impl_witness_access constants.%impl_witness.21, element0 [template = constants.%Op.14] // CHECK:STDOUT: %Op.bound: = bound_method %int_10, %impl.elem0.loc15 [template = constants.%Op.bound] // CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %Op.bound(%int_10) [template = constants.%int_-10] // CHECK:STDOUT: %.loc15_17.1: Core.IntLiteral = value_of_initializer %int.snegate [template = constants.%int_-10] diff --git a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon index 9c3e7763ae82..e31b215879fd 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon @@ -25,9 +25,9 @@ var c: i32 = a.(b); // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -71,14 +71,14 @@ var c: i32 = a.(b); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_26.1: %tuple.type.3 = tuple_literal (%int_2, %int_3) -// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_2, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.1: = specific_function %Convert.bound.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc11_26.2: init %i32 = converted %int_2, %int.convert_checked.loc11_26.1 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_26.3: init %i32 = initialize_from %.loc11_26.2 to %tuple.elem0 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_3, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.2: = specific_function %Convert.bound.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_3) [template = constants.%int_3.2] @@ -89,7 +89,7 @@ var c: i32 = a.(b); // CHECK:STDOUT: %.loc11_27: init %tuple.type.2 = converted %.loc11_26.1, %.loc11_26.6 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_27 // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_0, %impl.elem0.loc12 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index 14b601137f36..5da84928cc4c 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -27,9 +27,9 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -67,14 +67,14 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon index ac08b37b1543..fa71ced6384c 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -36,9 +36,9 @@ fn Main() { // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.19), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] @@ -73,7 +73,7 @@ fn Main() { // CHECK:STDOUT: %int_5.loc18_30: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %int_5.loc18_33: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc18_34.1: %tuple.type = tuple_literal (%int_5.loc18_30, %int_5.loc18_33) -// CHECK:STDOUT: %impl.elem0.loc18_34.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_34.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_34.1: = bound_method %int_5.loc18_30, %impl.elem0.loc18_34.1 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc18_34.1: = specific_function %Convert.bound.loc18_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc18_34.1: init %i32 = call %Convert.specific_fn.loc18_34.1(%int_5.loc18_30) [template = constants.%int_5.2] @@ -81,7 +81,7 @@ fn Main() { // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc18_34.3: ref %i32 = array_index %non_tuple.var, %int_0.loc18 // CHECK:STDOUT: %.loc18_34.4: init %i32 = initialize_from %.loc18_34.2 to %.loc18_34.3 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc18_34.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_34.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_34.2: = bound_method %int_5.loc18_33, %impl.elem0.loc18_34.2 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc18_34.2: = specific_function %Convert.bound.loc18_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc18_34.2: init %i32 = call %Convert.specific_fn.loc18_34.2(%int_5.loc18_33) [template = constants.%int_5.2] diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon index ba8263fd0906..79cb2445ac05 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon @@ -24,9 +24,9 @@ var b: i32 = a.2; // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -64,14 +64,14 @@ var b: i32 = a.2; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon index c935b54f7dfd..46694560c1dc 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon @@ -24,9 +24,9 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %int_34.1: Core.IntLiteral = int_value 34 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -66,14 +66,14 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_34: Core.IntLiteral = int_value 34 [template = constants.%int_34.1] // CHECK:STDOUT: %.loc11_28.1: %tuple.type.3 = tuple_literal (%int_12, %int_34) -// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.1: = bound_method %int_12, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.1: = specific_function %Convert.bound.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %Convert.specific_fn.loc11_28.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_28.2: init %i32 = converted %int_12, %int.convert_checked.loc11_28.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_28.3: init %i32 = initialize_from %.loc11_28.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.2: = bound_method %int_34, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.2: = specific_function %Convert.bound.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %Convert.specific_fn.loc11_28.2(%int_34) [template = constants.%int_34.2] diff --git a/toolchain/check/testdata/tuple/access/index_not_literal.carbon b/toolchain/check/testdata/tuple/access/index_not_literal.carbon index 9069ce6973ba..66b551ff555d 100644 --- a/toolchain/check/testdata/tuple/access/index_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/index_not_literal.carbon @@ -24,9 +24,9 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %tuple.type.3: type = tuple_type (bool, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.15), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_34.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_34.2: %i32 = int_value 34 [template] @@ -36,15 +36,15 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %struct.1: %struct_type.index.1 = struct_value (%int_1.1) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.4, @As(%i32) [template] +// CHECK:STDOUT: %impl_witness.21: = impl_witness (imports.%import_ref.28), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %interface.20: = interface_witness (%Convert.12) [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.12 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] +// CHECK:STDOUT: %impl_witness.23: = impl_witness (imports.%import_ref.19), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %interface.21: = interface_witness (%Convert.13) [template] // CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.2, %Convert.13 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %Convert.bound.4: = bound_method %int_1.1, %Convert.12 [template] @@ -61,7 +61,7 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: .Bool = %import_ref.1 // CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.6 -// CHECK:STDOUT: .As = %import_ref.230 +// CHECK:STDOUT: .As = %import_ref.253 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -93,7 +93,7 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %.loc11_31.1: %tuple.type.3 = tuple_literal (%true, %int_34) // CHECK:STDOUT: %tuple.elem0.loc11: ref bool = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_31.2: init bool = initialize_from %true to %tuple.elem0.loc11 [template = constants.%true] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_34, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_34) [template = constants.%int_34.2] @@ -116,13 +116,13 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc13_20.1: %Convert.type.11 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.12] +// CHECK:STDOUT: %impl.elem0.loc13_20.1: %Convert.type.11 = impl_witness_access constants.%impl_witness.21, element0 [template = constants.%Convert.12] // CHECK:STDOUT: %Convert.bound.loc13_20.1: = bound_method %int_0, %impl.elem0.loc13_20.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_20.1: = specific_function %Convert.bound.loc13_20.1, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_20.1: init %i32 = call %Convert.specific_fn.loc13_20.1(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20.1 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_0, %.loc13_20.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc13_20.2: %Convert.type.5 = interface_witness_access constants.%interface.21, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %impl.elem0.loc13_20.2: %Convert.type.5 = impl_witness_access constants.%impl_witness.23, element0 [template = constants.%Convert.13] // CHECK:STDOUT: %Convert.bound.loc13_20.2: = bound_method %.loc13_20.2, %impl.elem0.loc13_20.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_20.2: = specific_function %Convert.bound.loc13_20.2, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_20.2: init Core.IntLiteral = call %Convert.specific_fn.loc13_20.2(%.loc13_20.2) [template = constants.%int_0.1] @@ -135,7 +135,7 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc14_29: %Convert.type.11 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.12] +// CHECK:STDOUT: %impl.elem0.loc14_29: %Convert.type.11 = impl_witness_access constants.%impl_witness.21, element0 [template = constants.%Convert.12] // CHECK:STDOUT: %Convert.bound.loc14_29: = bound_method %int_1.loc14, %impl.elem0.loc14_29 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc14_29: = specific_function %Convert.bound.loc14_29, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc14_29: init %i32 = call %Convert.specific_fn.loc14_29(%int_1.loc14) [template = constants.%int_1.2] @@ -145,7 +145,7 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %struct.loc14: %struct_type.index.2 = struct_value (%.loc14_29.2) [template = constants.%struct.2] // CHECK:STDOUT: %.loc14_35.2: %struct_type.index.2 = converted %.loc14_35.1, %struct.loc14 [template = constants.%struct.2] // CHECK:STDOUT: %.loc14_36.1: %i32 = struct_access %.loc14_35.2, element0 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_36: %Convert.type.5 = interface_witness_access constants.%interface.21, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %impl.elem0.loc14_36: %Convert.type.5 = impl_witness_access constants.%impl_witness.23, element0 [template = constants.%Convert.13] // CHECK:STDOUT: %Convert.bound.loc14_36: = bound_method %.loc14_36.1, %impl.elem0.loc14_36 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc14_36: = specific_function %Convert.bound.loc14_36, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc14_36: init Core.IntLiteral = call %Convert.specific_fn.loc14_36(%.loc14_36.1) [template = constants.%int_1.1] diff --git a/toolchain/check/testdata/tuple/access/return_value_access.carbon b/toolchain/check/testdata/tuple/access/return_value_access.carbon index 7c14bf088c14..266270d67368 100644 --- a/toolchain/check/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/check/testdata/tuple/access/return_value_access.carbon @@ -26,9 +26,9 @@ fn Run() -> i32 { // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -81,7 +81,7 @@ fn Run() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.3 = tuple_literal (%int_0) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index 6a706f17546c..0c98b6b72e75 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -26,9 +26,9 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, f64) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -58,7 +58,7 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [template = constants.%float] // CHECK:STDOUT: %.loc17_30.1: %tuple.type.3 = tuple_literal (%int_2, %float) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 08bdb0906afa..408e53f10c70 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -19,12 +19,19 @@ class C(X:! (i32, i32)) {} fn F() -> C((1, 2)); -// --- implicit.impl.carbon +// --- fail_todo_implicit.impl.carbon impl package Implicit; var a: (i32,) = a_ref; var b: (((i32,), i32), (i32, i32)) = b_ref; +// CHECK:STDERR: fail_todo_implicit.impl.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C((1, 2))` to `C((, ))` [ImplicitAsConversionFailure] +// CHECK:STDERR: var c: C((1, 2)) = F(); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_implicit.impl.carbon:[[@LINE+4]]:1: note: type `C((1, 2))` does not implement interface `Core.ImplicitAs(C((, )))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: var c: C((1, 2)) = F(); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var c: C((1, 2)) = F(); // --- fail_bad_type.impl.carbon @@ -45,10 +52,10 @@ var c_bad: C((1, 2, 3)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C((1, 2))` to `C((3, 4))` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C((1, 2))` to `C((, ))` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C((1, 2))` does not implement interface `Core.ImplicitAs(C((3, 4)))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C((1, 2))` does not implement interface `Core.ImplicitAs(C((, )))` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C((3, 4)) = F(); @@ -62,9 +69,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -97,7 +104,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%X) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %tuple.5: %tuple.type.8 = tuple_value (%int_1.2, %int_2.2) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%tuple.5) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -149,13 +156,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc9_18.1: %tuple.type.12 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_18.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_18.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_18.1: = bound_method %int_1, %impl.elem0.loc9_18.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_18.1: = specific_function %Convert.bound.loc9_18.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %Convert.specific_fn.loc9_18.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_18.2: %i32 = value_of_initializer %int.convert_checked.loc9_18.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_18.3: %i32 = converted %int_1, %.loc9_18.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_18.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_18.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_18.2: = bound_method %int_2, %impl.elem0.loc9_18.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc9_18.2: = specific_function %Convert.bound.loc9_18.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %Convert.specific_fn.loc9_18.2(%int_2) [template = constants.%int_2.2] @@ -176,7 +183,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 @@ -190,7 +197,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc4_24.1: %tuple.type.3 = tuple_literal (%int_0.loc4) -// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4: = specific_function %Convert.bound.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.2] @@ -206,7 +213,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc5_59.1: %tuple.type.12 = tuple_literal (%int_2, %int_3) // CHECK:STDOUT: %.loc5_60.1: %tuple.type.13 = tuple_literal (%.loc5_51.1, %.loc5_59.1) -// CHECK:STDOUT: %impl.elem0.loc5_47: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5_47: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_47: = bound_method %int_0.loc5, %impl.elem0.loc5_47 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5_47: = specific_function %Convert.bound.loc5_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %Convert.specific_fn.loc5_47(%int_0.loc5) [template = constants.%int_0.2] @@ -216,7 +223,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_47.3: init %tuple.type.2 = tuple_init (%.loc5_47.2) to %tuple.elem0.loc5_51 [template = constants.%tuple.1] // CHECK:STDOUT: %.loc5_51.2: init %tuple.type.2 = converted %.loc5_47.1, %.loc5_47.3 [template = constants.%tuple.1] // CHECK:STDOUT: %.loc5_51.3: init %tuple.type.2 = initialize_from %.loc5_51.2 to %tuple.elem0.loc5_51 [template = constants.%tuple.1] -// CHECK:STDOUT: %impl.elem0.loc5_51: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5_51: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_51: = bound_method %int_1, %impl.elem0.loc5_51 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc5_51: = specific_function %Convert.bound.loc5_51, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %Convert.specific_fn.loc5_51(%int_1) [template = constants.%int_1.2] @@ -225,7 +232,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_51.5: init %i32 = initialize_from %.loc5_51.4 to %tuple.elem1.loc5_51 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc5_51.6: init %tuple.type.7 = tuple_init (%.loc5_51.3, %.loc5_51.5) to %tuple.elem0.loc5_60 [template = constants.%tuple.2] // CHECK:STDOUT: %.loc5_60.2: init %tuple.type.7 = converted %.loc5_51.1, %.loc5_51.6 [template = constants.%tuple.2] -// CHECK:STDOUT: %impl.elem0.loc5_59.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5_59.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_59.1: = bound_method %int_2, %impl.elem0.loc5_59.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc5_59.1: = specific_function %Convert.bound.loc5_59.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %Convert.specific_fn.loc5_59.1(%int_2) [template = constants.%int_2.2] @@ -233,7 +240,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %tuple.elem1.loc5_60: ref %tuple.type.8 = tuple_access file.%b_ref.var, element1 // CHECK:STDOUT: %tuple.elem0.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element0 // CHECK:STDOUT: %.loc5_59.3: init %i32 = initialize_from %.loc5_59.2 to %tuple.elem0.loc5_59 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc5_59.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5_59.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_59.2: = bound_method %int_3, %impl.elem0.loc5_59.2 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc5_59.2: = specific_function %Convert.bound.loc5_59.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %Convert.specific_fn.loc5_59.2(%int_3) [template = constants.%int_3.2] @@ -258,9 +265,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %X.patt.loc7_9.2 => constants.%tuple.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- implicit.impl.carbon +// CHECK:STDOUT: --- fail_todo_implicit.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] @@ -273,12 +284,22 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %X: %tuple.type.7 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.7 = symbolic_binding_pattern X, 0 [symbolic] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %tuple: %tuple.type.7 = tuple_value (%int_1.2, %int_2.2) [template] -// CHECK:STDOUT: %C.2: type = class_type @C, @C(%tuple) [template] +// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.2 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%N) [symbolic] +// CHECK:STDOUT: %int.convert_checked.1: init %Int = call %Convert.specific_fn.1(%int_1.1) [symbolic] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.2 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%N) [symbolic] +// CHECK:STDOUT: %int.convert_checked.2: init %Int = call %Convert.specific_fn.2(%int_2.1) [symbolic] +// CHECK:STDOUT: %tuple.1: %tuple.type.7 = tuple_value (%int.convert_checked.1, %int.convert_checked.2) [symbolic] +// CHECK:STDOUT: %C.2: type = class_type @C, @C(%tuple.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] +// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] +// CHECK:STDOUT: %tuple.2: %tuple.type.7 = tuple_value (%int_1.2, %int_2.2) [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -287,13 +308,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.230 -// CHECK:STDOUT: .ImplicitAs = %import_ref.233 +// CHECK:STDOUT: .Int = %import_ref.252 +// CHECK:STDOUT: .ImplicitAs = %import_ref.255 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.231: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.232 = import_ref Implicit//default, inst1023 [no loc], unloaded +// CHECK:STDOUT: %import_ref.253: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.254 = import_ref Implicit//default, inst1052 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -326,12 +347,12 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.232 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.231 +// CHECK:STDOUT: .Self = imports.%import_ref.254 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.253 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> %C.2 [from "implicit.carbon"]; +// CHECK:STDOUT: fn @F() -> %C.3 [from "implicit.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -373,9 +394,10 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_43: init %tuple.type.8 = converted %b_ref.ref, %.loc5_38.15 // CHECK:STDOUT: assign file.%b.var, %.loc5_43 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] -// CHECK:STDOUT: %.loc6: ref %C.2 = splice_block file.%c.var {} -// CHECK:STDOUT: %F.call: init %C.2 = call %F.ref() to %.loc6 -// CHECK:STDOUT: assign file.%c.var, %F.call +// CHECK:STDOUT: %.loc13_22: ref %C.3 = temporary_storage +// CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc13_22 +// CHECK:STDOUT: %.loc13_23: %C.2 = converted %F.call, [template = ] +// CHECK:STDOUT: assign file.%c.var, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -384,9 +406,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %X.patt => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%tuple) { -// CHECK:STDOUT: %X => constants.%tuple -// CHECK:STDOUT: %X.patt => constants.%tuple +// CHECK:STDOUT: specific @C(constants.%tuple.1) { +// CHECK:STDOUT: %X => constants.%tuple.1 +// CHECK:STDOUT: %X.patt => constants.%tuple.1 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%tuple.2) { +// CHECK:STDOUT: %X => constants.%tuple.2 +// CHECK:STDOUT: %X.patt => constants.%tuple.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -420,8 +449,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.230: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.231 = import_ref Implicit//default, inst1023 [no loc], unloaded +// CHECK:STDOUT: %import_ref.252: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.253 = import_ref Implicit//default, inst1052 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -448,8 +477,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.231 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.230 +// CHECK:STDOUT: .Self = imports.%import_ref.253 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.252 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -479,6 +508,10 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: --- fail_bad_value.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] @@ -488,10 +521,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %X: %tuple.type.1 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.1 = symbolic_binding_pattern X, 0 [symbolic] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] -// CHECK:STDOUT: %tuple.1: %tuple.type.1 = tuple_value (%int_3.2, %int_4.2) [template] -// CHECK:STDOUT: %C.2: type = class_type @C, @C(%tuple.1) [template] +// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3, %Convert.2 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%N) [symbolic] +// CHECK:STDOUT: %int.convert_checked.1: init %Int = call %Convert.specific_fn.1(%int_3) [symbolic] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_4, %Convert.2 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%N) [symbolic] +// CHECK:STDOUT: %int.convert_checked.2: init %Int = call %Convert.specific_fn.2(%int_4) [symbolic] +// CHECK:STDOUT: %tuple.1: %tuple.type.1 = tuple_value (%int.convert_checked.1, %int.convert_checked.2) [symbolic] +// CHECK:STDOUT: %C.2: type = class_type @C, @C(%tuple.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_2: %i32 = int_value 2 [template] @@ -506,12 +545,12 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.232 +// CHECK:STDOUT: .ImplicitAs = %import_ref.254 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.230: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.231 = import_ref Implicit//default, inst1023 [no loc], unloaded +// CHECK:STDOUT: %import_ref.252: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.253 = import_ref Implicit//default, inst1052 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -538,8 +577,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.231 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.230 +// CHECK:STDOUT: .Self = imports.%import_ref.253 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.252 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/nested_tuple.carbon b/toolchain/check/testdata/tuple/nested_tuple.carbon index 967f49293771..d466c214e9f4 100644 --- a/toolchain/check/testdata/tuple/nested_tuple.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple.carbon @@ -23,9 +23,9 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.7: type = tuple_type (%tuple.type.6, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -65,7 +65,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %.loc11_36.1: %tuple.type.6 = tuple_literal (%int_12, %int_76) // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_40.1: %tuple.type.7 = tuple_literal (%.loc11_36.1, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_36.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_36.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_36.1: = bound_method %int_12, %impl.elem0.loc11_36.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_36.1: = specific_function %Convert.bound.loc11_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_36.1: init %i32 = call %Convert.specific_fn.loc11_36.1(%int_12) [template = constants.%int_12.2] @@ -73,7 +73,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %tuple.elem0.loc11_40: ref %tuple.type.3 = tuple_access file.%x.var, element0 // CHECK:STDOUT: %tuple.elem0.loc11_36: ref %i32 = tuple_access %tuple.elem0.loc11_40, element0 // CHECK:STDOUT: %.loc11_36.3: init %i32 = initialize_from %.loc11_36.2 to %tuple.elem0.loc11_36 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_36.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_36.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_36.2: = bound_method %int_76, %impl.elem0.loc11_36.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_36.2: = specific_function %Convert.bound.loc11_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_36.2: init %i32 = call %Convert.specific_fn.loc11_36.2(%int_76) [template = constants.%int_76.2] @@ -82,7 +82,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %.loc11_36.5: init %i32 = initialize_from %.loc11_36.4 to %tuple.elem1.loc11_36 [template = constants.%int_76.2] // CHECK:STDOUT: %.loc11_36.6: init %tuple.type.3 = tuple_init (%.loc11_36.3, %.loc11_36.5) to %tuple.elem0.loc11_40 [template = constants.%tuple.1] // CHECK:STDOUT: %.loc11_40.2: init %tuple.type.3 = converted %.loc11_36.1, %.loc11_36.6 [template = constants.%tuple.1] -// CHECK:STDOUT: %impl.elem0.loc11_40: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_40: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_40: = bound_method %int_6, %impl.elem0.loc11_40 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_40: = specific_function %Convert.bound.loc11_40, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_40: init %i32 = call %Convert.specific_fn.loc11_40(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon index 3ab706e3ac19..04303b3a4279 100644 --- a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon @@ -37,9 +37,9 @@ fn H() { // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.9: type = tuple_type (Core.IntLiteral, %tuple.type.2, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -113,14 +113,14 @@ fn H() { // CHECK:STDOUT: %F.call: init %tuple.type.2 = call %F.ref() to %tuple.elem1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc18_50.1: %tuple.type.9 = tuple_literal (%int_1, %F.call, %int_2) -// CHECK:STDOUT: %impl.elem0.loc18_50.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_50.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_50.1: = bound_method %int_1, %impl.elem0.loc18_50.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18_50.1: = specific_function %Convert.bound.loc18_50.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18_50.1: init %i32 = call %Convert.specific_fn.loc18_50.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_50.2: init %i32 = converted %int_1, %int.convert_checked.loc18_50.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc18_50.3: init %i32 = initialize_from %.loc18_50.2 to %tuple.elem0 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_50.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_50.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_50.2: = bound_method %int_2, %impl.elem0.loc18_50.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc18_50.2: = specific_function %Convert.bound.loc18_50.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc18_50.2: init %i32 = call %Convert.specific_fn.loc18_50.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/tuple/one_element.carbon b/toolchain/check/testdata/tuple/one_element.carbon index 252016c7bbbf..3b2c1509dc4c 100644 --- a/toolchain/check/testdata/tuple/one_element.carbon +++ b/toolchain/check/testdata/tuple/one_element.carbon @@ -20,9 +20,9 @@ var y: (i32,) = x; // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -55,7 +55,7 @@ var y: (i32,) = x; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_20.1: %tuple.type.3 = tuple_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/tuple/two_elements.carbon b/toolchain/check/testdata/tuple/two_elements.carbon index 038319041f6d..3064805678b6 100644 --- a/toolchain/check/testdata/tuple/two_elements.carbon +++ b/toolchain/check/testdata/tuple/two_elements.carbon @@ -24,9 +24,9 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %int_102.1: Core.IntLiteral = int_value 102 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %impl_witness.19: = impl_witness (imports.%import_ref.14), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -65,13 +65,13 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %int_4.loc11: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %int_102.loc11: Core.IntLiteral = int_value 102 [template = constants.%int_102.1] // CHECK:STDOUT: %.loc11_28.1: %tuple.type.3 = tuple_literal (%int_4.loc11, %int_102.loc11) -// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.1: = bound_method %int_4.loc11, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.1: = specific_function %Convert.bound.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %Convert.specific_fn.loc11_28.1(%int_4.loc11) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc11_28.2: %i32 = value_of_initializer %int.convert_checked.loc11_28.1 [template = constants.%int_4.2] // CHECK:STDOUT: %.loc11_28.3: %i32 = converted %int_4.loc11, %.loc11_28.2 [template = constants.%int_4.2] -// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.2: = bound_method %int_102.loc11, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.2: = specific_function %Convert.bound.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %Convert.specific_fn.loc11_28.2(%int_102.loc11) [template = constants.%int_102.2] @@ -85,14 +85,14 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %int_4.loc14: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %int_102.loc14: Core.IntLiteral = int_value 102 [template = constants.%int_102.1] // CHECK:STDOUT: %.loc14_28.1: %tuple.type.3 = tuple_literal (%int_4.loc14, %int_102.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_28.1: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_28.1: = bound_method %int_4.loc14, %impl.elem0.loc14_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_28.1: = specific_function %Convert.bound.loc14_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_28.1: init %i32 = call %Convert.specific_fn.loc14_28.1(%int_4.loc14) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc14_28.2: init %i32 = converted %int_4.loc14, %int.convert_checked.loc14_28.1 [template = constants.%int_4.2] // CHECK:STDOUT: %tuple.elem0.loc14: ref %i32 = tuple_access file.%x.var, element0 // CHECK:STDOUT: %.loc14_28.3: init %i32 = initialize_from %.loc14_28.2 to %tuple.elem0.loc14 [template = constants.%int_4.2] -// CHECK:STDOUT: %impl.elem0.loc14_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_28.2: %Convert.type.2 = impl_witness_access constants.%impl_witness.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_28.2: = bound_method %int_102.loc14, %impl.elem0.loc14_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_28.2: = specific_function %Convert.bound.loc14_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_28.2: init %i32 = call %Convert.specific_fn.loc14_28.2(%int_102.loc14) [template = constants.%int_102.2] diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index f9f09d2221ac..046133b6965d 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -143,7 +143,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Impls: %Impls.type = struct_value () [template] // CHECK:STDOUT: %.Self.as_type.2: type = facet_access_type %.Self.1 [symbolic] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.1 [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %W: %I_where.type = bind_symbolic_name W, 0 [symbolic] // CHECK:STDOUT: %W.patt: %I_where.type = symbolic_binding_pattern W, 0 [symbolic] // CHECK:STDOUT: %And.type: type = fn_type @And [template] @@ -218,7 +218,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.Self.ref.loc15_38: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] // CHECK:STDOUT: %Member.ref: %assoc_type.1 = name_ref Member, @I.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref.loc15_38 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %.loc15_50: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc15_14.2: type = where_expr %.Self [template = constants.%I_where.type] { // CHECK:STDOUT: requirement_impls %.loc15_20, %J.ref @@ -300,7 +300,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, @K.%Associated [template] // CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] -// CHECK:STDOUT: %impl.elem0: %L.type = interface_witness_access %.Self.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: %L.type = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic] // CHECK:STDOUT: %K_where.type: type = facet_type <@K where TODO> [template] // CHECK:STDOUT: %W: %K_where.type = bind_symbolic_name W, 0 [symbolic] @@ -339,7 +339,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.Self.ref: %K.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %Associated.ref: %assoc_type = name_ref Associated, @K.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: %L.type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: %L.type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [template = constants.%M.type] // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic = constants.%as_type] // CHECK:STDOUT: %.loc11_36: type = converted %impl.elem0, %as_type [symbolic = constants.%as_type] @@ -565,7 +565,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %J.type: type = facet_type <@J> [template] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: %DoesNotImplI.type: type = fn_type @DoesNotImplI [template] // CHECK:STDOUT: %DoesNotImplI: %DoesNotImplI.type = struct_value () [template] // CHECK:STDOUT: %Impls.type: type = fn_type @Impls [template] @@ -616,6 +616,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %J.ref: type = name_ref J, imports.%import_ref.1 [template = constants.%J.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: %DoesNotImplI.decl: %DoesNotImplI.type = fn_decl @DoesNotImplI [template = constants.%DoesNotImplI] {} {} // CHECK:STDOUT: %EmptyStruct.decl: %EmptyStruct.type = fn_decl @EmptyStruct [template = constants.%EmptyStruct] { // CHECK:STDOUT: %Y.patt.loc26_16.1: %J_where.type = symbolic_binding_pattern Y, 0 [symbolic = %Y.patt.loc26_16.2 (constants.%Y.patt)] @@ -643,10 +644,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref as %J.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/where_expr/designator.carbon b/toolchain/check/testdata/where_expr/designator.carbon index 24d1c4b2f7d4..febdc5ac7668 100644 --- a/toolchain/check/testdata/where_expr/designator.carbon +++ b/toolchain/check/testdata/where_expr/designator.carbon @@ -101,7 +101,7 @@ class D { // CHECK:STDOUT: %PeriodSelf.type: type = fn_type @PeriodSelf [template] // CHECK:STDOUT: %PeriodSelf: %PeriodSelf.type = struct_value () [template] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.1 [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %U: %I_where.type = bind_symbolic_name U, 0 [symbolic] // CHECK:STDOUT: %U.patt: %I_where.type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %PeriodMember.type: type = fn_type @PeriodMember [template] @@ -158,7 +158,7 @@ class D { // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] // CHECK:STDOUT: %Member.ref: %assoc_type = name_ref Member, @I.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %.loc10_41: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc10_23.2: type = where_expr %.Self [template = constants.%I_where.type] { // CHECK:STDOUT: requirement_equivalent %impl.elem0, %.loc10_41 diff --git a/toolchain/check/testdata/where_expr/dot_self_index.carbon b/toolchain/check/testdata/where_expr/dot_self_index.carbon index c0b4809c7905..ffbc4425c209 100644 --- a/toolchain/check/testdata/where_expr/dot_self_index.carbon +++ b/toolchain/check/testdata/where_expr/dot_self_index.carbon @@ -41,7 +41,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %Empty.type.3, type [symbolic] // CHECK:STDOUT: %assoc0.2: %assoc_type.2 = assoc_entity element0, @Empty.%A [symbolic] // CHECK:STDOUT: %.Self.as_wit.1: = facet_access_witness %.Self.1 [symbolic] -// CHECK:STDOUT: %impl.elem0.1: type = interface_witness_access %.Self.as_wit.1, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0.1: type = impl_witness_access %.Self.as_wit.1, element0 [symbolic] // CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %Empty_where.type.1: type = facet_type <@Empty, @Empty(%T) where %impl.elem0.1 = %ptr.1> [symbolic] // CHECK:STDOUT: %V: type = bind_symbolic_name V, 1 [symbolic] @@ -56,7 +56,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %assoc_type.3: type = assoc_entity_type %Empty.type.4, type [template] // CHECK:STDOUT: %assoc0.3: %assoc_type.3 = assoc_entity element0, @Empty.%A [template] // CHECK:STDOUT: %.Self.as_wit.2: = facet_access_witness %.Self.2 [symbolic] -// CHECK:STDOUT: %impl.elem0.2: type = interface_witness_access %.Self.as_wit.2, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0.2: type = impl_witness_access %.Self.as_wit.2, element0 [symbolic] // CHECK:STDOUT: %ptr.2: type = ptr_type %i32 [template] // CHECK:STDOUT: %Empty_where.type.2: type = facet_type <@Empty, @Empty(%i32) where %impl.elem0.2 = %ptr.2> [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -112,7 +112,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %.loc18_34: @H.%assoc_type (%assoc_type.2) = specific_constant @Empty.%assoc0.loc12_15.1, @Empty(constants.%T) [symbolic = %assoc0 (constants.%assoc0.2)] // CHECK:STDOUT: %A.ref: @H.%assoc_type (%assoc_type.2) = name_ref A, %.loc18_34 [symbolic = %assoc0 (constants.%assoc0.2)] // CHECK:STDOUT: %.Self.as_wit.loc18_34.1: = facet_access_witness %.Self.ref [symbolic = %.Self.as_wit.loc18_34.2 (constants.%.Self.as_wit.1)] -// CHECK:STDOUT: %impl.elem0.loc18_34.1: type = interface_witness_access %.Self.as_wit.loc18_34.1, element0 [symbolic = %impl.elem0.loc18_34.2 (constants.%impl.elem0.1)] +// CHECK:STDOUT: %impl.elem0.loc18_34.1: type = impl_witness_access %.Self.as_wit.loc18_34.1, element0 [symbolic = %impl.elem0.loc18_34.2 (constants.%impl.elem0.1)] // CHECK:STDOUT: %T.ref.loc18_39: type = name_ref T, %T.loc18_6.1 [symbolic = %T.loc18_6.2 (constants.%T)] // CHECK:STDOUT: %ptr.loc18_40.1: type = ptr_type %T [symbolic = %ptr.loc18_40.2 (constants.%ptr.1)] // CHECK:STDOUT: %.loc18_28.2: type = where_expr %.Self.1 [symbolic = %Empty_where.type (constants.%Empty_where.type.1)] { @@ -138,7 +138,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %.loc20_26: %assoc_type.3 = specific_constant @Empty.%assoc0.loc12_15.1, @Empty(constants.%i32) [template = constants.%assoc0.3] // CHECK:STDOUT: %A.ref: %assoc_type.3 = name_ref A, %.loc20_26 [template = constants.%assoc0.3] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit.2] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0.2] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0.2] // CHECK:STDOUT: %int_32.loc20_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc20_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.2] @@ -181,7 +181,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %assoc_type: type = assoc_entity_type @H.%Empty.type.loc18_26.2 (%Empty.type.3), type [symbolic = %assoc_type (constants.%assoc_type.2)] // CHECK:STDOUT: %assoc0: @H.%assoc_type (%assoc_type.2) = assoc_entity element0, @Empty.%A [symbolic = %assoc0 (constants.%assoc0.2)] // CHECK:STDOUT: %.Self.as_wit.loc18_34.2: = facet_access_witness %.Self.2 [symbolic = %.Self.as_wit.loc18_34.2 (constants.%.Self.as_wit.1)] -// CHECK:STDOUT: %impl.elem0.loc18_34.2: type = interface_witness_access %.Self.as_wit.loc18_34.2, element0 [symbolic = %impl.elem0.loc18_34.2 (constants.%impl.elem0.1)] +// CHECK:STDOUT: %impl.elem0.loc18_34.2: type = impl_witness_access %.Self.as_wit.loc18_34.2, element0 [symbolic = %impl.elem0.loc18_34.2 (constants.%impl.elem0.1)] // CHECK:STDOUT: %ptr.loc18_40.2: type = ptr_type @H.%T.loc18_6.2 (%T) [symbolic = %ptr.loc18_40.2 (constants.%ptr.1)] // CHECK:STDOUT: %Empty_where.type: type = facet_type <@Empty, @Empty(%T.loc18_6.2) where %impl.elem0.loc18_34.2 (constants.%impl.elem0.1) = %ptr.loc18_40.2 (constants.%ptr.1)> [symbolic = %Empty_where.type (constants.%Empty_where.type.1)] // CHECK:STDOUT: %V.loc18_43.2: type = bind_symbolic_name V, 1 [symbolic = %V.loc18_43.2 (constants.%V)] @@ -228,8 +228,6 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %assoc0.loc12_15.2 => constants.%assoc0.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Empty(@H.%T.loc18_6.2) {} -// CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%T, constants.%V) { // CHECK:STDOUT: %T.loc18_6.2 => constants.%T // CHECK:STDOUT: %T.patt.loc18_6.2 => constants.%T @@ -246,6 +244,8 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %V.patt.loc18_43.2 => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Empty(@H.%T.loc18_6.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Empty(constants.%i32) { // CHECK:STDOUT: %W.loc11_17.2 => constants.%i32 // CHECK:STDOUT: %W.patt.loc11_17.2 => constants.%i32 diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index 66c4c6500585..0f5a2df858dc 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -227,7 +227,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, @N.%P [template] // CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %N_where.type: type = facet_type <@N where %impl.elem0 = %empty_struct_type> [template] // CHECK:STDOUT: %T: %N_where.type = bind_symbolic_name T, 0 [symbolic] @@ -262,7 +262,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref: %N.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @N.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %.loc8_28.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc8_28.2: type = converted %.loc8_28.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %.loc8_16.2: type = where_expr %.Self [template = constants.%N_where.type] { @@ -307,13 +307,13 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.1: %A.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %.Self.as_wit.1: = facet_access_witness %.Self.1 [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit.1, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.1, element0 [symbolic] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %A_where.type.1: type = facet_type <@A where %impl.elem0 = bool> [template] // CHECK:STDOUT: %.Self.2: %A_where.type.1 = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_wit.2: = facet_access_witness %.Self.2 [symbolic] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit.2, element1 [symbolic] +// CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.2, element1 [symbolic] // CHECK:STDOUT: %A_where.type.2: type = facet_type <@A where %impl.elem1 = %empty_tuple.type and %impl.elem0 = bool> [template] // CHECK:STDOUT: %D: %A_where.type.2 = bind_symbolic_name D, 0 [symbolic] // CHECK:STDOUT: %D.patt: %A_where.type.2 = symbolic_binding_pattern D, 0 [symbolic] @@ -348,7 +348,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref.loc9_31: %A.type = name_ref .Self, %.Self.1 [symbolic = constants.%.Self.1] // CHECK:STDOUT: %B.ref: %assoc_type = name_ref B, @A.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit.loc9_31: = facet_access_witness %.Self.ref.loc9_31 [symbolic = constants.%.Self.as_wit.1] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit.loc9_31, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.loc9_31, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc9_36.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc9_36.2: type = converted %bool.make_type, %.loc9_36.1 [template = bool] @@ -359,7 +359,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref.loc9_48: %A_where.type.1 = name_ref .Self, %.Self.2 [symbolic = constants.%.Self.2] // CHECK:STDOUT: %C.ref: %assoc_type = name_ref C, @A.%assoc1 [template = constants.%assoc1] // CHECK:STDOUT: %.Self.as_wit.loc9_48: = facet_access_witness %.Self.ref.loc9_48 [symbolic = constants.%.Self.as_wit.2] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit.loc9_48, element1 [symbolic = constants.%impl.elem1] +// CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.loc9_48, element1 [symbolic = constants.%impl.elem1] // CHECK:STDOUT: %.loc9_54.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc9_54.2: type = converted %.loc9_54.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc9_42.2: type = where_expr %.Self.2 [template = constants.%A_where.type.2] { @@ -406,7 +406,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %E_where.type: type = facet_type <@E where %impl.elem0 = %i32> [template] @@ -456,7 +456,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %F.ref: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc8_21.2: type = where_expr %.Self [template = constants.%E_where.type] { @@ -476,13 +476,13 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref.loc10_32: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %F.ref.loc10_32: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit.loc10_32: = facet_access_witness %.Self.ref.loc10_32 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0.loc10_32: type = interface_witness_access %.Self.as_wit.loc10_32, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0.loc10_32: type = impl_witness_access %.Self.as_wit.loc10_32, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32.loc10_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc10_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.Self.ref.loc10_45: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %F.ref.loc10_45: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit.loc10_45: = facet_access_witness %.Self.ref.loc10_45 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0.loc10_45: type = interface_witness_access %.Self.as_wit.loc10_45, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0.loc10_45: type = impl_witness_access %.Self.as_wit.loc10_45, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32.loc10_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc10_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc10_26.2: type = where_expr %.Self [template = constants.%E_where.type] { @@ -503,7 +503,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %F.ref: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc14_26.2: type = where_expr %.Self [template = constants.%E_where.type] { @@ -621,8 +621,8 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit, element1 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit, element1 [symbolic] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem1 = bool and %impl.elem0 = %empty_tuple.type> [template] @@ -665,13 +665,13 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref.loc9_29: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %K.ref: %assoc_type = name_ref K, @J.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit.loc9_29: = facet_access_witness %.Self.ref.loc9_29 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit.loc9_29, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.loc9_29, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %.loc9_35.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc9_35.2: type = converted %.loc9_35.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.Self.ref.loc9_41: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %L.ref: %assoc_type = name_ref L, @J.%assoc1 [template = constants.%assoc1] // CHECK:STDOUT: %.Self.as_wit.loc9_41: = facet_access_witness %.Self.ref.loc9_41 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit.loc9_41, element1 [symbolic = constants.%impl.elem1] +// CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.loc9_41, element1 [symbolic = constants.%impl.elem1] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc9_46.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc9_46.2: type = converted %bool.make_type, %.loc9_46.1 [template = bool] @@ -693,14 +693,14 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref.loc11_25: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %L.ref: %assoc_type = name_ref L, @J.%assoc1 [template = constants.%assoc1] // CHECK:STDOUT: %.Self.as_wit.loc11_25: = facet_access_witness %.Self.ref.loc11_25 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit.loc11_25, element1 [symbolic = constants.%impl.elem1] +// CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.loc11_25, element1 [symbolic = constants.%impl.elem1] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_30.2: type = converted %bool.make_type, %.loc11_30.1 [template = bool] // CHECK:STDOUT: %.Self.ref.loc11_39: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %K.ref: %assoc_type = name_ref K, @J.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit.loc11_39: = facet_access_witness %.Self.ref.loc11_39 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit.loc11_39, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.loc11_39, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %.loc11_45.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc11_45.2: type = converted %.loc11_45.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc11_19.2: type = where_expr %.Self [template = constants.%J_where.type] { @@ -783,7 +783,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %assoc0.1: %assoc_type = assoc_entity element0, @O.%P [template] // CHECK:STDOUT: %.Self: %O.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %O_where.type.1: type = facet_type <@O where %impl.elem0 = %i32> [template] @@ -830,7 +830,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref: %O.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @O.%assoc0 [template = constants.%assoc0.1] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc8_22.2: type = where_expr %.Self [template = constants.%O_where.type.1] { @@ -850,7 +850,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref: %O.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @O.%assoc0 [template = constants.%assoc0.1] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc10_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc10_30.2: type = converted %bool.make_type, %.loc10_30.1 [template = bool] @@ -921,13 +921,13 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self: %S.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %S_where.type.1: type = facet_type <@S where %impl.elem0 = %empty_tuple.type> [template] // CHECK:STDOUT: %V: %S_where.type.1 = bind_symbolic_name V, 0 [symbolic] // CHECK:STDOUT: %V.patt: %S_where.type.1 = symbolic_binding_pattern V, 0 [symbolic] // CHECK:STDOUT: %WithT.type: type = fn_type @WithT [template] // CHECK:STDOUT: %WithT: %WithT.type = struct_value () [template] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit, element1 [symbolic] +// CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit, element1 [symbolic] // CHECK:STDOUT: %S_where.type.2: type = facet_type <@S where %impl.elem1 = %empty_tuple.type> [template] // CHECK:STDOUT: %W: %S_where.type.2 = bind_symbolic_name W, 0 [symbolic] // CHECK:STDOUT: %W.patt: %S_where.type.2 = symbolic_binding_pattern W, 0 [symbolic] @@ -963,7 +963,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref: %S.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %T.ref: %assoc_type = name_ref T, @S.%assoc0 [template = constants.%assoc0.1] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %.loc9_28.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc9_28.2: type = converted %.loc9_28.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc9_16.2: type = where_expr %.Self [template = constants.%S_where.type.1] { @@ -983,7 +983,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref: %S.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %U.ref: %assoc_type = name_ref U, @S.%assoc1 [template = constants.%assoc1] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit, element1 [symbolic = constants.%impl.elem1] +// CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit, element1 [symbolic = constants.%impl.elem1] // CHECK:STDOUT: %.loc11_28.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc11_28.2: type = converted %.loc11_28.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc11_16.2: type = where_expr %.Self [template = constants.%S_where.type.2] { @@ -1057,7 +1057,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %N.type: type = facet_type <@N> [template] // CHECK:STDOUT: %.Self.1: %N.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_wit.1: = facet_access_witness %.Self.1 [symbolic] -// CHECK:STDOUT: %impl.elem0.1: type = interface_witness_access %.Self.as_wit.1, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0.1: type = impl_witness_access %.Self.as_wit.1, element0 [symbolic] // CHECK:STDOUT: %N_where.type: type = facet_type <@N where %impl.elem0.1 = %empty_struct_type> [template] // CHECK:STDOUT: %T: %N_where.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: %N_where.type = symbolic_binding_pattern T, 0 [symbolic] @@ -1068,11 +1068,11 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %A.type: type = facet_type <@A> [template] // CHECK:STDOUT: %.Self.2: %A.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_wit.2: = facet_access_witness %.Self.2 [symbolic] -// CHECK:STDOUT: %impl.elem0.2: type = interface_witness_access %.Self.as_wit.2, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0.2: type = impl_witness_access %.Self.as_wit.2, element0 [symbolic] // CHECK:STDOUT: %A_where.type.1: type = facet_type <@A where %impl.elem0.2 = bool> [template] // CHECK:STDOUT: %.Self.3: %A_where.type.1 = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_wit.3: = facet_access_witness %.Self.3 [symbolic] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit.3, element1 [symbolic] +// CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.3, element1 [symbolic] // CHECK:STDOUT: %A_where.type.2: type = facet_type <@A where %impl.elem1 = %empty_tuple.type and %impl.elem0.2 = bool> [template] // CHECK:STDOUT: %D: %A_where.type.2 = bind_symbolic_name D, 0 [symbolic] // CHECK:STDOUT: %D.patt: %A_where.type.2 = symbolic_binding_pattern D, 0 [symbolic] @@ -1176,7 +1176,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %assoc0.1: %assoc_type = assoc_entity element0, @I.%Member [template] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %X.patt: = symbolic_binding_pattern X, 0 [symbolic] // CHECK:STDOUT: %RewriteTypeMismatch.type: type = fn_type @RewriteTypeMismatch [template] @@ -1210,7 +1210,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %Member.ref: %assoc_type = name_ref Member, @I.%assoc0 [template = constants.%assoc0.1] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] // CHECK:STDOUT: %.loc16_46: type = converted %int_2, [template = ] // CHECK:STDOUT: %.loc16_30.2: type = where_expr %.Self [template = ] { @@ -1250,7 +1250,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: %impl_witness: = impl_witness () [template] // CHECK:STDOUT: %type_where: type = facet_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1276,6 +1276,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @A { @@ -1287,10 +1288,8 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %D.ref as %A.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] -// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -1320,10 +1319,10 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.1: %E.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %.Self.as_wit.1: = facet_access_witness %.Self.1 [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit.1, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.1, element0 [symbolic] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %impl.elem1.1: type = interface_witness_access %.Self.as_wit.1, element1 [symbolic] +// CHECK:STDOUT: %impl.elem1.1: type = impl_witness_access %.Self.as_wit.1, element1 [symbolic] // CHECK:STDOUT: %E_where.type.1: type = facet_type <@E where %impl.elem1.1 = %empty_tuple.type and %impl.elem0 = bool> [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] @@ -1332,7 +1331,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %E_where.type.2: type = facet_type <@E where %impl.elem0 = %empty_struct_type> [template] // CHECK:STDOUT: %.Self.2: %E_where.type.2 = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_wit.2: = facet_access_witness %.Self.2 [symbolic] -// CHECK:STDOUT: %impl.elem1.2: type = interface_witness_access %.Self.as_wit.2, element1 [symbolic] +// CHECK:STDOUT: %impl.elem1.2: type = impl_witness_access %.Self.as_wit.2, element1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %E_where.type.3: type = facet_type <@E where %impl.elem1.2 = %i32 and %impl.elem0 = %empty_struct_type> [template] diff --git a/toolchain/check/testdata/where_expr/non_generic.carbon b/toolchain/check/testdata/where_expr/non_generic.carbon index a25a41791646..aa2d81a9ffe1 100644 --- a/toolchain/check/testdata/where_expr/non_generic.carbon +++ b/toolchain/check/testdata/where_expr/non_generic.carbon @@ -22,7 +22,7 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, @I.%T [template] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where TODO> [template] @@ -57,7 +57,7 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %T.ref: %assoc_type = name_ref T, @I.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc14_21.2: type = where_expr %.Self [template = constants.%I_where.type] { diff --git a/toolchain/diagnostics/diagnostic_kind.def b/toolchain/diagnostics/diagnostic_kind.def index da2296987933..3fe28cd974b6 100644 --- a/toolchain/diagnostics/diagnostic_kind.def +++ b/toolchain/diagnostics/diagnostic_kind.def @@ -252,6 +252,7 @@ CARBON_DIAGNOSTIC_KIND(ExtendImplForall) CARBON_DIAGNOSTIC_KIND(ExtendImplOutsideClass) CARBON_DIAGNOSTIC_KIND(ExtendImplSelfAs) CARBON_DIAGNOSTIC_KIND(ExtendImplSelfAsDefault) +CARBON_DIAGNOSTIC_KIND(ImplAccessMemberBeforeComplete) CARBON_DIAGNOSTIC_KIND(ImplAsNonFacetType) CARBON_DIAGNOSTIC_KIND(ImplAsOutsideClass) CARBON_DIAGNOSTIC_KIND(ImplPreviousDefinition) diff --git a/toolchain/driver/testdata/compile/raw_ir.carbon b/toolchain/driver/testdata/compile/raw_ir.carbon index dc39b0cf1985..8e5bdad4768b 100644 --- a/toolchain/driver/testdata/compile/raw_ir.carbon +++ b/toolchain/driver/testdata/compile/raw_ir.carbon @@ -33,7 +33,7 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: generics: // CHECK:STDOUT: generic0: {decl: inst36, bindings: inst_block12} // CHECK:STDOUT: specifics: -// CHECK:STDOUT: specific0: {generic: generic0, args: inst_block14} +// CHECK:STDOUT: specific0: {generic: generic0, args: inst_block13} // CHECK:STDOUT: struct_type_fields: // CHECK:STDOUT: struct_type_fields0: {} // CHECK:STDOUT: types: @@ -197,11 +197,11 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: inst_block12: // CHECK:STDOUT: 0: inst13 // CHECK:STDOUT: inst_block13: +// CHECK:STDOUT: 0: inst14 +// CHECK:STDOUT: inst_block14: // CHECK:STDOUT: 0: inst37 // CHECK:STDOUT: 1: inst38 // CHECK:STDOUT: 2: inst39 -// CHECK:STDOUT: inst_block14: -// CHECK:STDOUT: 0: inst14 // CHECK:STDOUT: inst_block15: // CHECK:STDOUT: 0: inst14 // CHECK:STDOUT: 1: inst14 diff --git a/toolchain/lower/constant.cpp b/toolchain/lower/constant.cpp index cfc956579e3e..458dc3581e2e 100644 --- a/toolchain/lower/constant.cpp +++ b/toolchain/lower/constant.cpp @@ -22,23 +22,25 @@ class ConstantContext { : file_context_(&file_context), constants_(constants) {} // Gets the lowered constant value for an instruction, which must have a - // constant value that has already been lowered. + // constant value that has already been lowered. Returns nullptr if it + // hasn't been, in which case it should not be needed. auto GetConstant(SemIR::InstId inst_id) const -> llvm::Constant* { return GetConstant(file_context_->sem_ir().constant_values().Get(inst_id)); } // Gets the lowered constant value for a constant that has already been - // lowered. + // lowered. Returns nullptr if it hasn't been, in which case it should not be + // needed. auto GetConstant(SemIR::ConstantId const_id) const -> llvm::Constant* { CARBON_CHECK(const_id.is_template(), "Unexpected constant ID {0}", const_id); auto inst_id = file_context_->sem_ir().constant_values().GetInstId(const_id); - CARBON_CHECK( - inst_id.index >= 0 && inst_id.index <= last_lowered_constant_index_, - "Queried constant {0} with instruction {1} that has not been lowered " - "yet", - const_id, inst_id); + if (inst_id.index > last_lowered_constant_index_) { + // This constant hasn't been lowered. + return nullptr; + } + CARBON_CHECK(inst_id.index >= 0); return constants_[inst_id.index]; } @@ -280,6 +282,6 @@ auto LowerConstants(FileContext& file_context, constants[inst_id.index] = value; context.SetLastLoweredConstantIndex(inst_id.index); } -} // namespace Carbon::Lower +} } // namespace Carbon::Lower diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index e2f5a32bbcf1..5595b72075f4 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -585,7 +585,7 @@ static auto BuildTypeForInst(FileContext& context, InstT /*inst*/) // Treat non-monomorphized symbolic types as opaque. template requires(InstT::Kind.template IsAnyOf()) + SemIR::ImplWitnessAccess>()) static auto BuildTypeForInst(FileContext& context, InstT /*inst*/) -> llvm::Type* { return llvm::StructType::get(context.llvm_context()); diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index 3a750eace4a0..3b3f2d90d28c 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -262,13 +262,13 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case FunctionType::Kind: case GenericClassType::Kind: case GenericInterfaceType::Kind: + case ImplWitness::Kind: + case ImplWitnessAccess::Kind: case ImportDecl::Kind: case IntLiteralType::Kind: case IntType::Kind: case IntValue::Kind: case InterfaceDecl::Kind: - case InterfaceWitness::Kind: - case InterfaceWitnessAccess::Kind: case LegacyFloatType::Kind: case NamespaceType::Kind: case PointerType::Kind: diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index 48e136932bc0..743ffb8fce47 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -1201,6 +1201,10 @@ class FormatterImpl { out_ << ')'; } + auto FormatArg(AbsoluteInstBlockId id) -> void { + FormatArg(static_cast(id)); + } + auto FormatArg(RealId id) -> void { // TODO: Format with a `.` when the exponent is near zero. const auto& real = sem_ir_->reals().Get(id); diff --git a/toolchain/sem_ir/id_kind.h b/toolchain/sem_ir/id_kind.h index 7c86f6b1c771..9a87eb7e721d 100644 --- a/toolchain/sem_ir/id_kind.h +++ b/toolchain/sem_ir/id_kind.h @@ -142,9 +142,9 @@ using IdKind = TypeEnum< InstId, AbsoluteInstId, AnyRawId, ConstantId, EntityNameId, CompileTimeBindIndex, RuntimeParamIndex, FacetTypeId, FunctionId, ClassId, InterfaceId, ImplId, GenericId, SpecificId, ImportIRId, ImportIRInstId, - LocId, BoolValue, IntKind, NameId, NameScopeId, InstBlockId, ExprRegionId, - StructTypeFieldsId, TypeId, TypeBlockId, ElementIndex, LibraryNameId, - FloatKind>; + LocId, BoolValue, IntKind, NameId, NameScopeId, InstBlockId, + AbsoluteInstBlockId, ExprRegionId, StructTypeFieldsId, TypeId, TypeBlockId, + ElementIndex, LibraryNameId, FloatKind>; } // namespace Carbon::SemIR diff --git a/toolchain/sem_ir/ids.h b/toolchain/sem_ir/ids.h index 6a9b60c62e26..b843a01c672c 100644 --- a/toolchain/sem_ir/ids.h +++ b/toolchain/sem_ir/ids.h @@ -552,6 +552,20 @@ constexpr InstBlockId InstBlockId::GlobalInit = InstBlockId(3); constexpr InstBlockId InstBlockId::Invalid = InstBlockId(InvalidIndex); constexpr InstBlockId InstBlockId::Unreachable = InstBlockId(InvalidIndex - 1); +// An ID of an instruction block that is referenced absolutely by an +// instruction. This should only be used as the type of a field within a typed +// instruction class. See AbsoluteInstId. +class AbsoluteInstBlockId : public InstBlockId { + public: + // Support implicit conversion from InstBlockId so that InstBlockId and + // AbsoluteInstBlockId have the same interface. + // NOLINTNEXTLINE(google-explicit-constructor) + constexpr AbsoluteInstBlockId(InstBlockId inst_block_id) + : InstBlockId(inst_block_id) {} + + using InstBlockId::InstBlockId; +}; + // TODO: Move this out of sem_ir and into check, if we don't wind up using it // in the SemIR for expression patterns. struct ExprRegionId : public IdBase { diff --git a/toolchain/sem_ir/impl.h b/toolchain/sem_ir/impl.h index 911dd541b4bb..3dbd2973d5dd 100644 --- a/toolchain/sem_ir/impl.h +++ b/toolchain/sem_ir/impl.h @@ -28,11 +28,12 @@ struct ImplFields { // The first block of the impl body. // TODO: Handle control flow in the impl body, such as if-expressions. InstBlockId body_block_id = InstBlockId::Invalid; + // The witness for the impl. This can be `BuiltinErrorInst` or an import + // reference. Note that the entries in the witness are updated at the end of + // the impl definition. + InstId witness_id = InstId::Invalid; // The following members are set at the `}` of the impl definition. - - // The witness for the impl. This can be `BuiltinErrorInst`. - InstId witness_id = InstId::Invalid; bool defined = false; }; diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index 49d75d91916b..3baecbea06f7 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -66,6 +66,8 @@ CARBON_SEM_IR_INST_KIND(FunctionType) CARBON_SEM_IR_INST_KIND(GenericClassType) CARBON_SEM_IR_INST_KIND(GenericInterfaceType) CARBON_SEM_IR_INST_KIND(ImplDecl) +CARBON_SEM_IR_INST_KIND(ImplWitness) +CARBON_SEM_IR_INST_KIND(ImplWitnessAccess) CARBON_SEM_IR_INST_KIND(ImportDecl) CARBON_SEM_IR_INST_KIND(ImportRefLoaded) CARBON_SEM_IR_INST_KIND(ImportRefUnloaded) @@ -74,8 +76,6 @@ CARBON_SEM_IR_INST_KIND(IntLiteralType) CARBON_SEM_IR_INST_KIND(IntType) CARBON_SEM_IR_INST_KIND(IntValue) CARBON_SEM_IR_INST_KIND(InterfaceDecl) -CARBON_SEM_IR_INST_KIND(InterfaceWitness) -CARBON_SEM_IR_INST_KIND(InterfaceWitnessAccess) CARBON_SEM_IR_INST_KIND(LegacyFloatType) CARBON_SEM_IR_INST_KIND(NameRef) CARBON_SEM_IR_INST_KIND(Namespace) diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index 2539ca28bad2..d86c1ed2fc43 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -642,6 +642,20 @@ auto InstNamer::CollectNamesInBlock(ScopeId top_scope_id, queue_block_id(impl_scope_id, inst.decl_block_id); break; } + case ImplWitness::Kind: { + // TODO: Include name of interface (is this available from the + // specific?). + add_inst_name("impl_witness"); + continue; + } + case CARBON_KIND(ImplWitnessAccess inst): { + // TODO: Include information about the impl? + std::string name; + llvm::raw_string_ostream out(name); + out << "impl.elem" << inst.index.index; + add_inst_name(std::move(name)); + continue; + } case CARBON_KIND(ImportDecl inst): { if (inst.package_id.is_valid()) { add_inst_name_id(inst.package_id, ".import"); @@ -675,18 +689,6 @@ auto InstNamer::CollectNamesInBlock(ScopeId top_scope_id, queue_block_id(interface_scope_id, inst.decl_block_id); continue; } - case InterfaceWitness::Kind: { - // TODO: Include name of interface. - add_inst_name("interface"); - continue; - } - case CARBON_KIND(InterfaceWitnessAccess inst): { - std::string name; - llvm::raw_string_ostream out(name); - out << "impl.elem" << inst.index.index; - add_inst_name(std::move(name)); - continue; - } case CARBON_KIND(IntType inst): { add_int_or_float_type_name(inst.int_kind == IntKind::Signed ? 'i' : 'u', inst.bit_width_id, ".builtin"); diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index ad34223995f2..77afc5a69fbe 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -339,29 +339,7 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) << ">"; break; } - case CARBON_KIND(ImportRefUnloaded inst): { - if (inst.entity_name_id.is_valid()) { - step_stack.PushEntityName(inst.entity_name_id); - } else { - out << ""; - } - break; - } - case CARBON_KIND(IntType inst): { - out << ""); - if (auto width_value = - sem_ir.insts().TryGetAs(inst.bit_width_id)) { - out << (inst.int_kind.is_signed() ? "i" : "u"); - sem_ir.ints().Get(width_value->int_id).print(out, /*isSigned=*/false); - } else { - out << (inst.int_kind.is_signed() ? "Int(" : "UInt("); - step_stack.PushString(")"); - step_stack.PushInstId(inst.bit_width_id); - } - break; - } - case CARBON_KIND(InterfaceWitnessAccess inst): { + case CARBON_KIND(ImplWitnessAccess inst): { auto witness_inst_id = sem_ir.constant_values().GetConstantInstId(inst.witness_id); auto witness = @@ -413,6 +391,28 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) } break; } + case CARBON_KIND(ImportRefUnloaded inst): { + if (inst.entity_name_id.is_valid()) { + step_stack.PushEntityName(inst.entity_name_id); + } else { + out << ""; + } + break; + } + case CARBON_KIND(IntType inst): { + out << ""); + if (auto width_value = + sem_ir.insts().TryGetAs(inst.bit_width_id)) { + out << (inst.int_kind.is_signed() ? "i" : "u"); + sem_ir.ints().Get(width_value->int_id).print(out, /*isSigned=*/false); + } else { + out << (inst.int_kind.is_signed() ? "Int(" : "UInt("); + step_stack.PushString(")"); + step_stack.PushInstId(inst.bit_width_id); + } + break; + } case CARBON_KIND(IntValue inst): { sem_ir.ints().Get(inst.int_id).print(out, /*isSigned=*/true); break; @@ -571,11 +571,11 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) case FloatLiteral::Kind: case FunctionDecl::Kind: case ImplDecl::Kind: + case ImplWitness::Kind: case ImportDecl::Kind: case ImportRefLoaded::Kind: case InitializeFrom::Kind: case InterfaceDecl::Kind: - case InterfaceWitness::Kind: case OutParam::Kind: case OutParamPattern::Kind: case RequireCompleteType::Kind: diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 2b421c85f370..6746c70371a1 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -132,9 +132,9 @@ struct ArrayIndex { // Common representation for aggregate access nodes, which access a fixed // element of an aggregate. struct AnyAggregateAccess { - static constexpr InstKind Kinds[] = { - InstKind::StructAccess, InstKind::TupleAccess, - InstKind::ClassElementAccess, InstKind::InterfaceWitnessAccess}; + static constexpr InstKind Kinds[] = {InstKind::ClassElementAccess, + InstKind::StructAccess, + InstKind::TupleAccess}; InstKind kind; TypeId type_id; @@ -156,8 +156,8 @@ struct AnyAggregateInit { // Common representation for all kinds of aggregate value. struct AnyAggregateValue { - static constexpr InstKind Kinds[] = { - InstKind::StructValue, InstKind::TupleValue, InstKind::InterfaceWitness}; + static constexpr InstKind Kinds[] = {InstKind::StructValue, + InstKind::TupleValue}; InstKind kind; TypeId type_id; @@ -661,7 +661,7 @@ struct FacetValue { TypeId type_id; // The type that you will get if you cast this value to `type`. InstId type_inst_id; - // An `InterfaceWitness` instruction (TODO: `FacetTypeWitness`). + // An `ImplWitness` instruction (TODO: `FacetTypeWitness`). InstId witness_inst_id; }; @@ -788,6 +788,35 @@ struct ImplDecl { InstBlockId decl_block_id; }; +// A witness that a type implements an interface. +struct ImplWitness { + static constexpr auto Kind = InstKind::ImplWitness.Define( + {.ir_name = "impl_witness", + .constant_kind = InstConstantKind::Conditional, + // TODO: For dynamic dispatch, we might want to lower witness tables as + // constants. + .is_lowered = false}); + + // Always the builtin witness type. + TypeId type_id; + AbsoluteInstBlockId elements_id; + SpecificId specific_id; +}; + +// Accesses an element of an impl witness by index. +struct ImplWitnessAccess { + static constexpr auto Kind = + InstKind::ImplWitnessAccess.Define( + {.ir_name = "impl_witness_access", + .is_type = InstIsType::Maybe, + .constant_kind = InstConstantKind::SymbolicOnly, + .is_lowered = false}); + + TypeId type_id; + InstId witness_id; + ElementIndex index; +}; + // An `import` declaration. This is mainly for `import` diagnostics, and a 1:1 // correspondence with actual `import`s isn't guaranteed. struct ImportDecl { @@ -859,34 +888,6 @@ struct InterfaceDecl { InstBlockId decl_block_id; }; -// A witness that a type implements an interface. -struct InterfaceWitness { - static constexpr auto Kind = InstKind::InterfaceWitness.Define( - {.ir_name = "interface_witness", - .constant_kind = InstConstantKind::Conditional, - // TODO: For dynamic dispatch, we might want to lower witness tables as - // constants. - .is_lowered = false}); - - // Always the builtin witness type. - TypeId type_id; - InstBlockId elements_id; -}; - -// Accesses an element of an interface witness by index. -struct InterfaceWitnessAccess { - static constexpr auto Kind = - InstKind::InterfaceWitnessAccess.Define( - {.ir_name = "interface_witness_access", - .is_type = InstIsType::Maybe, - .constant_kind = InstConstantKind::SymbolicOnly, - .is_lowered = false}); - - TypeId type_id; - InstId witness_id; - ElementIndex index; -}; - // A literal integer value. struct IntValue { // TODO: Make Parse::NodeId more specific.