diff --git a/toolchain/check/call.cpp b/toolchain/check/call.cpp index 18c5b202d2199..4519b0c708cf6 100644 --- a/toolchain/check/call.cpp +++ b/toolchain/check/call.cpp @@ -41,6 +41,7 @@ static auto ResolveCalleeInCall(Context& context, SemIR::LocId loc_id, const SemIR::EntityWithParamsBase& entity, EntityKind entity_kind_for_diagnostic, SemIR::SpecificId enclosing_specific_id, + SemIR::InstId self_type_id, SemIR::InstId self_id, llvm::ArrayRef arg_ids) -> std::optional { @@ -70,7 +71,7 @@ static auto ResolveCalleeInCall(Context& context, SemIR::LocId loc_id, auto specific_id = SemIR::SpecificId::None; if (entity.generic_id.has_value()) { specific_id = DeduceGenericCallArguments( - context, loc_id, entity.generic_id, enclosing_specific_id, + context, loc_id, entity.generic_id, enclosing_specific_id, self_type_id, entity.implicit_param_patterns_id, entity.param_patterns_id, self_id, arg_ids); if (!specific_id.has_value()) { @@ -91,6 +92,7 @@ static auto PerformCallToGenericClass(Context& context, SemIR::LocId loc_id, auto callee_specific_id = ResolveCalleeInCall(context, loc_id, generic_class, EntityKind::GenericClass, enclosing_specific_id, + /*self_type_id=*/SemIR::InstId::None, /*self_id=*/SemIR::InstId::None, arg_ids); if (!callee_specific_id) { return SemIR::ErrorInst::SingletonInstId; @@ -111,6 +113,7 @@ static auto PerformCallToGenericInterface( auto callee_specific_id = ResolveCalleeInCall(context, loc_id, interface, EntityKind::GenericInterface, enclosing_specific_id, + /*self_type_id=*/SemIR::InstId::None, /*self_id=*/SemIR::InstId::None, arg_ids); if (!callee_specific_id) { return SemIR::ErrorInst::SingletonInstId; @@ -153,7 +156,7 @@ auto PerformCall(Context& context, SemIR::LocId loc_id, SemIR::InstId callee_id, auto callee_specific_id = ResolveCalleeInCall( context, loc_id, context.functions().Get(callee_function.function_id), EntityKind::Function, callee_function.enclosing_specific_id, - callee_function.self_id, arg_ids); + callee_function.self_type_id, callee_function.self_id, arg_ids); if (!callee_specific_id) { return SemIR::ErrorInst::SingletonInstId; } @@ -165,7 +168,12 @@ auto PerformCall(Context& context, SemIR::LocId loc_id, SemIR::InstId callee_id, SemIR::SpecificFunctionType::SingletonInstId), .callee_id = callee_id, .specific_id = *callee_specific_id}); - context.definitions_required().push_back(callee_id); + if (callee_function.self_type_id.has_value()) { + // This is an associated function, and will be required to be defined as + // part of checking that the impl is complete. + } else { + context.definitions_required().push_back(callee_id); + } } // If there is a return slot, build storage for the result. diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 921c6b2ab71d5..be25dbd9fac05 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -1292,7 +1292,8 @@ class TypeCompleter { template requires(InstT::Kind.template IsAnyOf< SemIR::AssociatedEntityType, SemIR::FacetAccessType, - SemIR::FacetType, SemIR::FunctionType, SemIR::GenericClassType, + SemIR::FacetType, SemIR::FunctionType, + SemIR::FunctionTypeWithSelfType, SemIR::GenericClassType, SemIR::GenericInterfaceType, SemIR::UnboundElementType, SemIR::WhereExpr>()) auto BuildValueReprForInst(SemIR::TypeId /*type_id*/, InstT /*inst*/) const @@ -1555,6 +1556,13 @@ auto Context::GetFunctionType(SemIR::FunctionId fn_id, return GetCompleteTypeImpl(*this, fn_id, specific_id); } +auto Context::GetFunctionTypeWithSelfType( + SemIR::InstId interface_function_type_id, SemIR::InstId self_id) + -> SemIR::TypeId { + return GetCompleteTypeImpl( + *this, interface_function_type_id, self_id); +} + auto Context::GetGenericClassType(SemIR::ClassId class_id, SemIR::SpecificId enclosing_specific_id) -> SemIR::TypeId { diff --git a/toolchain/check/context.h b/toolchain/check/context.h index f717ca8a051f9..2b197bb5f38fd 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -475,6 +475,11 @@ class Context { auto GetFunctionType(SemIR::FunctionId fn_id, SemIR::SpecificId specific_id) -> SemIR::TypeId; + // Gets the type of an associated function with the `Self` parameter bound to + // a particular value. The returned type will be complete. + auto GetFunctionTypeWithSelfType(SemIR::InstId interface_function_type_id, + SemIR::InstId self_id) -> SemIR::TypeId; + // Gets a generic class type, which is the type of a name of a generic class, // such as the type of `Vector` given `class Vector(T:! type)`. The returned // type will be complete. diff --git a/toolchain/check/deduce.cpp b/toolchain/check/deduce.cpp index aaf35b508087a..89a015a677697 100644 --- a/toolchain/check/deduce.cpp +++ b/toolchain/check/deduce.cpp @@ -188,12 +188,13 @@ class DeductionWorklist { // State that is tracked throughout the deduction process. class DeductionContext { public: - // Preparse to perform deduction. If an enclosing specific is provided, adds - // the arguments from the given specific as known arguments that will not be - // deduced. + // Preparse to perform deduction. If an enclosing specific or self type + // are provided, adds the corresponding arguments as known arguments that will + // not be deduced. DeductionContext(Context& context, SemIR::LocId loc_id, SemIR::GenericId generic_id, - SemIR::SpecificId enclosing_specific_id, bool diagnose); + SemIR::SpecificId enclosing_specific_id, + SemIR::InstId self_type_id, bool diagnose); auto context() const -> Context& { return *context_; } @@ -250,7 +251,7 @@ static auto NoteGenericHere(Context& context, SemIR::GenericId generic_id, DeductionContext::DeductionContext(Context& context, SemIR::LocId loc_id, SemIR::GenericId generic_id, SemIR::SpecificId enclosing_specific_id, - bool diagnose) + SemIR::InstId self_type_id, bool diagnose) : context_(&context), loc_id_(loc_id), generic_id_(generic_id), @@ -285,6 +286,16 @@ DeductionContext::DeductionContext(Context& context, SemIR::LocId loc_id, first_deduced_index_ = SemIR::CompileTimeBindIndex(args.size()); } + if (self_type_id.has_value()) { + // Copy the provided `Self` type as the value of the next binding. + auto self_index = first_deduced_index_; + result_arg_ids_[self_index.index] = self_type_id; + substitutions_.push_back( + {.bind_id = SemIR::CompileTimeBindIndex(self_index), + .replacement_id = context.constant_values().Get(self_type_id)}); + first_deduced_index_ = SemIR::CompileTimeBindIndex(self_index.index + 1); + } + non_deduced_indexes_.resize(result_arg_ids_.size() - first_deduced_index_.index); } @@ -504,19 +515,17 @@ auto DeductionContext::CheckDeductionIsComplete() -> bool { auto DeductionContext::MakeSpecific() -> SemIR::SpecificId { // TODO: Convert the deduced values to the types of the bindings. - return Check::MakeSpecific( - context(), loc_id_, generic_id_, - context().inst_blocks().AddCanonical(result_arg_ids_)); + return Check::MakeSpecific(context(), loc_id_, generic_id_, result_arg_ids_); } auto DeduceGenericCallArguments( Context& context, SemIR::LocId loc_id, SemIR::GenericId generic_id, - SemIR::SpecificId enclosing_specific_id, + SemIR::SpecificId enclosing_specific_id, SemIR::InstId self_type_id, [[maybe_unused]] SemIR::InstBlockId implicit_params_id, SemIR::InstBlockId params_id, [[maybe_unused]] SemIR::InstId self_id, llvm::ArrayRef arg_ids) -> SemIR::SpecificId { DeductionContext deduction(context, loc_id, generic_id, enclosing_specific_id, - /*diagnose=*/true); + self_type_id, /*diagnose=*/true); // Prepare to perform deduction of the explicit parameters against their // arguments. @@ -537,6 +546,7 @@ auto DeduceImplArguments(Context& context, SemIR::LocId loc_id, SemIR::ConstantId constraint_id) -> SemIR::SpecificId { DeductionContext deduction(context, loc_id, impl.generic_id, /*enclosing_specific_id=*/SemIR::SpecificId::None, + /*self_type_id=*/SemIR::InstId::None, /*diagnose=*/false); // Prepare to perform deduction of the type and interface. diff --git a/toolchain/check/deduce.h b/toolchain/check/deduce.h index d63e4078c37fa..d4d4321882bd4 100644 --- a/toolchain/check/deduce.h +++ b/toolchain/check/deduce.h @@ -11,13 +11,11 @@ namespace Carbon::Check { // Deduces the generic arguments to use in a call to a generic. -auto DeduceGenericCallArguments(Context& context, SemIR::LocId loc_id, - SemIR::GenericId generic_id, - SemIR::SpecificId enclosing_specific_id, - SemIR::InstBlockId implicit_params_id, - SemIR::InstBlockId params_id, - SemIR::InstId self_id, - llvm::ArrayRef arg_ids) +auto DeduceGenericCallArguments( + Context& context, SemIR::LocId loc_id, SemIR::GenericId generic_id, + SemIR::SpecificId enclosing_specific_id, SemIR::InstId self_type_id, + SemIR::InstBlockId implicit_params_id, SemIR::InstBlockId params_id, + SemIR::InstId self_id, llvm::ArrayRef arg_ids) -> SemIR::SpecificId; // Deduces the impl arguments to use in a use of a parameterized impl. Returns diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index fbf7e4b98ede0..eeb4f2d2e0a23 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1588,6 +1588,11 @@ static auto TryEvalInstInContext(EvalContext& eval_context, case SemIR::FunctionType::Kind: return RebuildIfFieldsAreConstant(eval_context, inst, &SemIR::FunctionType::specific_id); + case SemIR::FunctionTypeWithSelfType::Kind: + return RebuildIfFieldsAreConstant( + eval_context, inst, + &SemIR::FunctionTypeWithSelfType::interface_function_type_id, + &SemIR::FunctionTypeWithSelfType::self_id); case SemIR::GenericClassType::Kind: return RebuildIfFieldsAreConstant( eval_context, inst, &SemIR::GenericClassType::enclosing_specific_id); diff --git a/toolchain/check/generic.cpp b/toolchain/check/generic.cpp index d0953d5e48bcf..98312aa74f932 100644 --- a/toolchain/check/generic.cpp +++ b/toolchain/check/generic.cpp @@ -429,6 +429,12 @@ auto MakeSpecific(Context& context, SemIRLoc loc, SemIR::GenericId generic_id, return specific_id; } +auto MakeSpecific(Context& context, SemIRLoc loc, SemIR::GenericId generic_id, + llvm::ArrayRef args) -> SemIR::SpecificId { + auto args_id = context.inst_blocks().AddCanonical(args); + return MakeSpecific(context, loc, generic_id, args_id); +} + static auto MakeSelfSpecificId(Context& context, SemIR::GenericId generic_id) -> SemIR::SpecificId { if (!generic_id.has_value()) { diff --git a/toolchain/check/generic.h b/toolchain/check/generic.h index 00282ba8368e9..4a842371d565e 100644 --- a/toolchain/check/generic.h +++ b/toolchain/check/generic.h @@ -52,24 +52,17 @@ auto RebuildGenericEvalBlock(Context& context, SemIR::GenericId generic_id, llvm::ArrayRef const_ids) -> SemIR::InstBlockId; -// Builds a new specific, or finds an existing one if this generic has already -// been referenced with these arguments. Performs substitution into the -// declaration, but not the definition, of the generic. -// -// `args_id` should be a canonical instruction block referring to constants. +// Builds a new specific with a given argument list, or finds an existing one if +// this generic has already been referenced with these arguments. Performs +// substitution into the declaration, but not the definition, of the generic. auto MakeSpecific(Context& context, SemIRLoc loc, SemIR::GenericId generic_id, - SemIR::InstBlockId args_id) -> SemIR::SpecificId; + llvm::ArrayRef args) -> SemIR::SpecificId; -// Builds a new specific if the given generic is it has a value. Otherwise -// returns `None`. -inline auto MakeSpecificIfGeneric(Context& context, SemIRLoc loc, - SemIR::GenericId generic_id, - SemIR::InstBlockId args_id) - -> SemIR::SpecificId { - return generic_id.has_value() - ? MakeSpecific(context, loc, generic_id, args_id) - : SemIR::SpecificId::None; -} +// Builds a new specific or finds an existing one in the case where the argument +// list has already been converted into an instruction block. `args_id` should +// be a canonical instruction block referring to constants. +auto MakeSpecific(Context& context, SemIRLoc loc, SemIR::GenericId generic_id, + SemIR::InstBlockId args_id) -> SemIR::SpecificId; // Builds the specific that describes how the generic should refer to itself. // For example, for a generic `G(T:! type)`, this is the specific `G(T)`. If diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 6281030a12dea..04682b3cfcf6c 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -491,6 +491,7 @@ class ImportRefResolver : public ImportContext { // Performs resolution for one instruction and then performs all work we // deferred. + // NOLINTNEXTLINE(misc-no-recursion) auto Resolve(SemIR::InstId inst_id) -> SemIR::ConstantId { auto const_id = ResolveOneInst(inst_id); PerformPendingWork(); @@ -498,11 +499,13 @@ class ImportRefResolver : public ImportContext { } // Wraps constant evaluation with logic to handle constants. + // NOLINTNEXTLINE(misc-no-recursion) auto ResolveConstant(SemIR::ConstantId import_const_id) -> SemIR::ConstantId { return Resolve(GetInstWithConstantValue(import_ir(), import_const_id)); } // Wraps constant evaluation with logic to handle types. + // NOLINTNEXTLINE(misc-no-recursion) auto ResolveType(SemIR::TypeId import_type_id) -> SemIR::TypeId { if (!import_type_id.has_value()) { return import_type_id; @@ -767,6 +770,20 @@ static auto GetLocalCanonicalInstBlockId(ImportContext& context, return context.local_inst_blocks().AddCanonical(contents); } +// Gets a local instruction block containing ImportRefs referring to the +// instructions in the specified imported instruction block. +static auto GetLocalImportRefInstBlock(ImportContext& context, + SemIR::InstBlockId import_inst_block_id) + -> SemIR::InstBlockId { + llvm::SmallVector elements; + auto import_elements = context.import_inst_blocks().Get(import_inst_block_id); + elements.reserve(import_elements.size()); + for (auto element : import_elements) { + elements.push_back(AddImportRef(context, element)); + } + return context.local_inst_blocks().Add(elements); +} + // Gets an incomplete local version of an imported generic. Most fields are // set in the third phase. static auto MakeIncompleteGeneric(ImportContext& context, SemIR::InstId decl_id, @@ -785,34 +802,31 @@ static auto MakeIncompleteGeneric(ImportContext& context, SemIR::InstId decl_id, namespace { // Local information associated with an imported generic. struct GenericData { - llvm::SmallVector bindings; + // TODO: Delete `GenericData` if we still don't use it once generic import is + // more stable. }; } // namespace // Gets a local version of the data associated with a generic. -static auto GetLocalGenericData(ImportRefResolver& resolver, - SemIR::GenericId generic_id) -> GenericData { - if (!generic_id.has_value()) { - return GenericData(); - } - - const auto& generic = resolver.import_generics().Get(generic_id); - return {.bindings = GetLocalInstBlockContents(resolver, generic.bindings_id)}; +static auto GetLocalGenericData(ImportRefResolver& /*resolver*/, + SemIR::GenericId /*generic_id*/) + -> GenericData { + return {}; } // Adds the given local generic data to the given generic. static auto SetGenericData(ImportContext& context, SemIR::GenericId import_generic_id, SemIR::GenericId new_generic_id, - const GenericData& generic_data) -> void { + const GenericData& /*generic_data*/) -> void { if (!import_generic_id.has_value()) { return; } const auto& import_generic = context.import_generics().Get(import_generic_id); auto& new_generic = context.local_generics().Get(new_generic_id); - new_generic.bindings_id = GetLocalCanonicalInstBlockId( - context, import_generic.bindings_id, generic_data.bindings); + new_generic.bindings_id = + GetLocalImportRefInstBlock(context, import_generic.bindings_id); // Track that we need to fill in the remaining information in // FinishPendingGeneric. @@ -1956,6 +1970,23 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, resolver, inst.specific_id, specific_data)}); } +static auto TryResolveTypedInst(ImportRefResolver& resolver, + SemIR::FunctionTypeWithSelfType inst) + -> ResolveResult { + CARBON_CHECK(inst.type_id == SemIR::TypeType::SingletonTypeId); + auto interface_function_type_id = + GetLocalConstantInstId(resolver, inst.interface_function_type_id); + auto self_id = GetLocalConstantInstId(resolver, inst.self_id); + if (resolver.HasNewWork()) { + return ResolveResult::Retry(); + } + + return ResolveAs( + resolver, {.type_id = SemIR::TypeType::SingletonTypeId, + .interface_function_type_id = interface_function_type_id, + .self_id = self_id}); +} + static auto TryResolveTypedInst(ImportRefResolver& resolver, SemIR::GenericClassType inst) -> ResolveResult { CARBON_CHECK(inst.type_id == SemIR::TypeType::SingletonTypeId); @@ -2393,13 +2424,7 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, return ResolveResult::Retry(); } - 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 elements_id = GetLocalImportRefInstBlock(resolver, inst.elements_id); auto specific_id = GetOrAddLocalSpecific(resolver, inst.specific_id, specific_data); return ResolveAs( @@ -2746,6 +2771,9 @@ static auto TryResolveInstCanonical(ImportRefResolver& resolver, case CARBON_KIND(SemIR::FunctionType inst): { return TryResolveTypedInst(resolver, inst); } + case CARBON_KIND(SemIR::FunctionTypeWithSelfType inst): { + return TryResolveTypedInst(resolver, inst); + } case CARBON_KIND(SemIR::GenericClassType inst): { return TryResolveTypedInst(resolver, inst); } @@ -2923,12 +2951,21 @@ static auto ResolveLocalEvalBlock(ImportRefResolver& resolver, } // Fills in the remaining information in a partially-imported generic. +// NOLINTNEXTLINE(misc-no-recursion) static auto FinishPendingGeneric(ImportRefResolver& resolver, ImportContext::PendingGeneric pending) -> void { const auto& import_generic = resolver.import_generics().Get(pending.import_id); + // Load the bindings for the generic eagerly; they're used to form the self + // specific. + // TODO: Avoid recursion. + for (auto binding_id : resolver.local_inst_blocks().Get( + resolver.local_generics().Get(pending.local_id).bindings_id)) { + LoadImportRef(resolver.local_context(), binding_id); + } + // Don't store the local generic between calls: the generics list can be // reallocated by ResolveLocalEvalBlock importing more specifics. @@ -2996,6 +3033,7 @@ static auto FinishPendingSpecific(ImportRefResolver& resolver, } // Perform any work that we deferred until the end of the main Resolve loop. +// NOLINTNEXTLINE(misc-no-recursion) auto ImportRefResolver::PerformPendingWork() -> void { // Note that the individual Finish steps can add new pending work, so keep // going until we have no more work to do. @@ -3058,6 +3096,7 @@ static auto GetInstForLoad(Context& context, } } +// NOLINTNEXTLINE(misc-no-recursion) auto LoadImportRef(Context& context, SemIR::InstId inst_id) -> void { auto inst = context.insts().TryGetAs(inst_id); if (!inst) { diff --git a/toolchain/check/interface.cpp b/toolchain/check/interface.cpp index 245814c07d50f..9f6a9c4ed2848 100644 --- a/toolchain/check/interface.cpp +++ b/toolchain/check/interface.cpp @@ -40,55 +40,106 @@ auto BuildAssociatedEntity(Context& context, SemIR::InterfaceId interface_id, {.type_id = type_id, .index = index, .decl_id = decl_id}); } -auto GetSelfSpecificForInterfaceMemberWithSelfType( - Context& context, SemIRLoc loc, SemIR::SpecificId enclosing_specific_id, - SemIR::GenericId generic_id, SemIR::TypeId self_type_id, - SemIR::InstId witness_inst_id) -> SemIR::SpecificId { - const auto& generic = context.generics().Get(generic_id); +// Returns the `Self` binding for an interface, given a specific for the +// interface and a generic for an associated entity within it. +static auto GetSelfBinding(Context& context, + SemIR::SpecificId interface_specific_id, + SemIR::GenericId assoc_entity_generic_id) + -> SemIR::InstId { + const auto& generic = context.generics().Get(assoc_entity_generic_id); auto bindings = context.inst_blocks().Get(generic.bindings_id); - - llvm::SmallVector arg_ids; - arg_ids.reserve(bindings.size()); - - // Start with the enclosing arguments. - if (enclosing_specific_id.has_value()) { - auto enclosing_specific_args_id = - context.specifics().Get(enclosing_specific_id).args_id; - auto enclosing_specific_args = - context.inst_blocks().Get(enclosing_specific_args_id); - arg_ids.assign(enclosing_specific_args.begin(), - enclosing_specific_args.end()); - } - - // Add the `Self` argument. First find the `Self` binding. - auto self_binding = - context.insts().GetAs(bindings[arg_ids.size()]); + auto interface_args_id = + context.specifics().GetArgsOrEmpty(interface_specific_id); + auto interface_args = context.inst_blocks().Get(interface_args_id); + + // The `Self` binding is the first binding after the interface's arguments. + auto self_binding_id = bindings[interface_args.size()]; + + // Check that we found the self binding. The binding might be a + // `BindSymbolicName` or an `ImportRef` naming one. + auto self_binding_const_inst_id = + context.constant_values().GetConstantInstId(self_binding_id); + auto bind_name_inst = context.insts().GetAs( + self_binding_const_inst_id); CARBON_CHECK( - context.entity_names().Get(self_binding.entity_name_id).name_id == + context.entity_names().Get(bind_name_inst.entity_name_id).name_id == SemIR::NameId::SelfType, - "Expected a Self binding, found {0}", self_binding); + "Expected a Self binding, found {0}", bind_name_inst); + + return self_binding_id; +} + +// Given a `Self` type and a witness that it implements an interface, along with +// that interface's `Self` binding, forms and returns a facet that can be used +// as the argument for that `Self` binding. +static auto GetSelfFacet(Context& context, + SemIR::SpecificId interface_specific_id, + SemIR::GenericId generic_id, + SemIR::TypeId self_type_id, + SemIR::InstId self_witness_id) -> SemIR::InstId { + auto self_binding_id = + GetSelfBinding(context, interface_specific_id, generic_id); + auto self_binding = context.insts().Get(self_binding_id); + auto self_facet_type_id = SemIR::GetTypeInSpecific( + context.sem_ir(), interface_specific_id, self_binding.type_id()); // Create a facet value to be the value of `Self` in the interface. // TODO: Pass this in instead of creating it here. The caller sometimes // already has a facet value. auto type_inst_id = context.types().GetInstId(self_type_id); - auto facet_value_const_id = + auto self_value_const_id = TryEvalInst(context, SemIR::InstId::None, - SemIR::FacetValue{.type_id = self_binding.type_id, + SemIR::FacetValue{.type_id = self_facet_type_id, .type_inst_id = type_inst_id, - .witness_inst_id = witness_inst_id}); - arg_ids.push_back(context.constant_values().GetInstId(facet_value_const_id)); + .witness_inst_id = self_witness_id}); + return context.constant_values().GetInstId(self_value_const_id); +} + +// Builds and returns the argument list from `interface_specific_id` with a +// value for the `Self` parameter of `generic_id` appended. +static auto GetGenericArgsWithSelfType(Context& context, + SemIR::SpecificId interface_specific_id, + SemIR::GenericId generic_id, + SemIR::TypeId self_type_id, + SemIR::InstId witness_inst_id, + std::size_t reserve_args_size = 0) + -> llvm::SmallVector { + auto interface_args_id = + context.specifics().GetArgsOrEmpty(interface_specific_id); + auto interface_args = context.inst_blocks().Get(interface_args_id); + + llvm::SmallVector arg_ids; + arg_ids.reserve(std::max(reserve_args_size, interface_args.size() + 1)); + + // Start with the enclosing arguments from the interface. + arg_ids.assign(interface_args.begin(), interface_args.end()); + + // Add the `Self` argument. + arg_ids.push_back(GetSelfFacet(context, interface_specific_id, generic_id, + self_type_id, witness_inst_id)); + + return arg_ids; +} + +auto GetSelfSpecificForInterfaceMemberWithSelfType( + Context& context, SemIRLoc loc, SemIR::SpecificId interface_specific_id, + 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 self_specific_args = context.inst_blocks().Get( + context.specifics().Get(generic.self_specific_id).args_id); + + auto arg_ids = GetGenericArgsWithSelfType( + context, interface_specific_id, generic_id, self_type_id, witness_inst_id, + self_specific_args.size()); // Take any trailing argument values from the self specific. // TODO: If these refer to outer arguments, for example in their types, we may // need to perform extra substitutions here. - auto self_specific_args = context.inst_blocks().Get( - context.specifics().Get(generic.self_specific_id).args_id); for (auto arg_id : self_specific_args.drop_front(arg_ids.size())) { arg_ids.push_back(context.constant_values().GetConstantInstId(arg_id)); } - auto args_id = context.inst_blocks().AddCanonical(arg_ids); - return MakeSpecific(context, loc, generic_id, args_id); + return MakeSpecific(context, loc, generic_id, arg_ids); } auto GetTypeForSpecificAssociatedEntity(Context& context, SemIRLoc loc, @@ -99,20 +150,34 @@ auto GetTypeForSpecificAssociatedEntity(Context& context, SemIRLoc loc, -> SemIR::TypeId { auto decl = context.insts().Get(context.constant_values().GetConstantInstId(decl_id)); - - auto specific_id = interface_specific_id; if (auto assoc_const = decl.TryAs()) { - specific_id = GetSelfSpecificForInterfaceMemberWithSelfType( - context, loc, interface_specific_id, - context.associated_constants() - .Get(assoc_const->assoc_const_id) - .generic_id, - self_type_id, self_witness_id); + // Form a specific for the associated constant, and grab the type from + // there. + auto generic_id = context.associated_constants() + .Get(assoc_const->assoc_const_id) + .generic_id; + auto arg_ids = + GetGenericArgsWithSelfType(context, interface_specific_id, generic_id, + self_type_id, self_witness_id); + auto const_specific_id = MakeSpecific(context, loc, generic_id, arg_ids); + return SemIR::GetTypeInSpecific(context.sem_ir(), const_specific_id, + context.insts().Get(decl_id).type_id()); + } else if (auto fn = context.types().TryGetAs( + decl.type_id())) { + // Form the type of the function within the interface, and attach the `Self` + // type. + auto interface_fn_type_id = + SemIR::GetTypeInSpecific(context.sem_ir(), interface_specific_id, + context.insts().Get(decl_id).type_id()); + auto self_facet_id = + GetSelfFacet(context, interface_specific_id, + context.functions().Get(fn->function_id).generic_id, + self_type_id, self_witness_id); + return context.GetFunctionTypeWithSelfType( + context.types().GetInstId(interface_fn_type_id), self_facet_id); + } else { + CARBON_FATAL("Unexpected kind for associated constant {0}", decl); } - // TODO: For a `FunctionDecl`, should we substitute `Self` into the type? - - return SemIR::GetTypeInSpecific(context.sem_ir(), specific_id, - context.insts().Get(decl_id).type_id()); } } // namespace Carbon::Check diff --git a/toolchain/check/interface.h b/toolchain/check/interface.h index 98723ab08eb83..c3399ed1a224b 100644 --- a/toolchain/check/interface.h +++ b/toolchain/check/interface.h @@ -18,9 +18,9 @@ auto BuildAssociatedEntity(Context& context, SemIR::InterfaceId interface_id, SemIR::InstId decl_id) -> SemIR::InstId; // Gets the self specific of a generic declaration that is an interface member, -// given a specific for an enclosing generic, plus a type to use as `Self`. +// given a specific for the interface plus a type to use as `Self`. auto GetSelfSpecificForInterfaceMemberWithSelfType( - Context& context, SemIRLoc loc, SemIR::SpecificId enclosing_specific_id, + Context& context, SemIRLoc loc, SemIR::SpecificId interface_specific_id, SemIR::GenericId generic_id, SemIR::TypeId self_type_id, SemIR::InstId witness_inst_id) -> SemIR::SpecificId; diff --git a/toolchain/check/member_access.cpp b/toolchain/check/member_access.cpp index 1d002a7348bb6..9fd5995c2adcd 100644 --- a/toolchain/check/member_access.cpp +++ b/toolchain/check/member_access.cpp @@ -14,6 +14,7 @@ #include "toolchain/check/import_ref.h" #include "toolchain/check/interface.h" #include "toolchain/diagnostics/diagnostic_emitter.h" +#include "toolchain/sem_ir/function.h" #include "toolchain/sem_ir/generic.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/inst.h" @@ -354,51 +355,57 @@ static auto LookupMemberNameInScope(Context& context, SemIR::LocId loc_id, static auto PerformInstanceBinding(Context& context, SemIR::LocId loc_id, SemIR::InstId base_id, SemIR::InstId member_id) -> SemIR::InstId { - auto member_type_id = context.insts().Get(member_id).type_id(); - CARBON_KIND_SWITCH(context.types().GetAsInst(member_type_id)) { - case CARBON_KIND(SemIR::UnboundElementType unbound_element_type): { - // Convert the base to the type of the element if necessary. - base_id = ConvertToValueOrRefOfType(context, loc_id, base_id, - unbound_element_type.class_type_id); - - // Find the specified element, which could be either a field or a base - // class, and build an element access expression. - auto element_id = context.constant_values().GetConstantInstId(member_id); - CARBON_CHECK(element_id.has_value(), - "Non-constant value {0} of unbound element type", - context.insts().Get(member_id)); - auto index = GetClassElementIndex(context, element_id); - auto access_id = context.GetOrAddInst( - loc_id, {.type_id = unbound_element_type.element_type_id, - .base_id = base_id, - .index = index}); - if (SemIR::GetExprCategory(context.sem_ir(), base_id) == - SemIR::ExprCategory::Value && - SemIR::GetExprCategory(context.sem_ir(), access_id) != - SemIR::ExprCategory::Value) { - // Class element access on a value expression produces an ephemeral - // reference if the class's value representation is a pointer to the - // object representation. Add a value binding in that case so that the - // expression category of the result matches the expression category of - // the base. - access_id = ConvertToValueExpr(context, access_id); - } - return access_id; + // If the member is a function, check whether it's an instance method. + if (auto callee = SemIR::GetCalleeFunction(context.sem_ir(), member_id); + callee.function_id.has_value()) { + if (!IsInstanceMethod(context.sem_ir(), callee.function_id) || + callee.self_id.has_value()) { + // Found a static member function or an already-bound method. + return member_id; } - case CARBON_KIND(SemIR::FunctionType fn_type): { - if (IsInstanceMethod(context.sem_ir(), fn_type.function_id)) { - return context.GetOrAddInst( - loc_id, {.type_id = context.GetSingletonType( - SemIR::BoundMethodType::SingletonInstId), - .object_id = base_id, - .function_decl_id = member_id}); - } - [[fallthrough]]; + + return context.GetOrAddInst( + loc_id, {.type_id = context.GetSingletonType( + SemIR::BoundMethodType::SingletonInstId), + .object_id = base_id, + .function_decl_id = member_id}); + } + + // Otherwise, if it's a field, form a class element access. + if (auto unbound_element_type = + context.types().TryGetAs( + context.insts().Get(member_id).type_id())) { + // Convert the base to the type of the element if necessary. + base_id = ConvertToValueOrRefOfType(context, loc_id, base_id, + unbound_element_type->class_type_id); + + // Find the specified element, which could be either a field or a base + // class, and build an element access expression. + auto element_id = context.constant_values().GetConstantInstId(member_id); + CARBON_CHECK(element_id.has_value(), + "Non-constant value {0} of unbound element type", + context.insts().Get(member_id)); + auto index = GetClassElementIndex(context, element_id); + auto access_id = context.GetOrAddInst( + loc_id, {.type_id = unbound_element_type->element_type_id, + .base_id = base_id, + .index = index}); + if (SemIR::GetExprCategory(context.sem_ir(), base_id) == + SemIR::ExprCategory::Value && + SemIR::GetExprCategory(context.sem_ir(), access_id) != + SemIR::ExprCategory::Value) { + // Class element access on a value expression produces an ephemeral + // reference if the class's value representation is a pointer to the + // object representation. Add a value binding in that case so that the + // expression category of the result matches the expression category + // of the base. + access_id = ConvertToValueExpr(context, access_id); } - default: - // Not an instance member: no instance binding. - return member_id; + return access_id; } + + // Not an instance member: no instance binding. + return member_id; } // Validates that the index (required to be an IntValue) is valid within the @@ -496,6 +503,14 @@ auto PerformMemberAccess(Context& context, SemIR::LocId loc_id, base_type_const_id, lookup_scopes, /*lookup_in_type_of_base=*/true); + // For name lookup into a facet, never perform instance binding. + // TODO: According to the design, this should be a "lookup in base" lookup, + // not a "lookup in type of base" lookup, and the facet itself should have + // member names that directly name members of the `impl`. + if (context.IsFacetType(base_type_id)) { + return member_id; + } + // Perform instance binding if we found an instance member. member_id = PerformInstanceBinding(context, loc_id, base_id, member_id); diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index e54696322d58b..f73cf5fc6180c 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -27,10 +27,13 @@ fn G() { // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.37f: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -75,26 +78,26 @@ fn G() { // CHECK:STDOUT: %int_2.loc13_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %int_3.loc13_28: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc13_29.1: %tuple.type.37f = tuple_literal (%int_1.loc13_22, %int_2.loc13_25, %int_3.loc13_28) -// CHECK:STDOUT: %impl.elem0.loc13_29.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_29.1: = bound_method %int_1.loc13_22, %impl.elem0.loc13_29.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc13_29.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_29.1: = bound_method %int_1.loc13_22, %impl.elem0.loc13_29.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc13_29.1: = specific_function %bound_method.loc13_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc13_29.1: init %i32 = call %specific_fn.loc13_29.1(%int_1.loc13_22) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_29.2: init %i32 = converted %int_1.loc13_22, %int.convert_checked.loc13_29.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc13_29.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_29.2: = bound_method %int_2.loc13_25, %impl.elem0.loc13_29.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0.loc13_29.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_29.2: = bound_method %int_2.loc13_25, %impl.elem0.loc13_29.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc13_29.2: = specific_function %bound_method.loc13_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc13_29.2: init %i32 = call %specific_fn.loc13_29.2(%int_2.loc13_25) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_29.5: init %i32 = converted %int_2.loc13_25, %int.convert_checked.loc13_29.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc13_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc13_29.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_29.3: = bound_method %int_3.loc13_28, %impl.elem0.loc13_29.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc13_29.3: init %i32 = call %Convert.specific_fn.loc13_29.3(%int_3.loc13_28) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc13_29.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_29.3: = bound_method %int_3.loc13_28, %impl.elem0.loc13_29.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc13_29.3: = specific_function %bound_method.loc13_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc13_29.3: init %i32 = call %specific_fn.loc13_29.3(%int_3.loc13_28) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc13_29.8: init %i32 = converted %int_3.loc13_28, %int.convert_checked.loc13_29.3 [template = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc13_29: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc13_29.9: ref %i32 = array_index %a.var, %int_2.loc13_29 @@ -118,24 +121,24 @@ fn G() { // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %int_3.loc14: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc14_36.1: %tuple.type.37f = tuple_literal (%int_1.loc14, %int_2.loc14, %int_3.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_36.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_36.1: = bound_method %int_1.loc14, %impl.elem0.loc14_36.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_36.1: init %i32 = call %Convert.specific_fn.loc14_36.1(%int_1.loc14) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc14_36.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_36.1: = bound_method %int_1.loc14, %impl.elem0.loc14_36.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14_36.1: = specific_function %bound_method.loc14_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc14_36.1: init %i32 = call %specific_fn.loc14_36.1(%int_1.loc14) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_36.2: init %i32 = converted %int_1.loc14, %int.convert_checked.loc14_36.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc14_36.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_36.2: = bound_method %int_2.loc14, %impl.elem0.loc14_36.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc14_36.2: init %i32 = call %Convert.specific_fn.loc14_36.2(%int_2.loc14) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc14_36.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_36.2: = bound_method %int_2.loc14, %impl.elem0.loc14_36.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_36.2: = specific_function %bound_method.loc14_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc14_36.2: init %i32 = call %specific_fn.loc14_36.2(%int_2.loc14) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_36.4: init %i32 = converted %int_2.loc14, %int.convert_checked.loc14_36.2 [template = constants.%int_2.ef8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc14_36.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_36.3: = bound_method %int_3.loc14, %impl.elem0.loc14_36.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc14_36.3: init %i32 = call %Convert.specific_fn.loc14_36.3(%int_3.loc14) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc14_36.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_36.3: = bound_method %int_3.loc14, %impl.elem0.loc14_36.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc14_36.3: = specific_function %bound_method.loc14_36.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc14_36.3: init %i32 = call %specific_fn.loc14_36.3(%int_3.loc14) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc14_36.6: init %i32 = converted %int_3.loc14, %int.convert_checked.loc14_36.3 [template = constants.%int_3.822] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %b.var, element2 // CHECK:STDOUT: %.loc14_36.7: init %i32 = initialize_from %.loc14_36.6 to %tuple.elem2 [template = constants.%int_3.822] diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index e64bf3072b1e1..ed4de73ee30a3 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -25,10 +25,13 @@ fn Run() { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -73,10 +76,10 @@ fn Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.985 = tuple_literal (%int_0) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_30.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_30.3: %i32 = converted %int_0, %.loc11_30.2 [template = constants.%int_0.6a9] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc11_30.3) [template = constants.%tuple] diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index 936fd6d0c6167..3d6b59b165a6e 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -22,10 +22,13 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.37f: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -92,24 +95,24 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %int_2.loc11: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc11_34.1: %tuple.type.37f = tuple_literal (%int_1.loc11, %int_2.loc11, %int_3) -// CHECK:STDOUT: %impl.elem0.loc11_34.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_34.1: = bound_method %int_1.loc11, %impl.elem0.loc11_34.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_34.1: init %i32 = call %Convert.specific_fn.loc11_34.1(%int_1.loc11) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc11_34.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_34.1: = bound_method %int_1.loc11, %impl.elem0.loc11_34.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11_34.1: = specific_function %bound_method.loc11_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc11_34.1: init %i32 = call %specific_fn.loc11_34.1(%int_1.loc11) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_34.2: init %i32 = converted %int_1.loc11, %int.convert_checked.loc11_34.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc11_34.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_34.2: = bound_method %int_2.loc11, %impl.elem0.loc11_34.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc11_34.2: init %i32 = call %Convert.specific_fn.loc11_34.2(%int_2.loc11) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc11_34.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_34.2: = bound_method %int_2.loc11, %impl.elem0.loc11_34.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_34.2: = specific_function %bound_method.loc11_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc11_34.2: init %i32 = call %specific_fn.loc11_34.2(%int_2.loc11) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_34.4: init %i32 = converted %int_2.loc11, %int.convert_checked.loc11_34.2 [template = constants.%int_2.ef8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc11_34.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_34.3: = bound_method %int_3, %impl.elem0.loc11_34.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc11_34.3: init %i32 = call %Convert.specific_fn.loc11_34.3(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc11_34.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_34.3: = bound_method %int_3, %impl.elem0.loc11_34.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc11_34.3: = specific_function %bound_method.loc11_34.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc11_34.3: init %i32 = call %specific_fn.loc11_34.3(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc11_34.6: init %i32 = converted %int_3, %int.convert_checked.loc11_34.3 [template = constants.%int_3.822] // CHECK:STDOUT: %tuple.elem2.loc11: ref %i32 = tuple_access file.%a.var, element2 // CHECK:STDOUT: %.loc11_34.7: init %i32 = initialize_from %.loc11_34.6 to %tuple.elem2.loc11 [template = constants.%int_3.822] diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index 2fcd7fb4c4f3c..bd4367b209b52 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -22,10 +22,13 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %array_type.0cb: type = array_type %int_1.5b8, %i32 [template] // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -110,10 +113,10 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc11_22.1: %tuple.type.985 = tuple_literal (%int_1.loc11) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.loc11, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1.loc11) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_22.2: init %i32 = converted %int_1.loc11, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_22.3: ref %i32 = array_index file.%a.var, %int_0.loc11 diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index 82cab4566d819..793b9ba319774 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -27,11 +27,15 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %ConvertToU32: %ConvertToU32.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -42,6 +46,8 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [template] +// CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [template] // CHECK:STDOUT: %Convert.bound.2d6: = bound_method %int_3.822, %Convert.960 [template] // CHECK:STDOUT: %Convert.specific_fn.377: = specific_function %Convert.bound.2d6, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] @@ -56,6 +62,8 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %impl_witness.8da2: = impl_witness (imports.%Core.import_ref.823), @impl.45(%int_32) [template] // CHECK:STDOUT: %Convert.type.e06: type = fn_type @Convert.9, @impl.45(%int_32) [template] // CHECK:STDOUT: %Convert.47f: %Convert.type.e06 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.84b: %ImplicitAs.type.2fd = facet_value %u32, %impl_witness.8da2 [template] +// CHECK:STDOUT: %.88a: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.84b [template] // CHECK:STDOUT: %Convert.bound.258: = bound_method %int_3.d14, %Convert.47f [template] // CHECK:STDOUT: %Convert.specific_fn.d14: = specific_function %Convert.bound.258, @Convert.9(%int_32) [template] // CHECK:STDOUT: } @@ -133,25 +141,25 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %Add.ref: %Add.type.b1f = name_ref Add, %Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc14_18: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_18: = bound_method %int_1, %impl.elem0.loc14_18 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc14_18: = specific_function %Convert.bound.loc14_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_18: init %i32 = call %Convert.specific_fn.loc14_18(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc14_18: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_18: = bound_method %int_1, %impl.elem0.loc14_18 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14_18: = specific_function %bound_method.loc14_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc14_18: init %i32 = call %specific_fn.loc14_18(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_18.1: %i32 = value_of_initializer %int.convert_checked.loc14_18 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_18.2: %i32 = converted %int_1, %.loc14_18.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc14_21: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_21: = bound_method %int_2, %impl.elem0.loc14_21 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc14_21: = specific_function %Convert.bound.loc14_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc14_21: init %i32 = call %Convert.specific_fn.loc14_21(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc14_21: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_21: = bound_method %int_2, %impl.elem0.loc14_21 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_21: = specific_function %bound_method.loc14_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc14_21: init %i32 = call %specific_fn.loc14_21(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_21.1: %i32 = value_of_initializer %int.convert_checked.loc14_21 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_21.2: %i32 = converted %int_2, %.loc14_21.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc14_18.2, %.loc14_21.2) [template = constants.%int_3.822] -// CHECK:STDOUT: %impl.elem0.loc14_22: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] -// CHECK:STDOUT: %Convert.bound.loc14_22: = bound_method %int.sadd, %impl.elem0.loc14_22 [template = constants.%Convert.bound.2d6] -// CHECK:STDOUT: %Convert.specific_fn.loc14_22: = specific_function %Convert.bound.loc14_22, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.377] +// CHECK:STDOUT: %impl.elem0.loc14_22: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] +// CHECK:STDOUT: %bound_method.loc14_22: = bound_method %int.sadd, %impl.elem0.loc14_22 [template = constants.%Convert.bound.2d6] +// CHECK:STDOUT: %specific_fn.loc14_22: = specific_function %bound_method.loc14_22, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.377] // CHECK:STDOUT: %.loc14_22.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.822] // CHECK:STDOUT: %.loc14_22.2: %i32 = converted %int.sadd, %.loc14_22.1 [template = constants.%int_3.822] -// CHECK:STDOUT: %int.convert_checked.loc14_22: init Core.IntLiteral = call %Convert.specific_fn.loc14_22(%.loc14_22.2) [template = constants.%int_3.1ba] +// CHECK:STDOUT: %int.convert_checked.loc14_22: init Core.IntLiteral = call %specific_fn.loc14_22(%.loc14_22.2) [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc14_22.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_22 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc14_22.4: Core.IntLiteral = converted %int.sadd, %.loc14_22.3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %array_type.loc14: type = array_type %.loc14_22.4, %i32 [template = constants.%array_type] @@ -176,19 +184,19 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ConvertToU32.ref: %ConvertToU32.type = name_ref ConvertToU32, %ConvertToU32.decl [template = constants.%ConvertToU32] // CHECK:STDOUT: %int_3.loc16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] -// CHECK:STDOUT: %impl.elem0.loc16_27: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16_27: = bound_method %int_3.loc16, %impl.elem0.loc16_27 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc16_27: = specific_function %Convert.bound.loc16_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc16_27: init %i32 = call %Convert.specific_fn.loc16_27(%int_3.loc16) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc16_27: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16_27: = bound_method %int_3.loc16, %impl.elem0.loc16_27 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc16_27: = specific_function %bound_method.loc16_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc16_27: init %i32 = call %specific_fn.loc16_27(%int_3.loc16) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc16_27.1: %i32 = value_of_initializer %int.convert_checked.loc16_27 [template = constants.%int_3.822] // CHECK:STDOUT: %.loc16_27.2: %i32 = converted %int_3.loc16, %.loc16_27.1 [template = constants.%int_3.822] // CHECK:STDOUT: %int.convert_checked.loc16_28.1: init %u32 = call %ConvertToU32.ref(%.loc16_27.2) [template = constants.%int_3.d14] -// CHECK:STDOUT: %impl.elem0.loc16_28: %Convert.type.71e = impl_witness_access constants.%impl_witness.8da2, element0 [template = constants.%Convert.47f] -// CHECK:STDOUT: %Convert.bound.loc16_28: = bound_method %int.convert_checked.loc16_28.1, %impl.elem0.loc16_28 [template = constants.%Convert.bound.258] -// CHECK:STDOUT: %Convert.specific_fn.loc16_28: = specific_function %Convert.bound.loc16_28, @Convert.9(constants.%int_32) [template = constants.%Convert.specific_fn.d14] +// CHECK:STDOUT: %impl.elem0.loc16_28: %.88a = impl_witness_access constants.%impl_witness.8da2, element0 [template = constants.%Convert.47f] +// CHECK:STDOUT: %bound_method.loc16_28: = bound_method %int.convert_checked.loc16_28.1, %impl.elem0.loc16_28 [template = constants.%Convert.bound.258] +// CHECK:STDOUT: %specific_fn.loc16_28: = specific_function %bound_method.loc16_28, @Convert.9(constants.%int_32) [template = constants.%Convert.specific_fn.d14] // CHECK:STDOUT: %.loc16_28.1: %u32 = value_of_initializer %int.convert_checked.loc16_28.1 [template = constants.%int_3.d14] // CHECK:STDOUT: %.loc16_28.2: %u32 = converted %int.convert_checked.loc16_28.1, %.loc16_28.1 [template = constants.%int_3.d14] -// CHECK:STDOUT: %int.convert_checked.loc16_28.2: init Core.IntLiteral = call %Convert.specific_fn.loc16_28(%.loc16_28.2) [template = constants.%int_3.1ba] +// CHECK:STDOUT: %int.convert_checked.loc16_28.2: init Core.IntLiteral = call %specific_fn.loc16_28(%.loc16_28.2) [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc16_28.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_28.2 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc16_28.4: Core.IntLiteral = converted %int.convert_checked.loc16_28.1, %.loc16_28.3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %array_type.loc16: type = array_type %.loc16_28.4, %i32 [template = constants.%array_type] @@ -207,26 +215,26 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_2.loc14_31: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_35.1: = bound_method %int_1.loc14_28, %impl.elem0.loc14_35.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc14_35.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_35.1: = bound_method %int_1.loc14_28, %impl.elem0.loc14_35.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14_35.1: = specific_function %bound_method.loc14_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc14_35.1: init %i32 = call %specific_fn.loc14_35.1(%int_1.loc14_28) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_35.2: init %i32 = converted %int_1.loc14_28, %int.convert_checked.loc14_35.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc14_35.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_35.2: = bound_method %int_2.loc14_31, %impl.elem0.loc14_35.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0.loc14_35.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_35.2: = bound_method %int_2.loc14_31, %impl.elem0.loc14_35.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_35.2: = specific_function %bound_method.loc14_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc14_35.2: init %i32 = call %specific_fn.loc14_35.2(%int_2.loc14_31) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_35.5: init %i32 = converted %int_2.loc14_31, %int.convert_checked.loc14_35.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc14_35: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc14_35.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_35.3: = bound_method %int_3, %impl.elem0.loc14_35.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc14_35.3: init %i32 = call %Convert.specific_fn.loc14_35.3(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc14_35.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_35.3: = bound_method %int_3, %impl.elem0.loc14_35.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc14_35.3: = specific_function %bound_method.loc14_35.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc14_35.3: init %i32 = call %specific_fn.loc14_35.3(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc14_35.8: init %i32 = converted %int_3, %int.convert_checked.loc14_35.3 [template = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc14_35: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc14_35.9: ref %i32 = array_index file.%a.var, %int_2.loc14_35 diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index 1742c26b8833d..f5fb6eb383706 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -24,11 +24,15 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: %Negate.type.15b: type = fn_type @Negate.1 [template] // CHECK:STDOUT: %Negate: %Negate.type.15b = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -36,6 +40,8 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [template] +// CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [template] // CHECK:STDOUT: %Convert.bound.75d: = bound_method %int_-1.251, %Convert.960 [template] // CHECK:STDOUT: %Convert.specific_fn.4af: = specific_function %Convert.bound.75d, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_-1.638: Core.IntLiteral = int_value -1 [template] @@ -84,19 +90,19 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Negate.ref: %Negate.type.15b = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_21: = bound_method %int_1, %impl.elem0.loc17_21 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc17_21: = specific_function %Convert.bound.loc17_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc17_21: init %i32 = call %Convert.specific_fn.loc17_21(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc17_21: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_21: = bound_method %int_1, %impl.elem0.loc17_21 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc17_21: = specific_function %bound_method.loc17_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc17_21: init %i32 = call %specific_fn.loc17_21(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_21.1: %i32 = value_of_initializer %int.convert_checked.loc17_21 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_21.2: %i32 = converted %int_1, %.loc17_21.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc17_21.2) [template = constants.%int_-1.251] -// CHECK:STDOUT: %impl.elem0.loc17_22: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] -// CHECK:STDOUT: %Convert.bound.loc17_22: = bound_method %int.snegate, %impl.elem0.loc17_22 [template = constants.%Convert.bound.75d] -// CHECK:STDOUT: %Convert.specific_fn.loc17_22: = specific_function %Convert.bound.loc17_22, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.4af] +// CHECK:STDOUT: %impl.elem0.loc17_22: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] +// CHECK:STDOUT: %bound_method.loc17_22: = bound_method %int.snegate, %impl.elem0.loc17_22 [template = constants.%Convert.bound.75d] +// CHECK:STDOUT: %specific_fn.loc17_22: = specific_function %bound_method.loc17_22, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.4af] // CHECK:STDOUT: %.loc17_22.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-1.251] // CHECK:STDOUT: %.loc17_22.2: %i32 = converted %int.snegate, %.loc17_22.1 [template = constants.%int_-1.251] -// CHECK:STDOUT: %int.convert_checked.loc17_22: init Core.IntLiteral = call %Convert.specific_fn.loc17_22(%.loc17_22.2) [template = constants.%int_-1.638] +// CHECK:STDOUT: %int.convert_checked.loc17_22: init Core.IntLiteral = call %specific_fn.loc17_22(%.loc17_22.2) [template = constants.%int_-1.638] // CHECK:STDOUT: %.loc17_22.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc17_22 [template = constants.%int_-1.638] // CHECK:STDOUT: %.loc17_22.4: Core.IntLiteral = converted %int.snegate, %.loc17_22.3 [template = constants.%int_-1.638] // CHECK:STDOUT: %array_type: type = array_type %.loc17_22.4, %i32 [template = ] 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 5d9134e11a152..f2e2849f8e358 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,10 +26,13 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // 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: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -90,26 +93,26 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_2.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %int_3.loc11: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_1.loc11_20) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_1.loc11_20, %int.convert_checked.loc11_27.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_2.loc11_23) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_27.5: init %i32 = converted %int_2.loc11_23, %int.convert_checked.loc11_27.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc11_27: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.3: = bound_method %int_3.loc11, %impl.elem0.loc11_27.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %Convert.specific_fn.loc11_27.3(%int_3.loc11) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc11_27.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.3: = bound_method %int_3.loc11, %impl.elem0.loc11_27.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc11_27.3: = specific_function %bound_method.loc11_27.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %specific_fn.loc11_27.3(%int_3.loc11) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc11_27.8: init %i32 = converted %int_3.loc11, %int.convert_checked.loc11_27.3 [template = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc11_27: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc11_27.9: ref %i32 = array_index file.%a.var, %int_2.loc11_27 @@ -125,10 +128,10 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %.loc16_28.1: Core.IntLiteral = struct_access %.loc16_27.2, element0 [template = constants.%int_3.1ba] // 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.loc16: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %.loc16_28.1, %impl.elem0.loc16 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%.loc16_28.1) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16: = bound_method %.loc16_28.1, %impl.elem0.loc16 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%.loc16_28.1) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc16_28.2: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_3.822] // CHECK:STDOUT: %.loc16_28.3: %i32 = converted %.loc16_28.1, %.loc16_28.2 [template = constants.%int_3.822] // CHECK:STDOUT: %.loc16_34.1: ref %i32 = array_index %a.ref, %.loc16_28.3 [template = ] diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index b6a807688ef88..2a8922b96977d 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -52,10 +52,13 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %str.abb: String = string_literal "World" [template] // CHECK:STDOUT: %tuple.type.b0f: type = tuple_type (Core.IntLiteral, String, String) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -169,10 +172,10 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %str.loc18_23: String = string_literal "Hello" [template = constants.%str.ef1] // CHECK:STDOUT: %str.loc18_32: String = string_literal "World" [template = constants.%str.abb] // CHECK:STDOUT: %.loc18_39.1: %tuple.type.b0f = tuple_literal (%int_1.loc18, %str.loc18_23, %str.loc18_32) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.loc18, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1.loc18) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_39.2: init %i32 = converted %int_1.loc18, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc18_39.3: ref %i32 = array_index file.%a.var, %int_0.loc18 diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index 48c6a1cb881b0..3d3f932dcb103 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -31,10 +31,13 @@ fn G() -> i32 { // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // 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: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -121,27 +124,27 @@ fn G() -> i32 { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // 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.5b8] -// CHECK:STDOUT: %impl.elem0.loc16_20.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16_20.1: = bound_method %int_1.loc16_13, %impl.elem0.loc16_20.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc16_20.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16_20.1: = bound_method %int_1.loc16_13, %impl.elem0.loc16_20.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc16_20.1: = specific_function %bound_method.loc16_20.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc16_20.1: init %i32 = call %specific_fn.loc16_20.1(%int_1.loc16_13) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_20.2: init %i32 = converted %int_1.loc16_13, %int.convert_checked.loc16_20.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_20.3: ref %array_type = temporary_storage // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc16_20.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16_20.2: = bound_method %int_2.loc16_16, %impl.elem0.loc16_20.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0.loc16_20.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16_20.2: = bound_method %int_2.loc16_16, %impl.elem0.loc16_20.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc16_20.2: = specific_function %bound_method.loc16_20.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc16_20.2: init %i32 = call %specific_fn.loc16_20.2(%int_2.loc16_16) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc16_20.6: init %i32 = converted %int_2.loc16_16, %int.convert_checked.loc16_20.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc16_20: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc16_20.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16_20.3: = bound_method %int_3, %impl.elem0.loc16_20.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc16_20.3: init %i32 = call %Convert.specific_fn.loc16_20.3(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc16_20.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16_20.3: = bound_method %int_3, %impl.elem0.loc16_20.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc16_20.3: = specific_function %bound_method.loc16_20.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc16_20.3: init %i32 = call %specific_fn.loc16_20.3(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc16_20.9: init %i32 = converted %int_3, %int.convert_checked.loc16_20.3 [template = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc16_20: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc16_20.10: ref %i32 = array_index %.loc16_20.3, %int_2.loc16_20 @@ -150,10 +153,10 @@ 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16_23: = bound_method %int_1.loc16_23, %impl.elem0.loc16_23 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc16_23: = specific_function %Convert.bound.loc16_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16_23: init %i32 = call %Convert.specific_fn.loc16_23(%int_1.loc16_23) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc16_23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16_23: = bound_method %int_1.loc16_23, %impl.elem0.loc16_23 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc16_23: = specific_function %bound_method.loc16_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc16_23: init %i32 = call %specific_fn.loc16_23(%int_1.loc16_23) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_23.1: %i32 = value_of_initializer %int.convert_checked.loc16_23 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_23.2: %i32 = converted %int_1.loc16_23, %.loc16_23.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref(%.loc16_20.15, %.loc16_23.2) diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 986321b9e9d8f..88b0627cc53e9 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -22,10 +22,13 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // 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: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -86,26 +89,26 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_2.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_1.loc11_20) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_1.loc11_20, %int.convert_checked.loc11_27.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_2.loc11_23) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_27.5: init %i32 = converted %int_2.loc11_23, %int.convert_checked.loc11_27.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc11_27: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.3: = bound_method %int_3, %impl.elem0.loc11_27.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %Convert.specific_fn.loc11_27.3(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc11_27.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.3: = bound_method %int_3, %impl.elem0.loc11_27.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc11_27.3: = specific_function %bound_method.loc11_27.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %specific_fn.loc11_27.3(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc11_27.8: init %i32 = converted %int_3, %int.convert_checked.loc11_27.3 [template = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc11_27: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc11_27.9: ref %i32 = array_index file.%a.var, %int_2.loc11_27 @@ -121,10 +124,10 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %.loc12_28.1: Core.IntLiteral = struct_access %.loc12_27.2, element0 [template = constants.%int_2.ecc] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12: = bound_method %.loc12_28.1, %impl.elem0.loc12 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%.loc12_28.1) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12: = bound_method %.loc12_28.1, %impl.elem0.loc12 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%.loc12_28.1) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_28.2: %i32 = value_of_initializer %int.convert_checked.loc12 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_28.3: %i32 = converted %.loc12_28.1, %.loc12_28.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_34.1: ref %i32 = array_index %a.ref, %.loc12_28.3 diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index 86b1727c2c768..0209e21527304 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -44,10 +44,13 @@ fn H() { G(3); } // CHECK:STDOUT: %N.patt.8e2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [template] +// CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.51e, %Convert.960 [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.51e) [symbolic] @@ -92,9 +95,9 @@ fn H() { G(3); } // CHECK:STDOUT: %N.patt.loc4_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt.8e2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.bound.loc9_18.2: = bound_method %N.loc4_6.2, constants.%Convert.960 [symbolic = %Convert.bound.loc9_18.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc9_18.2: = specific_function %Convert.bound.loc9_18.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc9_18.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init Core.IntLiteral = call %Convert.specific_fn.loc9_18.2(%N.loc4_6.2) [symbolic = %int.convert_checked.loc9_18.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.loc4_6.2, constants.%Convert.960 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init Core.IntLiteral = call %Convert.specific_fn(%N.loc4_6.2) [symbolic = %int.convert_checked.loc9_18.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc9_19.2: type = array_type %int.convert_checked.loc9_18.2, %i32 [symbolic = %array_type.loc9_19.2 (constants.%array_type)] // CHECK:STDOUT: %require_complete: = require_complete_type @F.%array_type.loc9_19.2 (%array_type) [symbolic = %require_complete (constants.%require_complete.9dc)] // CHECK:STDOUT: @@ -114,10 +117,10 @@ fn H() { G(3); } // 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: %N.ref: %i32 = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N.51e)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] -// CHECK:STDOUT: %Convert.bound.loc9_18.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc9_18.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc9_18.1: = specific_function %Convert.bound.loc9_18.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc9_18.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init Core.IntLiteral = call %Convert.specific_fn.loc9_18.1(%N.ref) [symbolic = %int.convert_checked.loc9_18.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %impl.elem0: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] +// CHECK:STDOUT: %bound_method: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init Core.IntLiteral = call %specific_fn(%N.ref) [symbolic = %int.convert_checked.loc9_18.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc9_18.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc9_18.1 [symbolic = %int.convert_checked.loc9_18.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc9_18.2: Core.IntLiteral = converted %N.ref, %.loc9_18.1 [symbolic = %int.convert_checked.loc9_18.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc9_19.1: type = array_type %.loc9_18.2, %i32 [symbolic = %array_type.loc9_19.2 (constants.%array_type)] diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index edf69ba242f5e..c7df118b442f1 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -27,10 +27,13 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [template] // 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: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -102,74 +105,74 @@ 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.b85] // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.988] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_45.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_45.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc11_45.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_45.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_45.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11_45.1: = specific_function %bound_method.loc11_45.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc11_45.1: init %i32 = call %specific_fn.loc11_45.1(%int_1.loc11_20) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_45.2: init %i32 = converted %int_1.loc11_20, %int.convert_checked.loc11_45.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc11_45.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_45.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_45.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0.loc11_45.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_45.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_45.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_45.2: = specific_function %bound_method.loc11_45.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc11_45.2: init %i32 = call %specific_fn.loc11_45.2(%int_2.loc11_23) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_45.5: init %i32 = converted %int_2.loc11_23, %int.convert_checked.loc11_45.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc11_45: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc11_45.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_45.3: = bound_method %int_3.loc11_26, %impl.elem0.loc11_45.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// 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.822] +// CHECK:STDOUT: %impl.elem0.loc11_45.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_45.3: = bound_method %int_3.loc11_26, %impl.elem0.loc11_45.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc11_45.3: = specific_function %bound_method.loc11_45.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc11_45.3: init %i32 = call %specific_fn.loc11_45.3(%int_3.loc11_26) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc11_45.8: init %i32 = converted %int_3.loc11_26, %int.convert_checked.loc11_45.3 [template = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc11_45: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // 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.822] -// CHECK:STDOUT: %impl.elem0.loc11_45.4: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_45.4: = bound_method %int_4.loc11_29, %impl.elem0.loc11_45.4 [template = constants.%Convert.bound.ac3] -// 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.450] -// 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.940] +// CHECK:STDOUT: %impl.elem0.loc11_45.4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_45.4: = bound_method %int_4.loc11_29, %impl.elem0.loc11_45.4 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc11_45.4: = specific_function %bound_method.loc11_45.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc11_45.4: init %i32 = call %specific_fn.loc11_45.4(%int_4.loc11_29) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc11_45.11: init %i32 = converted %int_4.loc11_29, %int.convert_checked.loc11_45.4 [template = constants.%int_4.940] // CHECK:STDOUT: %int_3.loc11_45: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // 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.940] -// CHECK:STDOUT: %impl.elem0.loc11_45.5: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_45.5: = bound_method %int_5.loc11_32, %impl.elem0.loc11_45.5 [template = constants.%Convert.bound.4e6] -// 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.ba9] -// 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.0f6] +// CHECK:STDOUT: %impl.elem0.loc11_45.5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_45.5: = bound_method %int_5.loc11_32, %impl.elem0.loc11_45.5 [template = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc11_45.5: = specific_function %bound_method.loc11_45.5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] +// CHECK:STDOUT: %int.convert_checked.loc11_45.5: init %i32 = call %specific_fn.loc11_45.5(%int_5.loc11_32) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc11_45.14: init %i32 = converted %int_5.loc11_32, %int.convert_checked.loc11_45.5 [template = constants.%int_5.0f6] // CHECK:STDOUT: %int_4.loc11_45: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] // 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.0f6] -// CHECK:STDOUT: %impl.elem0.loc11_45.6: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_45.6: = bound_method %int_6.loc11_35, %impl.elem0.loc11_45.6 [template = constants.%Convert.bound.ce9] -// 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.631] -// 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.e56] +// CHECK:STDOUT: %impl.elem0.loc11_45.6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_45.6: = bound_method %int_6.loc11_35, %impl.elem0.loc11_45.6 [template = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_45.6: = specific_function %bound_method.loc11_45.6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631] +// CHECK:STDOUT: %int.convert_checked.loc11_45.6: init %i32 = call %specific_fn.loc11_45.6(%int_6.loc11_35) [template = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_45.17: init %i32 = converted %int_6.loc11_35, %int.convert_checked.loc11_45.6 [template = constants.%int_6.e56] // CHECK:STDOUT: %int_5.loc11_45: Core.IntLiteral = int_value 5 [template = constants.%int_5.64b] // 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.e56] -// CHECK:STDOUT: %impl.elem0.loc11_45.7: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_45.7: = bound_method %int_7.loc11_38, %impl.elem0.loc11_45.7 [template = constants.%Convert.bound.208] -// 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.c12] -// 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.0b1] +// CHECK:STDOUT: %impl.elem0.loc11_45.7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_45.7: = bound_method %int_7.loc11_38, %impl.elem0.loc11_45.7 [template = constants.%Convert.bound.208] +// CHECK:STDOUT: %specific_fn.loc11_45.7: = specific_function %bound_method.loc11_45.7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c12] +// CHECK:STDOUT: %int.convert_checked.loc11_45.7: init %i32 = call %specific_fn.loc11_45.7(%int_7.loc11_38) [template = constants.%int_7.0b1] // CHECK:STDOUT: %.loc11_45.20: init %i32 = converted %int_7.loc11_38, %int.convert_checked.loc11_45.7 [template = constants.%int_7.0b1] // CHECK:STDOUT: %int_6.loc11_45: Core.IntLiteral = int_value 6 [template = constants.%int_6.462] // 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.0b1] -// CHECK:STDOUT: %impl.elem0.loc11_45.8: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_45.8: = bound_method %int_8.loc11_41, %impl.elem0.loc11_45.8 [template = constants.%Convert.bound.e09] -// 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.e0d] -// 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.98c] +// CHECK:STDOUT: %impl.elem0.loc11_45.8: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_45.8: = bound_method %int_8.loc11_41, %impl.elem0.loc11_45.8 [template = constants.%Convert.bound.e09] +// CHECK:STDOUT: %specific_fn.loc11_45.8: = specific_function %bound_method.loc11_45.8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.e0d] +// CHECK:STDOUT: %int.convert_checked.loc11_45.8: init %i32 = call %specific_fn.loc11_45.8(%int_8.loc11_41) [template = constants.%int_8.98c] // CHECK:STDOUT: %.loc11_45.23: init %i32 = converted %int_8.loc11_41, %int.convert_checked.loc11_45.8 [template = constants.%int_8.98c] // CHECK:STDOUT: %int_7.loc11_45: Core.IntLiteral = int_value 7 [template = constants.%int_7.29f] // 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.98c] -// CHECK:STDOUT: %impl.elem0.loc11_45.9: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_45.9: = bound_method %int_9, %impl.elem0.loc11_45.9 [template = constants.%Convert.bound.9e2] -// 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.b02] -// CHECK:STDOUT: %int.convert_checked.loc11_45.9: init %i32 = call %Convert.specific_fn.loc11_45.9(%int_9) [template = constants.%int_9.f88] +// CHECK:STDOUT: %impl.elem0.loc11_45.9: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_45.9: = bound_method %int_9, %impl.elem0.loc11_45.9 [template = constants.%Convert.bound.9e2] +// CHECK:STDOUT: %specific_fn.loc11_45.9: = specific_function %bound_method.loc11_45.9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b02] +// CHECK:STDOUT: %int.convert_checked.loc11_45.9: init %i32 = call %specific_fn.loc11_45.9(%int_9) [template = constants.%int_9.f88] // CHECK:STDOUT: %.loc11_45.26: init %i32 = converted %int_9, %int.convert_checked.loc11_45.9 [template = constants.%int_9.f88] // CHECK:STDOUT: %int_8.loc11_45: Core.IntLiteral = int_value 8 [template = constants.%int_8.b85] // CHECK:STDOUT: %.loc11_45.27: ref %i32 = array_index file.%a.var, %int_8.loc11_45 diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 51bc1dc4eb029..ce979da679381 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -177,10 +177,13 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.x.y.4cf: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -293,17 +296,17 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc9_27.1: %struct_type.x.y.4cf = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_27.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc9_27.1: = bound_method %int_1, %impl.elem0.loc9_27.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc9_27.1: init %i32 = call %Convert.specific_fn.loc9_27.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc9_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc9_27.1: = bound_method %int_1, %impl.elem0.loc9_27.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc9_27.1: = specific_function %bound_method.loc9_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc9_27.1: init %i32 = call %specific_fn.loc9_27.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_27.2: init %i32 = converted %int_1, %int.convert_checked.loc9_27.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc9_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc9_27.2: = bound_method %int_2, %impl.elem0.loc9_27.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc9_27.2: init %i32 = call %Convert.specific_fn.loc9_27.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc9_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc9_27.2: = bound_method %int_2, %impl.elem0.loc9_27.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc9_27.2: = specific_function %bound_method.loc9_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc9_27.2: init %i32 = call %specific_fn.loc9_27.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_27.5: init %i32 = converted %int_2, %int.convert_checked.loc9_27.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_27.6: ref %i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc9_27.7: init %i32 = initialize_from %.loc9_27.5 to %.loc9_27.6 [template = constants.%int_2.ef8] @@ -317,17 +320,17 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc17_31.1: %struct_type.x.y.4cf = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc17_31.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_31.1: = bound_method %int_1, %impl.elem0.loc17_31.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc17_31.1: init %i32 = call %Convert.specific_fn.loc17_31.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc17_31.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_31.1: = bound_method %int_1, %impl.elem0.loc17_31.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc17_31.1: = specific_function %bound_method.loc17_31.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc17_31.1: init %i32 = call %specific_fn.loc17_31.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_31.2: init %i32 = converted %int_1, %int.convert_checked.loc17_31.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc17_31.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_31.2: = bound_method %int_2, %impl.elem0.loc17_31.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc17_31.2: init %i32 = call %Convert.specific_fn.loc17_31.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc17_31.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_31.2: = bound_method %int_2, %impl.elem0.loc17_31.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc17_31.2: = specific_function %bound_method.loc17_31.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc17_31.2: init %i32 = call %specific_fn.loc17_31.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_31.5: init %i32 = converted %int_2, %int.convert_checked.loc17_31.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_31.6: ref %i32 = class_element_access file.%a_ref.var, element1 // CHECK:STDOUT: %.loc17_31.7: init %i32 = initialize_from %.loc17_31.5 to %.loc17_31.6 [template = constants.%int_2.ef8] @@ -364,10 +367,13 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [template] // CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %impl_witness.882: = impl_witness (imports.%Core.import_ref.78a), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template] +// CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [template] +// CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.197 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -422,10 +428,10 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_15.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_15.2: %i32 = converted %int_1, %.loc8_15.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] @@ -543,10 +549,13 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.x.y.4cf: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -618,18 +627,18 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc13_34.1: %struct_type.x.y.4cf = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %impl.elem0.loc13_34.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_34.1: = bound_method %int_1, %impl.elem0.loc13_34.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc13_34.1: init %i32 = call %Convert.specific_fn.loc13_34.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc13_34.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_34.1: = bound_method %int_1, %impl.elem0.loc13_34.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc13_34.1: = specific_function %bound_method.loc13_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc13_34.1: init %i32 = call %specific_fn.loc13_34.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_34.2: init %i32 = converted %int_1, %int.convert_checked.loc13_34.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc13_34.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_34.2: = bound_method %int_2, %impl.elem0.loc13_34.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc13_34.2: init %i32 = call %Convert.specific_fn.loc13_34.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc13_34.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_34.2: = bound_method %int_2, %impl.elem0.loc13_34.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc13_34.2: = specific_function %bound_method.loc13_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc13_34.2: init %i32 = call %specific_fn.loc13_34.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_34.6: init %i32 = converted %int_2, %int.convert_checked.loc13_34.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_34.7: ref %i32 = class_element_access %.loc13_34.3, element1 // CHECK:STDOUT: %.loc13_34.8: init %i32 = initialize_from %.loc13_34.6 to %.loc13_34.7 [template = constants.%int_2.ef8] @@ -655,10 +664,13 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.x.y.4cf: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -732,18 +744,18 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc22_33.1: %struct_type.x.y.4cf = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %impl.elem0.loc22_33.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc22_33.1: = bound_method %int_1, %impl.elem0.loc22_33.1 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc22_33.1: = specific_function %Convert.bound.loc22_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc22_33.1: init %i32 = call %Convert.specific_fn.loc22_33.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc22_33.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc22_33.1: = bound_method %int_1, %impl.elem0.loc22_33.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc22_33.1: = specific_function %bound_method.loc22_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc22_33.1: init %i32 = call %specific_fn.loc22_33.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc22_33.2: init %i32 = converted %int_1, %int.convert_checked.loc22_33.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc22_33.3: ref %A = temporary_storage // CHECK:STDOUT: %.loc22_33.4: ref %i32 = class_element_access %.loc22_33.3, element0 // CHECK:STDOUT: %.loc22_33.5: init %i32 = initialize_from %.loc22_33.2 to %.loc22_33.4 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc22_33.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc22_33.2: = bound_method %int_2, %impl.elem0.loc22_33.2 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc22_33.2: = specific_function %Convert.bound.loc22_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc22_33.2: init %i32 = call %Convert.specific_fn.loc22_33.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc22_33.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc22_33.2: = bound_method %int_2, %impl.elem0.loc22_33.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc22_33.2: = specific_function %bound_method.loc22_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc22_33.2: init %i32 = call %specific_fn.loc22_33.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_33.6: init %i32 = converted %int_2, %int.convert_checked.loc22_33.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_33.7: ref %i32 = class_element_access %.loc22_33.3, element1 // CHECK:STDOUT: %.loc22_33.8: init %i32 = initialize_from %.loc22_33.6 to %.loc22_33.7 [template = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/as/basic.carbon b/toolchain/check/testdata/as/basic.carbon index 355c239579c5d..b539b0ce66db1 100644 --- a/toolchain/check/testdata/as/basic.carbon +++ b/toolchain/check/testdata/as/basic.carbon @@ -20,10 +20,13 @@ fn Main() -> i32 { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [template] // CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %impl_witness.882: = impl_witness (imports.%Core.import_ref.78a), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template] +// CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [template] +// CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.197 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -60,10 +63,10 @@ fn Main() -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_12.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_12.2: %i32 = converted %int_1, %.loc12_12.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc12_12.2 diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index e822db9527249..5d2b2b0cb672a 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -38,19 +38,25 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %impl_witness.491: = impl_witness (@impl.1.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.0e3: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.311: %Convert.type.0e3 = struct_value () [template] +// CHECK:STDOUT: %As.facet.e45: %As.type.602 = facet_value %i32, %impl_witness.491 [template] // CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [template] // CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %impl_witness.662: = impl_witness (@impl.2.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.c23: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.8bb: %Convert.type.c23 = struct_value () [template] +// CHECK:STDOUT: %As.facet.831: %As.type.fd4 = facet_value %X, %impl_witness.662 [template] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %impl_witness.882: = impl_witness (imports.%Core.import_ref.78a), @impl.5(%int_32) [template] // CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.7, @impl.5(%int_32) [template] // CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template] +// CHECK:STDOUT: %As.facet.5e2: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [template] +// CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet.5e2 [template] // CHECK:STDOUT: %Convert.bound.e80: = bound_method %int_4.0c1, %Convert.197 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound.e80, @Convert.7(%int_32) [template] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [template] +// CHECK:STDOUT: %.b22: type = fn_type_with_self_type %Convert.type.35b, %As.facet.e45 [template] // CHECK:STDOUT: %Convert.bound.483: = bound_method %int_4.940, %Convert.311 [template] +// CHECK:STDOUT: %.599: type = fn_type_with_self_type %Convert.type.99b, %As.facet.831 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -182,25 +188,25 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] // 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.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] -// CHECK:STDOUT: %Convert.bound.loc23_18: = bound_method %int_4, %impl.elem0.loc23_18 [template = constants.%Convert.bound.e80] -// 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.940] +// CHECK:STDOUT: %impl.elem0.loc23_18: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] +// CHECK:STDOUT: %bound_method.loc23_18: = bound_method %int_4, %impl.elem0.loc23_18 [template = constants.%Convert.bound.e80] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method.loc23_18, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_4) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc23_18.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_4.940] // CHECK:STDOUT: %.loc23_18.2: %i32 = converted %int_4, %.loc23_18.1 [template = constants.%int_4.940] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %impl.elem0.loc23_26: %Convert.type.35b = impl_witness_access constants.%impl_witness.491, element0 [template = constants.%Convert.311] -// CHECK:STDOUT: %Convert.bound.loc23_26: = bound_method %.loc23_18.2, %impl.elem0.loc23_26 [template = constants.%Convert.bound.483] +// CHECK:STDOUT: %impl.elem0.loc23_26: %.b22 = impl_witness_access constants.%impl_witness.491, element0 [template = constants.%Convert.311] +// CHECK:STDOUT: %bound_method.loc23_26: = bound_method %.loc23_18.2, %impl.elem0.loc23_26 [template = constants.%Convert.bound.483] // 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: %Convert.call.loc23_26: init %X = call %bound_method.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.99b = impl_witness_access constants.%impl_witness.662, element0 [template = constants.%Convert.8bb] -// CHECK:STDOUT: %Convert.bound.loc23_32: = bound_method %.loc23_26.2, %impl.elem0.loc23_32 +// CHECK:STDOUT: %impl.elem0.loc23_32: %.599 = impl_witness_access constants.%impl_witness.662, element0 [template = constants.%Convert.8bb] +// CHECK:STDOUT: %bound_method.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 -// CHECK:STDOUT: %Convert.call.loc23_32: init %i32 = call %Convert.bound.loc23_32(%.loc23_26.4) +// CHECK:STDOUT: %Convert.call.loc23_32: init %i32 = call %bound_method.loc23_32(%.loc23_26.4) // CHECK:STDOUT: %.loc23_32.1: %i32 = value_of_initializer %Convert.call.loc23_32 // CHECK:STDOUT: %.loc23_32.2: %i32 = converted %.loc23_26.2, %.loc23_32.1 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index 517915651ee63..24ab8b938d064 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -19,10 +19,13 @@ var test_type: type = i32; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -89,10 +92,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%test_i32.var, %.loc11 // CHECK:STDOUT: %float: f64 = float_literal 0.10000000000000001 [template = constants.%float] diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index 043b9f5f0304e..0f71191888fbc 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -44,10 +44,13 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_39999999999999999993.af6: Core.IntLiteral = int_value 39999999999999999993 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.7ef: = bound_method %int_39999999999999999993.af6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.2ed: = specific_function %Convert.bound.7ef, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_39999999999999999993.dee: %i32 = int_value 39999999999999999993 [template] @@ -87,10 +90,10 @@ let e: f64 = 5.0e39999999999999999993; // 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] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15: = bound_method @__global_init.%int_39999999999999999993, %impl.elem0.loc15 [template = constants.%Convert.bound.7ef] -// CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2ed] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(@__global_init.%int_39999999999999999993) [template = constants.%int_39999999999999999993.dee] +// CHECK:STDOUT: %impl.elem0.loc15: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc15: = bound_method @__global_init.%int_39999999999999999993, %impl.elem0.loc15 [template = constants.%Convert.bound.7ef] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %bound_method.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2ed] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %specific_fn.loc15(@__global_init.%int_39999999999999999993) [template = constants.%int_39999999999999999993.dee] // CHECK:STDOUT: %.loc15_14.1: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_39999999999999999993.dee] // CHECK:STDOUT: %.loc15_14.2: %i32 = converted @__global_init.%int_39999999999999999993, %.loc15_14.1 [template = constants.%int_39999999999999999993.dee] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc15_14.2 @@ -101,10 +104,10 @@ let e: f64 = 5.0e39999999999999999993; // 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] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc21: = bound_method @__global_init.%int_2147483648.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.85f] -// CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.387] -// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(@__global_init.%int_2147483648.loc21) [template = constants.%int_2147483648.8df] +// CHECK:STDOUT: %impl.elem0.loc21: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc21: = bound_method @__global_init.%int_2147483648.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.85f] +// CHECK:STDOUT: %specific_fn.loc21: = specific_function %bound_method.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.387] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %specific_fn.loc21(@__global_init.%int_2147483648.loc21) [template = constants.%int_2147483648.8df] // CHECK:STDOUT: %.loc21_14.1: %i32 = value_of_initializer %int.convert_checked.loc21 [template = constants.%int_2147483648.8df] // CHECK:STDOUT: %.loc21_14.2: %i32 = converted @__global_init.%int_2147483648.loc21, %.loc21_14.1 [template = constants.%int_2147483648.8df] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc21_14.2 @@ -115,10 +118,10 @@ let e: f64 = 5.0e39999999999999999993; // 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: } -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc27: = bound_method @__global_init.%int_2147483648.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound.85f] -// CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.387] -// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(@__global_init.%int_2147483648.loc27) [template = constants.%int_2147483648.8df] +// CHECK:STDOUT: %impl.elem0.loc27: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc27: = bound_method @__global_init.%int_2147483648.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound.85f] +// CHECK:STDOUT: %specific_fn.loc27: = specific_function %bound_method.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.387] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %specific_fn.loc27(@__global_init.%int_2147483648.loc27) [template = constants.%int_2147483648.8df] // CHECK:STDOUT: %.loc27_14.1: %i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%int_2147483648.8df] // CHECK:STDOUT: %.loc27_14.2: %i32 = converted @__global_init.%int_2147483648.loc27, %.loc27_14.1 [template = constants.%int_2147483648.8df] // CHECK:STDOUT: %c: %i32 = bind_name c, %.loc27_14.2 diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index a8b56e52a8b07..851310c880d7a 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -43,10 +43,13 @@ fn F() { // CHECK:STDOUT: %int_2147483647.d89: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %tuple.type.27c: 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: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.e09: = bound_method %int_8.b85, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.e0d: = specific_function %Convert.bound.e09, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [template] @@ -109,50 +112,50 @@ fn F() { // CHECK:STDOUT: %int_2147483647.loc19: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.d89] // CHECK:STDOUT: %int_2147483647.loc20: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.d89] // CHECK:STDOUT: %.loc21_3.1: %tuple.type.27c = 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc21_3.1: = bound_method %int_8.loc15, %impl.elem0.loc21_3.1 [template = constants.%Convert.bound.e09] -// 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.e0d] -// CHECK:STDOUT: %int.convert_checked.loc21_3.1: init %i32 = call %Convert.specific_fn.loc21_3.1(%int_8.loc15) [template = constants.%int_8.98c] +// CHECK:STDOUT: %impl.elem0.loc21_3.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc21_3.1: = bound_method %int_8.loc15, %impl.elem0.loc21_3.1 [template = constants.%Convert.bound.e09] +// CHECK:STDOUT: %specific_fn.loc21_3.1: = specific_function %bound_method.loc21_3.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.e0d] +// CHECK:STDOUT: %int.convert_checked.loc21_3.1: init %i32 = call %specific_fn.loc21_3.1(%int_8.loc15) [template = constants.%int_8.98c] // CHECK:STDOUT: %.loc21_3.2: init %i32 = converted %int_8.loc15, %int.convert_checked.loc21_3.1 [template = constants.%int_8.98c] // 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.98c] -// CHECK:STDOUT: %impl.elem0.loc21_3.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc21_3.2: = bound_method %int_9, %impl.elem0.loc21_3.2 [template = constants.%Convert.bound.9e2] -// 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.b02] -// CHECK:STDOUT: %int.convert_checked.loc21_3.2: init %i32 = call %Convert.specific_fn.loc21_3.2(%int_9) [template = constants.%int_9.f88] +// CHECK:STDOUT: %impl.elem0.loc21_3.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc21_3.2: = bound_method %int_9, %impl.elem0.loc21_3.2 [template = constants.%Convert.bound.9e2] +// CHECK:STDOUT: %specific_fn.loc21_3.2: = specific_function %bound_method.loc21_3.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b02] +// CHECK:STDOUT: %int.convert_checked.loc21_3.2: init %i32 = call %specific_fn.loc21_3.2(%int_9) [template = constants.%int_9.f88] // CHECK:STDOUT: %.loc21_3.5: init %i32 = converted %int_9, %int.convert_checked.loc21_3.2 [template = constants.%int_9.f88] // 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.f88] -// CHECK:STDOUT: %impl.elem0.loc21_3.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc21_3.3: = bound_method %int_8.loc17, %impl.elem0.loc21_3.3 [template = constants.%Convert.bound.e09] -// 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.e0d] -// CHECK:STDOUT: %int.convert_checked.loc21_3.3: init %i32 = call %Convert.specific_fn.loc21_3.3(%int_8.loc17) [template = constants.%int_8.98c] +// CHECK:STDOUT: %impl.elem0.loc21_3.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc21_3.3: = bound_method %int_8.loc17, %impl.elem0.loc21_3.3 [template = constants.%Convert.bound.e09] +// CHECK:STDOUT: %specific_fn.loc21_3.3: = specific_function %bound_method.loc21_3.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.e0d] +// CHECK:STDOUT: %int.convert_checked.loc21_3.3: init %i32 = call %specific_fn.loc21_3.3(%int_8.loc17) [template = constants.%int_8.98c] // CHECK:STDOUT: %.loc21_3.8: init %i32 = converted %int_8.loc17, %int.convert_checked.loc21_3.3 [template = constants.%int_8.98c] // 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.98c] -// CHECK:STDOUT: %impl.elem0.loc21_3.4: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc21_3.4: = bound_method %int_8.loc18, %impl.elem0.loc21_3.4 [template = constants.%Convert.bound.e09] -// 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.e0d] -// CHECK:STDOUT: %int.convert_checked.loc21_3.4: init %i32 = call %Convert.specific_fn.loc21_3.4(%int_8.loc18) [template = constants.%int_8.98c] +// CHECK:STDOUT: %impl.elem0.loc21_3.4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc21_3.4: = bound_method %int_8.loc18, %impl.elem0.loc21_3.4 [template = constants.%Convert.bound.e09] +// CHECK:STDOUT: %specific_fn.loc21_3.4: = specific_function %bound_method.loc21_3.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.e0d] +// CHECK:STDOUT: %int.convert_checked.loc21_3.4: init %i32 = call %specific_fn.loc21_3.4(%int_8.loc18) [template = constants.%int_8.98c] // CHECK:STDOUT: %.loc21_3.11: init %i32 = converted %int_8.loc18, %int.convert_checked.loc21_3.4 [template = constants.%int_8.98c] // 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.98c] -// CHECK:STDOUT: %impl.elem0.loc21_3.5: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc21_3.5: = bound_method %int_2147483647.loc19, %impl.elem0.loc21_3.5 [template = constants.%Convert.bound.f38] -// 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.221] -// CHECK:STDOUT: %int.convert_checked.loc21_3.5: init %i32 = call %Convert.specific_fn.loc21_3.5(%int_2147483647.loc19) [template = constants.%int_2147483647.a74] +// CHECK:STDOUT: %impl.elem0.loc21_3.5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc21_3.5: = bound_method %int_2147483647.loc19, %impl.elem0.loc21_3.5 [template = constants.%Convert.bound.f38] +// CHECK:STDOUT: %specific_fn.loc21_3.5: = specific_function %bound_method.loc21_3.5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.221] +// CHECK:STDOUT: %int.convert_checked.loc21_3.5: init %i32 = call %specific_fn.loc21_3.5(%int_2147483647.loc19) [template = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc21_3.14: init %i32 = converted %int_2147483647.loc19, %int.convert_checked.loc21_3.5 [template = constants.%int_2147483647.a74] // 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.a74] -// CHECK:STDOUT: %impl.elem0.loc21_3.6: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc21_3.6: = bound_method %int_2147483647.loc20, %impl.elem0.loc21_3.6 [template = constants.%Convert.bound.f38] -// 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.221] -// CHECK:STDOUT: %int.convert_checked.loc21_3.6: init %i32 = call %Convert.specific_fn.loc21_3.6(%int_2147483647.loc20) [template = constants.%int_2147483647.a74] +// CHECK:STDOUT: %impl.elem0.loc21_3.6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc21_3.6: = bound_method %int_2147483647.loc20, %impl.elem0.loc21_3.6 [template = constants.%Convert.bound.f38] +// CHECK:STDOUT: %specific_fn.loc21_3.6: = specific_function %bound_method.loc21_3.6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.221] +// CHECK:STDOUT: %int.convert_checked.loc21_3.6: init %i32 = call %specific_fn.loc21_3.6(%int_2147483647.loc20) [template = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc21_3.17: init %i32 = converted %int_2147483647.loc20, %int.convert_checked.loc21_3.6 [template = constants.%int_2147483647.a74] // CHECK:STDOUT: %int_5.loc21: Core.IntLiteral = int_value 5 [template = constants.%int_5] // CHECK:STDOUT: %.loc21_3.18: ref %i32 = array_index %ints.var, %int_5.loc21 diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index 8865a06cdb529..158fd7989f82d 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -17,10 +17,13 @@ var b: i32 = ((2)); // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -71,17 +74,17 @@ 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.5b8] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_1, %impl.elem0.loc11 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc11: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11: = bound_method %int_1, %impl.elem0.loc11 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11: = specific_function %bound_method.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %specific_fn.loc11(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11: init %i32 = converted %int_1, %int.convert_checked.loc11 [template = constants.%int_1.5d2] // CHECK:STDOUT: assign file.%a.var, %.loc11 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_2, %impl.elem0.loc12 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_2, %impl.elem0.loc12 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12: init %i32 = converted %int_2, %int.convert_checked.loc12 [template = constants.%int_2.ef8] // CHECK:STDOUT: assign file.%b.var, %.loc12 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/basics/run_i32.carbon b/toolchain/check/testdata/basics/run_i32.carbon index ec044a586137b..fc821bed03a77 100644 --- a/toolchain/check/testdata/basics/run_i32.carbon +++ b/toolchain/check/testdata/basics/run_i32.carbon @@ -18,10 +18,13 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -58,10 +61,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_27.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_27.2: %i32 = converted %int_0, %.loc11_27.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc11_27.2 diff --git a/toolchain/check/testdata/builtins/bool/eq.carbon b/toolchain/check/testdata/builtins/bool/eq.carbon index 5a459e0355300..c5f11c8be4833 100644 --- a/toolchain/check/testdata/builtins/bool/eq.carbon +++ b/toolchain/check/testdata/builtins/bool/eq.carbon @@ -290,8 +290,11 @@ var d: C(false == false) = True(); // CHECK:STDOUT: %C.2ba: type = class_type @C, @C(%false) [template] // CHECK:STDOUT: %False.type: type = fn_type @False [template] // CHECK:STDOUT: %False: %False.type = struct_value () [template] +// CHECK:STDOUT: %Eq.type: type = facet_type <@Eq> [template] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Core.import_ref.998, imports.%Core.import_ref.fb6) [template] // CHECK:STDOUT: %Equal.type.79c: type = fn_type @Equal.1 [template] +// CHECK:STDOUT: %Eq.facet: %Eq.type = facet_value bool, %impl_witness [template] +// CHECK:STDOUT: %.006: type = fn_type_with_self_type %Equal.type.79c, %Eq.facet [template] // CHECK:STDOUT: %Equal.type.aa3: type = fn_type @Equal.2 [template] // CHECK:STDOUT: %Equal.6e2: %Equal.type.aa3 = struct_value () [template] // CHECK:STDOUT: %Equal.bound.fe0: = bound_method %true, %Equal.6e2 [template] @@ -360,9 +363,9 @@ var d: C(false == false) = True(); // CHECK:STDOUT: %C.ref.loc9: %C.type = name_ref C, %C.decl [template = constants.%C.generic] // CHECK:STDOUT: %true.loc9_10: bool = bool_literal true [template = constants.%true] // CHECK:STDOUT: %true.loc9_18: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %impl.elem0.loc9: %Equal.type.79c = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.6e2] -// CHECK:STDOUT: %Equal.bound.loc9: = bound_method %true.loc9_10, %impl.elem0.loc9 [template = constants.%Equal.bound.fe0] -// CHECK:STDOUT: %bool.eq.loc9: init bool = call %Equal.bound.loc9(%true.loc9_10, %true.loc9_18) [template = constants.%true] +// CHECK:STDOUT: %impl.elem0.loc9: %.006 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.6e2] +// CHECK:STDOUT: %bound_method.loc9: = bound_method %true.loc9_10, %impl.elem0.loc9 [template = constants.%Equal.bound.fe0] +// CHECK:STDOUT: %bool.eq.loc9: init bool = call %bound_method.loc9(%true.loc9_10, %true.loc9_18) [template = constants.%true] // CHECK:STDOUT: %.loc9_22.2: bool = value_of_initializer %bool.eq.loc9 [template = constants.%true] // CHECK:STDOUT: %.loc9_22.3: bool = converted %bool.eq.loc9, %.loc9_22.2 [template = constants.%true] // CHECK:STDOUT: %C.loc9: type = class_type @C, @C(constants.%true) [template = constants.%C.a14] @@ -377,9 +380,9 @@ var d: C(false == false) = True(); // CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, %C.decl [template = constants.%C.generic] // CHECK:STDOUT: %true.loc10: bool = bool_literal true [template = constants.%true] // CHECK:STDOUT: %false.loc10: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %impl.elem0.loc10: %Equal.type.79c = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.6e2] -// CHECK:STDOUT: %Equal.bound.loc10: = bound_method %true.loc10, %impl.elem0.loc10 [template = constants.%Equal.bound.fe0] -// CHECK:STDOUT: %bool.eq.loc10: init bool = call %Equal.bound.loc10(%true.loc10, %false.loc10) [template = constants.%false] +// CHECK:STDOUT: %impl.elem0.loc10: %.006 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.6e2] +// CHECK:STDOUT: %bound_method.loc10: = bound_method %true.loc10, %impl.elem0.loc10 [template = constants.%Equal.bound.fe0] +// CHECK:STDOUT: %bool.eq.loc10: init bool = call %bound_method.loc10(%true.loc10, %false.loc10) [template = constants.%false] // CHECK:STDOUT: %.loc10_23.2: bool = value_of_initializer %bool.eq.loc10 [template = constants.%false] // CHECK:STDOUT: %.loc10_23.3: bool = converted %bool.eq.loc10, %.loc10_23.2 [template = constants.%false] // CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%false) [template = constants.%C.2ba] @@ -394,9 +397,9 @@ var d: C(false == false) = True(); // CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, %C.decl [template = constants.%C.generic] // CHECK:STDOUT: %false.loc11: bool = bool_literal false [template = constants.%false] // CHECK:STDOUT: %true.loc11: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %impl.elem0.loc11: %Equal.type.79c = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.6e2] -// CHECK:STDOUT: %Equal.bound.loc11: = bound_method %false.loc11, %impl.elem0.loc11 [template = constants.%Equal.bound.d3c] -// CHECK:STDOUT: %bool.eq.loc11: init bool = call %Equal.bound.loc11(%false.loc11, %true.loc11) [template = constants.%false] +// CHECK:STDOUT: %impl.elem0.loc11: %.006 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.6e2] +// CHECK:STDOUT: %bound_method.loc11: = bound_method %false.loc11, %impl.elem0.loc11 [template = constants.%Equal.bound.d3c] +// CHECK:STDOUT: %bool.eq.loc11: init bool = call %bound_method.loc11(%false.loc11, %true.loc11) [template = constants.%false] // CHECK:STDOUT: %.loc11_23.2: bool = value_of_initializer %bool.eq.loc11 [template = constants.%false] // CHECK:STDOUT: %.loc11_23.3: bool = converted %bool.eq.loc11, %.loc11_23.2 [template = constants.%false] // CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%false) [template = constants.%C.2ba] @@ -411,9 +414,9 @@ var d: C(false == false) = True(); // CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, %C.decl [template = constants.%C.generic] // CHECK:STDOUT: %false.loc12_10: bool = bool_literal false [template = constants.%false] // CHECK:STDOUT: %false.loc12_19: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %impl.elem0.loc12: %Equal.type.79c = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.6e2] -// CHECK:STDOUT: %Equal.bound.loc12: = bound_method %false.loc12_10, %impl.elem0.loc12 [template = constants.%Equal.bound.d3c] -// CHECK:STDOUT: %bool.eq.loc12: init bool = call %Equal.bound.loc12(%false.loc12_10, %false.loc12_19) [template = constants.%true] +// CHECK:STDOUT: %impl.elem0.loc12: %.006 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.6e2] +// CHECK:STDOUT: %bound_method.loc12: = bound_method %false.loc12_10, %impl.elem0.loc12 [template = constants.%Equal.bound.d3c] +// CHECK:STDOUT: %bool.eq.loc12: init bool = call %bound_method.loc12(%false.loc12_10, %false.loc12_19) [template = constants.%true] // CHECK:STDOUT: %.loc12_24.2: bool = value_of_initializer %bool.eq.loc12 [template = constants.%true] // CHECK:STDOUT: %.loc12_24.3: bool = converted %bool.eq.loc12, %.loc12_24.2 [template = constants.%true] // CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%true) [template = constants.%C.a14] diff --git a/toolchain/check/testdata/builtins/bool/neq.carbon b/toolchain/check/testdata/builtins/bool/neq.carbon index d04da3d43d26d..ea6d03526a28d 100644 --- a/toolchain/check/testdata/builtins/bool/neq.carbon +++ b/toolchain/check/testdata/builtins/bool/neq.carbon @@ -290,8 +290,11 @@ var d: C(false != false) = False(); // CHECK:STDOUT: %C.2ba: type = class_type @C, @C(%false) [template] // CHECK:STDOUT: %False.type: type = fn_type @False [template] // CHECK:STDOUT: %False: %False.type = struct_value () [template] +// CHECK:STDOUT: %Eq.type: type = facet_type <@Eq> [template] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Core.import_ref.85b, imports.%Core.import_ref.67a) [template] // CHECK:STDOUT: %NotEqual.type.e6c: type = fn_type @NotEqual.1 [template] +// CHECK:STDOUT: %Eq.facet: %Eq.type = facet_value bool, %impl_witness [template] +// CHECK:STDOUT: %.8b5: type = fn_type_with_self_type %NotEqual.type.e6c, %Eq.facet [template] // CHECK:STDOUT: %NotEqual.type.c0e: type = fn_type @NotEqual.2 [template] // CHECK:STDOUT: %NotEqual.bf4: %NotEqual.type.c0e = struct_value () [template] // CHECK:STDOUT: %NotEqual.bound.542: = bound_method %true, %NotEqual.bf4 [template] @@ -360,9 +363,9 @@ var d: C(false != false) = False(); // CHECK:STDOUT: %C.ref.loc9: %C.type = name_ref C, %C.decl [template = constants.%C.generic] // CHECK:STDOUT: %true.loc9_10: bool = bool_literal true [template = constants.%true] // CHECK:STDOUT: %true.loc9_18: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %impl.elem1.loc9: %NotEqual.type.e6c = impl_witness_access constants.%impl_witness, element1 [template = constants.%NotEqual.bf4] -// CHECK:STDOUT: %NotEqual.bound.loc9: = bound_method %true.loc9_10, %impl.elem1.loc9 [template = constants.%NotEqual.bound.542] -// CHECK:STDOUT: %bool.neq.loc9: init bool = call %NotEqual.bound.loc9(%true.loc9_10, %true.loc9_18) [template = constants.%false] +// CHECK:STDOUT: %impl.elem1.loc9: %.8b5 = impl_witness_access constants.%impl_witness, element1 [template = constants.%NotEqual.bf4] +// CHECK:STDOUT: %bound_method.loc9: = bound_method %true.loc9_10, %impl.elem1.loc9 [template = constants.%NotEqual.bound.542] +// CHECK:STDOUT: %bool.neq.loc9: init bool = call %bound_method.loc9(%true.loc9_10, %true.loc9_18) [template = constants.%false] // CHECK:STDOUT: %.loc9_22.2: bool = value_of_initializer %bool.neq.loc9 [template = constants.%false] // CHECK:STDOUT: %.loc9_22.3: bool = converted %bool.neq.loc9, %.loc9_22.2 [template = constants.%false] // CHECK:STDOUT: %C.loc9: type = class_type @C, @C(constants.%false) [template = constants.%C.2ba] @@ -377,9 +380,9 @@ var d: C(false != false) = False(); // CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, %C.decl [template = constants.%C.generic] // CHECK:STDOUT: %true.loc10: bool = bool_literal true [template = constants.%true] // CHECK:STDOUT: %false.loc10: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %impl.elem1.loc10: %NotEqual.type.e6c = impl_witness_access constants.%impl_witness, element1 [template = constants.%NotEqual.bf4] -// CHECK:STDOUT: %NotEqual.bound.loc10: = bound_method %true.loc10, %impl.elem1.loc10 [template = constants.%NotEqual.bound.542] -// CHECK:STDOUT: %bool.neq.loc10: init bool = call %NotEqual.bound.loc10(%true.loc10, %false.loc10) [template = constants.%true] +// CHECK:STDOUT: %impl.elem1.loc10: %.8b5 = impl_witness_access constants.%impl_witness, element1 [template = constants.%NotEqual.bf4] +// CHECK:STDOUT: %bound_method.loc10: = bound_method %true.loc10, %impl.elem1.loc10 [template = constants.%NotEqual.bound.542] +// CHECK:STDOUT: %bool.neq.loc10: init bool = call %bound_method.loc10(%true.loc10, %false.loc10) [template = constants.%true] // CHECK:STDOUT: %.loc10_23.2: bool = value_of_initializer %bool.neq.loc10 [template = constants.%true] // CHECK:STDOUT: %.loc10_23.3: bool = converted %bool.neq.loc10, %.loc10_23.2 [template = constants.%true] // CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%true) [template = constants.%C.a14] @@ -394,9 +397,9 @@ var d: C(false != false) = False(); // CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, %C.decl [template = constants.%C.generic] // CHECK:STDOUT: %false.loc11: bool = bool_literal false [template = constants.%false] // CHECK:STDOUT: %true.loc11: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %impl.elem1.loc11: %NotEqual.type.e6c = impl_witness_access constants.%impl_witness, element1 [template = constants.%NotEqual.bf4] -// CHECK:STDOUT: %NotEqual.bound.loc11: = bound_method %false.loc11, %impl.elem1.loc11 [template = constants.%NotEqual.bound.5a9] -// CHECK:STDOUT: %bool.neq.loc11: init bool = call %NotEqual.bound.loc11(%false.loc11, %true.loc11) [template = constants.%true] +// CHECK:STDOUT: %impl.elem1.loc11: %.8b5 = impl_witness_access constants.%impl_witness, element1 [template = constants.%NotEqual.bf4] +// CHECK:STDOUT: %bound_method.loc11: = bound_method %false.loc11, %impl.elem1.loc11 [template = constants.%NotEqual.bound.5a9] +// CHECK:STDOUT: %bool.neq.loc11: init bool = call %bound_method.loc11(%false.loc11, %true.loc11) [template = constants.%true] // CHECK:STDOUT: %.loc11_23.2: bool = value_of_initializer %bool.neq.loc11 [template = constants.%true] // CHECK:STDOUT: %.loc11_23.3: bool = converted %bool.neq.loc11, %.loc11_23.2 [template = constants.%true] // CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%true) [template = constants.%C.a14] @@ -411,9 +414,9 @@ var d: C(false != false) = False(); // CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, %C.decl [template = constants.%C.generic] // CHECK:STDOUT: %false.loc12_10: bool = bool_literal false [template = constants.%false] // CHECK:STDOUT: %false.loc12_19: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %impl.elem1.loc12: %NotEqual.type.e6c = impl_witness_access constants.%impl_witness, element1 [template = constants.%NotEqual.bf4] -// CHECK:STDOUT: %NotEqual.bound.loc12: = bound_method %false.loc12_10, %impl.elem1.loc12 [template = constants.%NotEqual.bound.5a9] -// CHECK:STDOUT: %bool.neq.loc12: init bool = call %NotEqual.bound.loc12(%false.loc12_10, %false.loc12_19) [template = constants.%false] +// CHECK:STDOUT: %impl.elem1.loc12: %.8b5 = impl_witness_access constants.%impl_witness, element1 [template = constants.%NotEqual.bf4] +// CHECK:STDOUT: %bound_method.loc12: = bound_method %false.loc12_10, %impl.elem1.loc12 [template = constants.%NotEqual.bound.5a9] +// CHECK:STDOUT: %bool.neq.loc12: init bool = call %bound_method.loc12(%false.loc12_10, %false.loc12_19) [template = constants.%false] // CHECK:STDOUT: %.loc12_24.2: bool = value_of_initializer %bool.neq.loc12 [template = constants.%false] // CHECK:STDOUT: %.loc12_24.3: bool = converted %bool.neq.loc12, %.loc12_24.2 [template = constants.%false] // CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%false) [template = constants.%C.2ba] diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index 5ceb160036c30..2eb100c103b99 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -95,10 +95,13 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_64.fab: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %ImplicitAs.type.9ba: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.6da: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.b97: = impl_witness (imports.%Core.import_ref.a86), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.ed5: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.16d: %Convert.type.ed5 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, %impl_witness.b97 [template] +// CHECK:STDOUT: %.39b: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_64.fab, %Convert.16d [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_64.198: %i32 = int_value 64 [template] @@ -134,10 +137,10 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %.loc6_16.1: type = splice_block %.loc6_16.3 [template = f64] { // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%Main.Float [template = constants.%Float] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64.fab] -// CHECK:STDOUT: %impl.elem0: %Convert.type.6da = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_64, %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_64) [template = constants.%int_64.198] +// CHECK:STDOUT: %impl.elem0: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] +// CHECK:STDOUT: %bound_method: = bound_method %int_64, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_64) [template = constants.%int_64.198] // CHECK:STDOUT: %.loc6_14.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_64.198] // CHECK:STDOUT: %.loc6_14.2: %i32 = converted %int_64, %.loc6_14.1 [template = constants.%int_64.198] // CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%.loc6_14.2) [template = f64] @@ -188,10 +191,13 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %int_32.be0: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32.be0) [template] +// CHECK:STDOUT: %ImplicitAs.type.9ba: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.6da: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.b97: = impl_witness (imports.%Core.import_ref.a86), @impl.1(%int_32.be0) [template] // CHECK:STDOUT: %Convert.type.ed5: type = fn_type @Convert.2, @impl.1(%int_32.be0) [template] // CHECK:STDOUT: %Convert.16d: %Convert.type.ed5 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, %impl_witness.b97 [template] +// CHECK:STDOUT: %.39b: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.cce: = bound_method %int_32.be0, %Convert.16d [template] // CHECK:STDOUT: %Convert.specific_fn.23b: = specific_function %Convert.bound.cce, @Convert.2(%int_32.be0) [template] // CHECK:STDOUT: %int_32.4de: %i32 = int_value 32 [template] @@ -229,10 +235,10 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %.loc10_28.1: type = splice_block %.loc10_28.3 [template = ] { // CHECK:STDOUT: %Float.ref.loc10: %Float.type = name_ref Float, imports.%Main.Float [template = constants.%Float] // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32.be0] -// CHECK:STDOUT: %impl.elem0: %Convert.type.6da = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_32.loc10, %impl.elem0 [template = constants.%Convert.bound.cce] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32.be0) [template = constants.%Convert.specific_fn.23b] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_32.loc10) [template = constants.%int_32.4de] +// CHECK:STDOUT: %impl.elem0: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] +// CHECK:STDOUT: %bound_method: = bound_method %int_32.loc10, %impl.elem0 [template = constants.%Convert.bound.cce] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32.be0) [template = constants.%Convert.specific_fn.23b] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_32.loc10) [template = constants.%int_32.4de] // CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_32.4de] // CHECK:STDOUT: %.loc10_26.2: %i32 = converted %int_32.loc10, %.loc10_26.1 [template = constants.%int_32.4de] // CHECK:STDOUT: %float.make_type.loc10: init type = call %Float.ref.loc10(%.loc10_26.2) [template = ] @@ -271,10 +277,10 @@ 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.fab] -// CHECK:STDOUT: %impl.elem0: %Convert.type.6da = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_64, %impl.elem0 [template = constants.%Convert.bound.575] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32.be0) [template = constants.%Convert.specific_fn.bd8] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_64) [template = constants.%int_64.198] +// CHECK:STDOUT: %impl.elem0: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] +// CHECK:STDOUT: %bound_method: = bound_method %int_64, %impl.elem0 [template = constants.%Convert.bound.575] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32.be0) [template = constants.%Convert.specific_fn.bd8] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_64) [template = constants.%int_64.198] // CHECK:STDOUT: %.loc12: init %i32 = converted %int_64, %int.convert_checked [template = constants.%int_64.198] // CHECK:STDOUT: assign file.%dyn_size.var, %.loc12 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/builtins/print/char.carbon b/toolchain/check/testdata/builtins/print/char.carbon index 8c3e44ccb8b1d..58c4b6faccdd8 100644 --- a/toolchain/check/testdata/builtins/print/char.carbon +++ b/toolchain/check/testdata/builtins/print/char.carbon @@ -27,10 +27,13 @@ fn Main() { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -87,20 +90,20 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %PrintChar.ref.loc16: %PrintChar.type.c95 = name_ref PrintChar, file.%PrintChar.decl [template = constants.%PrintChar.843] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_13.1: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_13.2: %i32 = converted %int_1, %.loc16_13.1 [template = constants.%int_1.5d2] // 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.089 = name_ref PrintChar, imports.%Core.PrintChar [template = constants.%PrintChar.d75] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_2, %impl.elem0.loc17 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc17: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17: = bound_method %int_2, %impl.elem0.loc17 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %bound_method.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %specific_fn.loc17(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_18.1: %i32 = value_of_initializer %int.convert_checked.loc17 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_18.2: %i32 = converted %int_2, %.loc17_18.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %print.char.loc17: init %i32 = call %PrintChar.ref.loc17(%.loc17_18.2) diff --git a/toolchain/check/testdata/builtins/print/int.carbon b/toolchain/check/testdata/builtins/print/int.carbon index fec15a32b8cc6..85dd1bd19d004 100644 --- a/toolchain/check/testdata/builtins/print/int.carbon +++ b/toolchain/check/testdata/builtins/print/int.carbon @@ -29,10 +29,13 @@ fn Main() { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -83,20 +86,20 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Print.ref.loc16: %Print.type.980 = name_ref Print, file.%Print.decl [template = constants.%Print.b7c] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_9.1: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_9.2: %i32 = converted %int_1, %.loc16_9.1 [template = constants.%int_1.5d2] // 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.6ed = name_ref Print, imports.%Core.Print [template = constants.%Print.723] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_2, %impl.elem0.loc18 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc18: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18: = bound_method %int_2, %impl.elem0.loc18 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %bound_method.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %specific_fn.loc18(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_14.1: %i32 = value_of_initializer %int.convert_checked.loc18 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_14.2: %i32 = converted %int_2, %.loc18_14.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %print.int.loc18: init %empty_tuple.type = call %Print.ref.loc18(%.loc18_14.2) diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 28401570c3d8a..664561e6252dd 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -154,10 +154,13 @@ class A { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Circle.elem: type = unbound_element_type %Circle, %i32 [template] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.ba9: = specific_function %Convert.bound.4e6, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [template] @@ -211,10 +214,10 @@ class A { // 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: } -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.0f6] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_45.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_45.2: %i32 = converted %int_5, %.loc6_45.1 [template = constants.%int_5.0f6] // CHECK:STDOUT: %SOME_INTERNAL_CONSTANT: %i32 = bind_name SOME_INTERNAL_CONSTANT, %.loc6_45.2 @@ -249,10 +252,10 @@ class A { // CHECK:STDOUT: fn @SomeInternalFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_13.2: %i32 = converted %int_0, %.loc9_13.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc9_13.2 @@ -262,10 +265,10 @@ class A { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.64b] // CHECK:STDOUT: %.loc13_24.1: %struct_type.radius.f47 = struct_literal (%int_5) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.0f6] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc13_24.2: init %i32 = converted %int_5, %int.convert_checked [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc13_24.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc13_24.4: init %i32 = initialize_from %.loc13_24.2 to %.loc13_24.3 [template = constants.%int_5.0f6] @@ -384,10 +387,13 @@ class A { // CHECK:STDOUT: %struct_type.radius: type = struct_type {.radius: %i32} [template] // CHECK:STDOUT: %complete_type.5a5: = complete_type_witness %struct_type.radius [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -477,10 +483,10 @@ class A { // CHECK:STDOUT: fn @SomeInternalFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_13.2: %i32 = converted %int_0, %.loc12_13.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc12_13.2 @@ -503,10 +509,13 @@ class A { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.64b, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [template] @@ -550,10 +559,10 @@ class A { // 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: } -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.0f6] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_16.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_16.2: %i32 = converted %int_5, %.loc5_16.1 [template = constants.%int_5.0f6] // CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_16.2 @@ -579,10 +588,13 @@ class A { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.64b, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [template] @@ -635,10 +647,10 @@ class A { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.0f6] +// CHECK:STDOUT: %impl.elem0.loc5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %bound_method.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %specific_fn.loc5(%int_5.loc5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_26.1: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_26.2: %i32 = converted %int_5.loc5, %.loc5_26.1 [template = constants.%int_5.0f6] // CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_26.2 @@ -650,10 +662,10 @@ class A { // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.0f6] +// CHECK:STDOUT: %impl.elem0.loc6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %bound_method.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %specific_fn.loc6(%int_5.loc6) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_24.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_24.2: %i32 = converted %int_5.loc6, %.loc6_24.1 [template = constants.%int_5.0f6] // CHECK:STDOUT: %y: %i32 = bind_name y, %.loc6_24.2 diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index 4438c21282acb..0bb5380140307 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -105,10 +105,13 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -151,18 +154,18 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: } // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_27.1: = bound_method @__global_init.%int_1, %impl.elem0.loc13_27.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %Convert.specific_fn.loc13_27.1(@__global_init.%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc13_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_27.1: = bound_method @__global_init.%int_1, %impl.elem0.loc13_27.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc13_27.1: = specific_function %bound_method.loc13_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %specific_fn.loc13_27.1(@__global_init.%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_27.1: init %i32 = converted @__global_init.%int_1, %int.convert_checked.loc13_27.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_27.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.3: ref %i32 = class_element_access %.loc13_27.2, element0 // CHECK:STDOUT: %.loc13_27.4: init %i32 = initialize_from %.loc13_27.1 to %.loc13_27.3 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_27.2: = bound_method @__global_init.%int_2, %impl.elem0.loc13_27.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %Convert.specific_fn.loc13_27.2(@__global_init.%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc13_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_27.2: = bound_method @__global_init.%int_2, %impl.elem0.loc13_27.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc13_27.2: = specific_function %bound_method.loc13_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %specific_fn.loc13_27.2(@__global_init.%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.5: init %i32 = converted @__global_init.%int_2, %int.convert_checked.loc13_27.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.6: ref %i32 = class_element_access %.loc13_27.2, element1 // CHECK:STDOUT: %.loc13_27.7: init %i32 = initialize_from %.loc13_27.5 to %.loc13_27.6 [template = constants.%int_2.ef8] @@ -289,10 +292,13 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -335,18 +341,18 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: } // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_27.1: = bound_method @__global_init.%int_1, %impl.elem0.loc13_27.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %Convert.specific_fn.loc13_27.1(@__global_init.%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc13_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_27.1: = bound_method @__global_init.%int_1, %impl.elem0.loc13_27.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc13_27.1: = specific_function %bound_method.loc13_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %specific_fn.loc13_27.1(@__global_init.%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_27.1: init %i32 = converted @__global_init.%int_1, %int.convert_checked.loc13_27.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_27.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.3: ref %i32 = class_element_access %.loc13_27.2, element0 // CHECK:STDOUT: %.loc13_27.4: init %i32 = initialize_from %.loc13_27.1 to %.loc13_27.3 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_27.2: = bound_method @__global_init.%int_2, %impl.elem0.loc13_27.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %Convert.specific_fn.loc13_27.2(@__global_init.%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc13_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_27.2: = bound_method @__global_init.%int_2, %impl.elem0.loc13_27.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc13_27.2: = specific_function %bound_method.loc13_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %specific_fn.loc13_27.2(@__global_init.%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.5: init %i32 = converted @__global_init.%int_2, %int.convert_checked.loc13_27.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.6: ref %i32 = class_element_access %.loc13_27.2, element1 // CHECK:STDOUT: %.loc13_27.7: init %i32 = initialize_from %.loc13_27.5 to %.loc13_27.6 [template = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index 3224453c717db..f923121d4ba0b 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -65,10 +65,13 @@ class Derived { // CHECK:STDOUT: %struct_type.b.a15: type = struct_type {.b: Core.IntLiteral} [template] // CHECK:STDOUT: %int_7.29f: Core.IntLiteral = int_value 7 [template] // CHECK:STDOUT: %struct_type.base.d.a20: type = struct_type {.base: %struct_type.b.a15, .d: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [template] @@ -169,20 +172,20 @@ class Derived { // CHECK:STDOUT: %.loc14_26.1: %struct_type.b.a15 = struct_literal (%int_4) // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7.29f] // CHECK:STDOUT: %.loc14_35.1: %struct_type.base.d.a20 = struct_literal (%.loc14_26.1, %int_7) -// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_26: = bound_method %int_4, %impl.elem0.loc14_26 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc14_26: = specific_function %Convert.bound.loc14_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %Convert.specific_fn.loc14_26(%int_4) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc14_26: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_26: = bound_method %int_4, %impl.elem0.loc14_26 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc14_26: = specific_function %bound_method.loc14_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %specific_fn.loc14_26(%int_4) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc14_26.2: init %i32 = converted %int_4, %int.convert_checked.loc14_26 [template = constants.%int_4.940] // CHECK:STDOUT: %.loc14_35.2: ref %Base = class_element_access %return, element0 // CHECK:STDOUT: %.loc14_26.3: ref %i32 = class_element_access %.loc14_35.2, element0 // CHECK:STDOUT: %.loc14_26.4: init %i32 = initialize_from %.loc14_26.2 to %.loc14_26.3 [template = constants.%int_4.940] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_35: = bound_method %int_7, %impl.elem0.loc14_35 [template = constants.%Convert.bound.208] -// CHECK:STDOUT: %Convert.specific_fn.loc14_35: = specific_function %Convert.bound.loc14_35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c12] -// CHECK:STDOUT: %int.convert_checked.loc14_35: init %i32 = call %Convert.specific_fn.loc14_35(%int_7) [template = constants.%int_7.0b1] +// CHECK:STDOUT: %impl.elem0.loc14_35: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_35: = bound_method %int_7, %impl.elem0.loc14_35 [template = constants.%Convert.bound.208] +// CHECK:STDOUT: %specific_fn.loc14_35: = specific_function %bound_method.loc14_35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c12] +// CHECK:STDOUT: %int.convert_checked.loc14_35: init %i32 = call %specific_fn.loc14_35(%int_7) [template = constants.%int_7.0b1] // CHECK:STDOUT: %.loc14_35.4: init %i32 = converted %int_7, %int.convert_checked.loc14_35 [template = constants.%int_7.0b1] // CHECK:STDOUT: %.loc14_35.5: ref %i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc14_35.6: init %i32 = initialize_from %.loc14_35.4 to %.loc14_35.5 [template = constants.%int_7.0b1] diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index f8e0d302e38bd..9abc418e6d321 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -40,10 +40,13 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %complete_type.fd7: = complete_type_witness %struct_type.a [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -146,10 +149,10 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] // 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.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_13: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %.loc18_10, %.loc18_13 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index d13077666e3dc..8e1eb959eb412 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -42,10 +42,13 @@ fn Run() -> i32 { // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.0c1, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [template] @@ -165,10 +168,10 @@ 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.0c1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.940] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_4) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc26_18.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_4.940] // CHECK:STDOUT: %.loc26_18.2: %i32 = converted %int_4, %.loc26_18.1 [template = constants.%int_4.940] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref(%.loc26_18.2) diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index 713f0f329d787..1de0818c1d76a 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -78,10 +78,13 @@ fn ConvertInit() { // CHECK:STDOUT: %struct_type.base.b.bf0: type = struct_type {.base: %struct_type.a.a6c, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %struct_type.base.c.136: type = struct_type {.base: %struct_type.base.b.bf0, .c: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -320,10 +323,10 @@ fn ConvertInit() { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc38_57.1: %struct_type.base.c.136 = 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc38_39: = bound_method %int_1, %impl.elem0.loc38_39 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc38_39: = specific_function %Convert.bound.loc38_39, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc38_39: init %i32 = call %Convert.specific_fn.loc38_39(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc38_39: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc38_39: = bound_method %int_1, %impl.elem0.loc38_39 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc38_39: = specific_function %bound_method.loc38_39, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc38_39: init %i32 = call %specific_fn.loc38_39(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc38_39.2: init %i32 = converted %int_1, %int.convert_checked.loc38_39 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc38_57.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc38_57.3: ref %B = class_element_access %.loc38_57.2, element0 @@ -332,19 +335,19 @@ fn ConvertInit() { // CHECK:STDOUT: %.loc38_39.4: init %i32 = initialize_from %.loc38_39.2 to %.loc38_39.3 [template = constants.%int_1.5d2] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc38_48: = bound_method %int_2, %impl.elem0.loc38_48 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc38_48: = specific_function %Convert.bound.loc38_48, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc38_48: init %i32 = call %Convert.specific_fn.loc38_48(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc38_48: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc38_48: = bound_method %int_2, %impl.elem0.loc38_48 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc38_48: = specific_function %bound_method.loc38_48, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc38_48: init %i32 = call %specific_fn.loc38_48(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc38_48.4: init %i32 = converted %int_2, %int.convert_checked.loc38_48 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc38_48.5: ref %i32 = class_element_access %.loc38_57.3, element1 // CHECK:STDOUT: %.loc38_48.6: init %i32 = initialize_from %.loc38_48.4 to %.loc38_48.5 [template = constants.%int_2.ef8] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc38_57: = bound_method %int_3, %impl.elem0.loc38_57 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc38_57: = specific_function %Convert.bound.loc38_57, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc38_57: init %i32 = call %Convert.specific_fn.loc38_57(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc38_57: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc38_57: = bound_method %int_3, %impl.elem0.loc38_57 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc38_57: = specific_function %bound_method.loc38_57, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc38_57: init %i32 = call %specific_fn.loc38_57(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc38_57.5: init %i32 = converted %int_3, %int.convert_checked.loc38_57 [template = constants.%int_3.822] // CHECK:STDOUT: %.loc38_57.6: ref %i32 = class_element_access %.loc38_57.2, element1 // CHECK:STDOUT: %.loc38_57.7: init %i32 = initialize_from %.loc38_57.5 to %.loc38_57.6 [template = constants.%int_3.822] diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index f38b8956b9f93..053b46ca50440 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -43,10 +43,13 @@ class Class { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -95,10 +98,10 @@ class Class { // CHECK:STDOUT: %int_32.loc29: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_0, %impl.elem0.loc29 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc29: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc29: = bound_method %int_0, %impl.elem0.loc29 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc29: = specific_function %bound_method.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %specific_fn.loc29(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc29_24.1: %i32 = value_of_initializer %int.convert_checked.loc29 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc29_24.2: %i32 = converted %int_0, %.loc29_24.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %l: %i32 = bind_name l, %.loc29_24.2 @@ -110,10 +113,10 @@ class Class { // CHECK:STDOUT: %int_32.loc35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc35: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc35: = bound_method %int_1, %impl.elem0.loc35 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc35: = specific_function %Convert.bound.loc35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %Convert.specific_fn.loc35(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc35: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc35: = bound_method %int_1, %impl.elem0.loc35 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc35: = specific_function %bound_method.loc35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %specific_fn.loc35(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_22.1: %i32 = value_of_initializer %int.convert_checked.loc35 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_22.2: %i32 = converted %int_1, %.loc35_22.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %m: %i32 = bind_name m, %.loc35_22.2 diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index 0d5415844c391..c5010b21ee7ae 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -46,10 +46,13 @@ fn F() { // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: Core.IntLiteral} [template] // 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: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -109,10 +112,10 @@ 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.loc26, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1.loc26) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc26_18.2: init %i32 = converted %int_1.loc26, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc26_18.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc26_18.4: ref %i32 = class_element_access %.loc26_18.3, element0 diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 526f144d3f217..0c20187038917 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -45,10 +45,13 @@ fn F() { // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -123,18 +126,18 @@ fn F() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc26_33.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %Class.ref.loc26_38: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0.loc26_33.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc26_33.1: = bound_method %int_1, %impl.elem0.loc26_33.1 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc26_33.1: = specific_function %Convert.bound.loc26_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc26_33.1: init %i32 = call %Convert.specific_fn.loc26_33.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc26_33.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc26_33.1: = bound_method %int_1, %impl.elem0.loc26_33.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc26_33.1: = specific_function %bound_method.loc26_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc26_33.1: init %i32 = call %specific_fn.loc26_33.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc26_33.2: init %i32 = converted %int_1, %int.convert_checked.loc26_33.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc26_33.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc26_33.4: ref %i32 = class_element_access %.loc26_33.3, element0 // CHECK:STDOUT: %.loc26_33.5: init %i32 = initialize_from %.loc26_33.2 to %.loc26_33.4 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc26_33.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc26_33.2: = bound_method %int_2, %impl.elem0.loc26_33.2 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc26_33.2: = specific_function %Convert.bound.loc26_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc26_33.2: init %i32 = call %Convert.specific_fn.loc26_33.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc26_33.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc26_33.2: = bound_method %int_2, %impl.elem0.loc26_33.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc26_33.2: = specific_function %bound_method.loc26_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc26_33.2: init %i32 = call %specific_fn.loc26_33.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc26_33.6: init %i32 = converted %int_2, %int.convert_checked.loc26_33.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc26_33.7: ref %i32 = class_element_access %.loc26_33.3, element1 // CHECK:STDOUT: %.loc26_33.8: init %i32 = initialize_from %.loc26_33.6 to %.loc26_33.7 [template = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index f5c03d63dc49e..d3418da2b8f04 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -33,10 +33,13 @@ fn G() -> i32 { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -93,10 +96,10 @@ fn G() -> i32 { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.2: %i32 = converted %int_1, %.loc13_13.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc13_13.2 diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 3ab57d4c6e5cd..8f79357f7c1b9 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -33,10 +33,13 @@ fn Run() { // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -99,20 +102,20 @@ fn Run() { // CHECK:STDOUT: %j.ref.loc18: %Class.elem = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] // 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.5b8] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_1, %impl.elem0.loc18 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc18: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18: = bound_method %int_1, %impl.elem0.loc18 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %bound_method.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %specific_fn.loc18(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_7: init %i32 = converted %int_1, %int.convert_checked.loc18 [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %.loc18_4, %.loc18_7 // CHECK:STDOUT: %c.ref.loc19: ref %Class = name_ref c, %c // CHECK:STDOUT: %k.ref.loc19: %Class.elem = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] // 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.ecc] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc19: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc19: = specific_function %bound_method.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %specific_fn.loc19(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_7: init %i32 = converted %int_2, %int.convert_checked.loc19 [template = constants.%int_2.ef8] // CHECK:STDOUT: assign %.loc19_4, %.loc19_7 // CHECK:STDOUT: name_binding_decl { diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 645f5521bc753..14a5f4c070799 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -34,10 +34,13 @@ fn Test() { // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -100,20 +103,20 @@ fn Test() { // CHECK:STDOUT: %j.ref.loc18: %Class.elem = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] // 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.5b8] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_1, %impl.elem0.loc18 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc18: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18: = bound_method %int_1, %impl.elem0.loc18 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %bound_method.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %specific_fn.loc18(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_8: init %i32 = converted %int_1, %int.convert_checked.loc18 [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %.loc18_5, %.loc18_8 // CHECK:STDOUT: %cv.ref.loc19: ref %Class = name_ref cv, %cv // CHECK:STDOUT: %k.ref.loc19: %Class.elem = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] // 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.ecc] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc19: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc19: = specific_function %bound_method.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %specific_fn.loc19(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_8: init %i32 = converted %int_2, %int.convert_checked.loc19 [template = constants.%int_2.ef8] // CHECK:STDOUT: assign %.loc19_5, %.loc19_8 // CHECK:STDOUT: name_binding_decl { diff --git a/toolchain/check/testdata/class/generic/adapt.carbon b/toolchain/check/testdata/class/generic/adapt.carbon index 6dc089e6c72e8..99d2829baf8bd 100644 --- a/toolchain/check/testdata/class/generic/adapt.carbon +++ b/toolchain/check/testdata/class/generic/adapt.carbon @@ -293,6 +293,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Main.import_ref.f6b: type = import_ref Main//adapt_specific_type, loc4_9, loaded [symbolic = @C.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.b5f: = import_ref Main//adapt_specific_type, loc6_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.433)] // CHECK:STDOUT: %Main.import_ref.4c0 = import_ref Main//adapt_specific_type, inst27 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.262: @C.%C.elem (%C.elem.66c) = import_ref Main//adapt_specific_type, loc5_8, loaded [template = %.22b] @@ -333,7 +334,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: .Self = imports.%Main.import_ref.feb // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%T: type) [from "adapt_specific_type.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Main.import_ref.f6b: type) [from "adapt_specific_type.carbon"] { // 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: @@ -660,6 +661,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Main.import_ref.f6b: type = import_ref Main//extend_adapt_specific_type_library, loc7_9, loaded [symbolic = @C.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.b5f: = import_ref Main//extend_adapt_specific_type_library, loc9_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.433)] // CHECK:STDOUT: %Main.import_ref.4c0 = import_ref Main//extend_adapt_specific_type_library, inst27 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.262: @C.%C.elem (%C.elem.66c) = import_ref Main//extend_adapt_specific_type_library, loc8_8, loaded [template = %.22b] @@ -701,7 +703,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: extend imports.%Main.import_ref.19d12e.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%T: type) [from "extend_adapt_specific_type_library.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Main.import_ref.f6b: type) [from "extend_adapt_specific_type_library.carbon"] { // 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: @@ -890,6 +892,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Main.import_ref.f6b: type = import_ref Main//adapt_generic_type, loc4_15, loaded [symbolic = @Adapter.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.fb3: = import_ref Main//adapt_generic_type, loc6_1, loaded [symbolic = @Adapter.%complete_type (constants.%complete_type.f87)] // CHECK:STDOUT: %Main.import_ref.9a3 = import_ref Main//adapt_generic_type, inst27 [no loc], unloaded // CHECK:STDOUT: } @@ -945,7 +948,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Adapter(constants.%T: type) [from "adapt_generic_type.carbon"] { +// CHECK:STDOUT: generic class @Adapter(imports.%Main.import_ref.f6b: type) [from "adapt_generic_type.carbon"] { // 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: diff --git a/toolchain/check/testdata/class/generic/base_is_generic.carbon b/toolchain/check/testdata/class/generic/base_is_generic.carbon index ead8740d38ffd..eb3f29186f19c 100644 --- a/toolchain/check/testdata/class/generic/base_is_generic.carbon +++ b/toolchain/check/testdata/class/generic/base_is_generic.carbon @@ -283,11 +283,12 @@ fn H() { // CHECK:STDOUT: %Main.import_ref.e8d: = import_ref Main//extend_generic_base, loc10_1, loaded [template = constants.%complete_type.09d] // CHECK:STDOUT: %Main.import_ref.446 = import_ref Main//extend_generic_base, inst45 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.a92: %Param.elem = import_ref Main//extend_generic_base, loc9_8, loaded [template = %.be7] +// CHECK:STDOUT: %Main.import_ref.f6b: type = import_ref Main//extend_generic_base, loc4_17, loaded [symbolic = @Base.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.b5f: = import_ref Main//extend_generic_base, loc6_1, loaded [symbolic = @Base.%complete_type (constants.%complete_type.433)] // CHECK:STDOUT: %Main.import_ref.8e0 = import_ref Main//extend_generic_base, inst27 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.7f7: @Base.%Base.elem (%Base.elem.9af) = import_ref Main//extend_generic_base, loc5_8, loaded [template = %.e66] // CHECK:STDOUT: %Main.import_ref.bd0: = import_ref Main//extend_generic_base, loc14_1, loaded [template = constants.%complete_type.b07] -// CHECK:STDOUT: %Main.import_ref.f6c = import_ref Main//extend_generic_base, inst82 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.f6c = import_ref Main//extend_generic_base, inst83 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.d24 = import_ref Main//extend_generic_base, loc13_27, unloaded // CHECK:STDOUT: %Main.import_ref.77a301.2: type = import_ref Main//extend_generic_base, loc13_26, loaded [template = constants.%Base.7a8] // CHECK:STDOUT: } @@ -336,7 +337,7 @@ fn H() { // CHECK:STDOUT: .y = imports.%Main.import_ref.a92 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Base(constants.%T: type) [from "extend_generic_base.carbon"] { +// CHECK:STDOUT: generic class @Base(imports.%Main.import_ref.f6b: type) [from "extend_generic_base.carbon"] { // 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: @@ -785,13 +786,16 @@ fn H() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Main.import_ref.86d684.1: type = import_ref Main//extend_generic_symbolic_base, loc4_14, loaded [symbolic = @X.%U (constants.%U)] // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//extend_generic_symbolic_base, loc6_1, loaded [template = constants.%complete_type.357] // CHECK:STDOUT: %Main.import_ref.e8e = import_ref Main//extend_generic_symbolic_base, inst27 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.b8a: @X.%G.type (%G.type.56f312.1) = import_ref Main//extend_generic_symbolic_base, loc5_15, loaded [symbolic = @X.%G (constants.%G.b504c4.1)] +// CHECK:STDOUT: %Main.import_ref.f6b: type = import_ref Main//extend_generic_symbolic_base, loc8_9, loaded [symbolic = @C.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.93f: = import_ref Main//extend_generic_symbolic_base, loc10_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.768)] // CHECK:STDOUT: %Main.import_ref.4c0 = import_ref Main//extend_generic_symbolic_base, inst68 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.65d = import_ref Main//extend_generic_symbolic_base, loc9_20, unloaded // CHECK:STDOUT: %Main.import_ref.561eb2.2: type = import_ref Main//extend_generic_symbolic_base, loc9_19, loaded [symbolic = @C.%X (constants.%X.75b6d8.2)] +// CHECK:STDOUT: %Main.import_ref.86d684.2: type = import_ref Main//extend_generic_symbolic_base, loc4_14, loaded [symbolic = @X.%U (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -807,7 +811,7 @@ fn H() { // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%T: type) [from "extend_generic_symbolic_base.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Main.import_ref.f6b: type) [from "extend_generic_symbolic_base.carbon"] { // 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: @@ -829,7 +833,7 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @X(constants.%U: type) [from "extend_generic_symbolic_base.carbon"] { +// CHECK:STDOUT: generic class @X(imports.%Main.import_ref.86d684.1: type) [from "extend_generic_symbolic_base.carbon"] { // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt (constants.%U.patt)] // CHECK:STDOUT: @@ -869,7 +873,7 @@ fn H() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(constants.%U: type) [from "extend_generic_symbolic_base.carbon"] { +// CHECK:STDOUT: generic fn @G(imports.%Main.import_ref.86d684.2: type) [from "extend_generic_symbolic_base.carbon"] { // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 0c43439d93285..d016d5c8a28fc 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -103,10 +103,13 @@ class Outer(T:! type) { // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [template] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.ba9: = specific_function %Convert.bound.4e6, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [template] @@ -161,10 +164,10 @@ class Outer(T:! type) { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.235] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.64b] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_5, %impl.elem0.loc6 [template = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_5) [template = constants.%int_5.0f6] +// CHECK:STDOUT: %impl.elem0.loc6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6: = bound_method %int_5, %impl.elem0.loc6 [template = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %bound_method.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %specific_fn.loc6(%int_5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_21.2: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_21.3: %i32 = converted %int_5, %.loc6_21.2 [template = constants.%int_5.0f6] // CHECK:STDOUT: %Class.loc6: type = class_type @Class, @Class(constants.%ptr.235, constants.%int_5.0f6) [template = constants.%Class.f29] @@ -180,10 +183,10 @@ class Outer(T:! type) { // CHECK:STDOUT: %.loc9_15: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // CHECK:STDOUT: %.loc9_19.2: type = converted %.loc9_15, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_0, %impl.elem0.loc9 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.specific_fn.loc9(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc9: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc9: = bound_method %int_0, %impl.elem0.loc9 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc9: = specific_function %bound_method.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %specific_fn.loc9(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_19.3: %i32 = value_of_initializer %int.convert_checked.loc9 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_19.4: %i32 = converted %int_0, %.loc9_19.3 [template = constants.%int_0.6a9] // CHECK:STDOUT: %Class.loc9: type = class_type @Class, @Class(constants.%empty_tuple.type, constants.%int_0.6a9) [template = constants.%Class.dd4] diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index 9e8baa7e733fa..73383b7b72a38 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -60,10 +60,13 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: %iN.builtin.c5d} [symbolic] // CHECK:STDOUT: %complete_type.547: = complete_type_witness %struct_type.base.n [symbolic] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -135,10 +138,10 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %.loc15_13: type = splice_block %ptr.loc15 [template = constants.%ptr.b65] { // 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_12.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_12.2: %i32 = converted %int_0, %.loc15_12.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %A: type = class_type @A, @A(constants.%int_0.6a9) [template = constants.%A.6fc] diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index bb48c1604d8c9..629a92edfa6af 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -103,10 +103,13 @@ class Class(U:! type) { // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] // CHECK:STDOUT: %complete_type.54b: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -207,10 +210,10 @@ class Class(U:! type) { // CHECK:STDOUT: fn() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_0, %.loc8_27.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc8_27.2 @@ -274,10 +277,13 @@ class Class(U:! type) { // CHECK:STDOUT: %F.971: %F.type.0aa = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.n.44a: type = struct_type {.n: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.847: = impl_witness (imports.%Main.import_ref.773), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [template] +// CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.4cb [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [template] @@ -292,10 +298,13 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//foo, loc4_13, loaded [symbolic = @Class.%T.1 (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//foo, loc6_21, loaded [symbolic = @CompleteClass.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.eb1: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type.a68] // CHECK:STDOUT: %Main.import_ref.3c0 = import_ref Main//foo, inst37 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.051 = import_ref Main//foo, loc7_8, unloaded // CHECK:STDOUT: %Main.import_ref.570 = import_ref Main//foo, loc8_17, unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//foo, loc6_21, loaded [symbolic = @CompleteClass.%T (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -328,7 +337,7 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(constants.%T: type) { +// CHECK:STDOUT: generic class @Class(imports.%Main.import_ref.f6b058.1: type) { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T, 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.1 (constants.%T.patt)] // CHECK:STDOUT: @@ -354,7 +363,7 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @CompleteClass(constants.%T: type) [from "foo.carbon"] { +// CHECK:STDOUT: generic class @CompleteClass(imports.%Main.import_ref.f6b058.2: type) [from "foo.carbon"] { // 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: @@ -374,7 +383,7 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%T: type) [from "foo.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.3: type) [from "foo.carbon"] { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %i32; @@ -384,10 +393,10 @@ class Class(U:! type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc9_17.1: %struct_type.n.44a = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] -// 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.47b] +// CHECK:STDOUT: %impl.elem0: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_17.2: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.47b] // 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.47b] @@ -466,10 +475,12 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//foo, loc6_21, loaded [symbolic = @CompleteClass.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.eb1: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type.54b] // CHECK:STDOUT: %Main.import_ref.3c0 = import_ref Main//foo, inst37 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.e76: @CompleteClass.%CompleteClass.elem (%CompleteClass.elem.28a) = import_ref Main//foo, loc7_8, loaded [template = %.364] // CHECK:STDOUT: %Main.import_ref.a52: @CompleteClass.%F.type (%F.type.14f) = import_ref Main//foo, loc8_17, loaded [symbolic = @CompleteClass.%F (constants.%F.874)] +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//foo, loc6_21, loaded [symbolic = @CompleteClass.%T (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -503,7 +514,7 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @CompleteClass(constants.%T: type) [from "foo.carbon"] { +// CHECK:STDOUT: generic class @CompleteClass(imports.%Main.import_ref.f6b058.1: type) [from "foo.carbon"] { // 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: @@ -551,7 +562,7 @@ class Class(U:! type) { // CHECK:STDOUT: return %.loc7_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%T: type) [from "foo.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.2: type) [from "foo.carbon"] { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %i32; @@ -654,10 +665,12 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//foo, loc6_21, loaded [symbolic = @CompleteClass.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.eb1: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type.a68] // CHECK:STDOUT: %Main.import_ref.3c0 = import_ref Main//foo, inst37 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.051 = import_ref Main//foo, loc7_8, unloaded // CHECK:STDOUT: %Main.import_ref.570 = import_ref Main//foo, loc8_17, unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//foo, loc6_21, loaded [symbolic = @CompleteClass.%T (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -673,7 +686,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @CompleteClass(constants.%T: type) [from "foo.carbon"] { +// CHECK:STDOUT: generic class @CompleteClass(imports.%Main.import_ref.f6b058.1: type) [from "foo.carbon"] { // 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: @@ -716,7 +729,7 @@ class Class(U:! type) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%T: type) [from "foo.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.2: type) [from "foo.carbon"] { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %i32; @@ -783,6 +796,7 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Main.import_ref.f6b: type = import_ref Main//foo, loc4_13, loaded [symbolic = @Class.%T (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -804,7 +818,7 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(constants.%T: type) [from "foo.carbon"] { +// CHECK:STDOUT: generic class @Class(imports.%Main.import_ref.f6b: type) [from "foo.carbon"] { // 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: diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index f12a7b9caf23b..32ff98464d904 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -336,10 +336,13 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_123.fff, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [template] @@ -381,10 +384,10 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %.loc13_13.1: type = splice_block %C [template = constants.%C.4c3] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [template = constants.%int_123.fff] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_123, %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_123) [template = constants.%int_123.f7f] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_123, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_123) [template = constants.%int_123.f7f] // CHECK:STDOUT: %.loc13_13.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_123.f7f] // CHECK:STDOUT: %.loc13_13.3: %i32 = converted %int_123, %.loc13_13.2 [template = constants.%int_123.f7f] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_123.f7f) [template = constants.%C.4c3] @@ -446,10 +449,13 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -504,18 +510,18 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc25_25.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc25_25.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc25_25.1: = bound_method %int_1, %impl.elem0.loc25_25.1 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc25_25.1: = specific_function %Convert.bound.loc25_25.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc25_25.1: init %i32 = call %Convert.specific_fn.loc25_25.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc25_25.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc25_25.1: = bound_method %int_1, %impl.elem0.loc25_25.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc25_25.1: = specific_function %bound_method.loc25_25.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc25_25.1: init %i32 = call %specific_fn.loc25_25.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc25_25.2: init %i32 = converted %int_1, %int.convert_checked.loc25_25.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc25_25.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc25_25.4: ref %i32 = class_element_access %.loc25_25.3, element0 // CHECK:STDOUT: %.loc25_25.5: init %i32 = initialize_from %.loc25_25.2 to %.loc25_25.4 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc25_25.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc25_25.2: = bound_method %int_2, %impl.elem0.loc25_25.2 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc25_25.2: = specific_function %Convert.bound.loc25_25.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc25_25.2: init %i32 = call %Convert.specific_fn.loc25_25.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc25_25.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc25_25.2: = bound_method %int_2, %impl.elem0.loc25_25.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc25_25.2: = specific_function %bound_method.loc25_25.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc25_25.2: init %i32 = call %specific_fn.loc25_25.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_25.6: init %i32 = converted %int_2, %int.convert_checked.loc25_25.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_25.7: ref %i32 = class_element_access %.loc25_25.3, element1 // CHECK:STDOUT: %.loc25_25.8: init %i32 = initialize_from %.loc25_25.6 to %.loc25_25.7 [template = constants.%int_2.ef8] @@ -570,18 +576,18 @@ 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.0c1] // CHECK:STDOUT: %.loc25_53.1: %struct_type.a.b.cfd = struct_literal (%int_3, %int_4) // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %impl.elem0.loc25_53.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc25_53.1: = bound_method %int_3, %impl.elem0.loc25_53.1 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc25_53.1: = specific_function %Convert.bound.loc25_53.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc25_53.1: init %i32 = call %Convert.specific_fn.loc25_53.1(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc25_53.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc25_53.1: = bound_method %int_3, %impl.elem0.loc25_53.1 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc25_53.1: = specific_function %bound_method.loc25_53.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc25_53.1: init %i32 = call %specific_fn.loc25_53.1(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc25_53.2: init %i32 = converted %int_3, %int.convert_checked.loc25_53.1 [template = constants.%int_3.822] // CHECK:STDOUT: %.loc25_53.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc25_53.4: ref %i32 = class_element_access %.loc25_53.3, element0 // CHECK:STDOUT: %.loc25_53.5: init %i32 = initialize_from %.loc25_53.2 to %.loc25_53.4 [template = constants.%int_3.822] -// CHECK:STDOUT: %impl.elem0.loc25_53.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc25_53.2: = bound_method %int_4, %impl.elem0.loc25_53.2 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc25_53.2: = specific_function %Convert.bound.loc25_53.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc25_53.2: init %i32 = call %Convert.specific_fn.loc25_53.2(%int_4) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc25_53.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc25_53.2: = bound_method %int_4, %impl.elem0.loc25_53.2 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc25_53.2: = specific_function %bound_method.loc25_53.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc25_53.2: init %i32 = call %specific_fn.loc25_53.2(%int_4) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc25_53.6: init %i32 = converted %int_4, %int.convert_checked.loc25_53.2 [template = constants.%int_4.940] // CHECK:STDOUT: %.loc25_53.7: ref %i32 = class_element_access %.loc25_53.3, element1 // CHECK:STDOUT: %.loc25_53.8: init %i32 = initialize_from %.loc25_53.6 to %.loc25_53.7 [template = constants.%int_4.940] diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 8f8473a65d26d..e80d9376be0eb 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -169,10 +169,13 @@ fn Run() { // CHECK:STDOUT: %complete_type.c07: = complete_type_witness %struct_type.x.767 [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.x.c96: type = struct_type {.x: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.9ba: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.6da: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.b97: = impl_witness (imports.%Core.import_ref.a86), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.ed5: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.16d: %Convert.type.ed5 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, %impl_witness.b97 [template] +// CHECK:STDOUT: %.39b: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.43e: = bound_method %int_1.5b8, %Convert.16d [template] // CHECK:STDOUT: %Convert.specific_fn.c37: = specific_function %Convert.bound.43e, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [template] @@ -209,11 +212,11 @@ fn Run() { // CHECK:STDOUT: %Main.import_ref.845 = import_ref Main//a, inst21 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.4d2: %Field.elem = import_ref Main//a, loc8_8, loaded [template = %.d33] // CHECK:STDOUT: %Main.import_ref.8f24d3.2: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.357] -// CHECK:STDOUT: %Main.import_ref.39e731.1 = import_ref Main//a, inst59 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.39e731.1 = import_ref Main//a, inst60 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.760: %F.type = import_ref Main//a, loc14_21, loaded [template = constants.%F] // CHECK:STDOUT: %Main.import_ref.26e: %G.type = import_ref Main//a, loc15_27, loaded [template = constants.%G] // CHECK:STDOUT: %Main.import_ref.8f24d3.3: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.357] -// CHECK:STDOUT: %Main.import_ref.39e731.2 = import_ref Main//a, inst59 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.39e731.2 = import_ref Main//a, inst60 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.42a = import_ref Main//a, loc14_21, unloaded // CHECK:STDOUT: %Main.import_ref.67a = import_ref Main//a, loc15_27, unloaded // CHECK:STDOUT: } @@ -287,10 +290,10 @@ fn Run() { // CHECK:STDOUT: %b.var: ref %Field = var b // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc9_25.1: %struct_type.x.c96 = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.6da = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] -// CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_1, %impl.elem0.loc9 [template = constants.%Convert.bound.43e] -// CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c37] -// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.specific_fn.loc9(%int_1) [template = constants.%int_1.47b] +// CHECK:STDOUT: %impl.elem0.loc9: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] +// CHECK:STDOUT: %bound_method.loc9: = bound_method %int_1, %impl.elem0.loc9 [template = constants.%Convert.bound.43e] +// CHECK:STDOUT: %specific_fn.loc9: = specific_function %bound_method.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c37] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %specific_fn.loc9(%int_1) [template = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_25.2: init %i32 = converted %int_1, %int.convert_checked.loc9 [template = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_25.3: ref %i32 = class_element_access %b.var, element0 // CHECK:STDOUT: %.loc9_25.4: init %i32 = initialize_from %.loc9_25.2 to %.loc9_25.3 [template = constants.%int_1.47b] @@ -303,10 +306,10 @@ fn Run() { // CHECK:STDOUT: %x.ref: %Field.elem = name_ref x, imports.%Main.import_ref.4d2 [template = imports.%.d33] // 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.ecc] -// CHECK:STDOUT: %impl.elem0.loc10: %Convert.type.6da = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] -// CHECK:STDOUT: %Convert.bound.loc10: = bound_method %int_2, %impl.elem0.loc10 [template = constants.%Convert.bound.918] -// CHECK:STDOUT: %Convert.specific_fn.loc10: = specific_function %Convert.bound.loc10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5a4] -// CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %Convert.specific_fn.loc10(%int_2) [template = constants.%int_2.d0d] +// CHECK:STDOUT: %impl.elem0.loc10: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] +// CHECK:STDOUT: %bound_method.loc10: = bound_method %int_2, %impl.elem0.loc10 [template = constants.%Convert.bound.918] +// CHECK:STDOUT: %specific_fn.loc10: = specific_function %bound_method.loc10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5a4] +// CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %specific_fn.loc10(%int_2) [template = constants.%int_2.d0d] // CHECK:STDOUT: %.loc10_7: init %i32 = converted %int_2, %int.convert_checked.loc10 [template = constants.%int_2.d0d] // CHECK:STDOUT: assign %.loc10_4, %.loc10_7 // CHECK:STDOUT: name_binding_decl { @@ -358,5 +361,5 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared.7b34f2.1]() [from "a.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr .inst1076: %ptr.6cf]() [from "a.carbon"]; +// CHECK:STDOUT: fn @G[addr .inst1129: %ptr.6cf]() [from "a.carbon"]; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index bb81999f23634..a21ff788a4b4b 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -146,10 +146,13 @@ fn Run() { // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.x.unused.c45: type = struct_type {.x: Core.IntLiteral, .unused: Core.IntLiteral} [template] // CHECK:STDOUT: %struct_type.base.6c7: type = struct_type {.base: %struct_type.x.unused.c45} [template] +// CHECK:STDOUT: %ImplicitAs.type.9ba: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.6da: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.b97: = impl_witness (imports.%Core.import_ref.a86), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.ed5: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.16d: %Convert.type.ed5 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, %impl_witness.b97 [template] +// CHECK:STDOUT: %.39b: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.9aa: = bound_method %int_0.5c6, %Convert.16d [template] // CHECK:STDOUT: %Convert.specific_fn.bae: = specific_function %Convert.bound.9aa, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.263: %i32 = int_value 0 [template] @@ -182,7 +185,7 @@ fn Run() { // CHECK:STDOUT: %Main.import_ref.e67: %Base.elem = import_ref Main//a, loc8_8, loaded [template = %.720] // CHECK:STDOUT: %Main.import_ref.2e4 = import_ref Main//a, loc9_13, unloaded // CHECK:STDOUT: %Main.import_ref.c5f: = import_ref Main//a, loc14_1, loaded [template = constants.%complete_type.15c] -// CHECK:STDOUT: %Main.import_ref.9a9 = import_ref Main//a, inst76 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.9a9 = import_ref Main//a, inst77 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.7e5 = import_ref Main//a, loc13_20, unloaded // CHECK:STDOUT: %Main.import_ref.a21640.2: type = import_ref Main//a, loc13_16, loaded [template = constants.%Base] // CHECK:STDOUT: } @@ -230,18 +233,18 @@ fn Run() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc7_47.1: %struct_type.x.unused.c45 = struct_literal (%int_0, %int_1) // CHECK:STDOUT: %.loc7_48.1: %struct_type.base.6c7 = struct_literal (%.loc7_47.1) -// CHECK:STDOUT: %impl.elem0.loc7_47.1: %Convert.type.6da = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] -// CHECK:STDOUT: %Convert.bound.loc7_47.1: = bound_method %int_0, %impl.elem0.loc7_47.1 [template = constants.%Convert.bound.9aa] -// 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.bae] -// CHECK:STDOUT: %int.convert_checked.loc7_47.1: init %i32 = call %Convert.specific_fn.loc7_47.1(%int_0) [template = constants.%int_0.263] +// CHECK:STDOUT: %impl.elem0.loc7_47.1: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] +// CHECK:STDOUT: %bound_method.loc7_47.1: = bound_method %int_0, %impl.elem0.loc7_47.1 [template = constants.%Convert.bound.9aa] +// CHECK:STDOUT: %specific_fn.loc7_47.1: = specific_function %bound_method.loc7_47.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.bae] +// CHECK:STDOUT: %int.convert_checked.loc7_47.1: init %i32 = call %specific_fn.loc7_47.1(%int_0) [template = constants.%int_0.263] // CHECK:STDOUT: %.loc7_47.2: init %i32 = converted %int_0, %int.convert_checked.loc7_47.1 [template = constants.%int_0.263] // 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.263] -// CHECK:STDOUT: %impl.elem0.loc7_47.2: %Convert.type.6da = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] -// CHECK:STDOUT: %Convert.bound.loc7_47.2: = bound_method %int_1, %impl.elem0.loc7_47.2 [template = constants.%Convert.bound.43e] -// 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.c37] -// CHECK:STDOUT: %int.convert_checked.loc7_47.2: init %i32 = call %Convert.specific_fn.loc7_47.2(%int_1) [template = constants.%int_1.47b] +// CHECK:STDOUT: %impl.elem0.loc7_47.2: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] +// CHECK:STDOUT: %bound_method.loc7_47.2: = bound_method %int_1, %impl.elem0.loc7_47.2 [template = constants.%Convert.bound.43e] +// CHECK:STDOUT: %specific_fn.loc7_47.2: = specific_function %bound_method.loc7_47.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c37] +// CHECK:STDOUT: %int.convert_checked.loc7_47.2: init %i32 = call %specific_fn.loc7_47.2(%int_1) [template = constants.%int_1.47b] // CHECK:STDOUT: %.loc7_47.5: init %i32 = converted %int_1, %int.convert_checked.loc7_47.2 [template = constants.%int_1.47b] // CHECK:STDOUT: %.loc7_47.6: ref %i32 = class_element_access %.loc7_48.2, element1 // CHECK:STDOUT: %.loc7_47.7: init %i32 = initialize_from %.loc7_47.5 to %.loc7_47.6 [template = constants.%int_1.47b] @@ -258,10 +261,10 @@ 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.ecc] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.6da = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] -// CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_2, %impl.elem0.loc8 [template = constants.%Convert.bound.918] -// CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5a4] -// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_2) [template = constants.%int_2.d0d] +// CHECK:STDOUT: %impl.elem0.loc8: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [template = constants.%Convert.16d] +// CHECK:STDOUT: %bound_method.loc8: = bound_method %int_2, %impl.elem0.loc8 [template = constants.%Convert.bound.918] +// CHECK:STDOUT: %specific_fn.loc8: = specific_function %bound_method.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5a4] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %specific_fn.loc8(%int_2) [template = constants.%int_2.d0d] // CHECK:STDOUT: %.loc8_7: init %i32 = converted %int_2, %int.convert_checked.loc8 [template = constants.%int_2.d0d] // CHECK:STDOUT: assign %.loc8_4.3, %.loc8_7 // CHECK:STDOUT: %a.ref.loc9: ref %Child = name_ref a, %a diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index 45ad785fe5946..2485728828e11 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -469,10 +469,13 @@ class B { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.64b, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [template] @@ -519,10 +522,10 @@ class B { // 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: } -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.0f6] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_38.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_38.2: %i32 = converted %int_5, %.loc5_38.1 [template = constants.%int_5.0f6] // CHECK:STDOUT: %SOME_CONSTANT: %i32 = bind_name SOME_CONSTANT, %.loc5_38.2 @@ -579,10 +582,10 @@ class B { // CHECK:STDOUT: fn @SomeProtectedFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.64b] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.0f6] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc7_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc7_13.2: %i32 = converted %int_5, %.loc7_13.1 [template = constants.%int_5.0f6] // CHECK:STDOUT: return %.loc7_13.2 @@ -946,10 +949,13 @@ class B { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.64b, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [template] @@ -997,10 +1003,10 @@ class B { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.0f6] +// CHECK:STDOUT: %impl.elem0.loc5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %bound_method.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %specific_fn.loc5(%int_5.loc5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_48.1: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_48.2: %i32 = converted %int_5.loc5, %.loc5_48.1 [template = constants.%int_5.0f6] // CHECK:STDOUT: %SOME_PROTECTED_CONSTANT: %i32 = bind_name SOME_PROTECTED_CONSTANT, %.loc5_48.2 @@ -1012,10 +1018,10 @@ class B { // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.0f6] +// CHECK:STDOUT: %impl.elem0.loc6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %bound_method.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %specific_fn.loc6(%int_5.loc6) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_44.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_44.2: %i32 = converted %int_5.loc6, %.loc6_44.1 [template = constants.%int_5.0f6] // CHECK:STDOUT: %SOME_PRIVATE_CONSTANT: %i32 = bind_name SOME_PRIVATE_CONSTANT, %.loc6_44.2 @@ -1037,10 +1043,10 @@ class B { // 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: } -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.0f6] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc10_42.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc10_42.2: %i32 = converted %int_5, %.loc10_42.1 [template = constants.%int_5.0f6] // CHECK:STDOUT: %INTERNAL_CONSTANT: %i32 = bind_name INTERNAL_CONSTANT, %.loc10_42.2 diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index c62eff1b016d0..cc02e5b9a3936 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -31,10 +31,13 @@ fn F() -> i32 { // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -98,18 +101,18 @@ fn F() -> i32 { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc17_26.1: %struct_type.a.b.cfd = 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_26.1: = bound_method %int_1, %impl.elem0.loc17_26.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc17_26.1: init %i32 = call %Convert.specific_fn.loc17_26.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc17_26.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_26.1: = bound_method %int_1, %impl.elem0.loc17_26.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc17_26.1: = specific_function %bound_method.loc17_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc17_26.1: init %i32 = call %specific_fn.loc17_26.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_26.2: init %i32 = converted %int_1, %int.convert_checked.loc17_26.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc17_26.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_26.2: = bound_method %int_2, %impl.elem0.loc17_26.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc17_26.2: init %i32 = call %Convert.specific_fn.loc17_26.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc17_26.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_26.2: = bound_method %int_2, %impl.elem0.loc17_26.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc17_26.2: = specific_function %bound_method.loc17_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc17_26.2: init %i32 = call %specific_fn.loc17_26.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_26.6: init %i32 = converted %int_2, %int.convert_checked.loc17_26.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_26.7: ref %i32 = class_element_access %.loc17_26.3, element1 // CHECK:STDOUT: %.loc17_26.8: init %i32 = initialize_from %.loc17_26.6 to %.loc17_26.7 [template = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/class/local.carbon b/toolchain/check/testdata/class/local.carbon index 6f466cf8c7a2c..0fcf31d248554 100644 --- a/toolchain/check/testdata/class/local.carbon +++ b/toolchain/check/testdata/class/local.carbon @@ -41,10 +41,13 @@ class A { // CHECK:STDOUT: %complete_type.54b: = complete_type_witness %struct_type.n.033 [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.n.44a: type = struct_type {.n: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -132,10 +135,10 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc15_39.1: %struct_type.n.44a = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_39.2: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_39.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc15_39.4: init %i32 = initialize_from %.loc15_39.2 to %.loc15_39.3 [template = constants.%int_1.5d2] diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 99417fb12e0fd..f75199f5e1592 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -80,10 +80,13 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %CallOnConstBoundMethod: %CallOnConstBoundMethod.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.k.240: type = struct_type {.k: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -338,10 +341,10 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc35_18.1: %struct_type.k.240 = struct_literal (%int_1) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_18.2: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_18.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc35_18.4: ref %i32 = class_element_access %.loc35_18.3, element0 diff --git a/toolchain/check/testdata/class/no_prelude/method_access.carbon b/toolchain/check/testdata/class/no_prelude/method_access.carbon new file mode 100644 index 0000000000000..17d3dce429bd5 --- /dev/null +++ b/toolchain/check/testdata/class/no_prelude/method_access.carbon @@ -0,0 +1,83 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/method_access.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/method_access.carbon + +// --- fail_multiple_bindings.carbon + +class X { + fn F[self: Self](); +} + +fn G(x: X) { + // TODO: Produce a better diagnostic for this case. + // CHECK:STDERR: fail_multiple_bindings.carbon:[[@LINE+4]]:3: error: member name of type `` in compound member access is not an instance member or an interface member [CompoundMemberAccessDoesNotUseBase] + // CHECK:STDERR: x.(x.F)(); + // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: + x.(x.F)(); +} + +// CHECK:STDOUT: --- fail_multiple_bindings.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %X: type = class_type @X [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [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] +// CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .X = %X.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %x.patt: %X = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %X = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %x.param: %X = value_param runtime_param0 +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %x: %X = bind_name x, %x.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @X { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %self.patt: %X = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %X = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: %X = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%X [template = constants.%X] +// CHECK:STDOUT: %self: %X = bind_name self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%X +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F[%self.param_patt: %X](); +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G(%x.param_patt: %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref.loc12_3: %X = name_ref x, %x +// CHECK:STDOUT: %x.ref.loc12_6: %X = name_ref x, %x +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, @X.%F.decl [template = constants.%F] +// CHECK:STDOUT: %F.bound: = bound_method %x.ref.loc12_6, %F.ref +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.bound(%x.ref.loc12_6) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index d2ff9b61aaa50..797118f5aa464 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -592,6 +592,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %Main.D: type = import_ref Main//two_file, D, loaded [template = constants.%C] // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//two_file, loc4_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//two_file, inst14 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.11fba2.1: %C = import_ref Main//two_file, loc7_11, loaded [symbolic = @Foo.%a.1 (constants.%a)] +// CHECK:STDOUT: %Main.import_ref.11fba2.2: %C = import_ref Main//two_file, loc8_11, loaded [symbolic = @Bar.%a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -628,7 +630,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = imports.%Main.import_ref.2c4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(constants.%a: %C) { +// CHECK:STDOUT: generic class @Foo(imports.%Main.import_ref.11fba2.1: %C) { // CHECK:STDOUT: %a.1: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.1 (constants.%a.patt)] // CHECK:STDOUT: @@ -643,7 +645,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Bar(constants.%a: %C) { +// CHECK:STDOUT: generic class @Bar(imports.%Main.import_ref.11fba2.2: %C) { // CHECK:STDOUT: %a.1: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.1 (constants.%a.patt)] // CHECK:STDOUT: @@ -981,6 +983,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %Main.C: type = import_ref Main//alias_two_file, C, loaded [template = constants.%C] // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//alias_two_file, loc4_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//alias_two_file, inst14 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.11f: %C = import_ref Main//alias_two_file, loc6_11, loaded [symbolic = @Foo.%a.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1010,7 +1013,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Self = imports.%Main.import_ref.2c4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(constants.%a: %C) { +// CHECK:STDOUT: generic class @Foo(imports.%Main.import_ref.11f: %C) { // CHECK:STDOUT: %a.1: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)] // CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.1 (constants.%a.patt)] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index 454133f882fb0..a1143274b2cac 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -31,10 +31,13 @@ class Class { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -99,10 +102,10 @@ class Class { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_13.2: %i32 = converted %int_1, %.loc17_13.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc17_13.2 diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index f69a93a905042..399fdd7dc7e24 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -80,10 +80,13 @@ class A { // CHECK:STDOUT: %complete_type.fd7: = complete_type_witness %struct_type.a.ba9 [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.a.a6c: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -213,10 +216,10 @@ class A { // CHECK:STDOUT: %a.var: ref %A = var a // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc29_25.1: %struct_type.a.a6c = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_1, %impl.elem0.loc29 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc29: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc29: = bound_method %int_1, %impl.elem0.loc29 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc29: = specific_function %bound_method.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %specific_fn.loc29(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc29_25.2: init %i32 = converted %int_1, %int.convert_checked.loc29 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc29_25.3: ref %i32 = class_element_access %a.var, element0 // CHECK:STDOUT: %.loc29_25.4: init %i32 = initialize_from %.loc29_25.2 to %.loc29_25.3 [template = constants.%int_1.5d2] @@ -232,10 +235,10 @@ class A { // CHECK:STDOUT: %b.var: ref %B = var b // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc30_25.1: %struct_type.b.a15 = struct_literal (%int_2) -// CHECK:STDOUT: %impl.elem0.loc30: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc30: = bound_method %int_2, %impl.elem0.loc30 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc30: = specific_function %Convert.bound.loc30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc30: init %i32 = call %Convert.specific_fn.loc30(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc30: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc30: = bound_method %int_2, %impl.elem0.loc30 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc30: = specific_function %bound_method.loc30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc30: init %i32 = call %specific_fn.loc30(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc30_25.2: init %i32 = converted %int_2, %int.convert_checked.loc30 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc30_25.3: ref %i32 = class_element_access %b.var, element0 // CHECK:STDOUT: %.loc30_25.4: init %i32 = initialize_from %.loc30_25.2 to %.loc30_25.3 [template = constants.%int_2.ef8] @@ -251,10 +254,10 @@ class A { // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc31_25.1: %struct_type.c.5b8 = struct_literal (%int_3) -// CHECK:STDOUT: %impl.elem0.loc31: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc31: = bound_method %int_3, %impl.elem0.loc31 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc31: = specific_function %Convert.bound.loc31, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc31: init %i32 = call %Convert.specific_fn.loc31(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc31: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc31: = bound_method %int_3, %impl.elem0.loc31 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc31: = specific_function %bound_method.loc31, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc31: init %i32 = call %specific_fn.loc31(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc31_25.2: init %i32 = converted %int_3, %int.convert_checked.loc31 [template = constants.%int_3.822] // CHECK:STDOUT: %.loc31_25.3: ref %i32 = class_element_access %c.var, element0 // CHECK:STDOUT: %.loc31_25.4: init %i32 = initialize_from %.loc31_25.2 to %.loc31_25.3 [template = constants.%int_3.822] @@ -270,10 +273,10 @@ class A { // CHECK:STDOUT: %d.var: ref %D = var d // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] // CHECK:STDOUT: %.loc32_25.1: %struct_type.d.3ea = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc32: = bound_method %int_4, %impl.elem0.loc32 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc32: = specific_function %Convert.bound.loc32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %Convert.specific_fn.loc32(%int_4) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc32: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc32: = bound_method %int_4, %impl.elem0.loc32 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc32: = specific_function %bound_method.loc32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %specific_fn.loc32(%int_4) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc32_25.2: init %i32 = converted %int_4, %int.convert_checked.loc32 [template = constants.%int_4.940] // CHECK:STDOUT: %.loc32_25.3: ref %i32 = class_element_access %d.var, element0 // CHECK:STDOUT: %.loc32_25.4: init %i32 = initialize_from %.loc32_25.2 to %.loc32_25.3 [template = constants.%int_4.940] diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 30c2093bd2a21..9002bcfbe9e0a 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -40,10 +40,13 @@ fn Run() { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -118,10 +121,10 @@ fn Run() { // CHECK:STDOUT: fn @F.1() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.2: %i32 = converted %int_1, %.loc13_13.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc13_13.2 @@ -139,10 +142,10 @@ fn Run() { // CHECK:STDOUT: fn @F.2() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_11.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_11.2: %i32 = converted %int_2, %.loc22_11.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: return %.loc22_11.2 diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index e690e9ef32636..bd7b5ff1ceb9f 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -52,10 +52,13 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %struct_type.base.b1e: type = struct_type {.base: %Base} [template] // CHECK:STDOUT: %complete_type.15c: = complete_type_witness %struct_type.base.b1e [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -198,10 +201,10 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] // 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.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc27_13: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %.loc27_10, %.loc27_13 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index d48da3b824a03..9430dafd26f0a 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -44,10 +44,13 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1000.ff9: Core.IntLiteral = int_value 1000 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.ff9, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1000.1b6: %i32 = int_value 1000 [template] @@ -94,10 +97,10 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc5_20.1: type = splice_block %C.loc5 [template = constants.%C.262] { // 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.ff9] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.1b6] +// CHECK:STDOUT: %impl.elem0.loc5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc5: = bound_method %int_1000.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %bound_method.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %specific_fn.loc5(%int_1000.loc5) [template = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc5_20.2: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc5_20.3: %i32 = converted %int_1000.loc5, %.loc5_20.2 [template = constants.%int_1000.1b6] // CHECK:STDOUT: %C.loc5: type = class_type @C, @C(constants.%int_1000.1b6) [template = constants.%C.262] @@ -112,10 +115,10 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc6_20.1: type = splice_block %C.loc6 [template = constants.%C.262] { // 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.ff9] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.1b6] +// CHECK:STDOUT: %impl.elem0.loc6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6: = bound_method %int_1000.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %bound_method.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %specific_fn.loc6(%int_1000.loc6) [template = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc6_20.2: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc6_20.3: %i32 = converted %int_1000.loc6, %.loc6_20.2 [template = constants.%int_1000.1b6] // CHECK:STDOUT: %C.loc6: type = class_type @C, @C(constants.%int_1000.1b6) [template = constants.%C.262] @@ -182,10 +185,13 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1000.ff9: Core.IntLiteral = int_value 1000 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.ff9, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1000.1b6: %i32 = int_value 1000 [template] @@ -234,10 +240,10 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc5_19.1: type = splice_block %C [template = constants.%C.262] { // 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.ff9] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.1b6] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1000) [template = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc5_19.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc5_19.3: %i32 = converted %int_1000, %.loc5_19.2 [template = constants.%int_1000.1b6] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.1b6) [template = constants.%C.262] @@ -252,10 +258,10 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc13_20.1: type = splice_block %C [template = constants.%C.262] { // 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.ff9] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.1b6] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1000) [template = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc13_20.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc13_20.3: %i32 = converted %int_1000, %.loc13_20.2 [template = constants.%int_1000.1b6] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.1b6) [template = constants.%C.262] diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index 8b8d53fe1324b..eb6783938b128 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -657,10 +657,13 @@ class Derived { // CHECK:STDOUT: %F.type.b25: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [template] @@ -729,10 +732,10 @@ class Derived { // CHECK:STDOUT: } // CHECK:STDOUT: %i.var: ref %i32 = var i // CHECK:STDOUT: %int_3.loc12: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_3.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_3.loc12) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_3.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_3.loc12) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_3.loc12, %int.convert_checked.loc12 [template = constants.%int_3.822] // CHECK:STDOUT: assign %i.var, %.loc12_3.2 // CHECK:STDOUT: %.loc12_10: type = splice_block %i32 [template = constants.%i32] { @@ -773,17 +776,17 @@ class Derived { // CHECK:STDOUT: %.loc15_35.2: ref %ptr.454 = class_element_access %b2.var, element0 // CHECK:STDOUT: %.loc15_35.3: ref %ptr.454 = vtable_ptr // CHECK:STDOUT: %.loc15_35.4: init %ptr.454 = initialize_from %.loc15_35.3 to %.loc15_35.2 -// CHECK:STDOUT: %impl.elem0.loc15_35.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15_35.1: = bound_method %int_5, %impl.elem0.loc15_35.1 [template = constants.%Convert.bound.4e6] -// 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.ba9] -// CHECK:STDOUT: %int.convert_checked.loc15_35.1: init %i32 = call %Convert.specific_fn.loc15_35.1(%int_5) [template = constants.%int_5.0f6] +// CHECK:STDOUT: %impl.elem0.loc15_35.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc15_35.1: = bound_method %int_5, %impl.elem0.loc15_35.1 [template = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc15_35.1: = specific_function %bound_method.loc15_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] +// CHECK:STDOUT: %int.convert_checked.loc15_35.1: init %i32 = call %specific_fn.loc15_35.1(%int_5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc15_35.5: init %i32 = converted %int_5, %int.convert_checked.loc15_35.1 [template = constants.%int_5.0f6] // 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.0f6] -// CHECK:STDOUT: %impl.elem0.loc15_35.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15_35.2: = bound_method %int_3.loc15, %impl.elem0.loc15_35.2 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc15_35.2: init %i32 = call %Convert.specific_fn.loc15_35.2(%int_3.loc15) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc15_35.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc15_35.2: = bound_method %int_3.loc15, %impl.elem0.loc15_35.2 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc15_35.2: = specific_function %bound_method.loc15_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc15_35.2: init %i32 = call %specific_fn.loc15_35.2(%int_3.loc15) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc15_35.8: init %i32 = converted %int_3.loc15, %int.convert_checked.loc15_35.2 [template = constants.%int_3.822] // CHECK:STDOUT: %.loc15_35.9: ref %i32 = class_element_access %b2.var, element1 // CHECK:STDOUT: %.loc15_35.10: init %i32 = initialize_from %.loc15_35.8 to %.loc15_35.9 [template = constants.%int_3.822] @@ -796,10 +799,10 @@ class Derived { // CHECK:STDOUT: %m2.ref: %Base.elem = name_ref m2, @Base.%.loc6_9 [template = @Base.%.loc6_9] // 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.0c1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_4, %impl.elem0.loc18 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_4) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc18: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18: = bound_method %int_4, %impl.elem0.loc18 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %bound_method.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %specific_fn.loc18(%int_4) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc18_9: init %i32 = converted %int_4, %int.convert_checked.loc18 [template = constants.%int_4.940] // CHECK:STDOUT: assign %.loc18_5, %.loc18_9 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index a92214427b3f3..4aa33811e4fd9 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -138,10 +138,13 @@ fn G() -> i32 { // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -229,10 +232,10 @@ fn G() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_43.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_43.2: %i32 = converted %int_0, %.loc6_43.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_44.1: ref @F.%array_type.loc6_24.2 (%array_type.743) = value_as_ref %a.ref @@ -315,10 +318,13 @@ fn G() -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %require_complete.d82: = require_complete_type %array_type.6a2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.41f: = bound_method %N, %Convert.956 [symbolic] // CHECK:STDOUT: %Convert.specific_fn.122: = specific_function %Convert.bound.41f, @Convert.2(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn.122(%N) [symbolic] @@ -414,17 +420,17 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type @F.%array_type.loc6_37.2 (%array_type.6a2) [symbolic = %require_complete (constants.%require_complete.d82)] -// CHECK:STDOUT: %Convert.bound.loc6_57.2: = bound_method %N.loc6_6.2, constants.%Convert.956 [symbolic = %Convert.bound.loc6_57.2 (constants.%Convert.bound.41f)] -// CHECK:STDOUT: %Convert.specific_fn.loc6_57.2: = specific_function %Convert.bound.loc6_57.2, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn.loc6_57.2 (constants.%Convert.specific_fn.122)] -// CHECK:STDOUT: %int.convert_checked.loc6_57.2: init %i32 = call %Convert.specific_fn.loc6_57.2(%N.loc6_6.2) [symbolic = %int.convert_checked.loc6_57.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.loc6_6.2, constants.%Convert.956 [symbolic = %Convert.bound (constants.%Convert.bound.41f)] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn.122)] +// CHECK:STDOUT: %int.convert_checked.loc6_57.2: init %i32 = call %Convert.specific_fn(%N.loc6_6.2) [symbolic = %int.convert_checked.loc6_57.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%a.param_patt: @F.%array_type.loc6_37.2 (%array_type.6a2)) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc6_56: Core.IntLiteral = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc6_57.1: = bound_method %N.ref.loc6_56, %impl.elem0 [symbolic = %Convert.bound.loc6_57.2 (constants.%Convert.bound.41f)] -// CHECK:STDOUT: %Convert.specific_fn.loc6_57.1: = specific_function %Convert.bound.loc6_57.1, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn.loc6_57.2 (constants.%Convert.specific_fn.122)] -// CHECK:STDOUT: %int.convert_checked.loc6_57.1: init %i32 = call %Convert.specific_fn.loc6_57.1(%N.ref.loc6_56) [symbolic = %int.convert_checked.loc6_57.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %N.ref.loc6_56, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound.41f)] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn.122)] +// CHECK:STDOUT: %int.convert_checked.loc6_57.1: init %i32 = call %specific_fn(%N.ref.loc6_56) [symbolic = %int.convert_checked.loc6_57.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc6_57.1: %i32 = value_of_initializer %int.convert_checked.loc6_57.1 [symbolic = %int.convert_checked.loc6_57.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc6_57.2: %i32 = converted %N.ref.loc6_56, %.loc6_57.1 [symbolic = %int.convert_checked.loc6_57.2 (constants.%int.convert_checked)] // CHECK:STDOUT: return %.loc6_57.2 @@ -486,8 +492,8 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1 -// CHECK:STDOUT: %Convert.bound.loc6_57.2 => constants.%Convert.bound.b30 -// CHECK:STDOUT: %Convert.specific_fn.loc6_57.2 => constants.%Convert.specific_fn.b42 +// CHECK:STDOUT: %Convert.bound => constants.%Convert.bound.b30 +// CHECK:STDOUT: %Convert.specific_fn => constants.%Convert.specific_fn.b42 // CHECK:STDOUT: %int.convert_checked.loc6_57.2 => constants.%int_3.822 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -670,10 +676,13 @@ fn G() -> i32 { // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -762,10 +771,10 @@ fn G() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_43.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_43.2: %i32 = converted %int_0, %.loc6_43.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_44.1: ref @F.%array_type.loc6_24.2 (%array_type.9d4) = value_as_ref %a.ref @@ -849,10 +858,13 @@ fn G() -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %require_complete.d82: = require_complete_type %array_type.6a2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.41f: = bound_method %N, %Convert.956 [symbolic] // CHECK:STDOUT: %Convert.specific_fn.122: = specific_function %Convert.bound.41f, @Convert.2(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn.122(%N) [symbolic] @@ -959,17 +971,17 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type @F.%array_type.loc7_37.2 (%array_type.6a2) [symbolic = %require_complete (constants.%require_complete.d82)] -// CHECK:STDOUT: %Convert.bound.loc7_57.2: = bound_method %N.loc7_6.2, constants.%Convert.956 [symbolic = %Convert.bound.loc7_57.2 (constants.%Convert.bound.41f)] -// CHECK:STDOUT: %Convert.specific_fn.loc7_57.2: = specific_function %Convert.bound.loc7_57.2, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn.loc7_57.2 (constants.%Convert.specific_fn.122)] -// CHECK:STDOUT: %int.convert_checked.loc7_57.2: init %i32 = call %Convert.specific_fn.loc7_57.2(%N.loc7_6.2) [symbolic = %int.convert_checked.loc7_57.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.loc7_6.2, constants.%Convert.956 [symbolic = %Convert.bound (constants.%Convert.bound.41f)] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn.122)] +// CHECK:STDOUT: %int.convert_checked.loc7_57.2: init %i32 = call %Convert.specific_fn(%N.loc7_6.2) [symbolic = %int.convert_checked.loc7_57.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%a.param_patt: @F.%array_type.loc7_37.2 (%array_type.6a2)) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc7_56: Core.IntLiteral = name_ref N, %N.loc7_6.1 [symbolic = %N.loc7_6.2 (constants.%N)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc7_57.1: = bound_method %N.ref.loc7_56, %impl.elem0 [symbolic = %Convert.bound.loc7_57.2 (constants.%Convert.bound.41f)] -// CHECK:STDOUT: %Convert.specific_fn.loc7_57.1: = specific_function %Convert.bound.loc7_57.1, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn.loc7_57.2 (constants.%Convert.specific_fn.122)] -// CHECK:STDOUT: %int.convert_checked.loc7_57.1: init %i32 = call %Convert.specific_fn.loc7_57.1(%N.ref.loc7_56) [symbolic = %int.convert_checked.loc7_57.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %N.ref.loc7_56, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound.41f)] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn.122)] +// CHECK:STDOUT: %int.convert_checked.loc7_57.1: init %i32 = call %specific_fn(%N.ref.loc7_56) [symbolic = %int.convert_checked.loc7_57.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc7_57.1: %i32 = value_of_initializer %int.convert_checked.loc7_57.1 [symbolic = %int.convert_checked.loc7_57.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc7_57.2: %i32 = converted %N.ref.loc7_56, %.loc7_57.1 [symbolic = %int.convert_checked.loc7_57.2 (constants.%int.convert_checked)] // CHECK:STDOUT: return %.loc7_57.2 @@ -1031,8 +1043,8 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1 -// CHECK:STDOUT: %Convert.bound.loc7_57.2 => constants.%Convert.bound.b30 -// CHECK:STDOUT: %Convert.specific_fn.loc7_57.2 => constants.%Convert.specific_fn.b42 +// CHECK:STDOUT: %Convert.bound => constants.%Convert.bound.b30 +// CHECK:STDOUT: %Convert.specific_fn => constants.%Convert.specific_fn.b42 // CHECK:STDOUT: %int.convert_checked.loc7_57.2 => constants.%int_3.822 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1046,10 +1058,13 @@ fn G() -> i32 { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %N.51e: %i32 = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %N.patt.8e2: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [template] +// CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.51e, %Convert.960 [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.51e) [symbolic] @@ -1107,10 +1122,10 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc6_23: type = splice_block %array_type.loc6_23.1 [symbolic = %array_type.loc6_23.2 (constants.%array_type.c13)] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %N.ref.loc6_22: %i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.51e)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] -// CHECK:STDOUT: %Convert.bound.loc6_22.1: = bound_method %N.ref.loc6_22, %impl.elem0 [symbolic = %Convert.bound.loc6_22.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc6_22.1: = specific_function %Convert.bound.loc6_22.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc6_22.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc6_22.1: init Core.IntLiteral = call %Convert.specific_fn.loc6_22.1(%N.ref.loc6_22) [symbolic = %int.convert_checked.loc6_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %impl.elem0: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] +// CHECK:STDOUT: %bound_method: = bound_method %N.ref.loc6_22, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc6_22.1: init Core.IntLiteral = call %specific_fn(%N.ref.loc6_22) [symbolic = %int.convert_checked.loc6_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc6_22.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc6_22.1 [symbolic = %int.convert_checked.loc6_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc6_22.2: Core.IntLiteral = converted %N.ref.loc6_22, %.loc6_22.1 [symbolic = %int.convert_checked.loc6_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc6_23.1: type = array_type %.loc6_22.2, %C [symbolic = %array_type.loc6_23.2 (constants.%array_type.c13)] @@ -1141,9 +1156,9 @@ fn G() -> i32 { // CHECK:STDOUT: generic fn @F(%N.loc6_6.1: %i32) { // CHECK:STDOUT: %N.loc6_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.2 (constants.%N.51e)] // CHECK:STDOUT: %N.patt.loc6_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.8e2)] -// CHECK:STDOUT: %Convert.bound.loc6_22.2: = bound_method %N.loc6_6.2, constants.%Convert.960 [symbolic = %Convert.bound.loc6_22.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc6_22.2: = specific_function %Convert.bound.loc6_22.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc6_22.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc6_22.2: init Core.IntLiteral = call %Convert.specific_fn.loc6_22.2(%N.loc6_6.2) [symbolic = %int.convert_checked.loc6_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.loc6_6.2, constants.%Convert.960 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc6_22.2: init Core.IntLiteral = call %Convert.specific_fn(%N.loc6_6.2) [symbolic = %int.convert_checked.loc6_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc6_23.2: type = array_type %int.convert_checked.loc6_22.2, %C [symbolic = %array_type.loc6_23.2 (constants.%array_type.c13)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -1196,8 +1211,8 @@ fn G() -> i32 { // CHECK:STDOUT: specific @F(constants.%N.51e) { // CHECK:STDOUT: %N.loc6_6.2 => constants.%N.51e // CHECK:STDOUT: %N.patt.loc6_6.2 => constants.%N.51e -// CHECK:STDOUT: %Convert.bound.loc6_22.2 => constants.%Convert.bound -// CHECK:STDOUT: %Convert.specific_fn.loc6_22.2 => constants.%Convert.specific_fn +// CHECK:STDOUT: %Convert.bound => constants.%Convert.bound +// CHECK:STDOUT: %Convert.specific_fn => constants.%Convert.specific_fn // CHECK:STDOUT: %int.convert_checked.loc6_22.2 => constants.%int.convert_checked // CHECK:STDOUT: %array_type.loc6_23.2 => constants.%array_type.c13 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index 08453056dc2f5..ab4535b17fd1c 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -749,10 +749,13 @@ fn G() -> i32 { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -862,10 +865,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_31.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_31.2: %i32 = converted %int_0, %.loc9_31.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %WithNontype: type = class_type @WithNontype, @WithNontype(constants.%int_0.6a9) [template = constants.%WithNontype.b82] diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index e2dd629906770..3a9d38c9a0a9e 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -246,10 +246,13 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -347,16 +350,16 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc8_22.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc8_22.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc8_22.1: = bound_method %int_1, %impl.elem0.loc8_22.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc8_22.1: init %i32 = call %Convert.specific_fn.loc8_22.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc8_22.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc8_22.1: = bound_method %int_1, %impl.elem0.loc8_22.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc8_22.1: = specific_function %bound_method.loc8_22.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc8_22.1: init %i32 = call %specific_fn.loc8_22.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_22.2: %i32 = value_of_initializer %int.convert_checked.loc8_22.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_22.3: %i32 = converted %int_1, %.loc8_22.2 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc8_22.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc8_22.2: = bound_method %int_2, %impl.elem0.loc8_22.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc8_22.2: init %i32 = call %Convert.specific_fn.loc8_22.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc8_22.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc8_22.2: = bound_method %int_2, %impl.elem0.loc8_22.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc8_22.2: = specific_function %bound_method.loc8_22.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc8_22.2: init %i32 = call %specific_fn.loc8_22.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc8_22.4: %i32 = value_of_initializer %int.convert_checked.loc8_22.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc8_22.5: %i32 = converted %int_2, %.loc8_22.4 [template = constants.%int_2.ef8] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc8_22.3, %.loc8_22.5) [template = constants.%tuple.21c] diff --git a/toolchain/check/testdata/eval/aggregate.carbon b/toolchain/check/testdata/eval/aggregate.carbon index 74761d6368343..5e56bef6fe3f9 100644 --- a/toolchain/check/testdata/eval/aggregate.carbon +++ b/toolchain/check/testdata/eval/aggregate.carbon @@ -26,10 +26,13 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -146,16 +149,16 @@ 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.24b = tuple_literal (%i32.loc11_41, %i32.loc11_46) // CHECK:STDOUT: %.loc11_49.2: type = converted %.loc11_49.1, constants.%tuple.type.d07 [template = constants.%tuple.type.d07] -// CHECK:STDOUT: %impl.elem0.loc11_35.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_35.1: = bound_method %int_1.loc11, %impl.elem0.loc11_35.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_35.1: init %i32 = call %Convert.specific_fn.loc11_35.1(%int_1.loc11) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc11_35.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_35.1: = bound_method %int_1.loc11, %impl.elem0.loc11_35.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11_35.1: = specific_function %bound_method.loc11_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc11_35.1: init %i32 = call %specific_fn.loc11_35.1(%int_1.loc11) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_35.2: %i32 = value_of_initializer %int.convert_checked.loc11_35.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_35.3: %i32 = converted %int_1.loc11, %.loc11_35.2 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc11_35.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_35.2: = bound_method %int_2.loc11, %impl.elem0.loc11_35.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc11_35.2: init %i32 = call %Convert.specific_fn.loc11_35.2(%int_2.loc11) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc11_35.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_35.2: = bound_method %int_2.loc11, %impl.elem0.loc11_35.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_35.2: = specific_function %bound_method.loc11_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc11_35.2: init %i32 = call %specific_fn.loc11_35.2(%int_2.loc11) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_35.4: %i32 = value_of_initializer %int.convert_checked.loc11_35.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_35.5: %i32 = converted %int_2.loc11, %.loc11_35.4 [template = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.loc11: %tuple.type.d07 = tuple_value (%.loc11_35.3, %.loc11_35.5) [template = constants.%tuple.21c] @@ -180,22 +183,22 @@ 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_71.1: = bound_method %int_2.loc13, %impl.elem0.loc13_71.1 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc13_71.1: init %i32 = call %Convert.specific_fn.loc13_71.1(%int_2.loc13) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc13_71.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_71.1: = bound_method %int_2.loc13, %impl.elem0.loc13_71.1 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc13_71.1: = specific_function %bound_method.loc13_71.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc13_71.1: init %i32 = call %specific_fn.loc13_71.1(%int_2.loc13) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_71.2: %i32 = value_of_initializer %int.convert_checked.loc13_71.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_71.3: %i32 = converted %int_2.loc13, %.loc13_71.2 [template = constants.%int_2.ef8] -// CHECK:STDOUT: %impl.elem0.loc13_71.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_71.2: = bound_method %int_1.loc13, %impl.elem0.loc13_71.2 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc13_71.2: init %i32 = call %Convert.specific_fn.loc13_71.2(%int_1.loc13) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc13_71.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_71.2: = bound_method %int_1.loc13, %impl.elem0.loc13_71.2 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc13_71.2: = specific_function %bound_method.loc13_71.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc13_71.2: init %i32 = call %specific_fn.loc13_71.2(%int_1.loc13) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_71.4: %i32 = value_of_initializer %int.convert_checked.loc13_71.2 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_71.5: %i32 = converted %int_1.loc13, %.loc13_71.4 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc13_71.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_71.3: = bound_method %int_3.loc13, %impl.elem0.loc13_71.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc13_71.3: init %i32 = call %Convert.specific_fn.loc13_71.3(%int_3.loc13) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc13_71.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_71.3: = bound_method %int_3.loc13, %impl.elem0.loc13_71.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc13_71.3: = specific_function %bound_method.loc13_71.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc13_71.3: init %i32 = call %specific_fn.loc13_71.3(%int_3.loc13) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc13_71.6: %i32 = value_of_initializer %int.convert_checked.loc13_71.3 [template = constants.%int_3.822] // CHECK:STDOUT: %.loc13_71.7: %i32 = converted %int_3.loc13, %.loc13_71.6 [template = constants.%int_3.822] // CHECK:STDOUT: %struct.loc13: %struct_type.b.a.c = struct_value (%.loc13_71.3, %.loc13_71.5, %.loc13_71.7) [template = constants.%struct.21d] @@ -226,10 +229,10 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %.loc15_54.2: %tuple.type.d46 = converted %.loc15_54.1, %tuple.loc15 [template = constants.%tuple.869] // CHECK:STDOUT: %tuple.elem2: Core.IntLiteral = tuple_access %.loc15_54.2, element2 [template = constants.%int_1.5b8] // CHECK:STDOUT: %array_type.loc15: type = array_type %tuple.elem2, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_0.loc15_30, %impl.elem0.loc15 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_0.loc15_30) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc15: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc15: = bound_method %int_0.loc15_30, %impl.elem0.loc15 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %bound_method.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %specific_fn.loc15(%int_0.loc15_30) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_32.2: init %i32 = converted %int_0.loc15_30, %int.convert_checked.loc15 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_1: ref %array_type = splice_block file.%tuple_index.var {} // CHECK:STDOUT: %int_0.loc15_32: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] @@ -249,10 +252,10 @@ 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.a81] // CHECK:STDOUT: %.loc17_61: Core.IntLiteral = struct_access %.loc17_60.2, element1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %array_type.loc17: type = array_type %.loc17_61, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_0.loc17_32, %impl.elem0.loc17 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_0.loc17_32) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc17: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17: = bound_method %int_0.loc17_32, %impl.elem0.loc17 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %bound_method.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %specific_fn.loc17(%int_0.loc17_32) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_34.2: init %i32 = converted %int_0.loc17_32, %int.convert_checked.loc17 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_1: ref %array_type = splice_block file.%struct_access.var {} // CHECK:STDOUT: %int_0.loc17_34: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index ee63fa0483323..8ad5d9bf8e55f 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -31,10 +31,13 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %tuple.type.d46: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %array_type.f32: type = array_type %int_4, %i32 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.ba9: = specific_function %Convert.bound.4e6, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [template] @@ -99,35 +102,35 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %i32.loc17_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.f32] -// CHECK:STDOUT: %impl.elem0.loc17_55.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_55.1: = bound_method %int_5, %impl.elem0.loc17_55.1 [template = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %Convert.specific_fn.loc17_55.1: = specific_function %Convert.bound.loc17_55.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked.loc17_55.1: init %i32 = call %Convert.specific_fn.loc17_55.1(%int_5) [template = constants.%int_5.0f6] +// CHECK:STDOUT: %impl.elem0.loc17_55.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_55.1: = bound_method %int_5, %impl.elem0.loc17_55.1 [template = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc17_55.1: = specific_function %bound_method.loc17_55.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] +// CHECK:STDOUT: %int.convert_checked.loc17_55.1: init %i32 = call %specific_fn.loc17_55.1(%int_5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc17_55.2: init %i32 = converted %int_5, %int.convert_checked.loc17_55.1 [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc17_55.3: ref %array_type.f32 = temporary_storage // CHECK:STDOUT: %int_0.loc17_55: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc17_55.4: ref %i32 = array_index %.loc17_55.3, %int_0.loc17_55 // CHECK:STDOUT: %.loc17_55.5: init %i32 = initialize_from %.loc17_55.2 to %.loc17_55.4 [template = constants.%int_5.0f6] -// CHECK:STDOUT: %impl.elem0.loc17_55.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_55.2: = bound_method %int_7, %impl.elem0.loc17_55.2 [template = constants.%Convert.bound.208] -// CHECK:STDOUT: %Convert.specific_fn.loc17_55.2: = specific_function %Convert.bound.loc17_55.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c12] -// CHECK:STDOUT: %int.convert_checked.loc17_55.2: init %i32 = call %Convert.specific_fn.loc17_55.2(%int_7) [template = constants.%int_7.0b1] +// CHECK:STDOUT: %impl.elem0.loc17_55.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_55.2: = bound_method %int_7, %impl.elem0.loc17_55.2 [template = constants.%Convert.bound.208] +// CHECK:STDOUT: %specific_fn.loc17_55.2: = specific_function %bound_method.loc17_55.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c12] +// CHECK:STDOUT: %int.convert_checked.loc17_55.2: init %i32 = call %specific_fn.loc17_55.2(%int_7) [template = constants.%int_7.0b1] // CHECK:STDOUT: %.loc17_55.6: init %i32 = converted %int_7, %int.convert_checked.loc17_55.2 [template = constants.%int_7.0b1] // CHECK:STDOUT: %int_1.loc17_55: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc17_55.7: ref %i32 = array_index %.loc17_55.3, %int_1.loc17_55 // CHECK:STDOUT: %.loc17_55.8: init %i32 = initialize_from %.loc17_55.6 to %.loc17_55.7 [template = constants.%int_7.0b1] -// CHECK:STDOUT: %impl.elem0.loc17_55.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_55.3: = bound_method %int_1.loc17_51, %impl.elem0.loc17_55.3 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc17_55.3: = specific_function %Convert.bound.loc17_55.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc17_55.3: init %i32 = call %Convert.specific_fn.loc17_55.3(%int_1.loc17_51) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc17_55.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_55.3: = bound_method %int_1.loc17_51, %impl.elem0.loc17_55.3 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc17_55.3: = specific_function %bound_method.loc17_55.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc17_55.3: init %i32 = call %specific_fn.loc17_55.3(%int_1.loc17_51) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_55.9: init %i32 = converted %int_1.loc17_51, %int.convert_checked.loc17_55.3 [template = constants.%int_1.5d2] // CHECK:STDOUT: %int_2.loc17_55: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc17_55.10: ref %i32 = array_index %.loc17_55.3, %int_2.loc17_55 // CHECK:STDOUT: %.loc17_55.11: init %i32 = initialize_from %.loc17_55.9 to %.loc17_55.10 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc17_55.4: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_55.4: = bound_method %int_9, %impl.elem0.loc17_55.4 [template = constants.%Convert.bound.9e2] -// CHECK:STDOUT: %Convert.specific_fn.loc17_55.4: = specific_function %Convert.bound.loc17_55.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b02] -// CHECK:STDOUT: %int.convert_checked.loc17_55.4: init %i32 = call %Convert.specific_fn.loc17_55.4(%int_9) [template = constants.%int_9.f88] +// CHECK:STDOUT: %impl.elem0.loc17_55.4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_55.4: = bound_method %int_9, %impl.elem0.loc17_55.4 [template = constants.%Convert.bound.9e2] +// CHECK:STDOUT: %specific_fn.loc17_55.4: = specific_function %bound_method.loc17_55.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b02] +// CHECK:STDOUT: %int.convert_checked.loc17_55.4: init %i32 = call %specific_fn.loc17_55.4(%int_9) [template = constants.%int_9.f88] // CHECK:STDOUT: %.loc17_55.12: init %i32 = converted %int_9, %int.convert_checked.loc17_55.4 [template = constants.%int_9.f88] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] // CHECK:STDOUT: %.loc17_55.13: ref %i32 = array_index %.loc17_55.3, %int_3 @@ -138,10 +141,10 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %.loc17_57.2: ref %array_type.f32 = temporary %.loc17_55.3, %.loc17_57.1 // CHECK:STDOUT: %int_32.loc17_71: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc17_71: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc17_70: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_70: = bound_method %int_2.loc17_70, %impl.elem0.loc17_70 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc17_70: = specific_function %Convert.bound.loc17_70, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc17_70: init %i32 = call %Convert.specific_fn.loc17_70(%int_2.loc17_70) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc17_70: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_70: = bound_method %int_2.loc17_70, %impl.elem0.loc17_70 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc17_70: = specific_function %bound_method.loc17_70, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc17_70: init %i32 = call %specific_fn.loc17_70(%int_2.loc17_70) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_70.1: %i32 = value_of_initializer %int.convert_checked.loc17_70 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_70.2: %i32 = converted %int_2.loc17_70, %.loc17_70.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_71.1: ref %i32 = array_index %.loc17_57.2, %.loc17_70.2 diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index f469054920d9e..1b33930b80ee0 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -42,10 +42,13 @@ fn G(N:! i32) { // CHECK:STDOUT: %N.patt.8e2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [template] +// CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.51e, %Convert.960 [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.51e) [symbolic] @@ -149,9 +152,9 @@ fn G(N:! i32) { // CHECK:STDOUT: %N.patt.loc18_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc18_6.2 (constants.%N.patt.8e2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.bound.loc19_16.2: = bound_method %N.loc18_6.2, constants.%Convert.960 [symbolic = %Convert.bound.loc19_16.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc19_16.2: = specific_function %Convert.bound.loc19_16.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc19_16.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc19_16.2: init Core.IntLiteral = call %Convert.specific_fn.loc19_16.2(%N.loc18_6.2) [symbolic = %int.convert_checked.loc19_16.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.loc18_6.2, constants.%Convert.960 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc19_16.2: init Core.IntLiteral = call %Convert.specific_fn(%N.loc18_6.2) [symbolic = %int.convert_checked.loc19_16.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc19_17.2: type = array_type %int.convert_checked.loc19_16.2, %i32 [symbolic = %array_type.loc19_17.2 (constants.%array_type.b04)] // CHECK:STDOUT: %require_complete: = require_complete_type @G.%array_type.loc19_17.2 (%array_type.b04) [symbolic = %require_complete (constants.%require_complete.9dc)] // CHECK:STDOUT: @@ -166,10 +169,10 @@ fn G(N:! i32) { // 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: %N.ref: %i32 = name_ref N, %N.loc18_6.1 [symbolic = %N.loc18_6.2 (constants.%N.51e)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] -// CHECK:STDOUT: %Convert.bound.loc19_16.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc19_16.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc19_16.1: = specific_function %Convert.bound.loc19_16.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc19_16.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc19_16.1: init Core.IntLiteral = call %Convert.specific_fn.loc19_16.1(%N.ref) [symbolic = %int.convert_checked.loc19_16.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %impl.elem0: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] +// CHECK:STDOUT: %bound_method: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc19_16.1: init Core.IntLiteral = call %specific_fn(%N.ref) [symbolic = %int.convert_checked.loc19_16.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc19_16.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc19_16.1 [symbolic = %int.convert_checked.loc19_16.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc19_16.2: Core.IntLiteral = converted %N.ref, %.loc19_16.1 [symbolic = %int.convert_checked.loc19_16.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc19_17.1: type = array_type %.loc19_16.2, %i32 [symbolic = %array_type.loc19_17.2 (constants.%array_type.b04)] diff --git a/toolchain/check/testdata/facet/no_prelude/access.carbon b/toolchain/check/testdata/facet/no_prelude/access.carbon new file mode 100644 index 0000000000000..600f9caa0e8ed --- /dev/null +++ b/toolchain/check/testdata/facet/no_prelude/access.carbon @@ -0,0 +1,522 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/facet/no_prelude/access.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/no_prelude/access.carbon + +// --- access_assoc_fn.carbon + +library "[[@TEST_NAME]]"; + +interface I { + fn DoIt(); +} + +fn Use(T:! I) { + T.DoIt(); +} + +// --- assoc_fn_using_self.carbon + +library "[[@TEST_NAME]]"; + +interface I { + fn Make() -> Self; +} + +fn Use(T:! I) -> T { + return T.Make(); +} + +// --- fail_todo_access_assoc_method.carbon + +library "[[@TEST_NAME]]"; + +interface I { + fn Copy[self: Self]() -> Self; +} + +fn Use[T:! I](x: T) -> T { + // CHECK:STDERR: fail_todo_access_assoc_method.carbon:[[@LINE+4]]:10: error: type `T` does not support qualified expressions [QualifiedExprUnsupported] + // CHECK:STDERR: return x.Copy(); + // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: + return x.Copy(); +} + +// --- access_assoc_method_indirect.carbon + +library "[[@TEST_NAME]]"; + +interface I { + fn Copy[self: Self]() -> Self; +} + +fn UseIndirect[T:! I](x: T) -> T { + return x.(T.Copy)(); +} + +// CHECK:STDOUT: --- access_assoc_fn.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %I.type: type = facet_type <@I> [template] +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %DoIt.type: type = fn_type @DoIt [template] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %DoIt: %DoIt.type = struct_value () [template] +// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [template] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%DoIt.decl [template] +// 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: %Use.type: type = fn_type @Use [template] +// CHECK:STDOUT: %Use: %Use.type = struct_value () [template] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] +// CHECK:STDOUT: %T.as_wit: = facet_access_witness %T [symbolic] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, %T.as_wit [symbolic] +// CHECK:STDOUT: %.d9e: type = fn_type_with_self_type %DoIt.type, %I.facet [symbolic] +// CHECK:STDOUT: %impl.elem0: %.d9e = impl_witness_access %T.as_wit, element0 [symbolic] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DoIt(%I.facet) [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} +// CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { +// CHECK:STDOUT: %T.patt.loc8_8.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc8_8.1, runtime_param [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: %I.type = value_param runtime_param +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %T.loc8_8.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %DoIt.decl: %DoIt.type = fn_decl @DoIt [template = constants.%DoIt] {} {} +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %DoIt.decl [template = constants.%assoc0] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .DoIt = %assoc0 +// CHECK:STDOUT: witness = (%DoIt.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @DoIt(@I.%Self: %I.type) { +// CHECK:STDOUT: fn(); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Use(%T.loc8_8.1: %I.type) { +// CHECK:STDOUT: %T.loc8_8.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_8.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.as_type.loc9_4.2: type = facet_access_type %T.loc8_8.2 [symbolic = %T.as_type.loc9_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.loc9_4.2: = facet_access_witness %T.loc8_8.2 [symbolic = %T.as_wit.loc9_4.2 (constants.%T.as_wit)] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc9_4.2, %T.as_wit.loc9_4.2 [symbolic = %I.facet (constants.%I.facet)] +// CHECK:STDOUT: %.loc9_4.2: type = fn_type_with_self_type constants.%DoIt.type, %I.facet [symbolic = %.loc9_4.2 (constants.%.d9e)] +// CHECK:STDOUT: %impl.elem0.loc9_4.2: @Use.%.loc9_4.2 (%.d9e) = impl_witness_access %T.as_wit.loc9_4.2, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_fn.loc9_4.2: = specific_function %impl.elem0.loc9_4.2, @DoIt(%I.facet) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%T.param_patt: %I.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %T.ref: %I.type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %DoIt.ref: %I.assoc_type = name_ref DoIt, @I.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %T.as_type.loc9_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc9_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc9_4.1: type = converted %T.ref, %T.as_type.loc9_4.1 [symbolic = %T.as_type.loc9_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.loc9_4.1: = facet_access_witness %T.ref [symbolic = %T.as_wit.loc9_4.2 (constants.%T.as_wit)] +// CHECK:STDOUT: %impl.elem0.loc9_4.1: @Use.%.loc9_4.2 (%.d9e) = impl_witness_access %T.as_wit.loc9_4.1, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_fn.loc9_4.1: = specific_function %impl.elem0.loc9_4.1, @DoIt(constants.%I.facet) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn)] +// CHECK:STDOUT: %DoIt.call: init %empty_tuple.type = call %specific_fn.loc9_4.1() +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @DoIt(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Use(constants.%T) { +// CHECK:STDOUT: %T.loc8_8.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_8.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @DoIt(constants.%I.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @DoIt(@Use.%I.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- assoc_fn_using_self.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %I.type: type = facet_type <@I> [template] +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %Make.type: type = fn_type @Make [template] +// CHECK:STDOUT: %Make: %Make.type = struct_value () [template] +// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [template] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Make.decl [template] +// 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: %Use.type: type = fn_type @Use [template] +// CHECK:STDOUT: %Use: %Use.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type [symbolic] +// CHECK:STDOUT: %T.as_wit: = facet_access_witness %T [symbolic] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, %T.as_wit [symbolic] +// CHECK:STDOUT: %.aaf: type = fn_type_with_self_type %Make.type, %I.facet [symbolic] +// CHECK:STDOUT: %impl.elem0: %.aaf = impl_witness_access %T.as_wit, element0 [symbolic] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Make(%I.facet) [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} +// CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { +// CHECK:STDOUT: %T.patt.loc8_8.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc8_8.1, runtime_param [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %return.patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.ref.loc8: %I.type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %T.as_type.loc8_18.1: type = facet_access_type %T.ref.loc8 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc8: type = converted %T.ref.loc8, %T.as_type.loc8_18.1 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.param: %I.type = value_param runtime_param +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %T.loc8_8.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %return.param: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = out_param runtime_param0 +// CHECK:STDOUT: %return: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { +// CHECK:STDOUT: %return.patt: @Make.%Self.as_type.loc5_16.1 (%Self.as_type) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Make.%Self.as_type.loc5_16.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_16.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_16.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5: type = converted %Self.ref, %Self.as_type.loc5_16.2 [symbolic = %Self.as_type.loc5_16.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %return.param: ref @Make.%Self.as_type.loc5_16.1 (%Self.as_type) = out_param runtime_param0 +// CHECK:STDOUT: %return: ref @Make.%Self.as_type.loc5_16.1 (%Self.as_type) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %Make.decl [template = constants.%assoc0] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .Make = %assoc0 +// CHECK:STDOUT: witness = (%Make.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Make(@I.%Self: %I.type) { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_16.1 (constants.%Self.as_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn() -> @Make.%Self.as_type.loc5_16.1 (%Self.as_type); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Use(%T.loc8_8.1: %I.type) { +// CHECK:STDOUT: %T.loc8_8.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_8.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.as_type.loc8_18.2: type = facet_access_type %T.loc8_8.2 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Use.%T.as_type.loc8_18.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %T.as_wit.loc9_11.2: = facet_access_witness %T.loc8_8.2 [symbolic = %T.as_wit.loc9_11.2 (constants.%T.as_wit)] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc8_18.2, %T.as_wit.loc9_11.2 [symbolic = %I.facet (constants.%I.facet)] +// CHECK:STDOUT: %.loc9_11.2: type = fn_type_with_self_type constants.%Make.type, %I.facet [symbolic = %.loc9_11.2 (constants.%.aaf)] +// CHECK:STDOUT: %impl.elem0.loc9_11.2: @Use.%.loc9_11.2 (%.aaf) = impl_witness_access %T.as_wit.loc9_11.2, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_fn.loc9_11.2: = specific_function %impl.elem0.loc9_11.2, @Make(%I.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%T.param_patt: %I.type) -> @Use.%T.as_type.loc8_18.2 (%T.as_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %T.ref.loc9: %I.type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %Make.ref: %I.assoc_type = name_ref Make, @I.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %T.as_type.loc9: type = facet_access_type %T.ref.loc9 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc9_11.1: type = converted %T.ref.loc9, %T.as_type.loc9 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.loc9_11.1: = facet_access_witness %T.ref.loc9 [symbolic = %T.as_wit.loc9_11.2 (constants.%T.as_wit)] +// CHECK:STDOUT: %impl.elem0.loc9_11.1: @Use.%.loc9_11.2 (%.aaf) = impl_witness_access %T.as_wit.loc9_11.1, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_fn.loc9_11.1: = specific_function %impl.elem0.loc9_11.1, @Make(constants.%I.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)] +// CHECK:STDOUT: %Make.call: init @Use.%T.as_type.loc8_18.2 (%T.as_type) = call %specific_fn.loc9_11.1() +// CHECK:STDOUT: %.loc9_17.1: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = temporary_storage +// CHECK:STDOUT: %.loc9_17.2: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = temporary %.loc9_17.1, %Make.call +// CHECK:STDOUT: %.loc9_17.3: @Use.%T.as_type.loc8_18.2 (%T.as_type) = bind_value %.loc9_17.2 +// CHECK:STDOUT: return %.loc9_17.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Make(constants.%Self) { +// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: %Self.as_type.loc5_16.1 => constants.%Self.as_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Use(constants.%T) { +// CHECK:STDOUT: %T.loc8_8.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_8.2 => constants.%T +// CHECK:STDOUT: %T.as_type.loc8_18.2 => constants.%T.as_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Make(constants.%I.facet) { +// CHECK:STDOUT: %Self => constants.%I.facet +// CHECK:STDOUT: %Self.as_type.loc5_16.1 => constants.%T.as_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Make(@Use.%I.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_todo_access_assoc_method.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %I.type: type = facet_type <@I> [template] +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %Copy.type: type = fn_type @Copy [template] +// CHECK:STDOUT: %Copy: %Copy.type = struct_value () [template] +// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [template] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Copy.decl [template] +// 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: %Use.type: type = fn_type @Use [template] +// CHECK:STDOUT: %Use: %Use.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} +// CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { +// CHECK:STDOUT: %T.patt.loc8_8.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc8_8.1, runtime_param [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %x.patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.ref.loc8_24: %I.type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %T.as_type.loc8_24: type = facet_access_type %T.ref.loc8_24 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc8_24: type = converted %T.ref.loc8_24, %T.as_type.loc8_24 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.param: %I.type = value_param runtime_param +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %T.loc8_8.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %x.param: @Use.%T.as_type.loc8_18.2 (%T.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_18.1: type = splice_block %.loc8_18.2 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] { +// CHECK:STDOUT: %T.ref.loc8_18: %I.type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %T.as_type.loc8_18.1: type = facet_access_type %T.ref.loc8_18 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc8_18.2: type = converted %T.ref.loc8_18, %T.as_type.loc8_18.1 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %x: @Use.%T.as_type.loc8_18.2 (%T.as_type) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %Copy.decl: %Copy.type = fn_decl @Copy [template = constants.%Copy] { +// CHECK:STDOUT: %self.patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc5_28: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_28: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %self.param: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_17.1: type = splice_block %.loc5_17.2 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref.loc5_17: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_17.2: type = facet_access_type %Self.ref.loc5_17 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_17.2: type = converted %Self.ref.loc5_17, %Self.as_type.loc5_17.2 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %Copy.decl [template = constants.%assoc0] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .Copy = %assoc0 +// CHECK:STDOUT: witness = (%Copy.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Copy(@I.%Self: %I.type) { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_17.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type)]() -> @Copy.%Self.as_type.loc5_17.1 (%Self.as_type); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Use(%T.loc8_8.1: %I.type) { +// CHECK:STDOUT: %T.loc8_8.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_8.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.as_type.loc8_18.2: type = facet_access_type %T.loc8_8.2 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Use.%T.as_type.loc8_18.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: %I.type](%x.param_patt: @Use.%T.as_type.loc8_18.2 (%T.as_type)) -> @Use.%T.as_type.loc8_18.2 (%T.as_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref: @Use.%T.as_type.loc8_18.2 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Copy(constants.%Self) { +// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: %Self.as_type.loc5_17.1 => constants.%Self.as_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Use(constants.%T) { +// CHECK:STDOUT: %T.loc8_8.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_8.2 => constants.%T +// CHECK:STDOUT: %T.as_type.loc8_18.2 => constants.%T.as_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- access_assoc_method_indirect.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %I.type: type = facet_type <@I> [template] +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %Copy.type: type = fn_type @Copy [template] +// CHECK:STDOUT: %Copy: %Copy.type = struct_value () [template] +// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [template] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Copy.decl [template] +// 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: %UseIndirect.type: type = fn_type @UseIndirect [template] +// CHECK:STDOUT: %UseIndirect: %UseIndirect.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type [symbolic] +// CHECK:STDOUT: %T.as_wit: = facet_access_witness %T [symbolic] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, %T.as_wit [symbolic] +// CHECK:STDOUT: %.4ef: type = fn_type_with_self_type %Copy.type, %I.facet [symbolic] +// CHECK:STDOUT: %impl.elem0: %.4ef = impl_witness_access %T.as_wit, element0 [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .UseIndirect = %UseIndirect.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} +// CHECK:STDOUT: %UseIndirect.decl: %UseIndirect.type = fn_decl @UseIndirect [template = constants.%UseIndirect] { +// CHECK:STDOUT: %T.patt.loc8_16.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc8_16.1, runtime_param [symbolic = %T.patt.loc8_16.2 (constants.%T.patt)] +// CHECK:STDOUT: %x.patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.ref.loc8_32: %I.type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] +// CHECK:STDOUT: %T.as_type.loc8_32: type = facet_access_type %T.ref.loc8_32 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc8_32: type = converted %T.ref.loc8_32, %T.as_type.loc8_32 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.param: %I.type = value_param runtime_param +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %T.loc8_16.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_16.2 (constants.%T)] +// CHECK:STDOUT: %x.param: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_26.1: type = splice_block %.loc8_26.2 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)] { +// CHECK:STDOUT: %T.ref.loc8_26: %I.type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] +// CHECK:STDOUT: %T.as_type.loc8_26.1: type = facet_access_type %T.ref.loc8_26 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc8_26.2: type = converted %T.ref.loc8_26, %T.as_type.loc8_26.1 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %x: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %Copy.decl: %Copy.type = fn_decl @Copy [template = constants.%Copy] { +// CHECK:STDOUT: %self.patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc5_28: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_28: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %self.param: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_17.1: type = splice_block %.loc5_17.2 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref.loc5_17: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_17.2: type = facet_access_type %Self.ref.loc5_17 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_17.2: type = converted %Self.ref.loc5_17, %Self.as_type.loc5_17.2 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %Copy.decl [template = constants.%assoc0] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .Copy = %assoc0 +// CHECK:STDOUT: witness = (%Copy.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Copy(@I.%Self: %I.type) { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_17.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type)]() -> @Copy.%Self.as_type.loc5_17.1 (%Self.as_type); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @UseIndirect(%T.loc8_16.1: %I.type) { +// CHECK:STDOUT: %T.loc8_16.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_16.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_16.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.as_type.loc8_26.2: type = facet_access_type %T.loc8_16.2 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %T.as_wit.loc9_14.2: = facet_access_witness %T.loc8_16.2 [symbolic = %T.as_wit.loc9_14.2 (constants.%T.as_wit)] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc8_26.2, %T.as_wit.loc9_14.2 [symbolic = %I.facet (constants.%I.facet)] +// CHECK:STDOUT: %.loc9_14.2: type = fn_type_with_self_type constants.%Copy.type, %I.facet [symbolic = %.loc9_14.2 (constants.%.4ef)] +// CHECK:STDOUT: %impl.elem0.loc9_14.2: @UseIndirect.%.loc9_14.2 (%.4ef) = impl_witness_access %T.as_wit.loc9_14.2, element0 [symbolic = %impl.elem0.loc9_14.2 (constants.%impl.elem0)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: %I.type](%x.param_patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type)) -> @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %T.ref.loc9: %I.type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] +// CHECK:STDOUT: %Copy.ref: %I.assoc_type = name_ref Copy, @I.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %T.as_type.loc9: type = facet_access_type %T.ref.loc9 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc9_14.1: type = converted %T.ref.loc9, %T.as_type.loc9 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.loc9_14.1: = facet_access_witness %T.ref.loc9 [symbolic = %T.as_wit.loc9_14.2 (constants.%T.as_wit)] +// CHECK:STDOUT: %impl.elem0.loc9_14.1: @UseIndirect.%.loc9_14.2 (%.4ef) = impl_witness_access %T.as_wit.loc9_14.1, element0 [symbolic = %impl.elem0.loc9_14.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %bound_method: = bound_method %x.ref, %impl.elem0.loc9_14.1 +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Copy(constants.%I.facet) +// CHECK:STDOUT: %Copy.call: init @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = call %specific_fn(%x.ref) +// CHECK:STDOUT: %.loc9_21.1: ref @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = temporary_storage +// CHECK:STDOUT: %.loc9_21.2: ref @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = temporary %.loc9_21.1, %Copy.call +// CHECK:STDOUT: %.loc9_21.3: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = bind_value %.loc9_21.2 +// CHECK:STDOUT: return %.loc9_21.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Copy(constants.%Self) { +// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: %Self.as_type.loc5_17.1 => constants.%Self.as_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @UseIndirect(constants.%T) { +// CHECK:STDOUT: %T.loc8_16.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T +// CHECK:STDOUT: %T.as_type.loc8_26.2 => constants.%T.as_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Copy(constants.%I.facet) { +// CHECK:STDOUT: %Self => constants.%I.facet +// CHECK:STDOUT: %Self.as_type.loc5_17.1 => constants.%T.as_type +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index e64f399d4d710..0a2c986b0f3bd 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -25,11 +25,15 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %Add: %Add.type.b1f = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -40,6 +44,8 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [template] +// CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [template] // CHECK:STDOUT: %Convert.bound.2d6: = bound_method %int_3.822, %Convert.960 [template] // CHECK:STDOUT: %Convert.specific_fn.377: = specific_function %Convert.bound.2d6, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] @@ -101,25 +107,25 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %Add.ref: %Add.type.b1f = name_ref Add, %Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc13_20: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_20: = bound_method %int_1, %impl.elem0.loc13_20 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc13_20: = specific_function %Convert.bound.loc13_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc13_20: init %i32 = call %Convert.specific_fn.loc13_20(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc13_20: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_20: = bound_method %int_1, %impl.elem0.loc13_20 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc13_20: = specific_function %bound_method.loc13_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc13_20: init %i32 = call %specific_fn.loc13_20(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_1, %.loc13_20.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc13_23: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_23: = bound_method %int_2, %impl.elem0.loc13_23 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc13_23: = specific_function %Convert.bound.loc13_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc13_23: init %i32 = call %Convert.specific_fn.loc13_23(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc13_23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_23: = bound_method %int_2, %impl.elem0.loc13_23 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc13_23: = specific_function %bound_method.loc13_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc13_23: init %i32 = call %specific_fn.loc13_23(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_23.1: %i32 = value_of_initializer %int.convert_checked.loc13_23 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_23.2: %i32 = converted %int_2, %.loc13_23.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc13_20.2, %.loc13_23.2) [template = constants.%int_3.822] -// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] -// CHECK:STDOUT: %Convert.bound.loc13_24: = bound_method %int.sadd, %impl.elem0.loc13_24 [template = constants.%Convert.bound.2d6] -// CHECK:STDOUT: %Convert.specific_fn.loc13_24: = specific_function %Convert.bound.loc13_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.377] +// CHECK:STDOUT: %impl.elem0.loc13_24: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] +// CHECK:STDOUT: %bound_method.loc13_24: = bound_method %int.sadd, %impl.elem0.loc13_24 [template = constants.%Convert.bound.2d6] +// CHECK:STDOUT: %specific_fn.loc13_24: = specific_function %bound_method.loc13_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.377] // CHECK:STDOUT: %.loc13_24.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.822] // CHECK:STDOUT: %.loc13_24.2: %i32 = converted %int.sadd, %.loc13_24.1 [template = constants.%int_3.822] -// CHECK:STDOUT: %int.convert_checked.loc13_24: init Core.IntLiteral = call %Convert.specific_fn.loc13_24(%.loc13_24.2) [template = constants.%int_3.1ba] +// CHECK:STDOUT: %int.convert_checked.loc13_24: init Core.IntLiteral = call %specific_fn.loc13_24(%.loc13_24.2) [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc13_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_24 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc13_24.4: Core.IntLiteral = converted %int.sadd, %.loc13_24.3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %array_type: type = array_type %.loc13_24.4, %i32 [template = constants.%array_type] diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index e38b7b4525d92..b65392dfa02af 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -35,20 +35,28 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %F.9ec: %F.type.066 = struct_value () [template] // CHECK:STDOUT: %I.facet: %I.type = facet_value %i32, %impl_witness.da7 [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [template] // CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %impl_witness.882: = impl_witness (imports.%Core.import_ref.78a), @impl.4(%int_32) [template] // CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.4(%int_32) [template] // CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template] +// CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [template] +// CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [template] // CHECK:STDOUT: %Convert.bound.c1b: = bound_method %int_1.5b8, %Convert.197 [template] // CHECK:STDOUT: %Convert.specific_fn.f9a: = specific_function %Convert.bound.c1b, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.c3e: type = fn_type_with_self_type %F.type.cf0, %I.facet [template] // CHECK:STDOUT: %F.bound: = bound_method %int_1.5d2, %F.9ec [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.2, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [template] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template] @@ -56,6 +64,8 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.4, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [template] +// CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [template] // CHECK:STDOUT: %Convert.bound.2d6: = bound_method %int_3.822, %Convert.960 [template] // CHECK:STDOUT: %Convert.specific_fn.377: = specific_function %Convert.bound.2d6, @Convert.4(%int_32) [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] @@ -97,30 +107,30 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_32.loc19_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc19_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc19_19: %Convert.type.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] -// CHECK:STDOUT: %Convert.bound.loc19_19: = bound_method %int_1, %impl.elem0.loc19_19 [template = constants.%Convert.bound.c1b] -// CHECK:STDOUT: %Convert.specific_fn.loc19_19: = specific_function %Convert.bound.loc19_19, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.f9a] -// CHECK:STDOUT: %int.convert_checked.loc19_19: init %i32 = call %Convert.specific_fn.loc19_19(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc19_19: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] +// CHECK:STDOUT: %bound_method.loc19_19: = bound_method %int_1, %impl.elem0.loc19_19 [template = constants.%Convert.bound.c1b] +// CHECK:STDOUT: %specific_fn.loc19_19: = specific_function %bound_method.loc19_19, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.f9a] +// CHECK:STDOUT: %int.convert_checked.loc19_19: init %i32 = call %specific_fn.loc19_19(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc19_19.1: %i32 = value_of_initializer %int.convert_checked.loc19_19 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc19_19.2: %i32 = converted %int_1, %.loc19_19.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%I.type] // CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0.a5e] -// CHECK:STDOUT: %impl.elem0.loc19_26: %F.type.cf0 = impl_witness_access constants.%impl_witness.da7, element0 [template = constants.%F.9ec] -// CHECK:STDOUT: %F.bound: = bound_method %.loc19_19.2, %impl.elem0.loc19_26 [template = constants.%F.bound] +// CHECK:STDOUT: %impl.elem0.loc19_26: %.c3e = impl_witness_access constants.%impl_witness.da7, element0 [template = constants.%F.9ec] +// CHECK:STDOUT: %bound_method.loc19_26: = bound_method %.loc19_19.2, %impl.elem0.loc19_26 [template = constants.%F.bound] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc19_33: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc19_33: = bound_method %int_2, %impl.elem0.loc19_33 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc19_33: = specific_function %Convert.bound.loc19_33, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc19_33: init %i32 = call %Convert.specific_fn.loc19_33(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc19_33: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc19_33: = bound_method %int_2, %impl.elem0.loc19_33 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc19_33: = specific_function %bound_method.loc19_33, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc19_33: init %i32 = call %specific_fn.loc19_33(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_33.1: %i32 = value_of_initializer %int.convert_checked.loc19_33 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_33.2: %i32 = converted %int_2, %.loc19_33.1 [template = constants.%int_2.ef8] -// CHECK:STDOUT: %int.sadd: init %i32 = call %F.bound(%.loc19_19.2, %.loc19_33.2) [template = constants.%int_3.822] -// CHECK:STDOUT: %impl.elem0.loc19_34: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] -// CHECK:STDOUT: %Convert.bound.loc19_34: = bound_method %int.sadd, %impl.elem0.loc19_34 [template = constants.%Convert.bound.2d6] -// CHECK:STDOUT: %Convert.specific_fn.loc19_34: = specific_function %Convert.bound.loc19_34, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.377] +// CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc19_26(%.loc19_19.2, %.loc19_33.2) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc19_34: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] +// CHECK:STDOUT: %bound_method.loc19_34: = bound_method %int.sadd, %impl.elem0.loc19_34 [template = constants.%Convert.bound.2d6] +// CHECK:STDOUT: %specific_fn.loc19_34: = specific_function %bound_method.loc19_34, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.377] // CHECK:STDOUT: %.loc19_34.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.822] // CHECK:STDOUT: %.loc19_34.2: %i32 = converted %int.sadd, %.loc19_34.1 [template = constants.%int_3.822] -// CHECK:STDOUT: %int.convert_checked.loc19_34: init Core.IntLiteral = call %Convert.specific_fn.loc19_34(%.loc19_34.2) [template = constants.%int_3.1ba] +// CHECK:STDOUT: %int.convert_checked.loc19_34: init Core.IntLiteral = call %specific_fn.loc19_34(%.loc19_34.2) [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc19_34.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc19_34 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc19_34.4: Core.IntLiteral = converted %int.sadd, %.loc19_34.3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %array_type: type = array_type %.loc19_34.4, %i32 [template = constants.%array_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 1b54630875893..23bd04dab9dce 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 @@ -97,7 +97,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %impl_witness.213: = impl_witness (@impl.2.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.fc9: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.33c: %Convert.type.fc9 = struct_value () [template] -// CHECK:STDOUT: %As.facet: %As.type.8ba = facet_value Core.IntLiteral, %impl_witness.213 [symbolic] +// CHECK:STDOUT: %As.facet: %As.type.a09 = facet_value Core.IntLiteral, %impl_witness.213 [template] // CHECK:STDOUT: %ImplicitAs.type.11a: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [template] // CHECK:STDOUT: %Convert.type.752: type = fn_type @Convert.2, @ImplicitAs(%i32.builtin) [template] // CHECK:STDOUT: %Convert.fcc: %Convert.type.752 = struct_value () [template] @@ -106,7 +106,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %impl_witness.48c: = impl_witness (@impl.3.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.c2a: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.40d: %Convert.type.c2a = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.555: %ImplicitAs.type.07f = facet_value Core.IntLiteral, %impl_witness.48c [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet.1ff: %ImplicitAs.type.11a = facet_value Core.IntLiteral, %impl_witness.48c [template] // CHECK:STDOUT: %ImplicitAs.type.9fc: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.60e: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.c73: %Convert.type.60e = struct_value () [template] @@ -115,7 +115,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %impl_witness.caf: = impl_witness (@impl.4.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.295: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.2bf: %Convert.type.295 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.2ca: %ImplicitAs.type.07f = facet_value %i32.builtin, %impl_witness.caf [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet.72d: %ImplicitAs.type.9fc = facet_value %i32.builtin, %impl_witness.caf [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -540,10 +540,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %assoc0.loc16_32.2 => constants.%assoc0.7cc // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%i32.builtin, constants.%ImplicitAs.facet.555) { +// CHECK:STDOUT: specific @Convert.2(constants.%i32.builtin, constants.%ImplicitAs.facet.1ff) { // CHECK:STDOUT: %T => constants.%i32.builtin // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.11a -// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.555 +// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.1ff // CHECK:STDOUT: %Self.as_type.loc16_20.1 => Core.IntLiteral // CHECK:STDOUT: } // CHECK:STDOUT: @@ -560,10 +560,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %assoc0.loc16_32.2 => constants.%assoc0.80e // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(Core.IntLiteral, constants.%ImplicitAs.facet.2ca) { +// CHECK:STDOUT: specific @Convert.2(Core.IntLiteral, constants.%ImplicitAs.facet.72d) { // CHECK:STDOUT: %T => Core.IntLiteral // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.9fc -// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.2ca +// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.72d // CHECK:STDOUT: %Self.as_type.loc16_20.1 => constants.%i32.builtin // CHECK:STDOUT: } // CHECK:STDOUT: @@ -610,6 +610,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %ImplicitAs.assoc_type.29f: type = assoc_entity_type %ImplicitAs.type.2fd [template] // CHECK:STDOUT: %assoc0.ed3: %ImplicitAs.assoc_type.29f = assoc_entity element0, imports.%Core.import_ref.1c752f.2 [template] // CHECK:STDOUT: %impl_witness.d9b: = impl_witness (imports.%Core.import_ref.73a) [template] +// CHECK:STDOUT: %As.facet: %As.type.a6d = facet_value Core.IntLiteral, %impl_witness.d9b [template] +// CHECK:STDOUT: %.dc4: type = fn_type_with_self_type %Convert.type.378, %As.facet [template] // CHECK:STDOUT: %Convert.type.953: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.5bc: %Convert.type.953 = struct_value () [template] // CHECK:STDOUT: %Convert.bound.b34: = bound_method %int_1.5b8, %Convert.5bc [template] @@ -622,12 +624,16 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %impl_witness.bd0: = impl_witness (imports.%Core.import_ref.db4) [template] // CHECK:STDOUT: %Op.type.545: type = fn_type @Op.1 [template] // CHECK:STDOUT: %Self.as_type.da9: type = facet_access_type %Self.a99 [symbolic] +// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %i32.builtin, %impl_witness.bd0 [template] +// CHECK:STDOUT: %.7c2: type = fn_type_with_self_type %Op.type.545, %Add.facet [template] // CHECK:STDOUT: %Op.type.240: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.0e2: %Op.type.240 = struct_value () [template] // CHECK:STDOUT: %Op.bound.393: = bound_method %int_1.f38, %Op.0e2 [template] // CHECK:STDOUT: %int_3.a0f: %i32.builtin = int_value 3 [template] // CHECK:STDOUT: %assoc0.43db8b.2: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.207961.2 [symbolic] // CHECK:STDOUT: %impl_witness.8f3: = impl_witness (imports.%Core.import_ref.4f9) [template] +// CHECK:STDOUT: %ImplicitAs.facet.6ef: %ImplicitAs.type.2fd = facet_value %i32.builtin, %impl_witness.8f3 [template] +// CHECK:STDOUT: %.38f: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.6ef [template] // CHECK:STDOUT: %Convert.type.0e4: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.b32: %Convert.type.0e4 = struct_value () [template] // CHECK:STDOUT: %Convert.bound.65a: = bound_method %int_3.a0f, %Convert.b32 [template] @@ -642,6 +648,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // 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.39c: = impl_witness (imports.%Core.import_ref.f35) [template] +// CHECK:STDOUT: %ImplicitAs.facet.085: %ImplicitAs.type.61e = facet_value Core.IntLiteral, %impl_witness.39c [template] +// CHECK:STDOUT: %.624: type = fn_type_with_self_type %Convert.type.059, %ImplicitAs.facet.085 [template] // CHECK:STDOUT: %Convert.type.49f: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.cb5: %Convert.type.49f = struct_value () [template] // CHECK:STDOUT: %Convert.bound.b6b: = bound_method %int_3.1ba, %Convert.cb5 [template] @@ -657,9 +665,12 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.f6b058.1: type = import_ref Core//default, loc11_14, loaded [symbolic = @As.%T (constants.%T)] // CHECK:STDOUT: %Core.import_ref.a7c = import_ref Core//default, inst85 [no loc], unloaded // CHECK:STDOUT: %Core.import_ref.713: @As.%As.assoc_type (%As.assoc_type.a44) = import_ref Core//default, loc12_32, loaded [symbolic = @As.%assoc0 (constants.%assoc0.5bc)] // CHECK:STDOUT: %Core.Convert.313 = import_ref Core//default, Convert, unloaded +// CHECK:STDOUT: %Core.import_ref.f6b058.2: type = import_ref Core//default, loc11_14, loaded [symbolic = @As.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.996: @As.%As.type (%As.type.eed) = import_ref Core//default, inst85 [no loc], loaded [symbolic = @As.%Self (constants.%Self.65a)] // CHECK:STDOUT: %Core.import_ref.708: @As.%Convert.type (%Convert.type.843) = import_ref Core//default, loc12_32, loaded [symbolic = @As.%Convert (constants.%Convert.95f)] // CHECK:STDOUT: %Core.import_ref.595: = import_ref Core//default, loc19_17, loaded [template = constants.%impl_witness.bd0] // CHECK:STDOUT: %Core.import_ref.07c = import_ref Core//default, inst39 [no loc], unloaded @@ -671,15 +682,19 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Core.import_ref.8721d7.1: type = import_ref Core//default, loc23_17, loaded [template = Core.IntLiteral] // CHECK:STDOUT: %Core.import_ref.1e5: type = import_ref Core//default, loc23_28, loaded [template = constants.%As.type.a6d] // CHECK:STDOUT: %Core.import_ref.de9: = import_ref Core//default, loc27_38, loaded [template = constants.%impl_witness.39c] +// CHECK:STDOUT: %Core.import_ref.f6b058.3: type = import_ref Core//default, loc15_22, loaded [symbolic = @ImplicitAs.%T (constants.%T)] // CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//default, inst128 [no loc], unloaded // CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//default, loc16_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)] // CHECK:STDOUT: %Core.Convert.e69 = import_ref Core//default, Convert, unloaded // CHECK:STDOUT: %Core.import_ref.8721d7.2: type = import_ref Core//default, loc27_17, loaded [template = Core.IntLiteral] // CHECK:STDOUT: %Core.import_ref.4d9: type = import_ref Core//default, loc27_36, loaded [template = constants.%ImplicitAs.type.61e] +// CHECK:STDOUT: %Core.import_ref.f6b058.4: type = import_ref Core//default, loc15_22, loaded [symbolic = @ImplicitAs.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//default, inst128 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)] // CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//default, loc16_32, unloaded // CHECK:STDOUT: %Core.import_ref.3b6: = import_ref Core//default, loc31_38, loaded [template = constants.%impl_witness.8f3] // CHECK:STDOUT: %Core.import_ref.c8c7cd.2: type = import_ref Core//default, loc31_6, loaded [template = constants.%i32.builtin] // CHECK:STDOUT: %Core.import_ref.efb: type = import_ref Core//default, loc31_36, loaded [template = constants.%ImplicitAs.type.2fd] +// CHECK:STDOUT: %Core.import_ref.442: %Add.type = import_ref Core//default, inst39 [no loc], loaded [symbolic = constants.%Self.a99] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -701,9 +716,9 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %int.make_type_signed.loc4_22: init type = call constants.%Int(%int_32.loc4_22) [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_signed.loc4_22 [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_signed.loc4_22, %.loc4_22.1 [template = constants.%i32.builtin] -// CHECK:STDOUT: %impl.elem0.loc4_19: %Convert.type.378 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc] -// CHECK:STDOUT: %Convert.bound.loc4_19: = bound_method %int_1, %impl.elem0.loc4_19 [template = constants.%Convert.bound.b34] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32.builtin = call %Convert.bound.loc4_19(%int_1) [template = constants.%int_1.f38] +// CHECK:STDOUT: %impl.elem0.loc4_19: %.dc4 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc] +// CHECK:STDOUT: %bound_method.loc4_19: = bound_method %int_1, %impl.elem0.loc4_19 [template = constants.%Convert.bound.b34] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32.builtin = call %bound_method.loc4_19(%int_1) [template = constants.%int_1.f38] // CHECK:STDOUT: %.loc4_19.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%int_1.f38] // CHECK:STDOUT: %.loc4_19.2: %i32.builtin = converted %int_1, %.loc4_19.1 [template = constants.%int_1.f38] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] @@ -711,21 +726,21 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %int.make_type_signed.loc4_35: init type = call constants.%Int(%int_32.loc4_35) [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %int.make_type_signed.loc4_35 [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc4_35.2: type = converted %int.make_type_signed.loc4_35, %.loc4_35.1 [template = constants.%i32.builtin] -// CHECK:STDOUT: %impl.elem0.loc4_32: %Convert.type.378 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc] -// CHECK:STDOUT: %Convert.bound.loc4_32: = bound_method %int_2, %impl.elem0.loc4_32 [template = constants.%Convert.bound.324] -// CHECK:STDOUT: %int.convert_checked.loc4_32: init %i32.builtin = call %Convert.bound.loc4_32(%int_2) [template = constants.%int_2.5a1] +// CHECK:STDOUT: %impl.elem0.loc4_32: %.dc4 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc] +// CHECK:STDOUT: %bound_method.loc4_32: = bound_method %int_2, %impl.elem0.loc4_32 [template = constants.%Convert.bound.324] +// CHECK:STDOUT: %int.convert_checked.loc4_32: init %i32.builtin = call %bound_method.loc4_32(%int_2) [template = constants.%int_2.5a1] // CHECK:STDOUT: %.loc4_32.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_32 [template = constants.%int_2.5a1] // CHECK:STDOUT: %.loc4_32.2: %i32.builtin = converted %int_2, %.loc4_32.1 [template = constants.%int_2.5a1] -// CHECK:STDOUT: %impl.elem0.loc4_27.1: %Op.type.545 = impl_witness_access constants.%impl_witness.bd0, element0 [template = constants.%Op.0e2] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc4_19.2, %impl.elem0.loc4_27.1 [template = constants.%Op.bound.393] -// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %Op.bound(%.loc4_19.2, %.loc4_32.2) [template = constants.%int_3.a0f] +// CHECK:STDOUT: %impl.elem0.loc4_27.1: %.7c2 = impl_witness_access constants.%impl_witness.bd0, element0 [template = constants.%Op.0e2] +// CHECK:STDOUT: %bound_method.loc4_27.1: = bound_method %.loc4_19.2, %impl.elem0.loc4_27.1 [template = constants.%Op.bound.393] +// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %bound_method.loc4_27.1(%.loc4_19.2, %.loc4_32.2) [template = constants.%int_3.a0f] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32.builtin] -// CHECK:STDOUT: %impl.elem0.loc4_27.2: %Convert.type.71e = impl_witness_access constants.%impl_witness.8f3, element0 [template = constants.%Convert.b32] -// CHECK:STDOUT: %Convert.bound.loc4_27: = bound_method %int.sadd, %impl.elem0.loc4_27.2 [template = constants.%Convert.bound.65a] +// CHECK:STDOUT: %impl.elem0.loc4_27.2: %.38f = impl_witness_access constants.%impl_witness.8f3, element0 [template = constants.%Convert.b32] +// CHECK:STDOUT: %bound_method.loc4_27.2: = bound_method %int.sadd, %impl.elem0.loc4_27.2 [template = constants.%Convert.bound.65a] // CHECK:STDOUT: %.loc4_27.1: %i32.builtin = value_of_initializer %int.sadd [template = constants.%int_3.a0f] // CHECK:STDOUT: %.loc4_27.2: %i32.builtin = converted %int.sadd, %.loc4_27.1 [template = constants.%int_3.a0f] -// CHECK:STDOUT: %int.convert_checked.loc4_27: init Core.IntLiteral = call %Convert.bound.loc4_27(%.loc4_27.2) [template = constants.%int_3.1ba] +// CHECK:STDOUT: %int.convert_checked.loc4_27: init Core.IntLiteral = call %bound_method.loc4_27.2(%.loc4_27.2) [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc4_27.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_27 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc4_27.4: Core.IntLiteral = converted %int.sadd, %.loc4_27.3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %array_type: type = array_type %.loc4_27.4, %i32.builtin [template = constants.%array_type] @@ -733,7 +748,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @As(constants.%T: type) [from "core.carbon"] { +// CHECK:STDOUT: generic interface @As(imports.%Core.import_ref.f6b058.1: type) [from "core.carbon"] { // 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: @@ -760,7 +775,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: witness = (imports.%Core.Op) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(constants.%T: type) [from "core.carbon"] { +// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.f6b058.3: type) [from "core.carbon"] { // 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: @@ -802,7 +817,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "core.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.1(constants.%T: type, constants.%Self.65a: %As.type.eed) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Convert.1(imports.%Core.import_ref.f6b058.2: type, imports.%Core.import_ref.996: @As.%As.type (%As.type.eed)) [from "core.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%T)> [symbolic = %As.type (constants.%As.type.eed)] // CHECK:STDOUT: %Self: %As.type.eed = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.65a)] @@ -811,7 +826,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type (%Self.as_type.04d)]() -> @Convert.1.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.2(constants.%T: type, constants.%Self.519: %ImplicitAs.type.d62) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Convert.2(imports.%Core.import_ref.f6b058.4: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "core.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)] // CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)] @@ -822,7 +837,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: // CHECK:STDOUT: fn @Convert.3[%self.param_patt: Core.IntLiteral]() -> %i32.builtin = "int.convert_checked" [from "core.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(constants.%Self.a99: %Add.type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.442: %Add.type) [from "core.carbon"] { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.a99)] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.da9)] // CHECK:STDOUT: @@ -844,9 +859,9 @@ 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.378 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc] -// CHECK:STDOUT: %Convert.bound.loc4_53: = bound_method %int_3.loc4_51, %impl.elem0.loc4_53 [template = constants.%Convert.bound.94d] -// CHECK:STDOUT: %int.convert_checked.loc4_53: init %i32.builtin = call %Convert.bound.loc4_53(%int_3.loc4_51) [template = constants.%int_3.a0f] +// CHECK:STDOUT: %impl.elem0.loc4_53: %.dc4 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc] +// CHECK:STDOUT: %bound_method.loc4_53: = bound_method %int_3.loc4_51, %impl.elem0.loc4_53 [template = constants.%Convert.bound.94d] +// CHECK:STDOUT: %int.convert_checked.loc4_53: init %i32.builtin = call %bound_method.loc4_53(%int_3.loc4_51) [template = constants.%int_3.a0f] // CHECK:STDOUT: %.loc4_53.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_53 [template = constants.%int_3.a0f] // CHECK:STDOUT: %.loc4_53.2: %i32.builtin = converted %int_3.loc4_51, %.loc4_53.1 [template = constants.%int_3.a0f] // CHECK:STDOUT: %int_4.loc4_64: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] @@ -854,25 +869,25 @@ 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.378 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc] -// CHECK:STDOUT: %Convert.bound.loc4_66: = bound_method %int_4.loc4_64, %impl.elem0.loc4_66 [template = constants.%Convert.bound.8fc] -// CHECK:STDOUT: %int.convert_checked.loc4_66: init %i32.builtin = call %Convert.bound.loc4_66(%int_4.loc4_64) [template = constants.%int_4.4f1] +// CHECK:STDOUT: %impl.elem0.loc4_66: %.dc4 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc] +// CHECK:STDOUT: %bound_method.loc4_66: = bound_method %int_4.loc4_64, %impl.elem0.loc4_66 [template = constants.%Convert.bound.8fc] +// CHECK:STDOUT: %int.convert_checked.loc4_66: init %i32.builtin = call %bound_method.loc4_66(%int_4.loc4_64) [template = constants.%int_4.4f1] // CHECK:STDOUT: %.loc4_66.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_66 [template = constants.%int_4.4f1] // CHECK:STDOUT: %.loc4_66.2: %i32.builtin = converted %int_4.loc4_64, %.loc4_66.1 [template = constants.%int_4.4f1] -// CHECK:STDOUT: %impl.elem0.loc4_61: %Op.type.545 = impl_witness_access constants.%impl_witness.bd0, element0 [template = constants.%Op.0e2] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc4_53.2, %impl.elem0.loc4_61 [template = constants.%Op.bound.423] -// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %Op.bound(%.loc4_53.2, %.loc4_66.2) [template = constants.%int_7] +// CHECK:STDOUT: %impl.elem0.loc4_61: %.7c2 = impl_witness_access constants.%impl_witness.bd0, element0 [template = constants.%Op.0e2] +// CHECK:STDOUT: %bound_method.loc4_61: = bound_method %.loc4_53.2, %impl.elem0.loc4_61 [template = constants.%Op.bound.423] +// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %bound_method.loc4_61(%.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.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc4_73.1: = bound_method %int_3.loc4_44, %impl.elem0.loc4_73.1 [template = constants.%Convert.bound.b6b] -// 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.a0f] +// CHECK:STDOUT: %impl.elem0.loc4_73.1: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc4_73.1: = bound_method %int_3.loc4_44, %impl.elem0.loc4_73.1 [template = constants.%Convert.bound.b6b] +// CHECK:STDOUT: %int.convert_checked.loc4_73.1: init %i32.builtin = call %bound_method.loc4_73.1(%int_3.loc4_44) [template = constants.%int_3.a0f] // CHECK:STDOUT: %.loc4_73.2: init %i32.builtin = converted %int_3.loc4_44, %int.convert_checked.loc4_73.1 [template = constants.%int_3.a0f] // 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.a0f] -// CHECK:STDOUT: %impl.elem0.loc4_73.2: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc4_73.2: = bound_method %int_4.loc4_47, %impl.elem0.loc4_73.2 [template = constants.%Convert.bound.626] -// 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.4f1] +// CHECK:STDOUT: %impl.elem0.loc4_73.2: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc4_73.2: = bound_method %int_4.loc4_47, %impl.elem0.loc4_73.2 [template = constants.%Convert.bound.626] +// CHECK:STDOUT: %int.convert_checked.loc4_73.2: init %i32.builtin = call %bound_method.loc4_73.2(%int_4.loc4_47) [template = constants.%int_4.4f1] // CHECK:STDOUT: %.loc4_73.5: init %i32.builtin = converted %int_4.loc4_47, %int.convert_checked.loc4_73.2 [template = constants.%int_4.4f1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc4_73.6: ref %i32.builtin = array_index file.%arr.var, %int_1 diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 53f281157f6a9..1b989d408bbef 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -26,10 +26,13 @@ fn Main() { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -86,10 +89,10 @@ fn Main() { // CHECK:STDOUT: %b.var: ref %i32 = var b // 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.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_21.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_21.2: %i32 = converted %int_1, %.loc16_21.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %Echo.call: init %i32 = call %Echo.ref(%.loc16_21.2) diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index b0708d72daf75..aa74550b1f88c 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -30,10 +30,13 @@ fn Main() { // CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -97,10 +100,10 @@ fn Main() { // CHECK:STDOUT: %x.var: ref %tuple.type.a1c = var x // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc14_22.1: %tuple.type.985 = tuple_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1, %impl.elem0.loc14 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc14: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14: = bound_method %int_1, %impl.elem0.loc14 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14: = specific_function %bound_method.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %specific_fn.loc14(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_22.2: init %i32 = converted %int_1, %int.convert_checked.loc14 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_22.3: init %tuple.type.a1c = tuple_init (%.loc14_22.2) to %x.var [template = constants.%tuple] // CHECK:STDOUT: %.loc14_3.2: init %tuple.type.a1c = converted %.loc14_22.1, %.loc14_22.3 [template = constants.%tuple] @@ -118,10 +121,10 @@ 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.462] // CHECK:STDOUT: %.loc16_8: %i32 = bind_value %tuple.elem0 -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_6, %impl.elem0.loc16 [template = constants.%Convert.bound.ce9] -// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_6) [template = constants.%int_6.e56] +// CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_6, %impl.elem0.loc16 [template = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_6) [template = constants.%int_6.e56] // CHECK:STDOUT: %.loc16_12.1: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_6.e56] // CHECK:STDOUT: %.loc16_12.2: %i32 = converted %int_6, %.loc16_12.1 [template = constants.%int_6.e56] // CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc16_8, %.loc16_12.2) diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index 1bab212ff1861..e612181e0ed22 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -25,10 +25,13 @@ fn Main() { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -73,10 +76,10 @@ 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.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1, %.loc14_7.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc14_7.2) diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index 31237cccbffd2..b60698eb5c83d 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -26,10 +26,13 @@ fn Main() { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -74,19 +77,19 @@ 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.5b8] -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc14: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14: = bound_method %int_1.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc14: = specific_function %bound_method.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %specific_fn.loc14(%int_1.loc14) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1.loc14, %.loc14_7.1 [template = constants.%int_1.5d2] // 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.5b8] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc15: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc15: = bound_method %int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %bound_method.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %specific_fn.loc15(%int_1.loc15) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_7.1: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_7.2: %i32 = converted %int_1.loc15, %.loc15_7.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %Foo.call.loc15: init %empty_tuple.type = call %Foo.ref.loc15(%.loc15_7.2) diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index e7b383650b725..529afc65d2c81 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -26,10 +26,13 @@ fn Main() { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -86,16 +89,16 @@ 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.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_7: = bound_method %int_1, %impl.elem0.loc14_7 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc14_7: = specific_function %Convert.bound.loc14_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %Convert.specific_fn.loc14_7(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc14_7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_7: = bound_method %int_1, %impl.elem0.loc14_7 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14_7: = specific_function %bound_method.loc14_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %specific_fn.loc14_7(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1, %.loc14_7.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_10: = bound_method %int_2, %impl.elem0.loc14_10 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc14_10: = specific_function %Convert.bound.loc14_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %Convert.specific_fn.loc14_10(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc14_10: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_10: = bound_method %int_2, %impl.elem0.loc14_10 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_10: = specific_function %bound_method.loc14_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %specific_fn.loc14_10(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_10.1: %i32 = value_of_initializer %int.convert_checked.loc14_10 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_10.2: %i32 = converted %int_2, %.loc14_10.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc14_7.2, %.loc14_10.2) diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index a3de1deaa19fb..bec60c0e918bf 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -27,10 +27,13 @@ fn Main() { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -87,32 +90,32 @@ 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.5b8] // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_7: = bound_method %int_1.loc14, %impl.elem0.loc14_7 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc14_7: = specific_function %Convert.bound.loc14_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %Convert.specific_fn.loc14_7(%int_1.loc14) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc14_7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_7: = bound_method %int_1.loc14, %impl.elem0.loc14_7 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14_7: = specific_function %bound_method.loc14_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %specific_fn.loc14_7(%int_1.loc14) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1.loc14, %.loc14_7.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_10: = bound_method %int_2.loc14, %impl.elem0.loc14_10 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc14_10: = specific_function %Convert.bound.loc14_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %Convert.specific_fn.loc14_10(%int_2.loc14) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc14_10: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_10: = bound_method %int_2.loc14, %impl.elem0.loc14_10 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_10: = specific_function %bound_method.loc14_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %specific_fn.loc14_10(%int_2.loc14) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_10.1: %i32 = value_of_initializer %int.convert_checked.loc14_10 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_10.2: %i32 = converted %int_2.loc14, %.loc14_10.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %Foo.call.loc14: init %empty_tuple.type = call %Foo.ref.loc14(%.loc14_7.2, %.loc14_10.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.5b8] // CHECK:STDOUT: %int_2.loc15: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc15_7: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15_7: = bound_method %int_1.loc15, %impl.elem0.loc15_7 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc15_7: = specific_function %Convert.bound.loc15_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc15_7: init %i32 = call %Convert.specific_fn.loc15_7(%int_1.loc15) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc15_7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc15_7: = bound_method %int_1.loc15, %impl.elem0.loc15_7 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc15_7: = specific_function %bound_method.loc15_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc15_7: init %i32 = call %specific_fn.loc15_7(%int_1.loc15) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_7.1: %i32 = value_of_initializer %int.convert_checked.loc15_7 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_7.2: %i32 = converted %int_1.loc15, %.loc15_7.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc15_10: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15_10: = bound_method %int_2.loc15, %impl.elem0.loc15_10 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc15_10: = specific_function %Convert.bound.loc15_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc15_10: init %i32 = call %Convert.specific_fn.loc15_10(%int_2.loc15) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc15_10: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc15_10: = bound_method %int_2.loc15, %impl.elem0.loc15_10 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc15_10: = specific_function %bound_method.loc15_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc15_10: init %i32 = call %specific_fn.loc15_10(%int_2.loc15) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_10.1: %i32 = value_of_initializer %int.convert_checked.loc15_10 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_10.2: %i32 = converted %int_2.loc15, %.loc15_10.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %Foo.call.loc15: init %empty_tuple.type = call %Foo.ref.loc15(%.loc15_7.2, %.loc15_10.2) diff --git a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon index 2f59707f809f9..6b0097e7e9d02 100644 --- a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon +++ b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon @@ -42,10 +42,13 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -147,10 +150,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc8_29.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc8_29.2: %i32 = converted %int_0, %.loc8_29.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc8_29.2 diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 0f3cddf72c284..8c25928f0412f 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -453,10 +453,13 @@ import library "extern_api"; // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -576,10 +579,10 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [template = constants.%B] // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc7: = bound_method %int_1.loc7, %impl.elem0.loc7 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc7: = specific_function %bound_method.loc7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %specific_fn.loc7(%int_1.loc7) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_16.1: %i32 = value_of_initializer %int.convert_checked.loc7 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_16.2: %i32 = converted %int_1.loc7, %.loc7_16.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc7_16.2) @@ -587,10 +590,10 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [template = constants.%C] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.985 = tuple_literal (%int_1.loc8) -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc8: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8: = specific_function %bound_method.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_25.2: %i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_25.3: %i32 = converted %int_1.loc8, %.loc8_25.2 [template = constants.%int_1.5d2] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc8_25.3) [template = constants.%tuple] @@ -627,10 +630,13 @@ import library "extern_api"; // CHECK:STDOUT: %E.type: type = fn_type @E [template] // CHECK:STDOUT: %E: %E.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -767,10 +773,10 @@ 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.5b8] -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc53: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc53: = specific_function %bound_method.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2) @@ -778,10 +784,10 @@ 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.5b8] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54) -// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc54: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc54: = specific_function %bound_method.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %int.convert_checked.loc54 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [template = constants.%int_1.5d2] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc54_25.3) [template = constants.%tuple] @@ -818,10 +824,13 @@ import library "extern_api"; // CHECK:STDOUT: %E.type: type = fn_type @E [template] // CHECK:STDOUT: %E: %E.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -958,10 +967,10 @@ 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.5b8] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_1.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_1.loc13) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_16.1: %i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_16.2: %i32 = converted %int_1.loc13, %.loc13_16.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc13_16.2) @@ -969,10 +978,10 @@ 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.5b8] // CHECK:STDOUT: %.loc14_25.1: %tuple.type.985 = tuple_literal (%int_1.loc14) -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc14: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14: = bound_method %int_1.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc14: = specific_function %bound_method.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %specific_fn.loc14(%int_1.loc14) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_25.2: %i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_25.3: %i32 = converted %int_1.loc14, %.loc14_25.2 [template = constants.%int_1.5d2] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc14_25.3) [template = constants.%tuple] @@ -1000,10 +1009,13 @@ import library "extern_api"; // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -1123,10 +1135,10 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [template = constants.%B] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc53: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc53: = specific_function %bound_method.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2) @@ -1134,10 +1146,10 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [template = constants.%C] // CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54) -// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc54: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc54: = specific_function %bound_method.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %int.convert_checked.loc54 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [template = constants.%int_1.5d2] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc54_25.3) [template = constants.%tuple] @@ -1165,10 +1177,13 @@ import library "extern_api"; // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -1288,10 +1303,10 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [template = constants.%B] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc53: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc53: = specific_function %bound_method.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2) @@ -1299,10 +1314,10 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [template = constants.%C] // CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54) -// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc54: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc54: = specific_function %bound_method.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %int.convert_checked.loc54 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [template = constants.%int_1.5d2] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc54_25.3) [template = constants.%tuple] diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index e6047c7f1e6ff..75c7c4a97616c 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -247,10 +247,13 @@ fn D() {} // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -334,10 +337,10 @@ fn D() {} // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [template = constants.%B] // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc7: = bound_method %int_1.loc7, %impl.elem0.loc7 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc7: = specific_function %bound_method.loc7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %specific_fn.loc7(%int_1.loc7) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_16.1: %i32 = value_of_initializer %int.convert_checked.loc7 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_16.2: %i32 = converted %int_1.loc7, %.loc7_16.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc7_16.2) @@ -345,10 +348,10 @@ fn D() {} // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [template = constants.%C] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.985 = tuple_literal (%int_1.loc8) -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc8: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8: = specific_function %bound_method.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_25.2: %i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_25.3: %i32 = converted %int_1.loc8, %.loc8_25.2 [template = constants.%int_1.5d2] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc8_25.3) [template = constants.%tuple] diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index cd8f1601290e7..639bed087c746 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -785,10 +785,13 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %tuple.type.4c8: type = tuple_type (Core.IntLiteral, %i32) [template] // CHECK:STDOUT: %TupleParam.specific_fn: = specific_function %TupleParam, @TupleParam(Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template] @@ -854,10 +857,10 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc7_19.1: %tuple.type.f94 = 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc7_19.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc7_19.3: %i32 = converted %int_2, %.loc7_19.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %tuple: %tuple.type.4c8 = tuple_value (%int_1, %.loc7_19.3) [template = constants.%tuple] @@ -900,10 +903,13 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %struct_type.a.b.a13: type = struct_type {.a: Core.IntLiteral, .b: %i32} [template] // CHECK:STDOUT: %StructParam.specific_fn: = specific_function %StructParam, @StructParam(Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template] @@ -968,10 +974,10 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc7_30.1: %struct_type.a.b.cfd = 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc7_30.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc7_30.3: %i32 = converted %int_2, %.loc7_30.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %struct: %struct_type.a.b.a13 = struct_value (%int_1, %.loc7_30.3) [template = constants.%struct] diff --git a/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon b/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon index 913c71152b4df..cb343da2364a1 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon @@ -122,8 +122,8 @@ fn H() { // CHECK:STDOUT: %H: %H.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %F.specific_fn.04a: = specific_function %F, @F(%C) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] @@ -134,6 +134,8 @@ fn H() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.F: %F.type = import_ref Main//library, F, loaded [template = constants.%F] // CHECK:STDOUT: %Main.G: %G.type = import_ref Main//library, G, loaded [template = constants.%G] +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//library, loc4_6, loaded [symbolic = @F.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//library, loc7_6, loaded [symbolic = @G.%T (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -169,7 +171,7 @@ fn H() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(constants.%T: type) [from "library.carbon"] { +// CHECK:STDOUT: generic fn @F(imports.%Main.import_ref.f6b058.1: type) [from "library.carbon"] { // 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: @@ -178,7 +180,7 @@ fn H() { // CHECK:STDOUT: fn(%T.param_patt: type); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(constants.%T: type) [from "library.carbon"] { +// CHECK:STDOUT: generic fn @G(imports.%Main.import_ref.f6b058.2: type) [from "library.carbon"] { // 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: diff --git a/toolchain/check/testdata/function/generic/param_in_type.carbon b/toolchain/check/testdata/function/generic/param_in_type.carbon index 9a5166bae99d4..92e299ab90c82 100644 --- a/toolchain/check/testdata/function/generic/param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/param_in_type.carbon @@ -17,10 +17,13 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %N.51e: %i32 = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %N.patt.8e2: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [template] +// CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.51e, %Convert.960 [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.51e) [symbolic] @@ -62,10 +65,10 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc11_6.1 [symbolic = %N.loc11_6.2 (constants.%N.51e)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] -// CHECK:STDOUT: %Convert.bound.loc11_24.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc11_24.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc11_24.1: = specific_function %Convert.bound.loc11_24.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc11_24.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc11_24.1: init Core.IntLiteral = call %Convert.specific_fn.loc11_24.1(%N.ref) [symbolic = %int.convert_checked.loc11_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %impl.elem0: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] +// CHECK:STDOUT: %bound_method: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc11_24.1: init Core.IntLiteral = call %specific_fn(%N.ref) [symbolic = %int.convert_checked.loc11_24.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc11_24.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc11_24.1 [symbolic = %int.convert_checked.loc11_24.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc11_24.2: Core.IntLiteral = converted %N.ref, %.loc11_24.1 [symbolic = %int.convert_checked.loc11_24.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc11_25.1: type = array_type %.loc11_24.2, %i32 [symbolic = %array_type.loc11_25.2 (constants.%array_type)] @@ -78,9 +81,9 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: generic fn @F(%N.loc11_6.1: %i32) { // CHECK:STDOUT: %N.loc11_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc11_6.2 (constants.%N.51e)] // CHECK:STDOUT: %N.patt.loc11_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_6.2 (constants.%N.patt.8e2)] -// CHECK:STDOUT: %Convert.bound.loc11_24.2: = bound_method %N.loc11_6.2, constants.%Convert.960 [symbolic = %Convert.bound.loc11_24.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc11_24.2: = specific_function %Convert.bound.loc11_24.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc11_24.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc11_24.2: init Core.IntLiteral = call %Convert.specific_fn.loc11_24.2(%N.loc11_6.2) [symbolic = %int.convert_checked.loc11_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.loc11_6.2, constants.%Convert.960 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc11_24.2: init Core.IntLiteral = call %Convert.specific_fn(%N.loc11_6.2) [symbolic = %int.convert_checked.loc11_24.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc11_25.2: type = array_type %int.convert_checked.loc11_24.2, %i32 [symbolic = %array_type.loc11_25.2 (constants.%array_type)] // CHECK:STDOUT: %ptr.loc11_26.2: type = ptr_type @F.%array_type.loc11_25.2 (%array_type) [symbolic = %ptr.loc11_26.2 (constants.%ptr)] // CHECK:STDOUT: @@ -90,8 +93,8 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: specific @F(constants.%N.51e) { // CHECK:STDOUT: %N.loc11_6.2 => constants.%N.51e // CHECK:STDOUT: %N.patt.loc11_6.2 => constants.%N.51e -// CHECK:STDOUT: %Convert.bound.loc11_24.2 => constants.%Convert.bound -// CHECK:STDOUT: %Convert.specific_fn.loc11_24.2 => constants.%Convert.specific_fn +// CHECK:STDOUT: %Convert.bound => constants.%Convert.bound +// CHECK:STDOUT: %Convert.specific_fn => constants.%Convert.specific_fn // CHECK:STDOUT: %int.convert_checked.loc11_24.2 => constants.%int.convert_checked // CHECK:STDOUT: %array_type.loc11_25.2 => constants.%array_type // CHECK:STDOUT: %ptr.loc11_26.2 => constants.%ptr diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index dd85467e1a360..52e57ac4a17e4 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -66,10 +66,13 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [template] // CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %impl_witness.882: = impl_witness (imports.%Core.import_ref.78a), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template] +// CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [template] +// CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.197 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -140,10 +143,10 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_20.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_20.2: %i32 = converted %int_0, %.loc9_20.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %Defined.specific_fn: = specific_function %Defined.ref, @Defined(constants.%i32) [template = constants.%Defined.specific_fn] @@ -180,10 +183,13 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [template] // CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %impl_witness.882: = impl_witness (imports.%Core.import_ref.78a), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template] +// CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [template] +// CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.197 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -272,10 +278,10 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc7_20.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc7_20.2: %i32 = converted %int_0, %.loc7_20.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %Defined.specific_fn: = specific_function %Defined.ref, @Defined(constants.%i32) [template = constants.%Defined.specific_fn] @@ -310,10 +316,13 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %CallUndefined.type: type = fn_type @CallUndefined [template] // CHECK:STDOUT: %CallUndefined: %CallUndefined.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [template] // CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %impl_witness.882: = impl_witness (imports.%Core.import_ref.78a), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template] +// CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [template] +// CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.197 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -377,10 +386,10 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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: %Convert.type.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc14_22.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc14_22.2: %i32 = converted %int_0, %.loc14_22.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %Undefined.specific_fn: = specific_function %Undefined.ref, @Undefined(constants.%i32) [template = constants.%Undefined.specific_fn] diff --git a/toolchain/check/testdata/generic/local.carbon b/toolchain/check/testdata/generic/local.carbon index 78db514b31bb8..67386d249a836 100644 --- a/toolchain/check/testdata/generic/local.carbon +++ b/toolchain/check/testdata/generic/local.carbon @@ -67,10 +67,13 @@ class C(C:! type) { // CHECK:STDOUT: %complete_type.1ec: = complete_type_witness %struct_type.x.ed6 [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.x.c96: type = struct_type {.x: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -137,10 +140,10 @@ class C(C:! type) { // CHECK:STDOUT: %v.var: ref %C.d45 = var v // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc8_26.1: %struct_type.x.c96 = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_26.2: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_26.3: ref %i32 = class_element_access %v.var, element0 // CHECK:STDOUT: %.loc8_26.4: init %i32 = initialize_from %.loc8_26.2 to %.loc8_26.3 [template = constants.%int_1.5d2] diff --git a/toolchain/check/testdata/global/simple_init.carbon b/toolchain/check/testdata/global/simple_init.carbon index 143bf0e6a887e..c7d6b9a7bd373 100644 --- a/toolchain/check/testdata/global/simple_init.carbon +++ b/toolchain/check/testdata/global/simple_init.carbon @@ -15,10 +15,13 @@ var a: i32 = 0; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -54,10 +57,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc10: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%a.var, %.loc10 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/global/simple_with_fun.carbon b/toolchain/check/testdata/global/simple_with_fun.carbon index a459a5a197a13..f7d5095bded72 100644 --- a/toolchain/check/testdata/global/simple_with_fun.carbon +++ b/toolchain/check/testdata/global/simple_with_fun.carbon @@ -22,10 +22,13 @@ var a: i32 = test_a(); // CHECK:STDOUT: %test_a.type: type = fn_type @test_a [template] // CHECK:STDOUT: %test_a: %test_a.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -71,10 +74,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.2: %i32 = converted %int_0, %.loc12_11.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc12_11.2 diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index b0acfae8c8200..840ac516a1c90 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -50,10 +50,13 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %If1.type: type = fn_type @If1 [template] // CHECK:STDOUT: %If1: %If1.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -148,10 +151,10 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.2: %i32 = converted %int_1, %.loc13_13.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc13_13.2 @@ -172,10 +175,10 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_13.2: %i32 = converted %int_2, %.loc25_13.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: return %.loc25_13.2 @@ -190,10 +193,10 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_13.2: %i32 = converted %int_1, %.loc35_13.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc35_13.2 diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index 0f2e0dbf8b10a..1143a7700fa83 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -30,10 +30,13 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %VarScope.type: type = fn_type @VarScope [template] // CHECK:STDOUT: %VarScope: %VarScope.type = struct_value () [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template] @@ -87,10 +90,10 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_5.2: init %i32 = converted %int_2, %int.convert_checked [template = constants.%int_2.ef8] // CHECK:STDOUT: assign %n.var, %.loc13_5.2 // CHECK:STDOUT: %.loc13_12: type = splice_block %i32.loc13 [template = constants.%i32] { diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index 90837a0dda21f..ba75cffeebf80 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -27,10 +27,13 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: %If.type: type = fn_type @If [template] // CHECK:STDOUT: %If: %If.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -83,20 +86,20 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_1, %impl.elem0.loc13 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_1, %impl.elem0.loc13 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.1: %i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.2: %i32 = converted %int_1, %.loc13_13.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc13_13.2 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_2, %impl.elem0.loc15 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc15: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc15: = bound_method %int_2, %impl.elem0.loc15 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %bound_method.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %specific_fn.loc15(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_13.1: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_13.2: %i32 = converted %int_2, %.loc15_13.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: return %.loc15_13.2 diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index a958530578970..d0b9b0ee166c1 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -26,10 +26,13 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -97,10 +100,10 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %x.var: ref %array_type = var x // CHECK:STDOUT: %int_0.loc12_22: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // CHECK:STDOUT: %.loc12_24.1: %tuple.type = tuple_literal (%int_0.loc12_22) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.loc12_22, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0.loc12_22) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_24.2: init %i32 = converted %int_0.loc12_22, %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %int_0.loc12_24: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // CHECK:STDOUT: %.loc12_24.3: ref %i32 = array_index %x.var, %int_0.loc12_24 diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index 07a15cb8c8d66..ca3250c0f2bcb 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -39,10 +39,13 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -148,10 +151,10 @@ 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.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_25.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_25.2: %i32 = converted %int_1, %.loc11_25.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc11_25.2 @@ -160,10 +163,10 @@ 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.ecc] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_25.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_25.2: %i32 = converted %int_2, %.loc12_25.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: return %.loc12_25.2 @@ -225,10 +228,10 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc23_3.2: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %v.var, %.loc23_3.2 // CHECK:STDOUT: br !.loc23_13 @@ -300,10 +303,10 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc29_3.2: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %v.var, %.loc29_3.2 // CHECK:STDOUT: br !.loc29_13 diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index 4510fa207434e..e4d29f725584c 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -23,10 +23,13 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -101,10 +104,10 @@ 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.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_25.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_25.2: %i32 = converted %int_1, %.loc11_25.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc11_25.2 @@ -113,10 +116,10 @@ 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.ecc] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_25.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_25.2: %i32 = converted %int_2, %.loc12_25.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: return %.loc12_25.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 567707156dd0c..7f28995cfd46b 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -94,7 +94,7 @@ class C { // 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: } -// CHECK:STDOUT: %x: %i32 = bind_name x, .inst998.loc27_14 +// CHECK:STDOUT: %x: %i32 = bind_name x, .inst1051.loc27_14 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %y.patt: %i32 = binding_pattern y // CHECK:STDOUT: %.loc37: %i32 = var_pattern %y.patt diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index 25a3635b537f1..17c045aeb94a5 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -22,10 +22,13 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -110,20 +113,20 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12_25: = bound_method %int_1, %impl.elem0.loc12_25 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc12_25: = specific_function %Convert.bound.loc12_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc12_25: init %i32 = call %Convert.specific_fn.loc12_25(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc12_25: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12_25: = bound_method %int_1, %impl.elem0.loc12_25 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc12_25: = specific_function %bound_method.loc12_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc12_25: init %i32 = call %specific_fn.loc12_25(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_25.1: %i32 = value_of_initializer %int.convert_checked.loc12_25 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_25.2: %i32 = converted %int_1, %.loc12_25.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_25.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc12_20: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12_32: = bound_method %int_2, %impl.elem0.loc12_32 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc12_32: = specific_function %Convert.bound.loc12_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %Convert.specific_fn.loc12_32(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc12_32: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12_32: = bound_method %int_2, %impl.elem0.loc12_32 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc12_32: = specific_function %bound_method.loc12_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %specific_fn.loc12_32(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_32.1: %i32 = value_of_initializer %int.convert_checked.loc12_32 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_32.2: %i32 = converted %int_2, %.loc12_32.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_32.2) @@ -140,20 +143,20 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12_49: = bound_method %int_3, %impl.elem0.loc12_49 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc12_49: = specific_function %Convert.bound.loc12_49, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc12_49: init %i32 = call %Convert.specific_fn.loc12_49(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc12_49: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12_49: = bound_method %int_3, %impl.elem0.loc12_49 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc12_49: = specific_function %bound_method.loc12_49, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc12_49: init %i32 = call %specific_fn.loc12_49(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.convert_checked.loc12_49 [template = constants.%int_3.822] // CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int_3, %.loc12_49.1 [template = constants.%int_3.822] // CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_49.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc12_44: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] -// CHECK:STDOUT: %impl.elem0.loc12_56: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12_56: = bound_method %int_4, %impl.elem0.loc12_56 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc12_56: = specific_function %Convert.bound.loc12_56, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc12_56: init %i32 = call %Convert.specific_fn.loc12_56(%int_4) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc12_56: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12_56: = bound_method %int_4, %impl.elem0.loc12_56 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc12_56: = specific_function %bound_method.loc12_56, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc12_56: init %i32 = call %specific_fn.loc12_56(%int_4) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc12_56.1: %i32 = value_of_initializer %int.convert_checked.loc12_56 [template = constants.%int_4.940] // CHECK:STDOUT: %.loc12_56.2: %i32 = converted %int_4, %.loc12_56.1 [template = constants.%int_4.940] // CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_56.2) diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 27a322f7be5a8..5c1aadef84c72 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -31,10 +31,13 @@ fn F(cond: bool) { // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -101,17 +104,17 @@ fn F(cond: bool) { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc14_46.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc14_46.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_46.1: = bound_method %int_1, %impl.elem0.loc14_46.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_46.1: init %i32 = call %Convert.specific_fn.loc14_46.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc14_46.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_46.1: = bound_method %int_1, %impl.elem0.loc14_46.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14_46.1: = specific_function %bound_method.loc14_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc14_46.1: init %i32 = call %specific_fn.loc14_46.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_46.2: init %i32 = converted %int_1, %int.convert_checked.loc14_46.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc14_46.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_46.2: = bound_method %int_2, %impl.elem0.loc14_46.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc14_46.2: init %i32 = call %Convert.specific_fn.loc14_46.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc14_46.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_46.2: = bound_method %int_2, %impl.elem0.loc14_46.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_46.2: = specific_function %bound_method.loc14_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc14_46.2: init %i32 = call %specific_fn.loc14_46.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_46.5: init %i32 = converted %int_2, %int.convert_checked.loc14_46.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_46.6: ref %i32 = struct_access %a.var, element1 // CHECK:STDOUT: %.loc14_46.7: init %i32 = initialize_from %.loc14_46.5 to %.loc14_46.6 [template = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/impl/assoc_const_self.carbon b/toolchain/check/testdata/impl/assoc_const_self.carbon index 8475b870ba3c5..aaefc4e278790 100644 --- a/toolchain/check/testdata/impl/assoc_const_self.carbon +++ b/toolchain/check/testdata/impl/assoc_const_self.carbon @@ -128,10 +128,13 @@ fn CallF() { // CHECK:STDOUT: %I.facet.401: %I.type = facet_value %i32, %impl_witness.6f4 [template] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -189,10 +192,10 @@ fn CallF() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness.loc10: = impl_witness (constants.%int_0.6a9) [template = constants.%impl_witness.6f4] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method constants.%int_0.5c6, %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(constants.%int_0.5c6) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method constants.%int_0.5c6, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(constants.%int_0.5c6) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc10_15.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc10_15.2: %i32 = converted constants.%int_0.5c6, %.loc10_15.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: } @@ -372,6 +375,7 @@ fn CallF() { // CHECK:STDOUT: %impl_witness.3db: = impl_witness (@impl.1.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.721: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.155: %Convert.type.721 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.15e = facet_value %empty_tuple.type, %impl_witness.3db [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic] @@ -383,6 +387,7 @@ fn CallF() { // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple> [template] // CHECK:STDOUT: %impl_witness.85b: = impl_witness () [template] // CHECK:STDOUT: %I.facet.b45: %I.type = facet_value %C, %impl_witness.85b [template] +// CHECK:STDOUT: %.d4d: type = fn_type_with_self_type %Convert.type.56d, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %empty_tuple, %Convert.155 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -431,10 +436,10 @@ fn CallF() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness.loc18: = impl_witness () [template = constants.%impl_witness.85b] -// CHECK:STDOUT: %impl.elem0: %Convert.type.56d = impl_witness_access constants.%impl_witness.3db, element0 [template = constants.%Convert.155] -// CHECK:STDOUT: %Convert.bound: = bound_method constants.%empty_tuple, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %impl.elem0: %.d4d = impl_witness_access constants.%impl_witness.3db, element0 [template = constants.%Convert.155] +// CHECK:STDOUT: %bound_method: = bound_method constants.%empty_tuple, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %.loc18_13.1: ref %C = temporary_storage -// CHECK:STDOUT: %Convert.call: init %C = call %Convert.bound(constants.%empty_tuple) to %.loc18_13.1 +// CHECK:STDOUT: %Convert.call: init %C = call %bound_method(constants.%empty_tuple) to %.loc18_13.1 // CHECK:STDOUT: %.loc18_13.2: init %C = converted constants.%empty_tuple, %Convert.call // CHECK:STDOUT: %.loc18_13.3: ref %C = temporary %.loc18_13.1, %.loc18_13.2 // CHECK:STDOUT: %.loc18_13.4: %C = bind_value %.loc18_13.3 @@ -541,8 +546,11 @@ fn CallF() { // CHECK:STDOUT: %assoc0.6db: %I.assoc_type.656 = assoc_entity element0, @I.%V [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [template] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Core.import_ref.c15) [template] // CHECK:STDOUT: %Op.type.e42: type = fn_type @Op.1 [template] +// CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value Core.IntLiteral, %impl_witness [template] +// CHECK:STDOUT: %.45d: type = fn_type_with_self_type %Op.type.e42, %Negate.facet [template] // CHECK:STDOUT: %Op.type.1be: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.bba: %Op.type.1be = struct_value () [template] // CHECK:STDOUT: %Op.bound: = bound_method %int_1, %Op.bba [template] @@ -553,7 +561,7 @@ fn CallF() { // CHECK:STDOUT: %assoc0.34f: %I.assoc_type.3f5 = assoc_entity element0, @I.%V [template] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] -// CHECK:STDOUT: %I.facet: %I.type.8a1 = facet_value %.Self.as_type, %.Self.as_wit [symbolic] +// CHECK:STDOUT: %I.facet: %I.type.057 = facet_value %.Self.as_type, %.Self.as_wit [symbolic] // CHECK:STDOUT: %impl.elem0: = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -592,9 +600,9 @@ fn CallF() { // CHECK:STDOUT: %.loc15_7.2: type = converted %.loc15_7.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, file.%I.decl [template = constants.%I.generic] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %impl.elem0.loc15_14: %Op.type.e42 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.bba] -// CHECK:STDOUT: %Op.bound: = bound_method %int_1, %impl.elem0.loc15_14 [template = constants.%Op.bound] -// CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %Op.bound(%int_1) [template = constants.%int_-1] +// CHECK:STDOUT: %impl.elem0.loc15_14: %.45d = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.bba] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0.loc15_14 [template = constants.%Op.bound] +// CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %bound_method(%int_1) [template = constants.%int_-1] // CHECK:STDOUT: %.loc15_16.1: Core.IntLiteral = value_of_initializer %int.snegate [template = constants.%int_-1] // CHECK:STDOUT: %.loc15_16.2: Core.IntLiteral = converted %int.snegate, %.loc15_16.1 [template = constants.%int_-1] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%int_-1)> [template = constants.%I.type.057] diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index a5d2f4d04fe63..cb7939d112643 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -58,8 +58,10 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, %impl_witness.5b2 [template] // CHECK:STDOUT: %NonInstanceCall.type: type = fn_type @NonInstanceCall [template] // CHECK:STDOUT: %NonInstanceCall: %NonInstanceCall.type = struct_value () [template] +// CHECK:STDOUT: %.187: type = fn_type_with_self_type %F.type.e2e, %Simple.facet [template] // CHECK:STDOUT: %InstanceCall.type: type = fn_type @InstanceCall [template] // CHECK:STDOUT: %InstanceCall: %InstanceCall.type = struct_value () [template] +// CHECK:STDOUT: %.b73: type = fn_type_with_self_type %G.type.b60, %Simple.facet [template] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template] // CHECK:STDOUT: %NonInstanceCallIndirect.type: type = fn_type @NonInstanceCallIndirect [template] // CHECK:STDOUT: %NonInstanceCallIndirect: %NonInstanceCallIndirect.type = struct_value () [template] @@ -205,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: %Simple.assoc_type = name_ref F, @Simple.%assoc0 [template = constants.%assoc0.9ca] -// CHECK:STDOUT: %impl.elem0: %F.type.e2e = impl_witness_access constants.%impl_witness.5b2, element0 [template = constants.%F.df1] +// CHECK:STDOUT: %impl.elem0: %.187 = impl_witness_access constants.%impl_witness.5b2, element0 [template = constants.%F.df1] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -215,9 +217,9 @@ 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: %Simple.assoc_type = name_ref G, @Simple.%assoc1 [template = constants.%assoc1] -// CHECK:STDOUT: %impl.elem1: %G.type.b60 = impl_witness_access constants.%impl_witness.5b2, element1 [template = constants.%G.e73] -// 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: %impl.elem1: %.b73 = impl_witness_access constants.%impl_witness.5b2, element1 [template = constants.%G.e73] +// CHECK:STDOUT: %bound_method: = bound_method %n.ref, %impl.elem1 +// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %bound_method(%n.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -227,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: %Simple.assoc_type = name_ref F, @Simple.%assoc0 [template = constants.%assoc0.9ca] // CHECK:STDOUT: %.loc30: ref %i32 = deref %p.ref -// CHECK:STDOUT: %impl.elem0: %F.type.e2e = impl_witness_access constants.%impl_witness.5b2, element0 [template = constants.%F.df1] +// CHECK:STDOUT: %impl.elem0: %.187 = impl_witness_access constants.%impl_witness.5b2, element0 [template = constants.%F.df1] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -238,10 +240,10 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %G.ref: %Simple.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.b60 = impl_witness_access constants.%impl_witness.5b2, element1 [template = constants.%G.e73] -// CHECK:STDOUT: %G.bound: = bound_method %.loc34_4.1, %impl.elem1 +// CHECK:STDOUT: %impl.elem1: %.b73 = impl_witness_access constants.%impl_witness.5b2, element1 [template = constants.%G.e73] +// CHECK:STDOUT: %bound_method: = 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) +// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %bound_method(%.loc34_4.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/extend_impl.carbon b/toolchain/check/testdata/impl/extend_impl.carbon index d0c764a0c0e3f..dec5324e2af02 100644 --- a/toolchain/check/testdata/impl/extend_impl.carbon +++ b/toolchain/check/testdata/impl/extend_impl.carbon @@ -42,6 +42,7 @@ fn G(c: C) { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %.626: type = fn_type_with_self_type %F.type.b7b, %HasF.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -117,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: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc22: %F.type.b7b = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.ad8] +// CHECK:STDOUT: %impl.elem0.loc22: %.626 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.ad8] // 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: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc23: %F.type.b7b = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.ad8] +// CHECK:STDOUT: %impl.elem0.loc23: %.626 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.ad8] // 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 304e2ccf590f7..c25285bcab6ab 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -75,21 +75,25 @@ class X(U:! type) { // CHECK:STDOUT: %impl_witness.9bf: = impl_witness (@impl.1.%F.decl) [template] // CHECK:STDOUT: %F.type.94c: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.901: %F.type.94c = struct_value () [template] -// CHECK:STDOUT: %HasF.facet: %HasF.type.901 = facet_value %C, %impl_witness.9bf [symbolic] +// CHECK:STDOUT: %HasF.facet: %HasF.type.b18 = facet_value %C, %impl_witness.9bf [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.x.c96: type = struct_type {.x: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template] // CHECK:STDOUT: %Param.val: %Param = struct_value (%int_2.ef8) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %.da8: type = fn_type_with_self_type %F.type.7f1, %HasF.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -215,10 +219,10 @@ class X(U:! type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc15_21.1: %struct_type.x.c96 = struct_literal (%int_2) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_21.2: init %i32 = converted %int_2, %int.convert_checked [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_21.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc15_21.4: init %i32 = initialize_from %.loc15_21.2 to %.loc15_21.3 [template = constants.%int_2.ef8] @@ -235,7 +239,7 @@ class X(U:! type) { // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21_17: %HasF.assoc_type.dc4 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param) [template = constants.%assoc0.a6b] // CHECK:STDOUT: %F.ref.loc21: %HasF.assoc_type.dc4 = name_ref F, %.loc21_17 [template = constants.%assoc0.a6b] -// CHECK:STDOUT: %impl.elem0.loc21: %F.type.7f1 = impl_witness_access constants.%impl_witness.9bf, element0 [template = constants.%F.901] +// CHECK:STDOUT: %impl.elem0.loc21: %.da8 = impl_witness_access constants.%impl_witness.9bf, element0 [template = constants.%F.901] // 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 @@ -254,7 +258,7 @@ class X(U:! type) { // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %.loc22_17: %HasF.assoc_type.dc4 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param) [template = constants.%assoc0.a6b] // CHECK:STDOUT: %F.ref.loc22: %HasF.assoc_type.dc4 = name_ref F, %.loc22_17 [template = constants.%assoc0.a6b] -// CHECK:STDOUT: %impl.elem0.loc22: %F.type.7f1 = impl_witness_access constants.%impl_witness.9bf, element0 [template = constants.%F.901] +// CHECK:STDOUT: %impl.elem0.loc22: %.da8 = impl_witness_access constants.%impl_witness.9bf, element0 [template = constants.%F.901] // 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 @@ -326,7 +330,7 @@ class X(U:! type) { // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(%U) [symbolic] // CHECK:STDOUT: %F.type.e88: type = fn_type @F.2, @impl(%U) [symbolic] // CHECK:STDOUT: %F.b02: %F.type.e88 = struct_value () [symbolic] -// CHECK:STDOUT: %I.facet: %I.type.325e65.1 = facet_value %X, %impl_witness [symbolic] +// CHECK:STDOUT: %I.facet: %I.type.325e65.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.441: = require_complete_type %X [symbolic] diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index 29192e487180d..301ec071f7585 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -42,6 +42,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, %impl_witness.85b [template] // CHECK:STDOUT: %InstanceCall.type: type = fn_type @InstanceCall [template] // CHECK:STDOUT: %InstanceCall: %InstanceCall.type = struct_value () [template] +// CHECK:STDOUT: %.eac: type = fn_type_with_self_type %G.type.b60, %Simple.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -130,8 +131,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: %Simple.assoc_type = name_ref G, @Simple.%assoc0 [template = constants.%assoc0.45f] -// CHECK:STDOUT: %impl.elem0: %G.type.b60 = impl_witness_access constants.%impl_witness.85b, element0 [template = ] -// CHECK:STDOUT: %G.bound: = bound_method %n.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.eac = impl_witness_access constants.%impl_witness.85b, element0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon b/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon index b55bcff8b645b..8612106aea6f7 100644 --- a/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon @@ -468,10 +468,13 @@ impl () as I where .N = 2 { // CHECK:STDOUT: %I.facet.1f7: %I.type = facet_value %.Self.as_type, %.Self.as_wit [symbolic] // CHECK:STDOUT: %impl.elem0: %i32 = impl_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template] @@ -518,10 +521,10 @@ impl () as I where .N = 2 { // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] // CHECK:STDOUT: %impl.elem0.loc15_20: %i32 = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc15_25: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0.loc15_25 [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.ef8] +// CHECK:STDOUT: %impl.elem0.loc15_25: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0.loc15_25 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_25.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_25.2: %i32 = converted %int_2, %.loc15_25.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_14: type = where_expr %.Self [template = constants.%I_where.type] { diff --git a/toolchain/check/testdata/impl/lookup/alias.carbon b/toolchain/check/testdata/impl/lookup/alias.carbon index 7ffe3e207c398..aea4445133749 100644 --- a/toolchain/check/testdata/impl/lookup/alias.carbon +++ b/toolchain/check/testdata/impl/lookup/alias.carbon @@ -44,6 +44,7 @@ fn G(c: C) { // 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: %.447: type = fn_type_with_self_type %F.type.b7b, %HasF.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -122,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: %HasF.assoc_type = name_ref G, @C.%G [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc24: %F.type.b7b = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.dc7] +// CHECK:STDOUT: %impl.elem0.loc24: %.447 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.dc7] // 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: %HasF.assoc_type = name_ref G, @C.%G [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc25: %F.type.b7b = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.dc7] +// CHECK:STDOUT: %impl.elem0.loc25: %.447 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.dc7] // 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 0a3177c5f7724..136976c54c422 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -53,10 +53,12 @@ impl C as I { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type.b25: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [template] +// CHECK:STDOUT: %I.facet.b45: %I.type = facet_value %C, %impl_witness.85b [template] +// CHECK:STDOUT: %.575: type = fn_type_with_self_type %F.type.cf0, %I.facet.b45 [template] // CHECK:STDOUT: %impl_witness.054: = impl_witness (@impl.2.%F.decl) [template] // CHECK:STDOUT: %F.type.5d6: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.a2e: %F.type.5d6 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness.054 [template] +// CHECK:STDOUT: %I.facet.4ac: %I.type = facet_value %C, %impl_witness.054 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -136,7 +138,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: %I.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.cf0 = impl_witness_access constants.%impl_witness.85b, element0 [template = ] +// CHECK:STDOUT: %impl.elem0: %.575 = impl_witness_access constants.%impl_witness.85b, element0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,5 +149,5 @@ impl C as I { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%I.facet) {} +// CHECK:STDOUT: specific @F.1(constants.%I.facet.4ac) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index e6096f1a03f30..c4931ca86369f 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -137,13 +137,15 @@ fn G(x: A) { // CHECK:STDOUT: %impl_witness.d55: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.3fd: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.c98: %F.type.3fd = struct_value () [symbolic] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %T, %impl_witness.d55 [symbolic] +// CHECK:STDOUT: %HasF.facet.6fc: %HasF.type = facet_value %T, %impl_witness.d55 [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.d9b: = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.2e4: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.f13: %F.type.2e4 = struct_value () [template] +// CHECK:STDOUT: %HasF.facet.18f: %HasF.type = facet_value %empty_struct_type, %impl_witness.d9b [template] +// CHECK:STDOUT: %.658: type = fn_type_with_self_type %F.type.b7b, %HasF.facet.18f [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.f13, @F.2(%empty_struct_type) [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -232,9 +234,9 @@ 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: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.b7b = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%F.f13] -// 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: %impl.elem0: %.658 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%F.f13] +// CHECK:STDOUT: %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 %specific_fn() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -254,7 +256,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {} +// CHECK:STDOUT: specific @F.1(constants.%HasF.facet.6fc) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%empty_struct_type @@ -285,7 +287,7 @@ fn G(x: A) { // CHECK:STDOUT: %impl_witness.d55: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.3fd: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.c98: %F.type.3fd = struct_value () [symbolic] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %T, %impl_witness.d55 [symbolic] +// CHECK:STDOUT: %HasF.facet.6fc: %HasF.type = facet_value %T, %impl_witness.d55 [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] @@ -293,6 +295,8 @@ fn G(x: A) { // CHECK:STDOUT: %impl_witness.d9b: = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.2e4: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.f13: %F.type.2e4 = struct_value () [template] +// CHECK:STDOUT: %HasF.facet.18f: %HasF.type = facet_value %empty_struct_type, %impl_witness.d9b [template] +// CHECK:STDOUT: %.658: type = fn_type_with_self_type %F.type.b7b, %HasF.facet.18f [template] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } @@ -425,10 +429,10 @@ 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: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.b7b = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%F.f13] -// 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) +// CHECK:STDOUT: %impl.elem0: %.658 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%F.f13] +// CHECK:STDOUT: %bound_method: = bound_method %x.ref, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @F.2(constants.%empty_struct_type) +// CHECK:STDOUT: %F.call: init %empty_struct_type = call %specific_fn(%x.ref) // CHECK:STDOUT: %.loc13_21.1: ref %empty_struct_type = temporary_storage // CHECK:STDOUT: %.loc13_21.2: ref %empty_struct_type = temporary %.loc13_21.1, %F.call // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template = constants.%empty_struct] @@ -457,8 +461,8 @@ fn G(x: A) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%HasF.facet) { -// CHECK:STDOUT: %Self => constants.%HasF.facet +// CHECK:STDOUT: specific @F.1(constants.%HasF.facet.6fc) { +// CHECK:STDOUT: %Self => constants.%HasF.facet.6fc // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: @@ -499,13 +503,15 @@ fn G(x: A) { // CHECK:STDOUT: %impl_witness.7d1: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.8fe: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.92a: %F.type.8fe = struct_value () [symbolic] -// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C.f2e, %impl_witness.7d1 [symbolic] +// CHECK:STDOUT: %HasF.facet.83b: %HasF.type = facet_value %C.f2e, %impl_witness.7d1 [symbolic] // CHECK:STDOUT: %C.7a7: 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.770: = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.2e5: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.c77: %F.type.2e5 = struct_value () [template] +// CHECK:STDOUT: %HasF.facet.007: %HasF.type = facet_value %C.7a7, %impl_witness.770 [template] +// CHECK:STDOUT: %.4df: type = fn_type_with_self_type %F.type.b7b, %HasF.facet.007 [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.c77, @F.2(%empty_struct_type) [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -622,9 +628,9 @@ fn G(x: A) { // CHECK:STDOUT: %x.ref: %C.7a7 = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.b7b = impl_witness_access constants.%impl_witness.770, element0 [template = constants.%F.c77] -// 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: %impl.elem0: %.4df = impl_witness_access constants.%impl_witness.770, element0 [template = constants.%F.c77] +// CHECK:STDOUT: %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 %specific_fn() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -652,7 +658,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {} +// CHECK:STDOUT: specific @F.1(constants.%HasF.facet.83b) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%empty_struct_type @@ -695,7 +701,7 @@ fn G(x: A) { // CHECK:STDOUT: %impl_witness.142: = impl_witness (@impl.%F.decl), @impl(%T) [symbolic] // CHECK:STDOUT: %F.type.6c8: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.008: %F.type.6c8 = struct_value () [symbolic] -// CHECK:STDOUT: %HasF.facet: %HasF.type.901 = facet_value %empty_struct_type, %impl_witness.142 [symbolic] +// CHECK:STDOUT: %HasF.facet.77c: %HasF.type.901 = facet_value %empty_struct_type, %impl_witness.142 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %HasF.type.072: type = facet_type <@HasF, @HasF(%empty_struct_type)> [template] @@ -707,6 +713,8 @@ fn G(x: A) { // CHECK:STDOUT: %impl_witness.221: = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.a13: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.8c6: %F.type.a13 = struct_value () [template] +// CHECK:STDOUT: %HasF.facet.075: %HasF.type.072 = facet_value %empty_struct_type, %impl_witness.221 [template] +// CHECK:STDOUT: %.a00: type = fn_type_with_self_type %F.type.b0b, %HasF.facet.075 [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.8c6, @F.2(%empty_struct_type) [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -823,9 +831,9 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%empty_struct_type)> [template = constants.%HasF.type.072] // CHECK:STDOUT: %.loc13_14: %HasF.assoc_type.60b = specific_constant @HasF.%assoc0.loc5_9.1, @HasF(constants.%empty_struct_type) [template = constants.%assoc0.46d] // CHECK:STDOUT: %F.ref: %HasF.assoc_type.60b = name_ref F, %.loc13_14 [template = constants.%assoc0.46d] -// CHECK:STDOUT: %impl.elem0: %F.type.b0b = impl_witness_access constants.%impl_witness.221, element0 [template = constants.%F.8c6] -// 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: %impl.elem0: %.a00 = impl_witness_access constants.%impl_witness.221, element0 [template = constants.%F.8c6] +// CHECK:STDOUT: %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 %specific_fn() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -864,7 +872,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%T, constants.%HasF.facet) {} +// CHECK:STDOUT: specific @F.1(constants.%T, constants.%HasF.facet.77c) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%empty_struct_type diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index 286402b721fda..6880d96346e80 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -45,6 +45,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %F.type.b25: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [template] +// CHECK:STDOUT: %.f8b: type = fn_type_with_self_type %F.type.cf0, %I.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -158,9 +159,9 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.cf0 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3] -// CHECK:STDOUT: %F.bound: = bound_method %c.ref, %impl.elem0 -// CHECK:STDOUT: %F.call: init %i32 = call %F.bound(%c.ref) +// CHECK:STDOUT: %impl.elem0: %.f8b = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3] +// CHECK:STDOUT: %bound_method: = bound_method %c.ref, %impl.elem0 +// CHECK:STDOUT: %F.call: init %i32 = call %bound_method(%c.ref) // CHECK:STDOUT: %.loc24_15.1: %i32 = value_of_initializer %F.call // CHECK:STDOUT: %.loc24_15.2: %i32 = converted %F.call, %.loc24_15.1 // CHECK:STDOUT: return %.loc24_15.2 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 e387a91101146..36b0b0c702b27 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon @@ -67,7 +67,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %impl_witness.ab3b51.1: = impl_witness (@impl.%F.decl), @impl(%V) [symbolic] // CHECK:STDOUT: %F.type.0fea45.1: type = fn_type @F.2, @impl(%V) [symbolic] // CHECK:STDOUT: %F.d6ae34.1: %F.type.0fea45.1 = struct_value () [symbolic] -// CHECK:STDOUT: %I.facet: %I.type.325e65.1 = facet_value %A.13025a.2, %impl_witness.ab3b51.1 [symbolic] +// CHECK:STDOUT: %I.facet.5b0ece.1: %I.type.325e65.2 = facet_value %A.13025a.2, %impl_witness.ab3b51.1 [symbolic] // CHECK:STDOUT: %require_complete.4aeca8.2: = require_complete_type %V [symbolic] // CHECK:STDOUT: %A.elem.1ceb36.2: type = unbound_element_type %A.13025a.2, %V [symbolic] // CHECK:STDOUT: %struct_type.n.848971.2: type = struct_type {.n: %V} [symbolic] @@ -92,6 +92,8 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %impl_witness.ab3b51.2: = impl_witness (@impl.%F.decl), @impl(%W) [symbolic] // CHECK:STDOUT: %F.type.0fea45.2: type = fn_type @F.2, @impl(%W) [symbolic] // CHECK:STDOUT: %F.d6ae34.2: %F.type.0fea45.2 = struct_value () [symbolic] +// CHECK:STDOUT: %I.facet.5b0ece.2: %I.type.325e65.3 = facet_value %A.13025a.3, %impl_witness.ab3b51.2 [symbolic] +// CHECK:STDOUT: %.051: type = fn_type_with_self_type %F.type.2aef59.3, %I.facet.5b0ece.2 [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %A.235: type = class_type @A, @A(%empty_struct_type) [template] // CHECK:STDOUT: %TestSpecific.type: type = fn_type @TestSpecific [template] @@ -109,6 +111,8 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %impl_witness.f35: = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.875: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.158: %F.type.875 = struct_value () [template] +// CHECK:STDOUT: %I.facet.f67: %I.type.885 = facet_value %A.235, %impl_witness.f35 [template] +// CHECK:STDOUT: %.f01: type = fn_type_with_self_type %F.type.684, %I.facet.f67 [template] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -330,6 +334,9 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @TestGeneric.%I.type.loc17_16.2 (%I.type.325e65.3) [symbolic = %I.assoc_type (constants.%I.assoc_type.955255.3)] // CHECK:STDOUT: %assoc0: @TestGeneric.%I.assoc_type (%I.assoc_type.955255.3) = assoc_entity element0, @I.%F.decl [symbolic = %assoc0 (constants.%assoc0.fef501.3)] // CHECK:STDOUT: %F.type.loc17_11.1: type = fn_type @F.1, @I(%W.loc16_16.2) [symbolic = %F.type.loc17_11.1 (constants.%F.type.2aef59.3)] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(%W.loc16_16.2) [symbolic = %impl_witness (constants.%impl_witness.ab3b51.2)] +// CHECK:STDOUT: %I.facet: @TestGeneric.%I.type.loc17_16.2 (%I.type.325e65.3) = facet_value %A.loc16_32.2, %impl_witness [symbolic = %I.facet (constants.%I.facet.5b0ece.2)] +// CHECK:STDOUT: %.loc17_11: type = fn_type_with_self_type %F.type.loc17_11.1, %I.facet [symbolic = %.loc17_11 (constants.%.051)] // CHECK:STDOUT: %F.type.loc17_11.2: type = fn_type @F.2, @impl(%W.loc16_16.2) [symbolic = %F.type.loc17_11.2 (constants.%F.type.0fea45.2)] // CHECK:STDOUT: %F: @TestGeneric.%F.type.loc17_11.2 (%F.type.0fea45.2) = struct_value () [symbolic = %F (constants.%F.d6ae34.2)] // CHECK:STDOUT: @@ -341,10 +348,10 @@ 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.325e65.3)] // CHECK:STDOUT: %.loc17_17: @TestGeneric.%I.assoc_type (%I.assoc_type.955255.3) = specific_constant @I.%assoc0.loc7_26.1, @I(constants.%W) [symbolic = %assoc0 (constants.%assoc0.fef501.3)] // CHECK:STDOUT: %F.ref: @TestGeneric.%I.assoc_type (%I.assoc_type.955255.3) = name_ref F, %.loc17_17 [symbolic = %assoc0 (constants.%assoc0.fef501.3)] -// CHECK:STDOUT: %impl.elem0: @TestGeneric.%F.type.loc17_11.1 (%F.type.2aef59.3) = impl_witness_access constants.%impl_witness.ab3b51.2, element0 [symbolic = %F (constants.%F.d6ae34.2)] -// 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) +// CHECK:STDOUT: %impl.elem0: @TestGeneric.%.loc17_11 (%.051) = impl_witness_access constants.%impl_witness.ab3b51.2, element0 [symbolic = %F (constants.%F.d6ae34.2)] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @F.2(constants.%W) +// CHECK:STDOUT: %F.call: init @TestGeneric.%W.loc16_16.2 (%W) = call %specific_fn(%a.ref) // CHECK:STDOUT: %.loc17_22.1: @TestGeneric.%W.loc16_16.2 (%W) = value_of_initializer %F.call // CHECK:STDOUT: %.loc17_22.2: @TestGeneric.%W.loc16_16.2 (%W) = converted %F.call, %.loc17_22.1 // CHECK:STDOUT: return %.loc17_22.2 @@ -360,10 +367,10 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%empty_struct_type)> [template = constants.%I.type.885] // CHECK:STDOUT: %.loc21_18: %I.assoc_type.67f = specific_constant @I.%assoc0.loc7_26.1, @I(constants.%empty_struct_type) [template = constants.%assoc0.639] // CHECK:STDOUT: %F.ref: %I.assoc_type.67f = name_ref F, %.loc21_18 [template = constants.%assoc0.639] -// CHECK:STDOUT: %impl.elem0: %F.type.684 = impl_witness_access constants.%impl_witness.f35, element0 [template = constants.%F.158] -// 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) +// CHECK:STDOUT: %impl.elem0: %.f01 = impl_witness_access constants.%impl_witness.f35, element0 [template = constants.%F.158] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @F.2(constants.%empty_struct_type) +// CHECK:STDOUT: %F.call: init %empty_struct_type = call %specific_fn(%a.ref) // CHECK:STDOUT: %.loc21_22.1: ref %empty_struct_type = temporary_storage // CHECK:STDOUT: %.loc21_22.2: ref %empty_struct_type = temporary %.loc21_22.1, %F.call // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template = constants.%empty_struct] @@ -445,10 +452,10 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @A(@F.2.%V) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%V, constants.%I.facet) { +// CHECK:STDOUT: specific @F.1(constants.%V, constants.%I.facet.5b0ece.1) { // CHECK:STDOUT: %U => constants.%V // CHECK:STDOUT: %I.type => constants.%I.type.325e65.2 -// CHECK:STDOUT: %Self => constants.%I.facet +// CHECK:STDOUT: %Self => constants.%I.facet.5b0ece.1 // CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%A.13025a.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index 779086b59f499..e772f6bbb912b 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -306,6 +306,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageA.import_ref.28c = import_ref PackageA//default, inst15 [no loc], unloaded // CHECK:STDOUT: %PackageA.import_ref.a2a = import_ref PackageA//default, loc5_9, unloaded // CHECK:STDOUT: %PackageA.F: %F.type.dbc = import_ref PackageA//default, F, loaded [template = constants.%F.a2b] +// CHECK:STDOUT: %PackageA.import_ref.e73: %HasF.type = import_ref PackageA//default, inst15 [no loc], loaded [symbolic = constants.%Self.cf3] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -402,7 +403,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%Self.cf3: %HasF.type) [from "package_a.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%PackageA.import_ref.e73: %HasF.type) [from "package_a.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -441,6 +442,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, imports.%PackageA.import_ref.ab2 [template] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%PackageA.import_ref.148) [template] // CHECK:STDOUT: %F.type.dbc: type = fn_type @F.1 [template] +// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %impl_witness [template] +// CHECK:STDOUT: %.e6d: type = fn_type_with_self_type %F.type.dbc, %HasF.facet [template] // CHECK:STDOUT: %F.type.4e3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.857: %F.type.4e3 = struct_value () [template] // CHECK:STDOUT: } @@ -461,6 +464,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageA.import_ref.a71: = import_ref PackageA//default, loc11_16, loaded [template = constants.%impl_witness] // CHECK:STDOUT: %PackageA.import_ref.29a: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C] // CHECK:STDOUT: %PackageA.import_ref.e8c: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %PackageA.import_ref.e73: %HasF.type = import_ref PackageA//default, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -507,12 +511,12 @@ 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.%PackageA.HasF [template = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, imports.%PackageA.import_ref.566 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.dbc = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.857] +// CHECK:STDOUT: %impl.elem0: %.e6d = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.857] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%Self: %HasF.type) [from "package_a.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%PackageA.import_ref.e73: %HasF.type) [from "package_a.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -537,6 +541,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [template] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%PackageB.import_ref.0cd) [template] // CHECK:STDOUT: %F.type.dbc: type = fn_type @F.1 [template] +// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %D, %impl_witness [template] +// CHECK:STDOUT: %.205: type = fn_type_with_self_type %F.type.dbc, %HasF.facet [template] // CHECK:STDOUT: %F.type.394: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.1fc: %F.type.394 = struct_value () [template] // CHECK:STDOUT: } @@ -574,6 +580,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.import_ref.231 = import_ref PackageB//default, loc23_16, unloaded // CHECK:STDOUT: %PackageB.import_ref.aa9f8a.2: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] // CHECK:STDOUT: %PackageB.import_ref.cee586.2: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %PackageA.import_ref.e73: %HasF.type = import_ref PackageA//default, inst15 [no loc], loaded [symbolic = constants.%Self.cf3] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -651,12 +658,12 @@ 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.%PackageA.HasF [template = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, imports.%PackageA.import_ref.566 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.dbc = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.1fc] +// CHECK:STDOUT: %impl.elem0: %.205 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.1fc] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%Self.cf3: %HasF.type) [from "package_a.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%PackageA.import_ref.e73: %HasF.type) [from "package_a.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -681,6 +688,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%PackageB.import_ref.9ec) [template] // CHECK:STDOUT: %G.type.d9e: type = fn_type @G.1 [template] +// CHECK:STDOUT: %HasG.facet: %HasG.type = facet_value %C, %impl_witness [template] +// CHECK:STDOUT: %.25a: type = fn_type_with_self_type %G.type.d9e, %HasG.facet [template] // CHECK:STDOUT: %G.type.18e: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.dbb: %G.type.18e = struct_value () [template] // CHECK:STDOUT: } @@ -718,6 +727,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.import_ref.231 = import_ref PackageB//default, loc23_16, unloaded // CHECK:STDOUT: %PackageB.import_ref.aa9f8a.2: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] // CHECK:STDOUT: %PackageB.import_ref.cee586.2: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %PackageB.import_ref.ef5: %HasG.type = import_ref PackageB//default, inst17 [no loc], loaded [symbolic = constants.%Self.fcb] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -795,12 +805,12 @@ 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.%PackageB.HasG [template = constants.%HasG.type] // CHECK:STDOUT: %G.ref: %HasG.assoc_type = name_ref G, imports.%PackageB.import_ref.604 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %G.type.d9e = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.dbb] +// CHECK:STDOUT: %impl.elem0: %.25a = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.dbb] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G.1(constants.%Self.fcb: %HasG.type) [from "package_b.carbon"] { +// CHECK:STDOUT: generic fn @G.1(imports.%PackageB.import_ref.ef5: %HasG.type) [from "package_b.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -825,6 +835,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%PackageB.import_ref.b0a) [template] // CHECK:STDOUT: %G.type.d9e: type = fn_type @G.1 [template] +// CHECK:STDOUT: %HasG.facet: %HasG.type = facet_value %D, %impl_witness [template] +// CHECK:STDOUT: %.b8e: type = fn_type_with_self_type %G.type.d9e, %HasG.facet [template] // CHECK:STDOUT: %G.type.405: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.703: %G.type.405 = struct_value () [template] // CHECK:STDOUT: } @@ -856,6 +868,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.import_ref.240: = import_ref PackageB//default, loc23_16, loaded [template = constants.%impl_witness] // CHECK:STDOUT: %PackageB.import_ref.aa9f8a.2: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] // CHECK:STDOUT: %PackageB.import_ref.cee586.2: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %PackageB.import_ref.ef5: %HasG.type = import_ref PackageB//default, inst17 [no loc], loaded [symbolic = constants.%Self.fcb] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -926,12 +939,12 @@ 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.%PackageB.HasG [template = constants.%HasG.type] // CHECK:STDOUT: %G.ref: %HasG.assoc_type = name_ref G, imports.%PackageB.import_ref.604 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %G.type.d9e = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.703] +// CHECK:STDOUT: %impl.elem0: %.b8e = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.703] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G.1(constants.%Self.fcb: %HasG.type) [from "package_b.carbon"] { +// CHECK:STDOUT: generic fn @G.1(imports.%PackageB.import_ref.ef5: %HasG.type) [from "package_b.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1012,6 +1025,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, imports.%PackageAssociatedInterface.import_ref.250 [template] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%PackageAssociatedInterface.import_ref.6d7) [template] // CHECK:STDOUT: %H.type.386: type = fn_type @H.1 [template] +// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %empty_tuple.type, %impl_witness [template] +// CHECK:STDOUT: %.a8b: type = fn_type_with_self_type %H.type.386, %Z.facet [template] // CHECK:STDOUT: %H.type.ab3: type = fn_type @H.2 [template] // CHECK:STDOUT: %H.c25: %H.type.ab3 = struct_value () [template] // CHECK:STDOUT: } @@ -1028,6 +1043,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.998: = import_ref PackageAssociatedInterface//default, loc8_14, loaded [template = constants.%impl_witness] // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.e5c: type = import_ref PackageAssociatedInterface//default, loc8_7, loaded [template = constants.%empty_tuple.type] // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.df1: type = import_ref PackageAssociatedInterface//default, loc8_12, loaded [template = constants.%Z.type] +// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.d26: %Z.type = import_ref PackageAssociatedInterface//default, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1057,12 +1073,12 @@ 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.%PackageAssociatedInterface.Z [template = constants.%Z.type] // CHECK:STDOUT: %H.ref: %Z.assoc_type = name_ref H, imports.%PackageAssociatedInterface.import_ref.ddc [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %H.type.386 = impl_witness_access constants.%impl_witness, element0 [template = constants.%H.c25] +// CHECK:STDOUT: %impl.elem0: %.a8b = impl_witness_access constants.%impl_witness, element0 [template = constants.%H.c25] // CHECK:STDOUT: %H.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @H.1(constants.%Self: %Z.type) [from "associated_interface.carbon"] { +// CHECK:STDOUT: generic fn @H.1(imports.%PackageAssociatedInterface.import_ref.d26: %Z.type) [from "associated_interface.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1188,6 +1204,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %AnyParam.val: %AnyParam.241 = struct_value () [template] // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type %Y.type [template] // CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [template] +// CHECK:STDOUT: %.572: type = fn_type_with_self_type %K.type.311, %Y.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1197,12 +1214,15 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: import PackageHasParam//default // CHECK:STDOUT: } // CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [template = constants.%AnyParam.generic] +// CHECK:STDOUT: %PackageHasParam.import_ref.f6b: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)] +// CHECK:STDOUT: %PackageHasParam.import_ref.e96: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)] // CHECK:STDOUT: %PackageHasParam.import_ref.8f2: = import_ref PackageHasParam//default, loc4_34, loaded [template = constants.%complete_type] // CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst34 [no loc], unloaded // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [template = constants.%Y.type] // CHECK:STDOUT: %PackageHasParam.import_ref.dc1 = import_ref PackageHasParam//default, inst40 [no loc], unloaded // CHECK:STDOUT: %PackageHasParam.import_ref.5e7: %Y.assoc_type = import_ref PackageHasParam//default, loc7_10, loaded [template = constants.%assoc0] // CHECK:STDOUT: %PackageHasParam.K: %K.type.311 = import_ref PackageHasParam//default, K, loaded [template = constants.%K.7a1] +// CHECK:STDOUT: %PackageHasParam.import_ref.292: %Y.type = import_ref PackageHasParam//default, inst40 [no loc], loaded [symbolic = constants.%Self.f64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1263,7 +1283,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // 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"] { +// CHECK:STDOUT: generic class @AnyParam(imports.%PackageHasParam.import_ref.f6b: type, imports.%PackageHasParam.import_ref.e96: @AnyParam.%T (%T)) [from "has_param.carbon"] { // 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: %X: %T = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)] @@ -1279,7 +1299,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @K.1(constants.%Self.f64: %Y.type) [from "has_param.carbon"] { +// CHECK:STDOUT: generic fn @K.1(imports.%PackageHasParam.import_ref.292: %Y.type) [from "has_param.carbon"] { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn(); @@ -1312,7 +1332,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.ref.loc14: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [template = constants.%Y.type] // CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.5e7 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %K.type.311 = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.2e9] +// CHECK:STDOUT: %impl.elem0: %.572 = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.2e9] // CHECK:STDOUT: %K.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1372,6 +1392,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [template] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%PackageGenericInterface.import_ref.456) [template] // CHECK:STDOUT: %K.type.311: type = fn_type @K.1 [template] +// CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.861, %impl_witness [template] +// CHECK:STDOUT: %.0fb: type = fn_type_with_self_type %K.type.311, %Y.facet [template] // CHECK:STDOUT: %K.type.7f9: type = fn_type @K.2 [template] // CHECK:STDOUT: %K.c3c: %K.type.7f9 = struct_value () [template] // CHECK:STDOUT: } @@ -1387,9 +1409,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: import PackageGenericInterface//default // CHECK:STDOUT: } // CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [template = constants.%AnyParam.generic] +// CHECK:STDOUT: %PackageHasParam.import_ref.f6b: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)] +// CHECK:STDOUT: %PackageHasParam.import_ref.e96: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)] // CHECK:STDOUT: %PackageHasParam.import_ref.8f2: = import_ref PackageHasParam//default, loc4_34, loaded [template = constants.%complete_type] // CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst34 [no loc], unloaded // CHECK:STDOUT: %PackageGenericInterface.GenericInterface: %GenericInterface.type.0da = import_ref PackageGenericInterface//default, GenericInterface, loaded [template = constants.%GenericInterface.generic] +// CHECK:STDOUT: %PackageGenericInterface.import_ref.86d: type = import_ref PackageGenericInterface//default, loc6_28, loaded [symbolic = @GenericInterface.%U (constants.%U)] // CHECK:STDOUT: %PackageGenericInterface.import_ref.c3b = import_ref PackageGenericInterface//default, inst28 [no loc], unloaded // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [template = constants.%Y.type] // CHECK:STDOUT: %PackageHasParam.import_ref.dc1 = import_ref PackageHasParam//default, inst40 [no loc], unloaded @@ -1398,6 +1423,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageGenericInterface.import_ref.ca8: = import_ref PackageGenericInterface//default, loc8_70, loaded [template = constants.%impl_witness] // CHECK:STDOUT: %PackageGenericInterface.import_ref.321: type = import_ref PackageGenericInterface//default, loc8_47, loaded [template = constants.%AnyParam.861] // CHECK:STDOUT: %PackageGenericInterface.import_ref.ca6: type = import_ref PackageGenericInterface//default, loc8_67, loaded [template = constants.%Y.type] +// CHECK:STDOUT: %PackageHasParam.import_ref.292: %Y.type = import_ref PackageHasParam//default, inst40 [no loc], loaded [symbolic = constants.%Self.f64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1411,7 +1437,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %M.decl: %M.type = fn_decl @M [template = constants.%M] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @GenericInterface(constants.%U: type) [from "has_generic_interface.carbon"] { +// CHECK:STDOUT: generic interface @GenericInterface(imports.%PackageGenericInterface.import_ref.86d: type) [from "has_generic_interface.carbon"] { // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt (constants.%U.patt)] // CHECK:STDOUT: @@ -1438,7 +1464,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: witness = imports.%PackageGenericInterface.import_ref.ca8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @AnyParam(constants.%T: type, constants.%X: %T) [from "has_param.carbon"] { +// CHECK:STDOUT: generic class @AnyParam(imports.%PackageHasParam.import_ref.f6b: type, imports.%PackageHasParam.import_ref.e96: @AnyParam.%T (%T)) [from "has_param.carbon"] { // 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: %X: %T = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)] @@ -1477,12 +1503,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.ref.loc10: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [template = constants.%Y.type] // CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.5e7 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %K.type.311 = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.c3c] +// CHECK:STDOUT: %impl.elem0: %.0fb = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.c3c] // CHECK:STDOUT: %K.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @K.1(constants.%Self.f64: %Y.type) [from "has_param.carbon"] { +// CHECK:STDOUT: generic fn @K.1(imports.%PackageHasParam.import_ref.292: %Y.type) [from "has_param.carbon"] { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn(); @@ -1758,6 +1784,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: import HasExtraInterfaces//default // CHECK:STDOUT: } // CHECK:STDOUT: %HasExtraInterfaces.C: %C.type = import_ref HasExtraInterfaces//default, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %HasExtraInterfaces.import_ref.f6b: type = import_ref HasExtraInterfaces//default, loc13_9, loaded [symbolic = @C.%T (constants.%T)] // CHECK:STDOUT: %HasExtraInterfaces.import_ref.8f2: = import_ref HasExtraInterfaces//default, loc13_20, loaded [template = constants.%complete_type] // CHECK:STDOUT: %HasExtraInterfaces.import_ref.4c0 = import_ref HasExtraInterfaces//default, inst57 [no loc], unloaded // CHECK:STDOUT: %HasExtraInterfaces.I: type = import_ref HasExtraInterfaces//default, I, loaded [template = constants.%I.type] @@ -1857,7 +1884,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: witness = imports.%HasExtraInterfaces.import_ref.1c8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%T: type) [from "has_extra_interfaces.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%HasExtraInterfaces.import_ref.f6b: type) [from "has_extra_interfaces.carbon"] { // 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: 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 24e11f66be1fb..2383aec4db1fc 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon @@ -185,7 +185,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.b63: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.d5f: %F.type.b63 = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type.325 = facet_value %X, %impl_witness [symbolic] +// CHECK:STDOUT: %I.facet: %I.type.e45 = facet_value %X, %impl_witness [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -194,9 +194,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Main.X: type = import_ref Main//types, X, loaded [template = constants.%X] // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.cbe = import_ref Main//types, loc4_31, unloaded // CHECK:STDOUT: %Main.F: @I.%F.type (%F.type.2ae) = import_ref Main//types, F, loaded [symbolic = @I.%F (constants.%F.bb2)] +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)] // CHECK:STDOUT: %Main.import_ref.479 = import_ref Main//types, loc4_31, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -218,7 +221,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // 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"] { +// CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] { // 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: @@ -261,7 +264,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: .Self = imports.%Main.import_ref.acf // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%T: type, constants.%Self: %I.type.325) [from "types.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -321,6 +324,8 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %assoc0.0fc: %I.assoc_type.9f3 = assoc_entity element0, imports.%Main.import_ref.e54 [template] // CHECK:STDOUT: %assoc0.249: %I.assoc_type.955 = assoc_entity element0, imports.%Main.import_ref.479 [symbolic] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Main.import_ref.7f5) [template] +// CHECK:STDOUT: %I.facet: %I.type.e45 = facet_value %X, %impl_witness [template] +// CHECK:STDOUT: %.e37: type = fn_type_with_self_type %F.type.14f, %I.facet [template] // CHECK:STDOUT: %F.type.b63: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.d5f: %F.type.b63 = struct_value () [template] // CHECK:STDOUT: } @@ -332,9 +337,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Main.InInterfaceArgs: type = import_ref Main//impl_in_interface_args, InInterfaceArgs, loaded [template = constants.%InInterfaceArgs] // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.cd3: @I.%I.assoc_type (%I.assoc_type.955) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%assoc0 (constants.%assoc0.249)] // CHECK:STDOUT: %Main.F = import_ref Main//types, F, unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)] // CHECK:STDOUT: %Main.import_ref.e54: @I.%F.type (%F.type.2ae) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%F (constants.%F.bb2)] // CHECK:STDOUT: %Main.import_ref.8f24d3.2: = import_ref Main//impl_in_interface_args, loc5_24, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.bf8 = import_ref Main//impl_in_interface_args, inst18 [no loc], unloaded @@ -362,7 +370,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @I(constants.%T: type) [from "types.carbon"] { +// CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] { // 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: @@ -409,12 +417,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%InInterfaceArgs)> [template = constants.%I.type.e45] // CHECK:STDOUT: %.loc6: %I.assoc_type.9f3 = specific_constant imports.%Main.import_ref.cd3, @I(constants.%InInterfaceArgs) [template = constants.%assoc0.0fc] // CHECK:STDOUT: %F.ref: %I.assoc_type.9f3 = name_ref F, %.loc6 [template = constants.%assoc0.0fc] -// CHECK:STDOUT: %impl.elem0: %F.type.14f = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.d5f] +// CHECK:STDOUT: %impl.elem0: %.e37 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.d5f] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%T: type, constants.%Self: %I.type.325) [from "types.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -470,18 +478,22 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.fab: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.7ab: %F.type.fab = struct_value () [template] -// CHECK:STDOUT: %I.facet: %I.type.325 = facet_value %C.23b, %impl_witness [symbolic] +// CHECK:STDOUT: %I.facet: %I.type.45c = facet_value %C.23b, %impl_witness [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.I: %I.type.dac = import_ref Main//types, I, loaded [template = constants.%I.generic] // CHECK:STDOUT: %Main.C: %C.type = import_ref Main//types, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %Main.X: type = import_ref Main//types, X, loaded [template = constants.%X] +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc5_9, loaded [symbolic = @C.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//types, loc5_20, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.4c0 = import_ref Main//types, inst49 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.cbe = import_ref Main//types, loc4_31, unloaded // CHECK:STDOUT: %Main.F: @I.%F.type (%F.type.2ae) = import_ref Main//types, F, loaded [symbolic = @I.%F (constants.%F.bb2)] +// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)] // CHECK:STDOUT: %Main.import_ref.479 = import_ref Main//types, loc4_31, unloaded // CHECK:STDOUT: %Main.import_ref.8f24d3.2: = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded @@ -507,7 +519,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // 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"] { +// CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.2: type) [from "types.carbon"] { // 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: @@ -543,7 +555,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: .Self = constants.%InClassArgs // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%T: type) [from "types.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] { // 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: @@ -564,7 +576,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: .Self = imports.%Main.import_ref.acf // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%T: type, constants.%Self: %I.type.325) [from "types.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.3: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -637,6 +649,8 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %assoc0.ba0: %I.assoc_type.a7e = assoc_entity element0, imports.%Main.import_ref.e54 [template] // CHECK:STDOUT: %assoc0.249: %I.assoc_type.955 = assoc_entity element0, imports.%Main.import_ref.479 [symbolic] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Main.import_ref.ae4) [template] +// CHECK:STDOUT: %I.facet: %I.type.45c = facet_value %C.23b, %impl_witness [template] +// CHECK:STDOUT: %.c87: type = fn_type_with_self_type %F.type.56a, %I.facet [template] // CHECK:STDOUT: %F.type.fab: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.7ab: %F.type.fab = struct_value () [template] // CHECK:STDOUT: } @@ -646,13 +660,17 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Main.C: %C.type = import_ref Main//types, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %Main.X: type = import_ref Main//types, X, loaded [template = constants.%X] // CHECK:STDOUT: %Main.InClassArgs: type = import_ref Main//impl_in_class_args, InClassArgs, loaded [template = constants.%InClassArgs] +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc5_9, loaded [symbolic = @C.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//types, loc5_20, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.4c0 = import_ref Main//types, inst49 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.8f24d3.2: = import_ref Main//impl_in_class_args, loc5_20, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.683 = import_ref Main//impl_in_class_args, inst18 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.cd3: @I.%I.assoc_type (%I.assoc_type.955) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%assoc0 (constants.%assoc0.249)] // CHECK:STDOUT: %Main.F = import_ref Main//types, F, unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)] // CHECK:STDOUT: %Main.import_ref.e54: @I.%F.type (%F.type.2ae) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%F (constants.%F.bb2)] // CHECK:STDOUT: %Main.import_ref.8f24d3.3: = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded @@ -684,7 +702,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @I(constants.%T: type) [from "types.carbon"] { +// CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.2: type) [from "types.carbon"] { // 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: @@ -709,7 +727,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: witness = imports.%Main.import_ref.6de // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%T: type) [from "types.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] { // 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: @@ -745,12 +763,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%X)> [template = constants.%I.type.45c] // CHECK:STDOUT: %.loc6_34: %I.assoc_type.a7e = specific_constant imports.%Main.import_ref.cd3, @I(constants.%X) [template = constants.%assoc0.ba0] // CHECK:STDOUT: %F.ref: %I.assoc_type.a7e = name_ref F, %.loc6_34 [template = constants.%assoc0.ba0] -// CHECK:STDOUT: %impl.elem0: %F.type.56a = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.7ab] +// CHECK:STDOUT: %impl.elem0: %.c87 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.7ab] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%T: type, constants.%Self: %I.type.325) [from "types.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.3: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/transitive.carbon b/toolchain/check/testdata/impl/lookup/transitive.carbon index 7117baf573c4b..e0bd552d71af4 100644 --- a/toolchain/check/testdata/impl/lookup/transitive.carbon +++ b/toolchain/check/testdata/impl/lookup/transitive.carbon @@ -112,6 +112,7 @@ fn Call() { // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//i, inst17 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.1e0 = import_ref Main//i, loc4_21, unloaded // CHECK:STDOUT: %Main.F: %F.type.cf0 = import_ref Main//i, F, loaded [template = constants.%F.bc6] +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//i, inst17 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -153,7 +154,7 @@ fn Call() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%Self: %I.type) [from "i.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.5dd: %I.type) [from "i.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -230,6 +231,8 @@ fn Call() { // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.e03 [template] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Main.import_ref.742) [template] // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [template] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [template] +// CHECK:STDOUT: %.076: type = fn_type_with_self_type %F.type.cf0, %I.facet [template] // CHECK:STDOUT: %F.type.5d6: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.a2e: %F.type.5d6 = struct_value () [template] // CHECK:STDOUT: } @@ -249,6 +252,7 @@ fn Call() { // CHECK:STDOUT: %Main.import_ref.e53: = import_ref Main//c, loc7_13, loaded [template = constants.%impl_witness] // CHECK:STDOUT: %Main.import_ref.29a: type = import_ref Main//c, loc7_6, loaded [template = constants.%C] // CHECK:STDOUT: %Main.import_ref.f50: type = import_ref Main//c, loc7_11, loaded [template = constants.%I.type] +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//i, inst17 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -289,14 +293,14 @@ fn Call() { // CHECK:STDOUT: %Get.call: init %C = call %Get.ref() to %.loc9 // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [template = constants.%I.type] // CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, imports.%Main.import_ref.bcb [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.cf0 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.a2e] +// CHECK:STDOUT: %impl.elem0: %.076 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.a2e] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Get() -> %C [from "get.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%Self: %I.type) [from "i.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.5dd: %I.type) [from "i.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/multiple_extend.carbon b/toolchain/check/testdata/impl/multiple_extend.carbon index fa9f4b19a8b41..53e2b1c53e17a 100644 --- a/toolchain/check/testdata/impl/multiple_extend.carbon +++ b/toolchain/check/testdata/impl/multiple_extend.carbon @@ -189,6 +189,8 @@ fn P(o: O) { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] +// CHECK:STDOUT: %.626: type = fn_type_with_self_type %F.type.b7b, %HasF.facet [template] +// CHECK:STDOUT: %.790: type = fn_type_with_self_type %G.type.d27, %HasG.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -300,19 +302,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: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0.992] -// CHECK:STDOUT: %impl.elem0.loc22: %F.type.b7b = impl_witness_access constants.%impl_witness.329, element0 [template = constants.%F.ad8] +// CHECK:STDOUT: %impl.elem0.loc22: %.626 = impl_witness_access constants.%impl_witness.329, element0 [template = constants.%F.ad8] // 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: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0.992] -// CHECK:STDOUT: %impl.elem0.loc23: %F.type.b7b = impl_witness_access constants.%impl_witness.329, element0 [template = constants.%F.ad8] +// CHECK:STDOUT: %impl.elem0.loc23: %.626 = impl_witness_access constants.%impl_witness.329, element0 [template = constants.%F.ad8] // 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: %HasG.assoc_type = name_ref G, @HasG.%assoc0 [template = constants.%assoc0.58a] -// CHECK:STDOUT: %impl.elem0.loc24: %G.type.d27 = impl_witness_access constants.%impl_witness.42a, element0 [template = constants.%G.957] +// CHECK:STDOUT: %impl.elem0.loc24: %.790 = impl_witness_access constants.%impl_witness.42a, element0 [template = constants.%G.957] // 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: %HasG.assoc_type = name_ref G, @HasG.%assoc0 [template = constants.%assoc0.58a] -// CHECK:STDOUT: %impl.elem0.loc25: %G.type.d27 = impl_witness_access constants.%impl_witness.42a, element0 [template = constants.%G.957] +// CHECK:STDOUT: %impl.elem0.loc25: %.790 = impl_witness_access constants.%impl_witness.42a, element0 [template = constants.%G.957] // CHECK:STDOUT: %G.call.loc25: init %empty_tuple.type = call %impl.elem0.loc25() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -502,6 +504,7 @@ fn P(o: O) { // CHECK:STDOUT: %complete_type.98e: = complete_type_witness %struct_type.base.0ff [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] +// CHECK:STDOUT: %.83f: type = fn_type_with_self_type %I.type.9bd, %HasI.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -598,11 +601,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: %HasI.assoc_type = name_ref I, @HasI.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc20: %I.type.9bd = impl_witness_access constants.%impl_witness, element0 [template = constants.%I.e74] +// CHECK:STDOUT: %impl.elem0.loc20: %.83f = impl_witness_access constants.%impl_witness, element0 [template = constants.%I.e74] // 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: %HasI.assoc_type = name_ref I, @HasI.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc21: %I.type.9bd = impl_witness_access constants.%impl_witness, element0 [template = constants.%I.e74] +// CHECK:STDOUT: %impl.elem0.loc21: %.83f = impl_witness_access constants.%impl_witness, element0 [template = constants.%I.e74] // 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] 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 6f2c976bdbd79..874afa9c534e4 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon @@ -105,6 +105,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // 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: %.dcc: type = fn_type_with_self_type %Op.type.31b, %Add.facet [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -328,6 +329,9 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type @Double.%MyInt.loc19_39.2 (%MyInt) [symbolic = %require_complete (constants.%require_complete.fc7)] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(%N.loc19_11.2) [symbolic = %impl_witness (constants.%impl_witness)] +// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt.loc19_39.2, %impl_witness [symbolic = %Add.facet (constants.%Add.facet)] +// CHECK:STDOUT: %.loc20_11: type = fn_type_with_self_type constants.%Op.type.31b, %Add.facet [symbolic = %.loc20_11 (constants.%.dcc)] // CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N.loc19_11.2) [symbolic = %Op.type (constants.%Op.type.883)] // CHECK:STDOUT: %Op: @Double.%Op.type (%Op.type.883) = struct_value () [symbolic = %Op (constants.%Op.8bc)] // CHECK:STDOUT: @@ -336,11 +340,11 @@ 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: %Add.assoc_type = name_ref Op, @Add.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %Op.type.31b = impl_witness_access constants.%impl_witness, element0 [symbolic = %Op (constants.%Op.8bc)] -// CHECK:STDOUT: %Op.bound: = bound_method %x.ref.loc20_10, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: @Double.%.loc20_11 (%.dcc) = impl_witness_access constants.%impl_witness, element0 [symbolic = %Op (constants.%Op.8bc)] +// CHECK:STDOUT: %bound_method: = 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) -// CHECK:STDOUT: %int.sadd: init @Double.%MyInt.loc19_39.2 (%MyInt) = call %Op.specific_fn(%x.ref.loc20_10, %x.ref.loc20_21) +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Op.2(constants.%N) +// CHECK:STDOUT: %int.sadd: init @Double.%MyInt.loc19_39.2 (%MyInt) = call %specific_fn(%x.ref.loc20_10, %x.ref.loc20_21) // CHECK:STDOUT: %.loc20_23.1: @Double.%MyInt.loc19_39.2 (%MyInt) = value_of_initializer %int.sadd // CHECK:STDOUT: %.loc20_23.2: @Double.%MyInt.loc19_39.2 (%MyInt) = converted %int.sadd, %.loc20_23.1 // CHECK:STDOUT: return %.loc20_23.2 @@ -428,16 +432,24 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Op.8bc: %Op.type.883 = struct_value () [symbolic] // CHECK:STDOUT: %require_complete.fc7: = require_complete_type %MyInt.09f [symbolic] // CHECK:STDOUT: %impl_witness.8d6: = impl_witness (imports.%Main.import_ref.19b), @impl(%int_64) [template] -// CHECK:STDOUT: %impl_witness.7e5: = impl_witness (imports.%Main.import_ref.464), @impl(%N) [symbolic] +// CHECK:STDOUT: %impl_witness.7e5be3.1: = impl_witness (imports.%Main.import_ref.464c51.1), @impl(%N) [symbolic] // CHECK:STDOUT: %Op.type.5a6: type = fn_type @Op.1, @impl(%int_64) [template] // CHECK:STDOUT: %Op.cf9: %Op.type.5a6 = struct_value () [template] // CHECK:STDOUT: %Op.type.31b: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %Add.facet.3ca: %Add.type = facet_value %MyInt.f30, %impl_witness.8d6 [template] +// CHECK:STDOUT: %.3ca: type = fn_type_with_self_type %Op.type.31b, %Add.facet.3ca [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] // CHECK:STDOUT: %Double: %Double.type = struct_value () [template] +// CHECK:STDOUT: %impl_witness.7e5be3.2: = impl_witness (imports.%Main.import_ref.464c51.2), @impl(%N) [symbolic] +// CHECK:STDOUT: %Add.facet.9a8: %Add.type = facet_value %MyInt.09f, %impl_witness.7e5be3.2 [symbolic] +// CHECK:STDOUT: %.72d: type = fn_type_with_self_type %Op.type.31b, %Add.facet.9a8 [symbolic] // CHECK:STDOUT: %Double.specific_fn: = specific_function %Double, @Double(%int_64) [template] +// CHECK:STDOUT: %impl_witness.bb3: = impl_witness (imports.%Main.import_ref.464c51.2), @impl(%int_64) [template] +// CHECK:STDOUT: %Add.facet.22c: %Add.type = facet_value %MyInt.f30, %impl_witness.bb3 [template] +// CHECK:STDOUT: %.41c: type = fn_type_with_self_type %Op.type.31b, %Add.facet.22c [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -446,15 +458,21 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Main.Int = import_ref Main//generic_impl, Int, unloaded // CHECK:STDOUT: %Main.MyInt: %MyInt.type = import_ref Main//generic_impl, MyInt, loaded [template = constants.%MyInt.generic] // CHECK:STDOUT: %Main.Double: %Double.type = import_ref Main//generic_impl, Double, loaded [template = constants.%Double] +// CHECK:STDOUT: %Main.import_ref.50eccf.1: Core.IntLiteral = import_ref Main//generic_impl, loc11_13, loaded [symbolic = @MyInt.%N (constants.%N)] // CHECK:STDOUT: %Main.import_ref.9e9: = import_ref Main//generic_impl, loc13_1, loaded [symbolic = @MyInt.%complete_type (constants.%complete_type.a87)] // CHECK:STDOUT: %Main.import_ref.697 = import_ref Main//generic_impl, inst89 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.07c = import_ref Main//generic_impl, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.db7: %Add.assoc_type = import_ref Main//generic_impl, loc5_41, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.Op = import_ref Main//generic_impl, Op, unloaded -// CHECK:STDOUT: %Main.import_ref.33b: = import_ref Main//generic_impl, loc15_48, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.7e5)] +// CHECK:STDOUT: %Main.import_ref.33b: = import_ref Main//generic_impl, loc15_48, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.7e5be3.1)] +// CHECK:STDOUT: %Main.import_ref.50eccf.2: Core.IntLiteral = import_ref Main//generic_impl, loc15_14, loaded [symbolic = @impl.%N (constants.%N)] // CHECK:STDOUT: %Main.import_ref.719: type = import_ref Main//generic_impl, loc15_39, loaded [symbolic = @impl.%MyInt (constants.%MyInt.09f)] // CHECK:STDOUT: %Main.import_ref.bf0: type = import_ref Main//generic_impl, loc15_44, loaded [template = constants.%Add.type] // CHECK:STDOUT: %Main.import_ref.19b: @impl.%Op.type (%Op.type.883) = import_ref Main//generic_impl, loc16_42, loaded [symbolic = @impl.%Op (constants.%Op.8bc)] +// CHECK:STDOUT: %Main.import_ref.50eccf.3: Core.IntLiteral = import_ref Main//generic_impl, loc15_14, loaded [symbolic = @impl.%N (constants.%N)] +// CHECK:STDOUT: %Main.import_ref.e5e: %Add.type = import_ref Main//generic_impl, inst15 [no loc], loaded [symbolic = constants.%Self] +// CHECK:STDOUT: %Main.import_ref.50eccf.4: Core.IntLiteral = import_ref Main//generic_impl, loc19_11, loaded [symbolic = @Double.%N (constants.%N)] +// CHECK:STDOUT: %Main.import_ref.464c51.2 = import_ref Main//generic_impl, loc16_42, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -515,7 +533,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: witness = (imports.%Main.Op) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] { +// CHECK:STDOUT: generic impl @impl(imports.%Main.import_ref.50eccf.2: Core.IntLiteral) [from "generic_impl.carbon"] { // 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.09f)] @@ -532,7 +550,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @MyInt(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] { +// CHECK:STDOUT: generic class @MyInt(imports.%Main.import_ref.50eccf.1: Core.IntLiteral) [from "generic_impl.carbon"] { // 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: @@ -554,17 +572,17 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %x.ref.loc9_10: %MyInt.f30 = name_ref x, %x // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%Main.Add [template = constants.%Add.type] // CHECK:STDOUT: %Op.ref: %Add.assoc_type = name_ref Op, imports.%Main.import_ref.db7 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %Op.type.31b = impl_witness_access constants.%impl_witness.8d6, element0 [template = constants.%Op.cf9] -// CHECK:STDOUT: %Op.bound: = bound_method %x.ref.loc9_10, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.3ca = impl_witness_access constants.%impl_witness.8d6, element0 [template = constants.%Op.cf9] +// CHECK:STDOUT: %bound_method: = bound_method %x.ref.loc9_10, %impl.elem0 // CHECK:STDOUT: %x.ref.loc9_21: %MyInt.f30 = name_ref x, %x -// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.bound, @Op.1(constants.%int_64) -// CHECK:STDOUT: %int.sadd: init %MyInt.f30 = call %Op.specific_fn(%x.ref.loc9_10, %x.ref.loc9_21) +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Op.1(constants.%int_64) +// CHECK:STDOUT: %int.sadd: init %MyInt.f30 = call %specific_fn(%x.ref.loc9_10, %x.ref.loc9_21) // CHECK:STDOUT: %.loc9_23.1: %MyInt.f30 = value_of_initializer %int.sadd // CHECK:STDOUT: %.loc9_23.2: %MyInt.f30 = converted %int.sadd, %.loc9_23.1 // CHECK:STDOUT: return %.loc9_23.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] { +// CHECK:STDOUT: generic fn @Op.1(imports.%Main.import_ref.50eccf.3: Core.IntLiteral) [from "generic_impl.carbon"] { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.09f)] // CHECK:STDOUT: @@ -573,7 +591,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: fn[%self.param_patt: @Op.1.%MyInt (%MyInt.09f)](%other.param_patt: @Op.1.%MyInt (%MyInt.09f)) -> @Op.1.%MyInt (%MyInt.09f) = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %Add.type) [from "generic_impl.carbon"] { +// CHECK:STDOUT: generic fn @Op.2(imports.%Main.import_ref.e5e: %Add.type) [from "generic_impl.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: @@ -591,13 +609,16 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: return %.loc13_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Double(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] { +// CHECK:STDOUT: generic fn @Double(imports.%Main.import_ref.50eccf.4: Core.IntLiteral) [from "generic_impl.carbon"] { // 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.09f)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type @Double.%MyInt (%MyInt.09f) [symbolic = %require_complete (constants.%require_complete.fc7)] +// CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Main.import_ref.464c51.2), @impl(%N) [symbolic = %impl_witness (constants.%impl_witness.7e5be3.2)] +// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt, %impl_witness [symbolic = %Add.facet (constants.%Add.facet.9a8)] +// CHECK:STDOUT: %.1: type = fn_type_with_self_type constants.%Op.type.31b, %Add.facet [symbolic = %.1 (constants.%.72d)] // CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @impl(%N) [symbolic = %Op.type (constants.%Op.type.883)] // CHECK:STDOUT: %Op: @Double.%Op.type (%Op.type.883) = struct_value () [symbolic = %Op (constants.%Op.8bc)] // CHECK:STDOUT: @@ -690,6 +711,9 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.4a1 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.bb3 +// CHECK:STDOUT: %Add.facet => constants.%Add.facet.22c +// CHECK:STDOUT: %.1 => constants.%.41c // CHECK:STDOUT: %Op.type => constants.%Op.type.5a6 // CHECK:STDOUT: %Op => constants.%Op.cf9 // CHECK:STDOUT: } @@ -1000,8 +1024,8 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.987: %i32.builtin = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %N.patt.36b: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %N.987: %i32.builtin = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %ToLiteral.type.e7c: type = fn_type @ToLiteral.1 [template] // CHECK:STDOUT: %ToLiteral.cf3: %ToLiteral.type.e7c = struct_value () [template] // CHECK:STDOUT: %int.convert_checked.346: init Core.IntLiteral = call %ToLiteral.cf3(%N.987) [symbolic] @@ -1016,8 +1040,8 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %MakeFromClass: %MakeFromClass.type = struct_value () [template] // CHECK:STDOUT: %OtherInt: type = class_type @OtherInt [template] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [template] -// CHECK:STDOUT: %N.335: %OtherInt = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %N.patt.59d: %OtherInt = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %N.335: %OtherInt = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %ToLiteral.type.67d: type = fn_type @ToLiteral.2 [template] // CHECK:STDOUT: %ToLiteral.ec2: %ToLiteral.type.67d = struct_value () [template] // CHECK:STDOUT: %ToLiteral.bound.8e3: = bound_method %N.335, %ToLiteral.ec2 [symbolic] @@ -1038,9 +1062,11 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Main.Make: %Make.type = import_ref Main//convert_symbolic, Make, loaded [template = constants.%Make] // CHECK:STDOUT: %Main.OtherInt: type = import_ref Main//convert_symbolic, OtherInt, loaded [template = constants.%OtherInt] // CHECK:STDOUT: %Main.MakeFromClass: %MakeFromClass.type = import_ref Main//convert_symbolic, MakeFromClass, loaded [template = constants.%MakeFromClass] +// CHECK:STDOUT: %Main.import_ref.512: %i32.builtin = import_ref Main//convert_symbolic, loc9_9, loaded [symbolic = @Make.%N (constants.%N.987)] // CHECK:STDOUT: %Main.import_ref.b03: = import_ref Main//convert_symbolic, loc14_1, loaded [template = constants.%complete_type.f8a] // CHECK:STDOUT: %Main.import_ref.d11 = import_ref Main//convert_symbolic, inst129 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.8f7 = import_ref Main//convert_symbolic, loc13_45, unloaded +// CHECK:STDOUT: %Main.import_ref.b3c: %OtherInt = import_ref Main//convert_symbolic, loc18_18, loaded [symbolic = @MakeFromClass.%N (constants.%N.335)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1094,7 +1120,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "convert_symbolic.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Make(constants.%N.987: %i32.builtin) [from "convert_symbolic.carbon"] { +// CHECK:STDOUT: generic fn @Make(imports.%Main.import_ref.512: %i32.builtin) [from "convert_symbolic.carbon"] { // CHECK:STDOUT: %N: %i32.builtin = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.987)] // CHECK:STDOUT: %N.patt: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.36b)] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call constants.%ToLiteral.cf3(%N) [symbolic = %int.convert_checked (constants.%int.convert_checked.346)] @@ -1111,7 +1137,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: // CHECK:STDOUT: fn @FromLiteral(%n.param_patt: Core.IntLiteral) -> %i32.builtin = "int.convert_checked" [from "convert_symbolic.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @MakeFromClass(constants.%N.335: %OtherInt) [from "convert_symbolic.carbon"] { +// CHECK:STDOUT: generic fn @MakeFromClass(imports.%Main.import_ref.b3c: %OtherInt) [from "convert_symbolic.carbon"] { // CHECK:STDOUT: %N: %OtherInt = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.335)] // CHECK:STDOUT: %N.patt: %OtherInt = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.59d)] // CHECK:STDOUT: %ToLiteral.bound: = bound_method %N, constants.%ToLiteral.ec2 [symbolic = %ToLiteral.bound (constants.%ToLiteral.bound.8e3)] 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 e0028110839c4..68993598bdb2e 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon @@ -121,6 +121,8 @@ fn G(c: C) { // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.e03 [template] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Main.import_ref.f6d) [template] // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [template] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [template] +// CHECK:STDOUT: %.8b3: type = fn_type_with_self_type %F.type.cf0, %I.facet [template] // CHECK:STDOUT: %F.type.f36: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.4c3: %F.type.f36 = struct_value () [template] // CHECK:STDOUT: } @@ -137,6 +139,7 @@ fn G(c: C) { // CHECK:STDOUT: %Main.import_ref.b86: = import_ref Main//extend_impl_library, loc9_20, loaded [template = constants.%impl_witness] // CHECK:STDOUT: %Main.import_ref.0ed: type = import_ref Main//extend_impl_library, loc9_15, loaded [template = constants.%C] // CHECK:STDOUT: %Main.import_ref.3019d1.2: type = import_ref Main//extend_impl_library, loc9_18, loaded [template = constants.%I.type] +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//extend_impl_library, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -180,16 +183,16 @@ fn G(c: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, imports.%Main.C [template = constants.%C] // CHECK:STDOUT: %F.ref.loc7: %I.assoc_type = name_ref F, imports.%Main.import_ref.bcb [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc7: %F.type.cf0 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3] +// CHECK:STDOUT: %impl.elem0.loc7: %.8b3 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3] // 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: %I.assoc_type = name_ref F, imports.%Main.import_ref.bcb [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc8: %F.type.cf0 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3] +// CHECK:STDOUT: %impl.elem0.loc8: %.8b3 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3] // CHECK:STDOUT: %F.call.loc8: init %empty_tuple.type = call %impl.elem0.loc8() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%Self: %I.type) [from "extend_impl_library.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.5dd: %I.type) [from "extend_impl_library.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // 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 20a62138e53d4..93f8ba4906b59 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon @@ -297,12 +297,15 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %Main.C: type = import_ref Main//import_generic, C, loaded [template = constants.%C] // CHECK:STDOUT: %Main.I: %I.type.dac = import_ref Main//import_generic, I, loaded [template = constants.%I.generic] // CHECK:STDOUT: %Main.import_ref.003 = import_ref Main//import_generic, loc8_33, unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//import_generic, loc5_13, loaded [symbolic = @I.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//import_generic, inst31 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//import_generic, loc4_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//import_generic, inst14 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//import_generic, loc8_14, loaded [symbolic = @impl.1.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.29aca8.1: type = import_ref Main//import_generic, loc8_24, loaded [template = constants.%C] // CHECK:STDOUT: %Main.import_ref.4be: type = import_ref Main//import_generic, loc8_32, loaded [symbolic = @impl.1.%I.type (constants.%I.type.325)] // CHECK:STDOUT: %Main.import_ref.4e1 = import_ref Main//import_generic, loc12_35, unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//import_generic, loc12_14, loaded [symbolic = @impl.2.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.29aca8.2: type = import_ref Main//import_generic, loc12_24, loaded [template = constants.%C] // CHECK:STDOUT: %Main.import_ref.3e2: type = import_ref Main//import_generic, loc12_33, loaded [symbolic = @impl.2.%I.type (constants.%I.type.0e2)] // CHECK:STDOUT: } @@ -366,7 +369,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %impl_witness.loc26: = impl_witness (), @impl.6(constants.%T) [symbolic = @impl.6.%impl_witness (constants.%impl_witness.46542c.3)] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @I(constants.%T: type) [from "import_generic.carbon"] { +// CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.1: type) [from "import_generic.carbon"] { // 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: @@ -381,7 +384,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.1(constants.%T: type) [from "import_generic.carbon"] { +// CHECK:STDOUT: generic impl @impl.1(imports.%Main.import_ref.f6b058.2: type) [from "import_generic.carbon"] { // 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.325)] @@ -396,7 +399,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.2(constants.%T: type) [from "import_generic.carbon"] { +// CHECK:STDOUT: generic impl @impl.2(imports.%Main.import_ref.f6b058.3: type) [from "import_generic.carbon"] { // 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: %ptr: type = ptr_type @impl.2.%T (%T) [symbolic = %ptr (constants.%ptr)] @@ -744,11 +747,14 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.D: type = import_ref Main//import_generic_decl, D, loaded [template = constants.%D] // CHECK:STDOUT: %Main.J: %J.type.2b8 = import_ref Main//import_generic_decl, J, loaded [template = constants.%J.generic] +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//import_generic_decl, loc5_13, loaded [symbolic = @J.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.ff5 = import_ref Main//import_generic_decl, inst31 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//import_generic_decl, loc4_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.cab = import_ref Main//import_generic_decl, inst14 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//import_generic_decl, loc11_14, loaded [symbolic = @impl.1.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.aa9f8a.1: type = import_ref Main//import_generic_decl, loc11_24, loaded [template = constants.%D] // CHECK:STDOUT: %Main.import_ref.ded: type = import_ref Main//import_generic_decl, loc11_32, loaded [symbolic = @impl.1.%J.type (constants.%J.type.b72)] +// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//import_generic_decl, loc17_14, loaded [symbolic = @impl.2.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.aa9f8a.2: type = import_ref Main//import_generic_decl, loc17_24, loaded [template = constants.%D] // CHECK:STDOUT: %Main.import_ref.0d3: type = import_ref Main//import_generic_decl, loc17_33, loaded [symbolic = @impl.2.%J.type (constants.%J.type.628)] // CHECK:STDOUT: } @@ -812,7 +818,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: %impl_witness.loc26: = impl_witness (), @impl.6(constants.%T) [symbolic = @impl.6.%impl_witness (constants.%impl_witness.b80f53.3)] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @J(constants.%T: type) [from "fail_import_generic_decl.carbon"] { +// CHECK:STDOUT: generic interface @J(imports.%Main.import_ref.f6b058.1: type) [from "fail_import_generic_decl.carbon"] { // 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: @@ -827,7 +833,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.1(constants.%T: type) [from "fail_import_generic_decl.carbon"] { +// CHECK:STDOUT: generic impl @impl.1(imports.%Main.import_ref.f6b058.2: type) [from "fail_import_generic_decl.carbon"] { // 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.b72)] @@ -837,7 +843,7 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: impl: imports.%Main.import_ref.aa9f8a.1 as imports.%Main.import_ref.ded; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.2(constants.%T: type) [from "fail_import_generic_decl.carbon"] { +// CHECK:STDOUT: generic impl @impl.2(imports.%Main.import_ref.f6b058.3: type) [from "fail_import_generic_decl.carbon"] { // 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: %ptr: type = ptr_type @impl.2.%T (%T) [symbolic = %ptr (constants.%ptr)] diff --git a/toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon b/toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon index 1f351b9f66eaf..3953753f62456 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon @@ -316,6 +316,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T] +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -353,7 +354,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T:! type; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -400,6 +401,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T] +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -453,7 +455,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T:! type; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -501,6 +503,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T] +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -543,7 +546,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T:! type; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -595,6 +598,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T] +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -649,7 +653,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T:! type; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -706,6 +710,9 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.T1 = import_ref Main//interface, T1, unloaded // CHECK:STDOUT: %Main.T2 = import_ref Main//interface, T2, unloaded // CHECK:STDOUT: %Main.T3 = import_ref Main//interface, T3, unloaded +// CHECK:STDOUT: %Main.import_ref.8a8474.1: %I3.type = import_ref Main//interface, inst23 [no loc], loaded [symbolic = constants.%Self] +// CHECK:STDOUT: %Main.import_ref.8a8474.2: %I3.type = import_ref Main//interface, inst23 [no loc], loaded [symbolic = constants.%Self] +// CHECK:STDOUT: %Main.import_ref.8a8474.3: %I3.type = import_ref Main//interface, inst23 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -794,15 +801,15 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.T1, imports.%Main.T2, imports.%Main.T3) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T1(constants.%Self: %I3.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T1(imports.%Main.import_ref.8a8474.1: %I3.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T1:! type; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T2(constants.%Self: %I3.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T2(imports.%Main.import_ref.8a8474.2: %I3.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T2:! type; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T3(constants.%Self: %I3.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T3(imports.%Main.import_ref.8a8474.3: %I3.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T3:! type; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -860,6 +867,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T] +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -902,7 +910,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T:! type; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -952,6 +960,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T] +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -998,7 +1007,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T:! type; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1044,6 +1053,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.T = import_ref Main//interface, T, unloaded +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1088,7 +1098,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T:! type; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1133,6 +1143,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.T = import_ref Main//interface, T, unloaded +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1177,7 +1188,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T:! type; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1222,6 +1233,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.T = import_ref Main//interface, T, unloaded +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1265,7 +1277,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T:! type; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1312,6 +1324,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T] +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1358,7 +1371,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const T:! type; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1408,6 +1421,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %Main.import_ref.8b7 = import_ref Main//interface, inst37 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.99f: %NonType.assoc_type = import_ref Main//interface, loc12_8, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.Y: %struct_type.a.225 = import_ref Main//interface, Y, loaded [template = %Y] +// CHECK:STDOUT: %Main.import_ref.86c: %NonType.type = import_ref Main//interface, inst37 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1449,7 +1463,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%Main.Y) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @Y(constants.%Self: %NonType.type) [from "interface.carbon"] { +// CHECK:STDOUT: generic assoc_const @Y(imports.%Main.import_ref.86c: %NonType.type) [from "interface.carbon"] { // CHECK:STDOUT: assoc_const Y:! %struct_type.a.225; // CHECK:STDOUT: } // 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 cc589d12513a7..3b91a46a00231 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_self.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_self.carbon @@ -117,6 +117,7 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %Add.assoc_type: type = assoc_entity_type %Add.type [template] // CHECK:STDOUT: %assoc0: %Add.assoc_type = assoc_entity element0, imports.%Main.import_ref.5a3 [template] +// CHECK:STDOUT: %.a26: type = fn_type_with_self_type %Op.type.31b, %Add.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -124,6 +125,7 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %Main.import_ref.07c = import_ref Main//a, inst15 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.db7: %Add.assoc_type = import_ref Main//a, loc5_41, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.Op: %Op.type.31b = import_ref Main//a, Op, loaded [template = constants.%Op.d59] +// CHECK:STDOUT: %Main.import_ref.e5e: %Add.type = import_ref Main//a, inst15 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -197,7 +199,7 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(constants.%Self: %Add.type) [from "a.carbon"] { +// CHECK:STDOUT: generic fn @Op.1(imports.%Main.import_ref.e5e: %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: @@ -217,10 +219,10 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, %x // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%Main.Add [template = constants.%Add.type] // CHECK:STDOUT: %Op.ref: %Add.assoc_type = name_ref Op, imports.%Main.import_ref.db7 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %Op.type.31b = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.489] -// CHECK:STDOUT: %Op.bound: = bound_method %x.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.a26 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.489] +// CHECK:STDOUT: %bound_method: = 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) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%x.ref, %y.ref) // CHECK:STDOUT: %.loc11_22.1: ref %empty_tuple.type = temporary_storage // CHECK:STDOUT: %.loc11_22.2: ref %empty_tuple.type = temporary %.loc11_22.1, %Op.call // CHECK:STDOUT: %tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] 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 0c2851f0da6ac..366dd2c45e531 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon @@ -198,6 +198,8 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %F.type.4a4: type = fn_type @F.1, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.9e6: %F.type.4a4 = struct_value () [template] // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.2 [template] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C.7a7, %impl_witness.02b [template] +// CHECK:STDOUT: %.c06: type = fn_type_with_self_type %F.type.cf0, %I.facet [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.9e6, @F.1(%empty_struct_type) [template] // CHECK:STDOUT: %F.type.b25: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [template] @@ -206,15 +208,19 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.C: %C.type = import_ref Main//import_generic, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %Main.I: type = import_ref Main//import_generic, I, loaded [template = constants.%I.type] +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//import_generic, loc4_9, loaded [symbolic = @C.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//import_generic, loc4_20, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.4c0 = import_ref Main//import_generic, inst25 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//import_generic, inst31 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.bcb: %I.assoc_type = import_ref Main//import_generic, loc7_9, loaded [template = constants.%assoc0] // CHECK:STDOUT: %Main.F = import_ref Main//import_generic, F, unloaded // CHECK:STDOUT: %Main.import_ref.d91: = import_ref Main//import_generic, loc10_34, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.bbe)] +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//import_generic, loc10_14, loaded [symbolic = @impl.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.499: type = import_ref Main//import_generic, loc10_27, loaded [symbolic = @impl.%C (constants.%C.f2e)] // CHECK:STDOUT: %Main.import_ref.301: type = import_ref Main//import_generic, loc10_32, loaded [template = constants.%I.type] // CHECK:STDOUT: %Main.import_ref.e2c: @impl.%F.type (%F.type.40c) = import_ref Main//import_generic, loc11_10, loaded [symbolic = @impl.%F (constants.%F.071)] +// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//import_generic, loc10_14, loaded [symbolic = @impl.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//import_generic, inst31 [no loc], loaded [symbolic = constants.%Self] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -244,9 +250,9 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %c.ref: ref %C.7a7 = name_ref c, file.%c // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [template = constants.%I.type] // CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, imports.%Main.import_ref.bcb [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.cf0 = impl_witness_access constants.%impl_witness.02b, element0 [template = constants.%F.9e6] -// CHECK:STDOUT: %F.specific_fn: = specific_function %impl.elem0, @F.1(constants.%empty_struct_type) [template = constants.%F.specific_fn] -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn() +// CHECK:STDOUT: %impl.elem0: %.c06 = impl_witness_access constants.%impl_witness.02b, element0 [template = constants.%F.9e6] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.1(constants.%empty_struct_type) [template = constants.%F.specific_fn] +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %specific_fn() // CHECK:STDOUT: %.loc16_19.1: ref %empty_tuple.type = temporary_storage // CHECK:STDOUT: %.loc16_19.2: ref %empty_tuple.type = temporary %.loc16_19.1, %F.call // CHECK:STDOUT: %.loc16_19.3: type = converted %F.call, [template = ] @@ -262,7 +268,7 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: witness = (imports.%Main.F) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl(constants.%T: type) [from "import_generic.carbon"] { +// CHECK:STDOUT: generic impl @impl(imports.%Main.import_ref.f6b058.2: type) [from "import_generic.carbon"] { // 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.f2e)] @@ -278,7 +284,7 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%T: type) [from "import_generic.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Main.import_ref.f6b058.1: type) [from "import_generic.carbon"] { // 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: @@ -292,13 +298,13 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%T: type) [from "import_generic.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.3: type) [from "import_generic.carbon"] { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.2(constants.%Self: %I.type) [from "import_generic.carbon"] { +// CHECK:STDOUT: generic fn @F.2(imports.%Main.import_ref.5dd: %I.type) [from "import_generic.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index df59e7c4d1ed1..31e58081b24c7 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -106,9 +106,10 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl) [template] // CHECK:STDOUT: %Op.type.4b4: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.40d: %Op.type.4b4 = struct_value () [template] -// CHECK:STDOUT: %Action.facet: %Action.type.cca = facet_value %A, %impl_witness [symbolic] +// CHECK:STDOUT: %Action.facet: %Action.type.cb0 = facet_value %A, %impl_witness [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %.920: type = fn_type_with_self_type %Op.type.54d, %Action.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -219,7 +220,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [template = constants.%Action.type.cb0] // CHECK:STDOUT: %.loc16: %Action.assoc_type.827 = specific_constant @Action.%assoc0.loc5_10.1, @Action(constants.%B) [template = constants.%assoc0.035] // CHECK:STDOUT: %Op.ref: %Action.assoc_type.827 = name_ref Op, %.loc16 [template = constants.%assoc0.035] -// CHECK:STDOUT: %impl.elem0: %Op.type.54d = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.40d] +// CHECK:STDOUT: %impl.elem0: %.920 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.40d] // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -275,6 +276,8 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %assoc0.905ab9.2: %Action.assoc_type.8f9 = assoc_entity element0, imports.%Main.import_ref.0e3753.2 [symbolic] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Main.import_ref.d0b) [template] +// CHECK:STDOUT: %Action.facet: %Action.type.cb0 = facet_value %A, %impl_witness [template] +// CHECK:STDOUT: %.ae7: type = fn_type_with_self_type %Op.type.54d, %Action.facet [template] // CHECK:STDOUT: %Op.type.4b4: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.40d: %Op.type.4b4 = struct_value () [template] // CHECK:STDOUT: } @@ -288,6 +291,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.71c: = import_ref Main//action, loc12_21, loaded [template = constants.%impl_witness] // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//action, loc9_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//action, inst46 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.ddc = import_ref Main//action, inst26 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.318: @Action.%Action.assoc_type (%Action.assoc_type.8f9) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.905ab9.2)] // CHECK:STDOUT: %Main.Op = import_ref Main//action, Op, unloaded @@ -296,6 +300,8 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//action, loc12_6, loaded [template = constants.%A] // CHECK:STDOUT: %Main.import_ref.bb2: type = import_ref Main//action, loc12_19, loaded [template = constants.%Action.type.cb0] // CHECK:STDOUT: %Main.import_ref.7b5 = import_ref Main//action, loc13_11, unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.835: @Action.%Action.type (%Action.type.cca) = import_ref Main//action, inst26 [no loc], loaded [symbolic = @Action.%Self (constants.%Self)] // CHECK:STDOUT: %Main.import_ref.0e3753.1 = import_ref Main//action, loc5_10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -320,7 +326,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Action(constants.%T: type) [from "action.carbon"] { +// CHECK:STDOUT: generic interface @Action(imports.%Main.import_ref.f6b058.1: type) [from "action.carbon"] { // 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: @@ -360,7 +366,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .Self = imports.%Main.import_ref.da3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(constants.%T: type, constants.%Self: %Action.type.cca) [from "action.carbon"] { +// CHECK:STDOUT: generic fn @Op.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.835: @Action.%Action.type (%Action.type.cca)) [from "action.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -372,7 +378,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [template = constants.%Action.type.cb0] // CHECK:STDOUT: %.loc4: %Action.assoc_type.827 = specific_constant imports.%Main.import_ref.318, @Action(constants.%B) [template = constants.%assoc0.4cc] // CHECK:STDOUT: %Op.ref: %Action.assoc_type.827 = name_ref Op, %.loc4 [template = constants.%assoc0.4cc] -// CHECK:STDOUT: %impl.elem0: %Op.type.54d = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.40d] +// CHECK:STDOUT: %impl.elem0: %.ae7 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.40d] // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -443,6 +449,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.7a1 = import_ref Main//action, loc12_21, unloaded // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//action, loc9_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//action, inst46 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.ddc = import_ref Main//action, inst26 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.318: @Action.%Action.assoc_type (%Action.assoc_type.8f9) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.905ab9.2)] // CHECK:STDOUT: %Main.Op = import_ref Main//action, Op, unloaded @@ -451,6 +458,8 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//action, loc12_6, loaded [template = constants.%A] // CHECK:STDOUT: %Main.import_ref.bb2: type = import_ref Main//action, loc12_19, loaded [template = constants.%Action.type.cb0] // CHECK:STDOUT: %Main.import_ref.7b5 = import_ref Main//action, loc13_11, unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.835: @Action.%Action.type (%Action.type.cca) = import_ref Main//action, inst26 [no loc], loaded [symbolic = @Action.%Self (constants.%Self)] // CHECK:STDOUT: %Main.import_ref.0e3753.1 = import_ref Main//action, loc5_10, unloaded // CHECK:STDOUT: %Main.import_ref.8f24d3.3: = import_ref Main//action, loc10_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//action, inst49 [no loc], unloaded @@ -477,7 +486,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Action(constants.%T: type) [from "action.carbon"] { +// CHECK:STDOUT: generic interface @Action(imports.%Main.import_ref.f6b058.1: type) [from "action.carbon"] { // 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: @@ -524,7 +533,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .Self = imports.%Main.import_ref.2c4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op(constants.%T: type, constants.%Self: %Action.type.cca) [from "action.carbon"] { +// CHECK:STDOUT: generic fn @Op(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.835: @Action.%Action.type (%Action.type.cca)) [from "action.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: @@ -599,7 +608,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Make.decl) [template] // CHECK:STDOUT: %Make.type.ec4: type = fn_type @Make.2 [template] // CHECK:STDOUT: %Make.377: %Make.type.ec4 = struct_value () [template] -// CHECK:STDOUT: %Factory.facet: %Factory.type.c96 = facet_value %A, %impl_witness [symbolic] +// CHECK:STDOUT: %Factory.facet: %Factory.type.a5d = facet_value %A, %impl_witness [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -750,6 +759,8 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %MakeB: %MakeB.type = struct_value () [template] // CHECK:STDOUT: %assoc0.35472f.2: %Factory.assoc_type.ca7 = assoc_entity element0, imports.%Main.import_ref.21018a.2 [symbolic] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Main.import_ref.9ec) [template] +// CHECK:STDOUT: %Factory.facet: %Factory.type.a5d = facet_value %A, %impl_witness [template] +// CHECK:STDOUT: %.357: type = fn_type_with_self_type %Make.type.c59, %Factory.facet [template] // CHECK:STDOUT: %Make.type.ec4: type = fn_type @Make.2 [template] // CHECK:STDOUT: %Make.377: %Make.type.ec4 = struct_value () [template] // CHECK:STDOUT: } @@ -761,6 +772,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.72b: = import_ref Main//factory, loc11_22, loaded [template = constants.%impl_witness] // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//factory, loc9_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//factory, inst52 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.fbb = import_ref Main//factory, inst26 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.8d5: @Factory.%Factory.assoc_type (%Factory.assoc_type.ca7) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.35472f.2)] // CHECK:STDOUT: %Main.Make = import_ref Main//factory, Make, unloaded @@ -769,6 +781,8 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//factory, loc11_6, loaded [template = constants.%A] // CHECK:STDOUT: %Main.import_ref.bd2: type = import_ref Main//factory, loc11_20, loaded [template = constants.%Factory.type.a5d] // CHECK:STDOUT: %Main.import_ref.a27 = import_ref Main//factory, loc12_17, unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96) = import_ref Main//factory, inst26 [no loc], loaded [symbolic = @Factory.%Self (constants.%Self)] // CHECK:STDOUT: %Main.import_ref.21018a.1 = import_ref Main//factory, loc5_17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -796,7 +810,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Factory(constants.%T: type) [from "factory.carbon"] { +// CHECK:STDOUT: generic interface @Factory(imports.%Main.import_ref.f6b058.1: type) [from "factory.carbon"] { // 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: @@ -836,7 +850,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .Self = imports.%Main.import_ref.da3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Make.1(constants.%T: type, constants.%Self: %Factory.type.c96) [from "factory.carbon"] { +// CHECK:STDOUT: generic fn @Make.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96)) [from "factory.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> @Make.1.%T (%T); @@ -850,7 +864,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%B)> [template = constants.%Factory.type.a5d] // CHECK:STDOUT: %.loc5: %Factory.assoc_type.668 = specific_constant imports.%Main.import_ref.8d5, @Factory(constants.%B) [template = constants.%assoc0.503] // CHECK:STDOUT: %Make.ref: %Factory.assoc_type.668 = name_ref Make, %.loc5 [template = constants.%assoc0.503] -// CHECK:STDOUT: %impl.elem0: %Make.type.c59 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Make.377] +// CHECK:STDOUT: %impl.elem0: %.357 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Make.377] // 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 @@ -922,6 +936,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.3e9 = import_ref Main//factory, loc11_22, unloaded // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//factory, loc9_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//factory, inst52 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.fbb = import_ref Main//factory, inst26 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.8d5: @Factory.%Factory.assoc_type (%Factory.assoc_type.ca7) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.35472f.2)] // CHECK:STDOUT: %Main.Make = import_ref Main//factory, Make, unloaded @@ -930,6 +945,8 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//factory, loc11_6, loaded [template = constants.%A] // CHECK:STDOUT: %Main.import_ref.bd2: type = import_ref Main//factory, loc11_20, loaded [template = constants.%Factory.type.a5d] // CHECK:STDOUT: %Main.import_ref.a27 = import_ref Main//factory, loc12_17, unloaded +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96) = import_ref Main//factory, inst26 [no loc], loaded [symbolic = @Factory.%Self (constants.%Self)] // CHECK:STDOUT: %Main.import_ref.21018a.1 = import_ref Main//factory, loc5_17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -959,7 +976,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Factory(constants.%T: type) [from "factory.carbon"] { +// CHECK:STDOUT: generic interface @Factory(imports.%Main.import_ref.f6b058.1: type) [from "factory.carbon"] { // 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: @@ -1007,7 +1024,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Make(constants.%T: type, constants.%Self: %Factory.type.c96) [from "factory.carbon"] { +// CHECK:STDOUT: generic fn @Make(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96)) [from "factory.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> @Make.%T (%T); diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index e55e2f6ce7b56..4cc3e11dc0073 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -24,10 +24,13 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_24.e3c: Core.IntLiteral = int_value 24 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -111,18 +114,18 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] // CHECK:STDOUT: %int_24: Core.IntLiteral = int_value 24 [template = constants.%int_24.e3c] // CHECK:STDOUT: %.loc11_26.1: %tuple.type = tuple_literal (%int_12, %int_24) -// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_12, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.221] -// 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.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_12) [template = constants.%int_12.1e1] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_26.1: = bound_method %int_12, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc11_26.1: = specific_function %bound_method.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] +// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %specific_fn.loc11_26.1(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_26.2: init %i32 = converted %int_12, %int.convert_checked.loc11_26.1 [template = constants.%int_12.1e1] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.1e1] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_24, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.ef4] -// 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.c4e] -// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_24) [template = constants.%int_24.365] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_26.2: = bound_method %int_24, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.ef4] +// CHECK:STDOUT: %specific_fn.loc11_26.2: = specific_function %bound_method.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c4e] +// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %specific_fn.loc11_26.2(%int_24) [template = constants.%int_24.365] // CHECK:STDOUT: %.loc11_26.5: init %i32 = converted %int_24, %int.convert_checked.loc11_26.2 [template = constants.%int_24.365] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc11_26.6: ref %i32 = array_index file.%a.var, %int_1.loc11 @@ -131,20 +134,20 @@ var d: i32 = a[b]; // CHECK:STDOUT: %.loc11_1: init %array_type = converted %.loc11_26.1, %.loc11_26.8 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_1 // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_1.loc12) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_1.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_1.loc12) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12 [template = constants.%int_1.5d2] // CHECK:STDOUT: assign file.%b.var, %.loc12 // CHECK:STDOUT: %a.ref.loc13: ref %array_type = name_ref a, file.%a // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_16.1: %i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_16.2: %i32 = converted %int_0.loc13, %.loc13_16.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_17.1: ref %i32 = array_index %a.ref.loc13, %.loc13_16.2 diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index c666fd99ff510..8ac2ab0f3a0ca 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -43,10 +43,13 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -138,26 +141,26 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_2.loc14_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %int_3.loc14_28: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc14_29.1: %tuple.type = tuple_literal (%int_1.loc14_22, %int_2.loc14_25, %int_3.loc14_28) -// CHECK:STDOUT: %impl.elem0.loc14_29.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_29.1: = bound_method %int_1.loc14_22, %impl.elem0.loc14_29.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc14_29.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_29.1: = bound_method %int_1.loc14_22, %impl.elem0.loc14_29.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14_29.1: = specific_function %bound_method.loc14_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc14_29.1: init %i32 = call %specific_fn.loc14_29.1(%int_1.loc14_22) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_29.2: init %i32 = converted %int_1.loc14_22, %int.convert_checked.loc14_29.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %int_0.loc14: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc14_29.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_29.2: = bound_method %int_2.loc14_25, %impl.elem0.loc14_29.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0.loc14_29.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_29.2: = bound_method %int_2.loc14_25, %impl.elem0.loc14_29.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_29.2: = specific_function %bound_method.loc14_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc14_29.2: init %i32 = call %specific_fn.loc14_29.2(%int_2.loc14_25) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_29.5: init %i32 = converted %int_2.loc14_25, %int.convert_checked.loc14_29.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc14_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc14_29.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_29.3: = bound_method %int_3.loc14_28, %impl.elem0.loc14_29.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc14_29.3: init %i32 = call %Convert.specific_fn.loc14_29.3(%int_3.loc14_28) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc14_29.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_29.3: = bound_method %int_3.loc14_28, %impl.elem0.loc14_29.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc14_29.3: = specific_function %bound_method.loc14_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc14_29.3: init %i32 = call %specific_fn.loc14_29.3(%int_3.loc14_28) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc14_29.8: init %i32 = converted %int_3.loc14_28, %int.convert_checked.loc14_29.3 [template = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc14_29: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc14_29.9: ref %i32 = array_index %a.var, %int_2.loc14_29 @@ -181,10 +184,10 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc17: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // CHECK:STDOUT: %int_32.loc17_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc17_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_0.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_0.loc17) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc17: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17: = bound_method %int_0.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %bound_method.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %specific_fn.loc17(%int_0.loc17) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_21.1: %i32 = value_of_initializer %int.convert_checked.loc17 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_21.2: %i32 = converted %int_0.loc17, %.loc17_21.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_22: ref %i32 = array_index %a.ref.loc17, %.loc17_21.2 @@ -200,18 +203,18 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc18_5: = bound_method %int_0.loc18, %impl.elem0.loc18_5 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc18_5: = specific_function %Convert.bound.loc18_5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc18_5: init %i32 = call %Convert.specific_fn.loc18_5(%int_0.loc18) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc18_5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18_5: = bound_method %int_0.loc18, %impl.elem0.loc18_5 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc18_5: = specific_function %bound_method.loc18_5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc18_5: init %i32 = call %specific_fn.loc18_5(%int_0.loc18) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc18_5.1: %i32 = value_of_initializer %int.convert_checked.loc18_5 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc18_5.2: %i32 = converted %int_0.loc18, %.loc18_5.1 [template = constants.%int_0.6a9] // 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.0c1] -// CHECK:STDOUT: %impl.elem0.loc18_8: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc18_8: = bound_method %int_4, %impl.elem0.loc18_8 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc18_8: = specific_function %Convert.bound.loc18_8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc18_8: init %i32 = call %Convert.specific_fn.loc18_8(%int_4) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc18_8: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18_8: = bound_method %int_4, %impl.elem0.loc18_8 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc18_8: = specific_function %bound_method.loc18_8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc18_8: init %i32 = call %specific_fn.loc18_8(%int_4) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc18_8: init %i32 = converted %int_4, %int.convert_checked.loc18_8 [template = constants.%int_4.940] // CHECK:STDOUT: assign %.loc18_6, %.loc18_8 // CHECK:STDOUT: return @@ -228,26 +231,26 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_2.loc22_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %int_3.loc22_28: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc22_29.1: %tuple.type = tuple_literal (%int_1.loc22_22, %int_2.loc22_25, %int_3.loc22_28) -// CHECK:STDOUT: %impl.elem0.loc22_29.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc22_29.1: = bound_method %int_1.loc22_22, %impl.elem0.loc22_29.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0.loc22_29.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc22_29.1: = bound_method %int_1.loc22_22, %impl.elem0.loc22_29.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc22_29.1: = specific_function %bound_method.loc22_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc22_29.1: init %i32 = call %specific_fn.loc22_29.1(%int_1.loc22_22) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc22_29.2: init %i32 = converted %int_1.loc22_22, %int.convert_checked.loc22_29.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc22_29.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc22_29.2: = bound_method %int_2.loc22_25, %impl.elem0.loc22_29.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0.loc22_29.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc22_29.2: = bound_method %int_2.loc22_25, %impl.elem0.loc22_29.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc22_29.2: = specific_function %bound_method.loc22_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc22_29.2: init %i32 = call %specific_fn.loc22_29.2(%int_2.loc22_25) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_29.5: init %i32 = converted %int_2.loc22_25, %int.convert_checked.loc22_29.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc22_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc22_29.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc22_29.3: = bound_method %int_3.loc22_28, %impl.elem0.loc22_29.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc22_29.3: init %i32 = call %Convert.specific_fn.loc22_29.3(%int_3.loc22_28) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc22_29.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc22_29.3: = bound_method %int_3.loc22_28, %impl.elem0.loc22_29.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc22_29.3: = specific_function %bound_method.loc22_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc22_29.3: init %i32 = call %specific_fn.loc22_29.3(%int_3.loc22_28) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc22_29.8: init %i32 = converted %int_3.loc22_28, %int.convert_checked.loc22_29.3 [template = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc22_29: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc22_29.9: ref %i32 = array_index %a.var, %int_2.loc22_29 @@ -266,10 +269,10 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc26: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_0.loc26, %impl.elem0.loc26 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_0.loc26) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc26: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc26: = bound_method %int_0.loc26, %impl.elem0.loc26 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc26: = specific_function %bound_method.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %specific_fn.loc26(%int_0.loc26) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc26_5.1: %i32 = value_of_initializer %int.convert_checked.loc26 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc26_5.2: %i32 = converted %int_0.loc26, %.loc26_5.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc26_6: ref %i32 = array_index %a.ref, %.loc26_5.2 @@ -277,10 +280,10 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc27: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_0.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_0.loc27) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc27: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc27: = bound_method %int_0.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc27: = specific_function %bound_method.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %specific_fn.loc27(%int_0.loc27) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc27_5.1: %i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc27_5.2: %i32 = converted %int_0.loc27, %.loc27_5.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc27_6.1: ref %array_type = value_as_ref %b.ref @@ -293,10 +296,10 @@ 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc28: = specific_function %Convert.bound.loc28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %Convert.specific_fn.loc28(%int_0.loc28) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc28: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc28: = specific_function %bound_method.loc28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %specific_fn.loc28(%int_0.loc28) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc28_7.1: %i32 = value_of_initializer %int.convert_checked.loc28 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc28_7.2: %i32 = converted %int_0.loc28, %.loc28_7.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc28_8.1: ref %i32 = array_index %.loc28_5.2, %.loc28_7.2 diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index a23c8ff5efac0..ab1258b11d7d0 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -32,10 +32,13 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -104,10 +107,10 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_12, %impl.elem0.loc11 [template = constants.%Convert.bound.221] -// CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_12) [template = constants.%int_12.1e1] +// CHECK:STDOUT: %impl.elem0.loc11: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11: = bound_method %int_12, %impl.elem0.loc11 [template = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc11: = specific_function %bound_method.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %specific_fn.loc11(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_23.2: init %i32 = converted %int_12, %int.convert_checked.loc11 [template = constants.%int_12.1e1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_23.3: ref %i32 = array_index file.%a.var, %int_0 @@ -119,10 +122,10 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_1, %impl.elem0.loc17 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc17: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17: = bound_method %int_1, %impl.elem0.loc17 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %bound_method.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %specific_fn.loc17(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_16.1: %i32 = value_of_initializer %int.convert_checked.loc17 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_16.2: %i32 = converted %int_1, %.loc17_16.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_17.1: ref %i32 = array_index %a.ref.loc17, %.loc17_16.2 [template = ] @@ -132,10 +135,10 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.d89] // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_2147483647, %impl.elem0.loc23 [template = constants.%Convert.bound.f38] -// CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.221] -// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_2147483647) [template = constants.%int_2147483647.a74] +// CHECK:STDOUT: %impl.elem0.loc23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc23: = bound_method %int_2147483647, %impl.elem0.loc23 [template = constants.%Convert.bound.f38] +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %bound_method.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.221] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %specific_fn.loc23(%int_2147483647) [template = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc23_16.1: %i32 = value_of_initializer %int.convert_checked.loc23 [template = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc23_16.2: %i32 = converted %int_2147483647, %.loc23_16.1 [template = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc23_27.1: ref %i32 = array_index %a.ref.loc23, %.loc23_16.2 [template = ] 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 13d37ef007286..5bd56c0782eae 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -28,10 +28,13 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -83,10 +86,10 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.1e1] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_23.2: init %i32 = converted %int_12, %int.convert_checked [template = constants.%int_12.1e1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_23.3: ref %i32 = array_index file.%a.var, %int_0 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 1efabd632a765..18d97cf9cc58f 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,10 +25,13 @@ var b: i32 = a[1]; // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -82,10 +85,10 @@ var b: i32 = a[1]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_12, %impl.elem0.loc11 [template = constants.%Convert.bound.221] -// CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_12) [template = constants.%int_12.1e1] +// CHECK:STDOUT: %impl.elem0.loc11: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11: = bound_method %int_12, %impl.elem0.loc11 [template = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc11: = specific_function %bound_method.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %specific_fn.loc11(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_23.2: init %i32 = converted %int_12, %int.convert_checked.loc11 [template = constants.%int_12.1e1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_23.3: ref %i32 = array_index file.%a.var, %int_0 @@ -97,10 +100,10 @@ var b: i32 = a[1]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.loc16: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_16.1: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_16.2: %i32 = converted %int_1, %.loc16_16.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_17.1: ref %i32 = array_index %a.ref, %.loc16_16.2 [template = ] diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 0d38136f9fc69..bb01f186ab655 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -50,10 +50,13 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -118,10 +121,10 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc19: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // CHECK:STDOUT: %int_32.loc19_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc19_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_0.loc19, %impl.elem0.loc19 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_0.loc19) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc19: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc19: = bound_method %int_0.loc19, %impl.elem0.loc19 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc19: = specific_function %bound_method.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %specific_fn.loc19(%int_0.loc19) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc19_21.1: %i32 = value_of_initializer %int.convert_checked.loc19 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc19_21.2: %i32 = converted %int_0.loc19, %.loc19_21.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc19_22.1: ref %array_type = value_as_ref %b.ref.loc19 @@ -139,20 +142,20 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc24: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc24_5: = bound_method %int_0.loc24, %impl.elem0.loc24_5 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc24_5: = specific_function %Convert.bound.loc24_5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc24_5: init %i32 = call %Convert.specific_fn.loc24_5(%int_0.loc24) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc24_5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc24_5: = bound_method %int_0.loc24, %impl.elem0.loc24_5 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc24_5: = specific_function %bound_method.loc24_5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc24_5: init %i32 = call %specific_fn.loc24_5(%int_0.loc24) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc24_5.1: %i32 = value_of_initializer %int.convert_checked.loc24_5 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc24_5.2: %i32 = converted %int_0.loc24, %.loc24_5.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc24_6.1: ref %array_type = value_as_ref %b.ref.loc24 // 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.0c1] -// CHECK:STDOUT: %impl.elem0.loc24_8: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc24_8: = bound_method %int_4.loc24, %impl.elem0.loc24_8 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc24_8: = specific_function %Convert.bound.loc24_8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc24_8: init %i32 = call %Convert.specific_fn.loc24_8(%int_4.loc24) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc24_8: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc24_8: = bound_method %int_4.loc24, %impl.elem0.loc24_8 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc24_8: = specific_function %bound_method.loc24_8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc24_8: init %i32 = call %specific_fn.loc24_8(%int_4.loc24) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc24_8: init %i32 = converted %int_4.loc24, %int.convert_checked.loc24_8 [template = constants.%int_4.940] // CHECK:STDOUT: assign %.loc24_6.3, %.loc24_8 // CHECK:STDOUT: name_binding_decl { @@ -167,10 +170,10 @@ 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_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc32_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc32: = bound_method %int_0.loc32, %impl.elem0.loc32 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc32: = specific_function %Convert.bound.loc32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %Convert.specific_fn.loc32(%int_0.loc32) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc32: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc32: = bound_method %int_0.loc32, %impl.elem0.loc32 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc32: = specific_function %bound_method.loc32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %specific_fn.loc32(%int_0.loc32) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc32_23.1: %i32 = value_of_initializer %int.convert_checked.loc32 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc32_23.2: %i32 = converted %int_0.loc32, %.loc32_23.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc32_24.1: ref %i32 = array_index %.loc32_21.2, %.loc32_23.2 @@ -190,19 +193,19 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc37_5.2: ref %array_type = temporary %.loc37_5.1, %F.call.loc37 // CHECK:STDOUT: %int_32.loc37: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc37_7: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc37_7: = bound_method %int_0.loc37, %impl.elem0.loc37_7 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc37_7: = specific_function %Convert.bound.loc37_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc37_7: init %i32 = call %Convert.specific_fn.loc37_7(%int_0.loc37) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc37_7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc37_7: = bound_method %int_0.loc37, %impl.elem0.loc37_7 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc37_7: = specific_function %bound_method.loc37_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc37_7: init %i32 = call %specific_fn.loc37_7(%int_0.loc37) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc37_7.1: %i32 = value_of_initializer %int.convert_checked.loc37_7 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc37_7.2: %i32 = converted %int_0.loc37, %.loc37_7.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc37_8.1: ref %i32 = array_index %.loc37_5.2, %.loc37_7.2 // CHECK:STDOUT: %.loc37_8.2: %i32 = bind_value %.loc37_8.1 // CHECK:STDOUT: %int_4.loc37: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] -// CHECK:STDOUT: %impl.elem0.loc37_10: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc37_10: = bound_method %int_4.loc37, %impl.elem0.loc37_10 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc37_10: = specific_function %Convert.bound.loc37_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc37_10: init %i32 = call %Convert.specific_fn.loc37_10(%int_4.loc37) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc37_10: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc37_10: = bound_method %int_4.loc37, %impl.elem0.loc37_10 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc37_10: = specific_function %bound_method.loc37_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc37_10: init %i32 = call %specific_fn.loc37_10(%int_4.loc37) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc37_10: init %i32 = converted %int_4.loc37, %int.convert_checked.loc37_10 [template = constants.%int_4.940] // CHECK:STDOUT: assign %.loc37_8.2, %.loc37_10 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 6313bf080f862..41d37475f8d88 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -26,10 +26,14 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %int_42.20e: Core.IntLiteral = int_value 42 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.132: = bound_method %int_42.20e, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.2f6: = specific_function %Convert.bound.132, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.c68: %i32 = int_value 42 [template] @@ -38,6 +42,8 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template] // CHECK:STDOUT: %impl_witness.0f6: = impl_witness (imports.%Core.import_ref.c15) [template] // CHECK:STDOUT: %Op.type.e42: type = fn_type @Op.13 [template] +// CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value Core.IntLiteral, %impl_witness.0f6 [template] +// CHECK:STDOUT: %.45d: type = fn_type_with_self_type %Op.type.e42, %Negate.facet [template] // CHECK:STDOUT: %Op.type.1be: type = fn_type @Op.14 [template] // CHECK:STDOUT: %Op.bba: %Op.type.1be = struct_value () [template] // CHECK:STDOUT: %Op.bound: = bound_method %int_10, %Op.bba [template] @@ -93,18 +99,18 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %int_42.loc11_20: Core.IntLiteral = int_value 42 [template = constants.%int_42.20e] // CHECK:STDOUT: %int_42.loc11_24: Core.IntLiteral = int_value 42 [template = constants.%int_42.20e] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_42.loc11_20, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.132] -// 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.2f6] -// 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.c68] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_26.1: = bound_method %int_42.loc11_20, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.132] +// CHECK:STDOUT: %specific_fn.loc11_26.1: = specific_function %bound_method.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2f6] +// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %specific_fn.loc11_26.1(%int_42.loc11_20) [template = constants.%int_42.c68] // CHECK:STDOUT: %.loc11_26.2: init %i32 = converted %int_42.loc11_20, %int.convert_checked.loc11_26.1 [template = constants.%int_42.c68] // 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.c68] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_42.loc11_24, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.132] -// 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.2f6] -// 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.c68] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_26.2: = bound_method %int_42.loc11_24, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.132] +// CHECK:STDOUT: %specific_fn.loc11_26.2: = specific_function %bound_method.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2f6] +// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %specific_fn.loc11_26.2(%int_42.loc11_24) [template = constants.%int_42.c68] // CHECK:STDOUT: %.loc11_26.5: init %i32 = converted %int_42.loc11_24, %int.convert_checked.loc11_26.2 [template = constants.%int_42.c68] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %.loc11_26.6: ref %i32 = array_index file.%c.var, %int_1 @@ -114,17 +120,17 @@ var d: i32 = c[-10]; // CHECK:STDOUT: assign file.%c.var, %.loc11_1 // 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.loc16_16.1: %Op.type.e42 = impl_witness_access constants.%impl_witness.0f6, element0 [template = constants.%Op.bba] -// CHECK:STDOUT: %Op.bound: = bound_method %int_10, %impl.elem0.loc16_16.1 [template = constants.%Op.bound] -// CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %Op.bound(%int_10) [template = constants.%int_-10.06d] +// CHECK:STDOUT: %impl.elem0.loc16_16.1: %.45d = impl_witness_access constants.%impl_witness.0f6, element0 [template = constants.%Op.bba] +// CHECK:STDOUT: %bound_method.loc16_16.1: = bound_method %int_10, %impl.elem0.loc16_16.1 [template = constants.%Op.bound] +// CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %bound_method.loc16_16.1(%int_10) [template = constants.%int_-10.06d] // 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.loc16_16.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int.snegate, %impl.elem0.loc16_16.2 [template = constants.%Convert.bound.1ca] -// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4be] +// CHECK:STDOUT: %impl.elem0.loc16_16.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16_16.2: = bound_method %int.snegate, %impl.elem0.loc16_16.2 [template = constants.%Convert.bound.1ca] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16_16.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4be] // CHECK:STDOUT: %.loc16_16.1: Core.IntLiteral = value_of_initializer %int.snegate [template = constants.%int_-10.06d] // CHECK:STDOUT: %.loc16_16.2: Core.IntLiteral = converted %int.snegate, %.loc16_16.1 [template = constants.%int_-10.06d] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%.loc16_16.2) [template = constants.%int_-10.c17] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%.loc16_16.2) [template = constants.%int_-10.c17] // CHECK:STDOUT: %.loc16_16.3: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_-10.c17] // CHECK:STDOUT: %.loc16_16.4: %i32 = converted %int.snegate, %.loc16_16.3 [template = constants.%int_-10.c17] // CHECK:STDOUT: %.loc16_19.1: ref %i32 = array_index %c.ref, %.loc16_16.4 [template = ] 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 cf7707a7f6654..07487abe66da8 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -34,10 +34,13 @@ interface I { // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%N [template] // CHECK:STDOUT: %int_42.20e: Core.IntLiteral = int_value 42 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42.20e, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.c68: %i32 = int_value 42 [template] @@ -75,10 +78,10 @@ interface I { // CHECK:STDOUT: %N: %i32 = assoc_const_decl @N [template] { // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%N [template = constants.%assoc1] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42.20e] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.c68] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_42, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_42) [template = constants.%int_42.c68] // CHECK:STDOUT: %.loc21_27.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_42.c68] // CHECK:STDOUT: %.loc21_27.2: %i32 = converted %int_42, %.loc21_27.1 [template = constants.%int_42.c68] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/member_lookup.carbon b/toolchain/check/testdata/interface/member_lookup.carbon index ff97a415f8cf2..5c56f07d2fba5 100644 --- a/toolchain/check/testdata/interface/member_lookup.carbon +++ b/toolchain/check/testdata/interface/member_lookup.carbon @@ -82,7 +82,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %assoc0.4ff: %Interface.assoc_type.44d = assoc_entity element0, @Interface.%X [template] // CHECK:STDOUT: %I.as_type.ee6: type = facet_access_type %I.d08 [symbolic] // CHECK:STDOUT: %I.as_wit.156: = facet_access_witness %I.d08 [symbolic] -// CHECK:STDOUT: %Interface.facet.a3f: %Interface.type.d32 = facet_value %I.as_type.ee6, %I.as_wit.156 [symbolic] +// CHECK:STDOUT: %Interface.facet.d35: %Interface.type.981 = facet_value %I.as_type.ee6, %I.as_wit.156 [symbolic] // CHECK:STDOUT: %impl.elem0.b00: %i32 = impl_witness_access %I.as_wit.156, element0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -281,7 +281,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %I.patt.loc12_19.2 => constants.%I.d08 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(constants.%i32, constants.%Interface.facet.a3f) { +// CHECK:STDOUT: specific @X(constants.%i32, constants.%Interface.facet.d35) { // CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/default_fn.carbon index f7d213532d5ec..5f7d0c689cf9a 100644 --- a/toolchain/check/testdata/interface/no_prelude/default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/default_fn.carbon @@ -41,6 +41,7 @@ class C { // 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] +// CHECK:STDOUT: %.eab: type = fn_type_with_self_type %F.type.0b5, %I.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -103,7 +104,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: %I.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.0b5 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.eb2] +// CHECK:STDOUT: %impl.elem0: %.eab = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.eb2] // 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_assoc_fn_invalid_use.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_fn_invalid_use.carbon new file mode 100644 index 0000000000000..06161a042f7f8 --- /dev/null +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_fn_invalid_use.carbon @@ -0,0 +1,127 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_fn_invalid_use.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_fn_invalid_use.carbon + +// --- fail_member_access.carbon + +library "[[@TEST_NAME]]"; + +interface I { + fn F[self: Self](); +} + +fn Use(T:! I) { + // CHECK:STDERR: fail_member_access.carbon:[[@LINE+4]]:3: error: type `` does not support qualified expressions [QualifiedExprUnsupported] + // CHECK:STDERR: T.F.member; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: + T.F.member; +} + +// CHECK:STDOUT: --- fail_member_access.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %I.type: type = facet_type <@I> [template] +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [template] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%F.decl [template] +// 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: %Use.type: type = fn_type @Use [template] +// CHECK:STDOUT: %Use: %Use.type = struct_value () [template] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] +// CHECK:STDOUT: %T.as_wit: = facet_access_witness %T [symbolic] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, %T.as_wit [symbolic] +// CHECK:STDOUT: %.de3: type = fn_type_with_self_type %F.type, %I.facet [symbolic] +// CHECK:STDOUT: %impl.elem0: %.de3 = impl_witness_access %T.as_wit, element0 [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %.de3 [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} +// CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { +// CHECK:STDOUT: %T.patt.loc8_8.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc8_8.1, runtime_param [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: %I.type = value_param runtime_param +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %T.loc8_8.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %self.patt: @F.%Self.as_type.loc5_14.1 (%Self.as_type) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: @F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @F.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .F = %assoc0 +// CHECK:STDOUT: witness = (%F.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(@I.%Self: %I.type) { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @F.%Self.as_type.loc5_14.1 (%Self.as_type)](); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Use(%T.loc8_8.1: %I.type) { +// CHECK:STDOUT: %T.loc8_8.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_8.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.as_type.loc13_4.2: type = facet_access_type %T.loc8_8.2 [symbolic = %T.as_type.loc13_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.loc13_4.2: = facet_access_witness %T.loc8_8.2 [symbolic = %T.as_wit.loc13_4.2 (constants.%T.as_wit)] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc13_4.2, %T.as_wit.loc13_4.2 [symbolic = %I.facet (constants.%I.facet)] +// CHECK:STDOUT: %.loc13_4.2: type = fn_type_with_self_type constants.%F.type, %I.facet [symbolic = %.loc13_4.2 (constants.%.de3)] +// CHECK:STDOUT: %impl.elem0.loc13_4.2: @Use.%.loc13_4.2 (%.de3) = impl_witness_access %T.as_wit.loc13_4.2, element0 [symbolic = %impl.elem0.loc13_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Use.%.loc13_4.2 (%.de3) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%T.param_patt: %I.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %T.ref: %I.type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %T.as_type.loc13_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc13_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc13_4.1: type = converted %T.ref, %T.as_type.loc13_4.1 [symbolic = %T.as_type.loc13_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.loc13_4.1: = facet_access_witness %T.ref [symbolic = %T.as_wit.loc13_4.2 (constants.%T.as_wit)] +// CHECK:STDOUT: %impl.elem0.loc13_4.1: @Use.%.loc13_4.2 (%.de3) = impl_witness_access %T.as_wit.loc13_4.1, element0 [symbolic = %impl.elem0.loc13_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%Self) { +// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Use(constants.%T) { +// CHECK:STDOUT: %T.loc8_8.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_8.2 => constants.%T +// CHECK:STDOUT: } +// 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 deleted file mode 100644 index 1484e3686d184..0000000000000 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon +++ /dev/null @@ -1,147 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// AUTOUPDATE -// TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon -// TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon - -interface Interface { fn F(); } - -fn CallStatic(T:! Interface) { - // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+4]]:3: error: value of type `` is not callable [CallToNonCallable] - // CHECK:STDERR: T.F(); - // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: - T.F(); -} - -fn CallFacet(T:! Interface, x: T) { - // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+4]]:3: error: type `T` does not support qualified expressions [QualifiedExprUnsupported] - // CHECK:STDERR: x.F(); - // CHECK:STDERR: ^~~ - // CHECK:STDERR: - x.F(); -} - -// CHECK:STDOUT: --- fail_todo_facet_lookup.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Interface.type: type = facet_type <@Interface> [template] -// CHECK:STDOUT: %Self: %Interface.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %Interface.assoc_type: type = assoc_entity_type %Interface.type [template] -// CHECK:STDOUT: %assoc0: %Interface.assoc_type = assoc_entity element0, @Interface.%F.decl [template] -// CHECK:STDOUT: %T: %Interface.type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %T.patt: %Interface.type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %CallStatic.type: type = fn_type @CallStatic [template] -// CHECK:STDOUT: %CallStatic: %CallStatic.type = struct_value () [template] -// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] -// CHECK:STDOUT: %T.as_wit: = facet_access_witness %T [symbolic] -// CHECK:STDOUT: %impl.elem0: %F.type = impl_witness_access %T.as_wit, element0 [symbolic] -// CHECK:STDOUT: %CallFacet.type: type = fn_type @CallFacet [template] -// CHECK:STDOUT: %CallFacet: %CallFacet.type = struct_value () [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type [symbolic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Interface = %Interface.decl -// CHECK:STDOUT: .CallStatic = %CallStatic.decl -// CHECK:STDOUT: .CallFacet = %CallFacet.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%Interface.type] {} {} -// CHECK:STDOUT: %CallStatic.decl: %CallStatic.type = fn_decl @CallStatic [template = constants.%CallStatic] { -// CHECK:STDOUT: %T.patt.loc13_15.1: %Interface.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_15.2 (constants.%T.patt)] -// CHECK:STDOUT: %T.param_patt: %Interface.type = value_param_pattern %T.patt.loc13_15.1, runtime_param [symbolic = %T.patt.loc13_15.2 (constants.%T.patt)] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: %Interface.type = value_param runtime_param -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.loc13_15.1: %Interface.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_15.2 (constants.%T)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %CallFacet.decl: %CallFacet.type = fn_decl @CallFacet [template = constants.%CallFacet] { -// CHECK:STDOUT: %T.patt.loc21_14.1: %Interface.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt)] -// CHECK:STDOUT: %T.param_patt: %Interface.type = value_param_pattern %T.patt.loc21_14.1, runtime_param [symbolic = %T.patt.loc21_14.2 (constants.%T.patt)] -// CHECK:STDOUT: %x.patt: @CallFacet.%T.as_type.loc21_32.2 (%T.as_type) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @CallFacet.%T.as_type.loc21_32.2 (%T.as_type) = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: %Interface.type = value_param runtime_param -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.loc21_14.1: %Interface.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc21_14.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @CallFacet.%T.as_type.loc21_32.2 (%T.as_type) = value_param runtime_param0 -// CHECK:STDOUT: %.loc21_32.1: type = splice_block %.loc21_32.2 [symbolic = %T.as_type.loc21_32.2 (constants.%T.as_type)] { -// CHECK:STDOUT: %T.ref: %Interface.type = name_ref T, %T.loc21_14.1 [symbolic = %T.loc21_14.2 (constants.%T)] -// CHECK:STDOUT: %T.as_type.loc21_32.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc21_32.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc21_32.2: type = converted %T.ref, %T.as_type.loc21_32.1 [symbolic = %T.as_type.loc21_32.2 (constants.%T.as_type)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %x: @CallFacet.%T.as_type.loc21_32.2 (%T.as_type) = bind_name x, %x.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @Interface { -// CHECK:STDOUT: %Self: %Interface.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} -// CHECK:STDOUT: %assoc0: %Interface.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .F = %assoc0 -// CHECK:STDOUT: witness = (%F.decl) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(@Interface.%Self: %Interface.type) { -// CHECK:STDOUT: fn(); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @CallStatic(%T.loc13_15.1: %Interface.type) { -// CHECK:STDOUT: %T.loc13_15.2: %Interface.type = bind_symbolic_name T, 0 [symbolic = %T.loc13_15.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc13_15.2: %Interface.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_15.2 (constants.%T.patt)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T.as_type.loc18_4.2: type = facet_access_type %T.loc13_15.2 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)] -// 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 = 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: %Interface.assoc_type = name_ref F, @Interface.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %T.as_type.loc18_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc18: type = converted %T.ref, %T.as_type.loc18_4.1 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)] -// 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 = 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: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @CallFacet(%T.loc21_14.1: %Interface.type) { -// CHECK:STDOUT: %T.loc21_14.2: %Interface.type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc21_14.2: %Interface.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt)] -// CHECK:STDOUT: %T.as_type.loc21_32.2: type = facet_access_type %T.loc21_14.2 [symbolic = %T.as_type.loc21_32.2 (constants.%T.as_type)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @CallFacet.%T.as_type.loc21_32.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.param_patt: %Interface.type, %x.param_patt: @CallFacet.%T.as_type.loc21_32.2 (%T.as_type)) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: @CallFacet.%T.as_type.loc21_32.2 (%T.as_type) = name_ref x, %x -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @CallStatic(constants.%T) { -// CHECK:STDOUT: %T.loc13_15.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc13_15.2 => constants.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @CallFacet(constants.%T) { -// CHECK:STDOUT: %T.loc21_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc21_14.2 => constants.%T -// CHECK:STDOUT: %T.as_type.loc21_32.2 => constants.%T.as_type -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index 9806397b1913d..414d697f95271 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -91,7 +91,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %impl_witness.49b: = impl_witness (@impl.2.%F.decl) [template] // CHECK:STDOUT: %F.type.005: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.317: %F.type.005 = struct_value () [template] -// CHECK:STDOUT: %WithAssocFn.facet: %WithAssocFn.type.ce6 = facet_value %C, %impl_witness.49b [symbolic] +// CHECK:STDOUT: %WithAssocFn.facet: %WithAssocFn.type.683 = facet_value %C, %impl_witness.49b [template] // CHECK:STDOUT: %X.val: %X = struct_value () [template] // CHECK:STDOUT: %N: %T.8b3 = bind_symbolic_name N, 1 [symbolic] // CHECK:STDOUT: %N.patt: %T.8b3 = symbolic_binding_pattern N, 1 [symbolic] diff --git a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon index 0c7a2c9254f8a..7b84172a089da 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon @@ -116,14 +116,17 @@ impl C as AddWith(C) { // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [template] // CHECK:STDOUT: %F.type.c09: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.e62: %F.type.c09 = struct_value () [template] -// CHECK:STDOUT: %AddWith.facet: %AddWith.type.bc7 = facet_value %C, %impl_witness [symbolic] +// CHECK:STDOUT: %AddWith.facet: %AddWith.type.e8e = facet_value %C, %impl_witness [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.AddWith: %AddWith.type.b35 = import_ref Main//a, AddWith, loaded [template = constants.%AddWith.generic] +// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//a, loc4_19, loaded [symbolic = @AddWith.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.476 = import_ref Main//a, inst26 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.550 = import_ref Main//a, loc5_9, unloaded // CHECK:STDOUT: %Main.F: @AddWith.%F.type (%F.type.fbc) = import_ref Main//a, F, loaded [symbolic = @AddWith.%F (constants.%F.be3)] +// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//a, loc4_19, loaded [symbolic = @AddWith.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.5a4: @AddWith.%AddWith.type (%AddWith.type.bc7) = import_ref Main//a, inst26 [no loc], loaded [symbolic = @AddWith.%Self (constants.%Self)] // CHECK:STDOUT: %Main.import_ref.0c5 = import_ref Main//a, loc5_9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -143,7 +146,7 @@ impl C as AddWith(C) { // 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"] { +// CHECK:STDOUT: generic interface @AddWith(imports.%Main.import_ref.f6b058.1: type) [from "a.carbon"] { // 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: @@ -179,7 +182,7 @@ impl C as AddWith(C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%T: type, constants.%Self: %AddWith.type.bc7) [from "a.carbon"] { +// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.5a4: @AddWith.%AddWith.type (%AddWith.type.bc7)) [from "a.carbon"] { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/local.carbon b/toolchain/check/testdata/interface/no_prelude/local.carbon index e1ca395ace247..e573fab1b7b91 100644 --- a/toolchain/check/testdata/interface/no_prelude/local.carbon +++ b/toolchain/check/testdata/interface/no_prelude/local.carbon @@ -34,6 +34,7 @@ fn F() { // CHECK:STDOUT: %G.type.c84: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.5a2: %G.type.c84 = struct_value () [template] // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_tuple.type, %impl_witness [template] +// CHECK:STDOUT: %.fbf: type = fn_type_with_self_type %G.type.bff, %I.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -74,7 +75,7 @@ fn F() { // CHECK:STDOUT: %.loc18: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%I.type] // CHECK:STDOUT: %G.ref: %I.assoc_type = name_ref G, @I.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %G.type.bff = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.5a2] +// CHECK:STDOUT: %impl.elem0: %.fbf = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.5a2] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index 7b9acbb18b9f2..5d8a48b7a6371 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -631,6 +631,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %Main.Bar: %Bar.type = import_ref Main//two_file, Bar, loaded [template = constants.%Bar.generic] // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//two_file, loc4_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//two_file, inst14 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.11fba2.1: %C = import_ref Main//two_file, loc7_15, loaded [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %Main.import_ref.11fba2.2: %C = import_ref Main//two_file, loc8_15, loaded [symbolic = @Bar.%a (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -660,7 +662,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(constants.%a: %C) [from "two_file.carbon"] { +// CHECK:STDOUT: generic interface @Foo(imports.%Main.import_ref.11fba2.1: %C) [from "two_file.carbon"] { // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt (constants.%a.patt)] // CHECK:STDOUT: @@ -684,7 +686,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Bar(constants.%a: %C) [from "two_file.carbon"] { +// CHECK:STDOUT: generic interface @Bar(imports.%Main.import_ref.11fba2.2: %C) [from "two_file.carbon"] { // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt (constants.%a.patt)] // CHECK:STDOUT: @@ -1071,6 +1073,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %Main.Foo: %Foo.type = import_ref Main//alias_two_file, Foo, loaded [template = constants.%Foo.generic] // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//alias_two_file, loc4_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//alias_two_file, inst14 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.11f: %C = import_ref Main//alias_two_file, loc6_15, loaded [symbolic = @Foo.%a (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1093,7 +1096,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(constants.%a: %C) [from "alias_two_file.carbon"] { +// CHECK:STDOUT: generic interface @Foo(imports.%Main.import_ref.11f: %C) [from "alias_two_file.carbon"] { // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt (constants.%a.patt)] // 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 adafe053114aa..3a34ea6bbc916 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -38,10 +38,13 @@ interface I { // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %assoc3: %I.assoc_type = assoc_entity element3, @I.%N [template] // CHECK:STDOUT: %int_42.20e: Core.IntLiteral = int_value 42 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42.20e, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.c68: %i32 = int_value 42 [template] @@ -107,10 +110,10 @@ interface I { // CHECK:STDOUT: %N: %i32 = assoc_const_decl @N [template] { // CHECK:STDOUT: %assoc3: %I.assoc_type = assoc_entity element3, @I.%N [template = constants.%assoc3] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42.20e] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.c68] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_42, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_42) [template = constants.%int_42.c68] // CHECK:STDOUT: %.loc19_19.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_42.c68] // CHECK:STDOUT: %.loc19_19.2: %i32 = converted %int_42, %.loc19_19.1 [template = constants.%int_42.c68] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index 9ee9522e93abc..2fddaa1d45676 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -19,10 +19,13 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -62,10 +65,10 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: } // CHECK:STDOUT: %n.var.loc11_22: ref %i32 = var n // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_22: = bound_method %int_1, %impl.elem0.loc11_22 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc11_22: = specific_function %Convert.bound.loc11_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %Convert.specific_fn.loc11_22(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc11_22: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_22: = bound_method %int_1, %impl.elem0.loc11_22 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11_22: = specific_function %bound_method.loc11_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %specific_fn.loc11_22(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_22.2: init %i32 = converted %int_1, %int.convert_checked.loc11_22 [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %n.var.loc11_22, %.loc11_22.2 // CHECK:STDOUT: %.loc11_29: type = splice_block %i32.loc11_29 [template = constants.%i32] { @@ -86,10 +89,10 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: } // CHECK:STDOUT: %n.var.loc11_52: ref %i32 = var n // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc11_52: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_52: = bound_method %int_2, %impl.elem0.loc11_52 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc11_52: = specific_function %Convert.bound.loc11_52, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc11_52: init %i32 = call %Convert.specific_fn.loc11_52(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc11_52: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_52: = bound_method %int_2, %impl.elem0.loc11_52 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_52: = specific_function %bound_method.loc11_52, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc11_52: init %i32 = call %specific_fn.loc11_52(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_52.2: init %i32 = converted %int_2, %int.convert_checked.loc11_52 [template = constants.%int_2.ef8] // CHECK:STDOUT: assign %n.var.loc11_52, %.loc11_52.2 // CHECK:STDOUT: %.loc11_59: type = splice_block %i32.loc11_59 [template = constants.%i32] { diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 7e2265c2449e1..ca84a9cc25203 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -593,10 +593,13 @@ impl i32 as Empty { // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0 [symbolic] // CHECK:STDOUT: %Zero.patt: %i32 = symbolic_binding_pattern Zero, 0 [symbolic] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -638,10 +641,10 @@ impl i32 as Empty { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc5_20.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc5_20.2: %i32 = converted %int_0, %.loc5_20.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0, %.loc5_20.2 [symbolic = constants.%Zero] @@ -660,10 +663,13 @@ impl i32 as Empty { // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0 [symbolic] // CHECK:STDOUT: %Zero.patt: %i32 = symbolic_binding_pattern Zero, 0 [symbolic] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -713,10 +719,10 @@ impl i32 as Empty { // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_0, %impl.elem0.loc6 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6: = bound_method %int_0, %impl.elem0.loc6 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %bound_method.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %specific_fn.loc6(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_22.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_22.2: %i32 = converted %int_0, %.loc6_22.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0, %.loc6_22.2 [symbolic = constants.%Zero] @@ -725,10 +731,10 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_1, %impl.elem0.loc9 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.specific_fn.loc9(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc9: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc9: = bound_method %int_1, %impl.elem0.loc9 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc9: = specific_function %bound_method.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %specific_fn.loc9(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_11.1: %i32 = value_of_initializer %int.convert_checked.loc9 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_11.2: %i32 = converted %int_1, %.loc9_11.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc9_11.2 @@ -916,10 +922,13 @@ impl i32 as Empty { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %impl_witness.1bc: = impl_witness () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -966,10 +975,10 @@ impl i32 as Empty { // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_20.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_20.2: %i32 = converted %int_0, %.loc11_20.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %Zero: %i32 = bind_name Zero, %.loc11_20.2 diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index f346eaa86e743..51f4a8e47e274 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -28,10 +28,13 @@ fn F() -> i32 { // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.37f: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -81,24 +84,24 @@ fn F() -> i32 { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc12_36.1: %tuple.type.37f = tuple_literal (%int_1.loc12, %int_2, %int_3) -// CHECK:STDOUT: %impl.elem0.loc12_36.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12_36.1: = bound_method %int_1.loc12, %impl.elem0.loc12_36.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc12_36.1: init %i32 = call %Convert.specific_fn.loc12_36.1(%int_1.loc12) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc12_36.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12_36.1: = bound_method %int_1.loc12, %impl.elem0.loc12_36.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc12_36.1: = specific_function %bound_method.loc12_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc12_36.1: init %i32 = call %specific_fn.loc12_36.1(%int_1.loc12) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_36.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_36.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc12_36.3: init %i32 = initialize_from %.loc12_36.2 to %tuple.elem0 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc12_36.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12_36.2: = bound_method %int_2, %impl.elem0.loc12_36.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc12_36.2: init %i32 = call %Convert.specific_fn.loc12_36.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc12_36.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12_36.2: = bound_method %int_2, %impl.elem0.loc12_36.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc12_36.2: = specific_function %bound_method.loc12_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc12_36.2: init %i32 = call %specific_fn.loc12_36.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_36.4: init %i32 = converted %int_2, %int.convert_checked.loc12_36.2 [template = constants.%int_2.ef8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc12_36.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12_36.3: = bound_method %int_3, %impl.elem0.loc12_36.3 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc12_36.3: init %i32 = call %Convert.specific_fn.loc12_36.3(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc12_36.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12_36.3: = bound_method %int_3, %impl.elem0.loc12_36.3 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc12_36.3: = specific_function %bound_method.loc12_36.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc12_36.3: init %i32 = call %specific_fn.loc12_36.3(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc12_36.6: init %i32 = converted %int_3, %int.convert_checked.loc12_36.3 [template = constants.%int_3.822] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %v.var, element2 // CHECK:STDOUT: %.loc12_36.7: init %i32 = initialize_from %.loc12_36.6 to %tuple.elem2 [template = constants.%int_3.822] diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index e37b12f0be090..67d5474c5edbe 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -28,10 +28,13 @@ fn F() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -69,10 +72,10 @@ fn F() { // 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: } -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1, %impl.elem0.loc12 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_1, %impl.elem0.loc12 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_16.1: %i32 = value_of_initializer %int.convert_checked.loc12 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_16.2: %i32 = converted %int_1, %.loc12_16.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %a.loc12: %i32 = bind_name a, %.loc12_16.2 @@ -84,10 +87,10 @@ fn F() { // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc20: = bound_method %int_2, %impl.elem0.loc20 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc20: = specific_function %Convert.bound.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %Convert.specific_fn.loc20(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc20: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc20: = bound_method %int_2, %impl.elem0.loc20 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc20: = specific_function %bound_method.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %specific_fn.loc20(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc20_16.1: %i32 = value_of_initializer %int.convert_checked.loc20 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc20_16.2: %i32 = converted %int_2, %.loc20_16.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %a.loc20: %i32 = bind_name a, %.loc20_16.2 diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index 167dfcbfc14c6..9075cab1b43a6 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -42,7 +42,7 @@ fn F() { // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .n = .inst43.loc15_5 +// CHECK:STDOUT: .n = .inst44.loc15_5 // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index 6ac40bcab4907..c035360316eb8 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -90,10 +90,13 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -128,10 +131,10 @@ protected protected let i: i32 = 1; // 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] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15: = bound_method @__global_init.%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(@__global_init.%int_1.loc15) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc15: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc15: = bound_method @__global_init.%int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %bound_method.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %specific_fn.loc15(@__global_init.%int_1.loc15) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_24.1: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_24.2: %i32 = converted @__global_init.%int_1.loc15, %.loc15_24.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc15_24.2 @@ -142,10 +145,10 @@ protected protected let i: i32 = 1; // 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] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc21: = bound_method @__global_init.%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(@__global_init.%int_1.loc21) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc21: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc21: = bound_method @__global_init.%int_1.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc21: = specific_function %bound_method.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %specific_fn.loc21(@__global_init.%int_1.loc21) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_22.1: %i32 = value_of_initializer %int.convert_checked.loc21 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_22.2: %i32 = converted @__global_init.%int_1.loc21, %.loc21_22.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %c: %i32 = bind_name c, %.loc21_22.2 @@ -156,10 +159,10 @@ protected protected let i: i32 = 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: } -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc27: = bound_method @__global_init.%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(@__global_init.%int_1.loc27) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc27: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc27: = bound_method @__global_init.%int_1.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc27: = specific_function %bound_method.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %specific_fn.loc27(@__global_init.%int_1.loc27) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc27_20.1: %i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc27_20.2: %i32 = converted @__global_init.%int_1.loc27, %.loc27_20.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %d: %i32 = bind_name d, %.loc27_20.2 @@ -170,10 +173,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %int_32.loc33: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc33: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc33: = bound_method @__global_init.%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(@__global_init.%int_1.loc33) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc33: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc33: = bound_method @__global_init.%int_1.loc33, %impl.elem0.loc33 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc33: = specific_function %bound_method.loc33, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc33: init %i32 = call %specific_fn.loc33(@__global_init.%int_1.loc33) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc33_22.1: %i32 = value_of_initializer %int.convert_checked.loc33 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc33_22.2: %i32 = converted @__global_init.%int_1.loc33, %.loc33_22.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %e: %i32 = bind_name e, %.loc33_22.2 @@ -184,10 +187,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %int_32.loc46: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc46: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc46: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc46: = bound_method @__global_init.%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(@__global_init.%int_1.loc46) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc46: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc46: = bound_method @__global_init.%int_1.loc46, %impl.elem0.loc46 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc46: = specific_function %bound_method.loc46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc46: init %i32 = call %specific_fn.loc46(@__global_init.%int_1.loc46) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc46_28.1: %i32 = value_of_initializer %int.convert_checked.loc46 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc46_28.2: %i32 = converted @__global_init.%int_1.loc46, %.loc46_28.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %f: %i32 = bind_name f, %.loc46_28.2 @@ -198,10 +201,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %int_32.loc59: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc59: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc59: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc59: = bound_method @__global_init.%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(@__global_init.%int_1.loc59) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc59: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc59: = bound_method @__global_init.%int_1.loc59, %impl.elem0.loc59 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc59: = specific_function %bound_method.loc59, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc59: init %i32 = call %specific_fn.loc59(@__global_init.%int_1.loc59) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc59_30.1: %i32 = value_of_initializer %int.convert_checked.loc59 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc59_30.2: %i32 = converted @__global_init.%int_1.loc59, %.loc59_30.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %g: %i32 = bind_name g, %.loc59_30.2 @@ -212,10 +215,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %int_32.loc72: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc72: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc72: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc72: = bound_method @__global_init.%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(@__global_init.%int_1.loc72) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc72: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc72: = bound_method @__global_init.%int_1.loc72, %impl.elem0.loc72 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc72: = specific_function %bound_method.loc72, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc72: init %i32 = call %specific_fn.loc72(@__global_init.%int_1.loc72) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc72_32.1: %i32 = value_of_initializer %int.convert_checked.loc72 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc72_32.2: %i32 = converted @__global_init.%int_1.loc72, %.loc72_32.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %h: %i32 = bind_name h, %.loc72_32.2 @@ -226,10 +229,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %int_32.loc85: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc85: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc85: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc85: = bound_method @__global_init.%int_1.loc85, %impl.elem0.loc85 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn.loc85: = specific_function %Convert.bound.loc85, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc85: init %i32 = call %Convert.specific_fn.loc85(@__global_init.%int_1.loc85) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc85: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc85: = bound_method @__global_init.%int_1.loc85, %impl.elem0.loc85 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc85: = specific_function %bound_method.loc85, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc85: init %i32 = call %specific_fn.loc85(@__global_init.%int_1.loc85) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc85_34.1: %i32 = value_of_initializer %int.convert_checked.loc85 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc85_34.2: %i32 = converted @__global_init.%int_1.loc85, %.loc85_34.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %i: %i32 = bind_name i, %.loc85_34.2 diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 39661f03d3e11..2a084f0c7f38f 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -18,10 +18,13 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -52,10 +55,10 @@ fn F() -> i32 { return n; } // 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: } -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method @__global_init.%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(@__global_init.%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method @__global_init.%int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(@__global_init.%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_14.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_14.2: %i32 = converted @__global_init.%int_1, %.loc11_14.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %n: %i32 = bind_name n, %.loc11_14.2 diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index 1382220032d68..0f643fdb7b3ec 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -22,10 +22,13 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -75,10 +78,10 @@ fn F(a: i32) -> i32 { // 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: } -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_16.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_16.2: %i32 = converted %int_1, %.loc12_16.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %a.loc12: %i32 = bind_name a, %.loc12_16.2 diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index 704afff3eb4c6..34cd7abc6e047 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -48,10 +48,13 @@ var a: i32 = NS.A(); // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -103,10 +106,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_28.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_28.2: %i32 = converted %int_0, %.loc4_28.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc4_28.2 diff --git a/toolchain/check/testdata/namespace/alias.carbon b/toolchain/check/testdata/namespace/alias.carbon index c45548fcd18b6..31a59a0c9da30 100644 --- a/toolchain/check/testdata/namespace/alias.carbon +++ b/toolchain/check/testdata/namespace/alias.carbon @@ -28,10 +28,13 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -100,10 +103,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_28.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_28.2: %i32 = converted %int_0, %.loc15_28.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc15_28.2 diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index ce1bbc405875c..b1560f933d75a 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -30,10 +30,13 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.d85: %.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -72,10 +75,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_28.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_28.2: %i32 = converted %int_0, %.loc23_28.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc23_28.2 diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index a472d345879f8..d42dd7d066852 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -41,10 +41,13 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -104,10 +107,10 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %A.var: ref %i32 = var A // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0.loc22: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc22: = bound_method %int_0.loc22, %impl.elem0.loc22 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc22: = specific_function %bound_method.loc22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %specific_fn.loc22(%int_0.loc22) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc22_5.2: init %i32 = converted %int_0.loc22, %int.convert_checked.loc22 [template = constants.%int_0.6a9] // CHECK:STDOUT: assign %A.var, %.loc22_5.2 // CHECK:STDOUT: %.loc22_12: type = splice_block %i32.loc22 [template = constants.%i32] { @@ -121,10 +124,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0.loc27: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc27: = bound_method %int_0.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc27: = specific_function %bound_method.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %specific_fn.loc27(%int_0.loc27) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc27_11.1: %i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc27_11.2: %i32 = converted %int_0.loc27, %.loc27_11.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc27_11.2 diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index 1ba7b2ead7c2d..6cfa2940badb5 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -34,10 +34,13 @@ fn Main() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -107,10 +110,10 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_12, %impl.elem0.loc12 [template = constants.%Convert.bound.221] -// CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_12) [template = constants.%int_12.1e1] +// CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_12, %impl.elem0.loc12 [template = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_12, %int.convert_checked.loc12 [template = constants.%int_12.1e1] // CHECK:STDOUT: assign %a.var, %.loc12_3.2 // CHECK:STDOUT: %.loc12_10: type = splice_block %i32.loc12 [template = constants.%i32] { @@ -120,10 +123,10 @@ fn Main() { // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %a.ref.loc13: ref %i32 = name_ref a, %a // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.988] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_9, %impl.elem0.loc13 [template = constants.%Convert.bound.9e2] -// CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b02] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_9) [template = constants.%int_9.f88] +// CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_9, %impl.elem0.loc13 [template = constants.%Convert.bound.9e2] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b02] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_9) [template = constants.%int_9.f88] // CHECK:STDOUT: %.loc13: init %i32 = converted %int_9, %int.convert_checked.loc13 [template = constants.%int_9.f88] // CHECK:STDOUT: assign %a.ref.loc13, %.loc13 // CHECK:STDOUT: name_binding_decl { @@ -134,17 +137,17 @@ fn Main() { // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc15: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc15_28.1: %tuple.type.f94 = tuple_literal (%int_1.loc15, %int_2.loc15) -// CHECK:STDOUT: %impl.elem0.loc15_28.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15_28.1: = bound_method %int_1.loc15, %impl.elem0.loc15_28.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc15_28.1: init %i32 = call %Convert.specific_fn.loc15_28.1(%int_1.loc15) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc15_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc15_28.1: = bound_method %int_1.loc15, %impl.elem0.loc15_28.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc15_28.1: = specific_function %bound_method.loc15_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc15_28.1: init %i32 = call %specific_fn.loc15_28.1(%int_1.loc15) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_28.2: init %i32 = converted %int_1.loc15, %int.convert_checked.loc15_28.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc15_28.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15_28.2: = bound_method %int_2.loc15, %impl.elem0.loc15_28.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc15_28.2: init %i32 = call %Convert.specific_fn.loc15_28.2(%int_2.loc15) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc15_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc15_28.2: = bound_method %int_2.loc15, %impl.elem0.loc15_28.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc15_28.2: = specific_function %bound_method.loc15_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc15_28.2: init %i32 = call %specific_fn.loc15_28.2(%int_2.loc15) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_28.4: init %i32 = converted %int_2.loc15, %int.convert_checked.loc15_28.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc15: ref %i32 = tuple_access %b.var, element1 // CHECK:STDOUT: %.loc15_28.5: init %i32 = initialize_from %.loc15_28.4 to %tuple.elem1.loc15 [template = constants.%int_2.ef8] @@ -164,20 +167,20 @@ 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.1ba] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_3.loc16, %impl.elem0.loc16 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_3.loc16) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_3.loc16, %impl.elem0.loc16 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_3.loc16) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc16: init %i32 = converted %int_3.loc16, %int.convert_checked.loc16 [template = constants.%int_3.822] // CHECK:STDOUT: assign %tuple.elem0.loc16, %.loc16 // CHECK:STDOUT: %b.ref.loc17: ref %tuple.type.d07 = name_ref b, %b // CHECK:STDOUT: %int_1.loc17: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.0c1] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_4.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_4.loc17) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc17: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17: = bound_method %int_4.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %bound_method.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %specific_fn.loc17(%int_4.loc17) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc17: init %i32 = converted %int_4.loc17, %int.convert_checked.loc17 [template = constants.%int_4.940] // CHECK:STDOUT: assign %tuple.elem1.loc17, %.loc17 // CHECK:STDOUT: name_binding_decl { @@ -188,17 +191,17 @@ fn Main() { // CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc19: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc19_46.1: %struct_type.a.b.cfd = struct_literal (%int_1.loc19, %int_2.loc19) -// CHECK:STDOUT: %impl.elem0.loc19_46.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc19_46.1: = bound_method %int_1.loc19, %impl.elem0.loc19_46.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc19_46.1: init %i32 = call %Convert.specific_fn.loc19_46.1(%int_1.loc19) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc19_46.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc19_46.1: = bound_method %int_1.loc19, %impl.elem0.loc19_46.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc19_46.1: = specific_function %bound_method.loc19_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc19_46.1: init %i32 = call %specific_fn.loc19_46.1(%int_1.loc19) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc19_46.2: init %i32 = converted %int_1.loc19, %int.convert_checked.loc19_46.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc19_46.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc19_46.2: = bound_method %int_2.loc19, %impl.elem0.loc19_46.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc19_46.2: init %i32 = call %Convert.specific_fn.loc19_46.2(%int_2.loc19) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc19_46.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc19_46.2: = bound_method %int_2.loc19, %impl.elem0.loc19_46.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc19_46.2: = specific_function %bound_method.loc19_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc19_46.2: init %i32 = call %specific_fn.loc19_46.2(%int_2.loc19) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_46.5: init %i32 = converted %int_2.loc19, %int.convert_checked.loc19_46.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_46.6: ref %i32 = struct_access %c.var, element1 // CHECK:STDOUT: %.loc19_46.7: init %i32 = initialize_from %.loc19_46.5 to %.loc19_46.6 [template = constants.%int_2.ef8] @@ -216,19 +219,19 @@ fn Main() { // CHECK:STDOUT: %c.ref.loc20: ref %struct_type.a.b.501 = 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.1ba] -// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc20: = bound_method %int_3.loc20, %impl.elem0.loc20 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc20: = specific_function %Convert.bound.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %Convert.specific_fn.loc20(%int_3.loc20) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc20: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc20: = bound_method %int_3.loc20, %impl.elem0.loc20 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc20: = specific_function %bound_method.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %specific_fn.loc20(%int_3.loc20) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc20_7: init %i32 = converted %int_3.loc20, %int.convert_checked.loc20 [template = constants.%int_3.822] // CHECK:STDOUT: assign %.loc20_4, %.loc20_7 // CHECK:STDOUT: %c.ref.loc21: ref %struct_type.a.b.501 = 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.0c1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_4.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_4.loc21) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc21: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc21: = bound_method %int_4.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc21: = specific_function %bound_method.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %specific_fn.loc21(%int_4.loc21) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc21_7: init %i32 = converted %int_4.loc21, %int.convert_checked.loc21 [template = constants.%int_4.940] // CHECK:STDOUT: assign %.loc21_4, %.loc21_7 // CHECK:STDOUT: name_binding_decl { @@ -249,10 +252,10 @@ fn Main() { // CHECK:STDOUT: %.loc24_4: %ptr.235 = 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.64b] -// CHECK:STDOUT: %impl.elem0.loc24: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc24: = bound_method %int_5, %impl.elem0.loc24 [template = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %Convert.specific_fn.loc24: = specific_function %Convert.bound.loc24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked.loc24: init %i32 = call %Convert.specific_fn.loc24(%int_5) [template = constants.%int_5.0f6] +// CHECK:STDOUT: %impl.elem0.loc24: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc24: = bound_method %int_5, %impl.elem0.loc24 [template = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc24: = specific_function %bound_method.loc24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] +// CHECK:STDOUT: %int.convert_checked.loc24: init %i32 = call %specific_fn.loc24(%int_5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc24_6: init %i32 = converted %int_5, %int.convert_checked.loc24 [template = constants.%int_5.0f6] // CHECK:STDOUT: assign %.loc24_3, %.loc24_6 // CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] @@ -272,10 +275,10 @@ fn Main() { // CHECK:STDOUT: %.loc26_5: %ptr.235 = 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.64f] -// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_10, %impl.elem0.loc26 [template = constants.%Convert.bound.491] -// CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.e67] -// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_10) [template = constants.%int_10.265] +// CHECK:STDOUT: %impl.elem0.loc26: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc26: = bound_method %int_10, %impl.elem0.loc26 [template = constants.%Convert.bound.491] +// CHECK:STDOUT: %specific_fn.loc26: = specific_function %bound_method.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.e67] +// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %specific_fn.loc26(%int_10) [template = constants.%int_10.265] // CHECK:STDOUT: %.loc26_29: init %i32 = converted %int_10, %int.convert_checked.loc26 [template = constants.%int_10.265] // CHECK:STDOUT: assign %.loc26_3, %.loc26_29 // CHECK:STDOUT: return 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 900f7a3b98e72..db247e856eaae 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,10 +68,13 @@ fn Main() { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -141,10 +144,10 @@ 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.5b8] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_1.loc23, %impl.elem0.loc23 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_1.loc23) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc23: = bound_method %int_1.loc23, %impl.elem0.loc23 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %bound_method.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %specific_fn.loc23(%int_1.loc23) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc23: init %i32 = converted %int_1.loc23, %int.convert_checked.loc23 [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %F.call, %.loc23 // CHECK:STDOUT: %int_1.loc28: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] @@ -168,10 +171,10 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_0, %impl.elem0.loc29 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc29: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc29: = bound_method %int_0, %impl.elem0.loc29 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc29: = specific_function %bound_method.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %specific_fn.loc29(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc29_3.2: init %i32 = converted %int_0, %int.convert_checked.loc29 [template = constants.%int_0.6a9] // CHECK:STDOUT: assign %n.var, %.loc29_3.2 // CHECK:STDOUT: %.loc29_10: type = splice_block %i32.loc29 [template = constants.%i32] { @@ -185,17 +188,17 @@ fn Main() { // CHECK:STDOUT: %int_1.loc34: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc34: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc34_17.1: %tuple.type.f94 = tuple_literal (%int_1.loc34, %int_2.loc34) -// CHECK:STDOUT: %impl.elem0.loc34_17.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc34_17.1: = bound_method %int_1.loc34, %impl.elem0.loc34_17.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc34_17.1: init %i32 = call %Convert.specific_fn.loc34_17.1(%int_1.loc34) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc34_17.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc34_17.1: = bound_method %int_1.loc34, %impl.elem0.loc34_17.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc34_17.1: = specific_function %bound_method.loc34_17.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc34_17.1: init %i32 = call %specific_fn.loc34_17.1(%int_1.loc34) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc34_17.2: init %i32 = converted %int_1.loc34, %int.convert_checked.loc34_17.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc34_17.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc34_17.2: = bound_method %int_2.loc34, %impl.elem0.loc34_17.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc34_17.2: init %i32 = call %Convert.specific_fn.loc34_17.2(%int_2.loc34) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc34_17.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc34_17.2: = bound_method %int_2.loc34, %impl.elem0.loc34_17.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc34_17.2: = specific_function %bound_method.loc34_17.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc34_17.2: init %i32 = call %specific_fn.loc34_17.2(%int_2.loc34) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc34_17.4: init %i32 = converted %int_2.loc34, %int.convert_checked.loc34_17.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc34: %i32 = tuple_access %.loc34_8.1, element1 // CHECK:STDOUT: %.loc34_17.5: init %i32 = initialize_from %.loc34_17.4 to %tuple.elem1.loc34 [template = constants.%int_2.ef8] @@ -234,20 +237,20 @@ fn Main() { // CHECK:STDOUT: %int_1.loc49: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc49_12: = bound_method %int_1.loc49, %impl.elem0.loc49_12 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc49_12: = specific_function %Convert.bound.loc49_12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc49_12: init %i32 = call %Convert.specific_fn.loc49_12(%int_1.loc49) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc49_12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc49_12: = bound_method %int_1.loc49, %impl.elem0.loc49_12 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc49_12: = specific_function %bound_method.loc49_12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc49_12: init %i32 = call %specific_fn.loc49_12(%int_1.loc49) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc49_12.1: %i32 = value_of_initializer %int.convert_checked.loc49_12 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc49_12.2: %i32 = converted %int_1.loc49, %.loc49_12.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: br !if.expr.result.loc49(%.loc49_12.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc49: // CHECK:STDOUT: %int_2.loc49: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc49_19: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc49_19: = bound_method %int_2.loc49, %impl.elem0.loc49_19 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc49_19: = specific_function %Convert.bound.loc49_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc49_19: init %i32 = call %Convert.specific_fn.loc49_19(%int_2.loc49) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc49_19: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc49_19: = bound_method %int_2.loc49, %impl.elem0.loc49_19 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc49_19: = specific_function %bound_method.loc49_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc49_19: init %i32 = call %specific_fn.loc49_19(%int_2.loc49) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc49_19.1: %i32 = value_of_initializer %int.convert_checked.loc49_19 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc49_19.2: %i32 = converted %int_2.loc49, %.loc49_19.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: br !if.expr.result.loc49(%.loc49_19.2) @@ -255,10 +258,10 @@ fn Main() { // CHECK:STDOUT: !if.expr.result.loc49: // CHECK:STDOUT: %.loc49_4: %i32 = block_arg !if.expr.result.loc49 [template = constants.%int_1.5d2] // CHECK:STDOUT: %int_3.loc49: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] -// CHECK:STDOUT: %impl.elem0.loc49_27: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc49_27: = bound_method %int_3.loc49, %impl.elem0.loc49_27 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc49_27: = specific_function %Convert.bound.loc49_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc49_27: init %i32 = call %Convert.specific_fn.loc49_27(%int_3.loc49) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc49_27: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc49_27: = bound_method %int_3.loc49, %impl.elem0.loc49_27 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc49_27: = specific_function %bound_method.loc49_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc49_27: init %i32 = call %specific_fn.loc49_27(%int_3.loc49) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc49_27: init %i32 = converted %int_3.loc49, %int.convert_checked.loc49_27 [template = constants.%int_3.822] // CHECK:STDOUT: assign %.loc49_4, %.loc49_27 // CHECK:STDOUT: name_binding_decl { @@ -287,10 +290,10 @@ fn Main() { // CHECK:STDOUT: !if.expr.result.loc57: // CHECK:STDOUT: %.loc57_4: %i32 = block_arg !if.expr.result.loc57 // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.64f] -// CHECK:STDOUT: %impl.elem0.loc57: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc57: = bound_method %int_10, %impl.elem0.loc57 [template = constants.%Convert.bound.491] -// CHECK:STDOUT: %Convert.specific_fn.loc57: = specific_function %Convert.bound.loc57, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.e67] -// CHECK:STDOUT: %int.convert_checked.loc57: init %i32 = call %Convert.specific_fn.loc57(%int_10) [template = constants.%int_10.265] +// CHECK:STDOUT: %impl.elem0.loc57: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc57: = bound_method %int_10, %impl.elem0.loc57 [template = constants.%Convert.bound.491] +// CHECK:STDOUT: %specific_fn.loc57: = specific_function %bound_method.loc57, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.e67] +// CHECK:STDOUT: %int.convert_checked.loc57: init %i32 = call %specific_fn.loc57(%int_10) [template = constants.%int_10.265] // CHECK:STDOUT: %.loc57_27: init %i32 = converted %int_10, %int.convert_checked.loc57 [template = constants.%int_10.265] // CHECK:STDOUT: assign %.loc57_4, %.loc57_27 // CHECK:STDOUT: return 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 10211469cabc7..f99741d4496c5 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -32,10 +32,13 @@ fn Main() { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -78,10 +81,10 @@ fn Main() { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_25.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_25.2: %i32 = converted %int_0, %.loc11_25.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc11_25.2 @@ -95,10 +98,10 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc14_3.2: init %i32 = converted %int_3, %int.convert_checked [template = constants.%int_3.822] // CHECK:STDOUT: assign %a.var, %.loc14_3.2 // CHECK:STDOUT: %.loc14_10: type = splice_block %i32 [template = constants.%i32] { 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 773a8f912fc81..0602000b746e2 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -28,10 +28,13 @@ fn Main() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1ba, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [template] @@ -64,10 +67,10 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.822] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_3, %int.convert_checked [template = constants.%int_3.822] // CHECK:STDOUT: assign %a.var, %.loc12_3.2 // CHECK:STDOUT: %.loc12_10: type = splice_block %i32 [template = constants.%i32] { 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 e3c4fef44defe..0613f0d947fa5 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -28,7 +28,6 @@ fn Main() -> i32 { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %float: f64 = float_literal 3.4000000000000004 [template] // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %Op.type: type = fn_type @Op [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -62,8 +61,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %.loc18: %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 = impl_witness_access , element0 [template = ] -// CHECK:STDOUT: %Op.bound: = bound_method , %impl.elem0 [template = ] +// CHECK:STDOUT: %impl.elem0: = impl_witness_access , element0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index 550917beed29a..b0ad6a6d58aaa 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -43,6 +43,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %impl_witness.796: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.7a3: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.c84: %Op.type.7a3 = struct_value () [template] +// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %C, %impl_witness.796 [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %AddAssign.type: type = facet_type <@AddAssign> [template] // CHECK:STDOUT: %Op.type.421: type = fn_type @Op.3 [template] @@ -50,10 +51,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.0b8: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.d8e: %Op.type.0b8 = struct_value () [template] +// CHECK:STDOUT: %AddAssign.facet: %AddAssign.type = facet_value %C, %impl_witness.95d [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] +// CHECK:STDOUT: %.4bb: type = fn_type_with_self_type %Op.type.545, %Add.facet [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] +// CHECK:STDOUT: %.499: type = fn_type_with_self_type %Op.type.421, %AddAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -198,10 +202,10 @@ 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.545 = impl_witness_access constants.%impl_witness.796, element0 [template = constants.%Op.c84] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.4bb = impl_witness_access constants.%impl_witness.796, element0 [template = constants.%Op.c84] +// CHECK:STDOUT: %bound_method: = 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: %Op.call: init %C = call %bound_method(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,10 +214,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %a.ref: %ptr.019 = 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.421 = impl_witness_access constants.%impl_witness.95d, element0 [template = constants.%Op.d8e] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.499 = impl_witness_access constants.%impl_witness.95d, element0 [template = constants.%Op.d8e] +// CHECK:STDOUT: %bound_method: = bound_method %.loc31, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc31 -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index 2070389800a13..c4dd93dac3c7a 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -43,6 +43,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %impl_witness.5af: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.45e: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.c43: %Op.type.45e = struct_value () [template] +// CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value %C, %impl_witness.5af [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %BitAndAssign.type: type = facet_type <@BitAndAssign> [template] // CHECK:STDOUT: %Op.type.93f: type = fn_type @Op.3 [template] @@ -50,10 +51,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.969: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.747: %Op.type.969 = struct_value () [template] +// CHECK:STDOUT: %BitAndAssign.facet: %BitAndAssign.type = facet_value %C, %impl_witness.762 [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] +// CHECK:STDOUT: %.9a0: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] +// CHECK:STDOUT: %.ade: type = fn_type_with_self_type %Op.type.93f, %BitAndAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -198,10 +202,10 @@ 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.27a = impl_witness_access constants.%impl_witness.5af, element0 [template = constants.%Op.c43] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.9a0 = impl_witness_access constants.%impl_witness.5af, element0 [template = constants.%Op.c43] +// CHECK:STDOUT: %bound_method: = 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: %Op.call: init %C = call %bound_method(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,10 +214,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %a.ref: %ptr.019 = 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.93f = impl_witness_access constants.%impl_witness.762, element0 [template = constants.%Op.747] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.ade = impl_witness_access constants.%impl_witness.762, element0 [template = constants.%Op.747] +// CHECK:STDOUT: %bound_method: = bound_method %.loc31, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc31 -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index 7c4bb298286b2..83ed9bb299c23 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -35,9 +35,11 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.544: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.bf2: %Op.type.544 = struct_value () [template] +// CHECK:STDOUT: %BitComplement.facet: %BitComplement.type = facet_value %C, %impl_witness [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] +// CHECK:STDOUT: %.784: type = fn_type_with_self_type %Op.type.f25, %BitComplement.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -117,10 +119,10 @@ 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.f25 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.bf2] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.784 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.bf2] +// CHECK:STDOUT: %bound_method: = 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 +// CHECK:STDOUT: %Op.call: init %C = call %bound_method(%a.ref) to %.loc23 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index 823b4504771c1..f3508e16fe028 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -43,6 +43,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %impl_witness.e68: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.951: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.59a: %Op.type.951 = struct_value () [template] +// CHECK:STDOUT: %BitOr.facet: %BitOr.type = facet_value %C, %impl_witness.e68 [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %BitOrAssign.type: type = facet_type <@BitOrAssign> [template] // CHECK:STDOUT: %Op.type.099: type = fn_type @Op.3 [template] @@ -50,10 +51,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.8ba: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.b27: %Op.type.8ba = struct_value () [template] +// CHECK:STDOUT: %BitOrAssign.facet: %BitOrAssign.type = facet_value %C, %impl_witness.85b [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] +// CHECK:STDOUT: %.88d: type = fn_type_with_self_type %Op.type.9bb, %BitOr.facet [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] +// CHECK:STDOUT: %.ecb: type = fn_type_with_self_type %Op.type.099, %BitOrAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -198,10 +202,10 @@ 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.9bb = impl_witness_access constants.%impl_witness.e68, element0 [template = constants.%Op.59a] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.88d = impl_witness_access constants.%impl_witness.e68, element0 [template = constants.%Op.59a] +// CHECK:STDOUT: %bound_method: = 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: %Op.call: init %C = call %bound_method(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,10 +214,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %a.ref: %ptr.019 = 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.099 = impl_witness_access constants.%impl_witness.85b, element0 [template = constants.%Op.b27] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.ecb = impl_witness_access constants.%impl_witness.85b, element0 [template = constants.%Op.b27] +// CHECK:STDOUT: %bound_method: = bound_method %.loc31, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc31 -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index 2380489b23b02..ff649aef0ee02 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -43,6 +43,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %impl_witness.01d: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.672: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.442: %Op.type.672 = struct_value () [template] +// CHECK:STDOUT: %BitXor.facet: %BitXor.type = facet_value %C, %impl_witness.01d [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %BitXorAssign.type: type = facet_type <@BitXorAssign> [template] // CHECK:STDOUT: %Op.type.58d: type = fn_type @Op.3 [template] @@ -50,10 +51,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.8ab: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.67d: %Op.type.8ab = struct_value () [template] +// CHECK:STDOUT: %BitXorAssign.facet: %BitXorAssign.type = facet_value %C, %impl_witness.8dc [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] +// CHECK:STDOUT: %.8f3: type = fn_type_with_self_type %Op.type.e96, %BitXor.facet [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] +// CHECK:STDOUT: %.1c2: type = fn_type_with_self_type %Op.type.58d, %BitXorAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -198,10 +202,10 @@ 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.e96 = impl_witness_access constants.%impl_witness.01d, element0 [template = constants.%Op.442] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.8f3 = impl_witness_access constants.%impl_witness.01d, element0 [template = constants.%Op.442] +// CHECK:STDOUT: %bound_method: = 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: %Op.call: init %C = call %bound_method(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,10 +214,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %a.ref: %ptr.019 = 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.58d = impl_witness_access constants.%impl_witness.8dc, element0 [template = constants.%Op.67d] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.1c2 = impl_witness_access constants.%impl_witness.8dc, element0 [template = constants.%Op.67d] +// CHECK:STDOUT: %bound_method: = bound_method %.loc31, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc31 -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 9af3b45f1cfc0..7006a354fe97b 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -36,9 +36,11 @@ fn TestOp() { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.9e0: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.cf9: %Op.type.9e0 = struct_value () [template] +// CHECK:STDOUT: %Dec.facet: %Dec.type = facet_value %C, %impl_witness [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] +// CHECK:STDOUT: %.01d: type = fn_type_with_self_type %Op.type.633, %Dec.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -110,10 +112,10 @@ fn TestOp() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c -// CHECK:STDOUT: %impl.elem0: %Op.type.633 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.cf9] -// CHECK:STDOUT: %Op.bound: = bound_method %c.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.01d = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.cf9] +// CHECK:STDOUT: %bound_method: = bound_method %c.ref, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %c.ref -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index 63e8c9d6b5f77..a1c675c3d9597 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -43,6 +43,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %impl_witness.745: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.750: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.21e: %Op.type.750 = struct_value () [template] +// CHECK:STDOUT: %Div.facet: %Div.type = facet_value %C, %impl_witness.745 [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %DivAssign.type: type = facet_type <@DivAssign> [template] // CHECK:STDOUT: %Op.type.b95: type = fn_type @Op.3 [template] @@ -50,10 +51,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.b04: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.27c: %Op.type.b04 = struct_value () [template] +// CHECK:STDOUT: %DivAssign.facet: %DivAssign.type = facet_value %C, %impl_witness.d13 [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] +// CHECK:STDOUT: %.a6e: type = fn_type_with_self_type %Op.type.784, %Div.facet [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] +// CHECK:STDOUT: %.0f9: type = fn_type_with_self_type %Op.type.b95, %DivAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -198,10 +202,10 @@ 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.784 = impl_witness_access constants.%impl_witness.745, element0 [template = constants.%Op.21e] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.a6e = impl_witness_access constants.%impl_witness.745, element0 [template = constants.%Op.21e] +// CHECK:STDOUT: %bound_method: = 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: %Op.call: init %C = call %bound_method(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,10 +214,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %a.ref: %ptr.019 = 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.b95 = impl_witness_access constants.%impl_witness.d13, element0 [template = constants.%Op.27c] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.0f9 = impl_witness_access constants.%impl_witness.d13, element0 [template = constants.%Op.27c] +// CHECK:STDOUT: %bound_method: = bound_method %.loc31, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc31 -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index be99afcba89ba..493afd735c4b0 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -99,10 +99,13 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Equal.f96: %Equal.type.b4a = struct_value () [template] // CHECK:STDOUT: %NotEqual.type.a7d: type = fn_type @NotEqual.2 [template] // CHECK:STDOUT: %NotEqual.c3f: %NotEqual.type.a7d = struct_value () [template] +// CHECK:STDOUT: %Eq.facet: %Eq.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %TestEqual.type: type = fn_type @TestEqual [template] // CHECK:STDOUT: %TestEqual: %TestEqual.type = struct_value () [template] +// CHECK:STDOUT: %.dad: type = fn_type_with_self_type %Equal.type.79c, %Eq.facet [template] // CHECK:STDOUT: %TestNotEqual.type: type = fn_type @TestNotEqual [template] // CHECK:STDOUT: %TestNotEqual: %TestNotEqual.type = struct_value () [template] +// CHECK:STDOUT: %.d23: type = fn_type_with_self_type %NotEqual.type.e6c, %Eq.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -236,9 +239,9 @@ 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.elem0: %Equal.type.79c = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.f96] -// 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: %impl.elem0: %.dad = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.f96] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %Equal.call: init bool = call %bound_method(%a.ref, %b.ref) // CHECK:STDOUT: %.loc12_16.1: bool = value_of_initializer %Equal.call // CHECK:STDOUT: %.loc12_16.2: bool = converted %Equal.call, %.loc12_16.1 // CHECK:STDOUT: return %.loc12_16.2 @@ -248,9 +251,9 @@ 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.e6c = impl_witness_access constants.%impl_witness, element1 [template = constants.%NotEqual.c3f] -// 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: %impl.elem1: %.d23 = impl_witness_access constants.%impl_witness, element1 [template = constants.%NotEqual.c3f] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem1 +// CHECK:STDOUT: %NotEqual.call: init bool = call %bound_method(%a.ref, %b.ref) // CHECK:STDOUT: %.loc16_16.1: bool = value_of_initializer %NotEqual.call // CHECK:STDOUT: %.loc16_16.2: bool = converted %NotEqual.call, %.loc16_16.1 // CHECK:STDOUT: return %.loc16_16.2 @@ -368,8 +371,10 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Equal.f96: %Equal.type.b4a = struct_value () [template] // CHECK:STDOUT: %NotEqual.type.a7d: type = fn_type @NotEqual.2 [template] // CHECK:STDOUT: %NotEqual.c3f: %NotEqual.type.a7d = struct_value () [template] +// CHECK:STDOUT: %Eq.facet: %Eq.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %TestRhsBad.type: type = fn_type @TestRhsBad [template] // CHECK:STDOUT: %TestRhsBad: %TestRhsBad.type = struct_value () [template] +// CHECK:STDOUT: %.dad: type = fn_type_with_self_type %Equal.type.79c, %Eq.facet [template] // CHECK:STDOUT: %TestLhsBad.type: type = fn_type @TestLhsBad [template] // CHECK:STDOUT: %TestLhsBad: %TestLhsBad.type = struct_value () [template] // CHECK:STDOUT: } @@ -516,10 +521,10 @@ fn TestLhsBad(a: D, b: C) -> 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.79c = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.f96] -// CHECK:STDOUT: %Equal.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.dad = impl_witness_access constants.%impl_witness, element0 [template = constants.%Equal.f96] +// CHECK:STDOUT: %bound_method: = 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, ) +// CHECK:STDOUT: %Equal.call: init bool = call %bound_method(%a.ref, ) // CHECK:STDOUT: %.loc23_16.1: bool = value_of_initializer %Equal.call // CHECK:STDOUT: %.loc23_16.2: bool = converted %Equal.call, %.loc23_16.1 // CHECK:STDOUT: return %.loc23_16.2 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 9eb7eceef5e61..e7864303924d7 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -54,15 +54,19 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.73a: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.0c9: %Op.type.73a = struct_value () [template] +// CHECK:STDOUT: %Inc.facet: %Inc.type = facet_value %C, %impl_witness.ec3 [template] // CHECK:STDOUT: %AddAssign.type: type = facet_type <@AddAssign> [template] // CHECK:STDOUT: %Op.type.421: type = fn_type @Op.3 [template] // CHECK:STDOUT: %impl_witness.95d: = impl_witness (@impl.2.%Op.decl) [template] // CHECK:STDOUT: %Op.type.0b8: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.d8e: %Op.type.0b8 = struct_value () [template] +// CHECK:STDOUT: %AddAssign.facet: %AddAssign.type = facet_value %C, %impl_witness.95d [template] // CHECK:STDOUT: %TestIncNonRef.type: type = fn_type @TestIncNonRef [template] // CHECK:STDOUT: %TestIncNonRef: %TestIncNonRef.type = struct_value () [template] +// CHECK:STDOUT: %.e6d: type = fn_type_with_self_type %Op.type.e3a, %Inc.facet [template] // CHECK:STDOUT: %TestAddAssignNonRef.type: type = fn_type @TestAddAssignNonRef [template] // CHECK:STDOUT: %TestAddAssignNonRef: %TestAddAssignNonRef.type = struct_value () [template] +// CHECK:STDOUT: %.499: type = fn_type_with_self_type %Op.type.421, %AddAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -178,9 +182,9 @@ fn TestAddAssignNonRef(a: C, b: C) { // 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.e3a = impl_witness_access constants.%impl_witness.ec3, element0 [template = constants.%Op.0c9] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound() +// CHECK:STDOUT: %impl.elem0: %.e6d = impl_witness_access constants.%impl_witness.ec3, element0 [template = constants.%Op.0c9] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -188,9 +192,9 @@ 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.421 = impl_witness_access constants.%impl_witness.95d, element0 [template = constants.%Op.d8e] -// 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: %impl.elem0: %.499 = impl_witness_access constants.%impl_witness.95d, element0 [template = constants.%Op.d8e] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon b/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon index 1d05861b18ee6..4e5afb943e7d1 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon @@ -33,6 +33,7 @@ fn G(n: i32) { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template] // CHECK:STDOUT: %Op.type.545: type = fn_type @Op.1 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] @@ -41,6 +42,8 @@ fn G(n: i32) { // CHECK:STDOUT: %impl_witness.01d: = impl_witness (imports.%Core.import_ref.344), @impl.14(%int_32) [template] // CHECK:STDOUT: %Op.type.210: type = fn_type @Op.2, @impl.14(%int_32) [template] // CHECK:STDOUT: %Op.c82: %Op.type.210 = struct_value () [template] +// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %i32, %impl_witness.01d [template] +// CHECK:STDOUT: %.ede: type = fn_type_with_self_type %Op.type.545, %Add.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -77,8 +80,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.545 = impl_witness_access , element0 [template = ] -// CHECK:STDOUT: %Op.bound: = bound_method %undeclared.ref, %impl.elem0 [template = ] +// CHECK:STDOUT: %impl.elem0: = impl_witness_access , element0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -86,8 +88,8 @@ 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.545 = impl_witness_access constants.%impl_witness.01d, element0 [template = constants.%Op.c82] -// CHECK:STDOUT: %Op.bound: = bound_method %n.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.ede = impl_witness_access constants.%impl_witness.01d, element0 [template = constants.%Op.c82] +// CHECK:STDOUT: %bound_method: = bound_method %n.ref, %impl.elem0 // CHECK:STDOUT: return // CHECK:STDOUT: } // 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 60f3be5b28f48..fd4c56a5727ad 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 @@ -62,17 +62,21 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %impl_witness.796: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.7a3: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.c84: %Op.type.7a3 = struct_value () [template] +// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %C, %impl_witness.796 [template] // CHECK:STDOUT: %AddAssign.type: type = facet_type <@AddAssign> [template] // CHECK:STDOUT: %Op.type.421: type = fn_type @Op.3 [template] // CHECK:STDOUT: %impl_witness.95d: = impl_witness (@impl.2.%Op.decl) [template] // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.0b8: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.d8e: %Op.type.0b8 = struct_value () [template] +// CHECK:STDOUT: %AddAssign.facet: %AddAssign.type = facet_value %C, %impl_witness.95d [template] // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] +// CHECK:STDOUT: %.4bb: type = fn_type_with_self_type %Op.type.545, %Add.facet [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] +// CHECK:STDOUT: %.499: type = fn_type_with_self_type %Op.type.421, %AddAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -211,11 +215,11 @@ fn TestAssign(b: D) { // 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.545 = impl_witness_access constants.%impl_witness.796, element0 [template = constants.%Op.c84] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.4bb = impl_witness_access constants.%impl_witness.796, element0 [template = constants.%Op.c84] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc23: ref %C = splice_block %return {} // CHECK:STDOUT: %.loc34: %C = converted %b.ref, [template = ] -// CHECK:STDOUT: %Op.call: init %C = call %Op.bound(%a.ref, ) to %.loc23 +// CHECK:STDOUT: %Op.call: init %C = call %bound_method(%a.ref, ) to %.loc23 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -234,11 +238,11 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %a: ref %C = bind_name a, %a.var // 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.421 = impl_witness_access constants.%impl_witness.95d, element0 [template = constants.%Op.d8e] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.499 = impl_witness_access constants.%impl_witness.95d, element0 [template = constants.%Op.d8e] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %a.ref // CHECK:STDOUT: %.loc49: %C = converted %b.ref, [template = ] -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, ) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr, ) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index d7e95bfb6c395..0342a1e90e1c9 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -50,11 +50,13 @@ fn Test() { // CHECK:STDOUT: %impl_witness.226: = impl_witness (@impl.1.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.853: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.08a: %Convert.type.853 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.a10: %ImplicitAs.type.ac8 = facet_value %i32, %impl_witness.226 [template] // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.c53: = impl_witness (@impl.2.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.8a1: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.c7a: %Convert.type.8a1 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.208: %ImplicitAs.type.205 = facet_value %X, %impl_witness.c53 [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] @@ -68,7 +70,9 @@ fn Test() { // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] // CHECK:STDOUT: %Source.specific_fn.363: = specific_function %Source, @Source(%X) [template] +// CHECK:STDOUT: %.d2d: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.208 [template] // CHECK:STDOUT: %Source.specific_fn.cc7: = specific_function %Source, @Source(%i32) [template] +// CHECK:STDOUT: %.d10: type = fn_type_with_self_type %Convert.type.665, %ImplicitAs.facet.a10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -254,11 +258,11 @@ fn Test() { // CHECK:STDOUT: %Source.specific_fn.loc30: = specific_function %Source.ref.loc30, @Source(constants.%X) [template = constants.%Source.specific_fn.363] // 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.1b6 = impl_witness_access constants.%impl_witness.c53, element0 [template = constants.%Convert.c7a] -// CHECK:STDOUT: %Convert.bound.loc30: = bound_method %Source.call.loc30, %impl.elem0.loc30 +// CHECK:STDOUT: %impl.elem0.loc30: %.d2d = impl_witness_access constants.%impl_witness.c53, element0 [template = constants.%Convert.c7a] +// CHECK:STDOUT: %bound_method.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 -// CHECK:STDOUT: %Convert.call.loc30: init %i32 = call %Convert.bound.loc30(%.loc30_20.3) +// CHECK:STDOUT: %Convert.call.loc30: init %i32 = call %bound_method.loc30(%.loc30_20.3) // CHECK:STDOUT: %.loc30_20.4: %i32 = value_of_initializer %Convert.call.loc30 // CHECK:STDOUT: %.loc30_20.5: %i32 = converted %Source.call.loc30, %.loc30_20.4 // CHECK:STDOUT: %Sink_i32.call: init %empty_tuple.type = call %Sink_i32.ref(%.loc30_20.5) @@ -268,12 +272,12 @@ 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.cc7] // CHECK:STDOUT: %Source.call.loc31: init %i32 = call %Source.specific_fn.loc31() -// CHECK:STDOUT: %impl.elem0.loc31: %Convert.type.665 = impl_witness_access constants.%impl_witness.226, element0 [template = constants.%Convert.08a] -// CHECK:STDOUT: %Convert.bound.loc31: = bound_method %Source.call.loc31, %impl.elem0.loc31 +// CHECK:STDOUT: %impl.elem0.loc31: %.d10 = impl_witness_access constants.%impl_witness.226, element0 [template = constants.%Convert.08a] +// CHECK:STDOUT: %bound_method.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 // CHECK:STDOUT: %.loc31_20.3: %i32 = converted %Source.call.loc31, %.loc31_20.2 -// CHECK:STDOUT: %Convert.call.loc31: init %X = call %Convert.bound.loc31(%.loc31_20.3) to %.loc31_20.1 +// CHECK:STDOUT: %Convert.call.loc31: init %X = call %bound_method.loc31(%.loc31_20.3) to %.loc31_20.1 // CHECK:STDOUT: %.loc31_20.4: init %X = converted %Source.call.loc31, %Convert.call.loc31 // CHECK:STDOUT: %.loc31_20.5: ref %X = temporary %.loc31_20.1, %.loc31_20.4 // CHECK:STDOUT: %.loc31_20.6: %X = bind_value %.loc31_20.5 diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 6da3386851b9b..eb77a60ac2ef8 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -36,9 +36,11 @@ fn TestOp() { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.73a: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.0c9: %Op.type.73a = struct_value () [template] +// CHECK:STDOUT: %Inc.facet: %Inc.type = facet_value %C, %impl_witness [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] +// CHECK:STDOUT: %.e6d: type = fn_type_with_self_type %Op.type.e3a, %Inc.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -110,10 +112,10 @@ fn TestOp() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c -// CHECK:STDOUT: %impl.elem0: %Op.type.e3a = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.0c9] -// CHECK:STDOUT: %Op.bound: = bound_method %c.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.e6d = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.0c9] +// CHECK:STDOUT: %bound_method: = bound_method %c.ref, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %c.ref -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 201dd04356b4c..177f1859b664a 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -92,9 +92,11 @@ let x: i32 = c[0]; // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%At.decl) [template] // CHECK:STDOUT: %At.type.178: type = fn_type @At.2 [template] // CHECK:STDOUT: %At.d43: %At.type.178 = struct_value () [template] +// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.e80 = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %ElementType.val: %ElementType.e6b = struct_value () [template] // CHECK:STDOUT: %SubscriptType.val: %SubscriptType.8ee = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] +// CHECK:STDOUT: %.1a3: type = fn_type_with_self_type %At.type.b3f, %IndexWith.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -219,11 +221,11 @@ let x: i32 = c[0]; // CHECK:STDOUT: %c.ref: ref %C = name_ref c, file.%c // CHECK:STDOUT: %s.ref: ref %SubscriptType.8ee = name_ref s, file.%s // CHECK:STDOUT: %.loc16_24: %SubscriptType.8ee = bind_value %s.ref -// CHECK:STDOUT: %impl.elem0: %At.type.b3f = impl_witness_access constants.%impl_witness, element0 [template = constants.%At.d43] -// CHECK:STDOUT: %At.bound: = bound_method %c.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.1a3 = impl_witness_access constants.%impl_witness, element0 [template = constants.%At.d43] +// CHECK:STDOUT: %bound_method: = bound_method %c.ref, %impl.elem0 // CHECK:STDOUT: %.loc16_25: ref %ElementType.e6b = temporary_storage // CHECK:STDOUT: %.loc16_22: %C = bind_value %c.ref -// CHECK:STDOUT: %At.call: init %ElementType.e6b = call %At.bound(%.loc16_22, %.loc16_24) to %.loc16_25 +// CHECK:STDOUT: %At.call: init %ElementType.e6b = call %bound_method(%.loc16_22, %.loc16_24) to %.loc16_25 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -241,14 +243,18 @@ let x: i32 = c[0]; // CHECK:STDOUT: %impl_witness.123: = impl_witness (@impl.1.%At.decl) [template] // CHECK:STDOUT: %At.type.9ac: type = fn_type @At.2 [template] // CHECK:STDOUT: %At.642: %At.type.9ac = struct_value () [template] +// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.917 = facet_value %tuple.type.d07, %impl_witness.123 [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -259,6 +265,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.252: type = fn_type_with_self_type %At.type.d77, %IndexWith.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -306,16 +313,16 @@ let x: i32 = c[0]; // CHECK:STDOUT: %.loc10_17.2: %tuple.type.24b = tuple_literal (%i32.loc10_9, %i32.loc10_14) // CHECK:STDOUT: %.loc10_17.3: type = converted %.loc10_17.2, constants.%tuple.type.d07 [template = constants.%tuple.type.d07] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc10_26.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc10_26.1: = bound_method @__global_init.%int_1, %impl.elem0.loc10_26.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc10_26.1: init %i32 = call %Convert.specific_fn.loc10_26.1(@__global_init.%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc10_26.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc10_26.1: = bound_method @__global_init.%int_1, %impl.elem0.loc10_26.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc10_26.1: = specific_function %bound_method.loc10_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc10_26.1: init %i32 = call %specific_fn.loc10_26.1(@__global_init.%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked.loc10_26.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc10_26.2: %i32 = converted @__global_init.%int_1, %.loc10_26.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc10_26.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc10_26.2: = bound_method @__global_init.%int_5, %impl.elem0.loc10_26.2 [template = constants.%Convert.bound.4e6] -// 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.ba9] -// CHECK:STDOUT: %int.convert_checked.loc10_26.2: init %i32 = call %Convert.specific_fn.loc10_26.2(@__global_init.%int_5) [template = constants.%int_5.0f6] +// CHECK:STDOUT: %impl.elem0.loc10_26.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc10_26.2: = bound_method @__global_init.%int_5, %impl.elem0.loc10_26.2 [template = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc10_26.2: = specific_function %bound_method.loc10_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] +// CHECK:STDOUT: %int.convert_checked.loc10_26.2: init %i32 = call %specific_fn.loc10_26.2(@__global_init.%int_5) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc10_26.3: %i32 = value_of_initializer %int.convert_checked.loc10_26.2 [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc10_26.4: %i32 = converted @__global_init.%int_5, %.loc10_26.3 [template = constants.%int_5.0f6] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc10_26.2, %.loc10_26.4) [template = constants.%tuple] @@ -377,15 +384,15 @@ let x: i32 = c[0]; // CHECK:STDOUT: %.loc10: %tuple.type.f94 = tuple_literal (%int_1, %int_5) // CHECK:STDOUT: %s.ref: %tuple.type.d07 = name_ref s, file.%s // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc11_17.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0.loc11_17.1 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc11_17.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_17.1: = bound_method %int_0, %impl.elem0.loc11_17.1 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method.loc11_17.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_17.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_17.2: %i32 = converted %int_0, %.loc11_17.1 [template = constants.%int_0.6a9] -// CHECK:STDOUT: %impl.elem0.loc11_17.2: %At.type.d77 = impl_witness_access constants.%impl_witness.123, element0 [template = constants.%At.642] -// 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: %impl.elem0.loc11_17.2: %.252 = impl_witness_access constants.%impl_witness.123, element0 [template = constants.%At.642] +// CHECK:STDOUT: %bound_method.loc11_17.2: = bound_method %s.ref, %impl.elem0.loc11_17.2 +// CHECK:STDOUT: %At.call: init %i32 = call %bound_method.loc11_17.2(%s.ref, %.loc11_17.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -404,9 +411,11 @@ let x: i32 = c[0]; // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%At.decl) [template] // CHECK:STDOUT: %At.type.178: type = fn_type @At.2 [template] // CHECK:STDOUT: %At.d43: %At.type.178 = struct_value () [template] +// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.e80 = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %ElementType.val: %ElementType.e6b = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.1a3: type = fn_type_with_self_type %At.type.b3f, %IndexWith.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -521,11 +530,11 @@ let x: i32 = c[0]; // CHECK:STDOUT: %c.ref: ref %C = name_ref c, file.%c // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc22_25.1: %SubscriptType.8ee = converted %int_0, [template = ] -// CHECK:STDOUT: %impl.elem0: %At.type.b3f = impl_witness_access constants.%impl_witness, element0 [template = constants.%At.d43] -// CHECK:STDOUT: %At.bound: = bound_method %c.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.1a3 = impl_witness_access constants.%impl_witness, element0 [template = constants.%At.d43] +// CHECK:STDOUT: %bound_method: = bound_method %c.ref, %impl.elem0 // CHECK:STDOUT: %.loc22_25.2: ref %ElementType.e6b = temporary_storage // CHECK:STDOUT: %.loc22_22: %C = bind_value %c.ref -// CHECK:STDOUT: %At.call: init %ElementType.e6b = call %At.bound(%.loc22_22, ) to %.loc22_25.2 +// CHECK:STDOUT: %At.call: init %ElementType.e6b = call %bound_method(%.loc22_22, ) to %.loc22_25.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index 6f7856a9bfe24..1f9972241c7d1 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -43,6 +43,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %impl_witness.df4: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.de2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.df9: %Op.type.de2 = struct_value () [template] +// CHECK:STDOUT: %LeftShift.facet: %LeftShift.type = facet_value %C, %impl_witness.df4 [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %LeftShiftAssign.type: type = facet_type <@LeftShiftAssign> [template] // CHECK:STDOUT: %Op.type.1de: type = fn_type @Op.3 [template] @@ -50,10 +51,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.386: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.8fc: %Op.type.386 = struct_value () [template] +// CHECK:STDOUT: %LeftShiftAssign.facet: %LeftShiftAssign.type = facet_value %C, %impl_witness.842 [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] +// CHECK:STDOUT: %.ad2: type = fn_type_with_self_type %Op.type.789, %LeftShift.facet [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] +// CHECK:STDOUT: %.b73: type = fn_type_with_self_type %Op.type.1de, %LeftShiftAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -198,10 +202,10 @@ 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.789 = impl_witness_access constants.%impl_witness.df4, element0 [template = constants.%Op.df9] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.ad2 = impl_witness_access constants.%impl_witness.df4, element0 [template = constants.%Op.df9] +// CHECK:STDOUT: %bound_method: = 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: %Op.call: init %C = call %bound_method(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,10 +214,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %a.ref: %ptr.019 = 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.1de = impl_witness_access constants.%impl_witness.842, element0 [template = constants.%Op.8fc] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.b73 = impl_witness_access constants.%impl_witness.842, element0 [template = constants.%Op.8fc] +// CHECK:STDOUT: %bound_method: = bound_method %.loc31, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc31 -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index 5e088cac868b7..ed9fbb7c03b99 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -43,6 +43,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %impl_witness.5d5: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.fd2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.777: %Op.type.fd2 = struct_value () [template] +// CHECK:STDOUT: %Mod.facet: %Mod.type = facet_value %C, %impl_witness.5d5 [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %ModAssign.type: type = facet_type <@ModAssign> [template] // CHECK:STDOUT: %Op.type.fae: type = fn_type @Op.3 [template] @@ -50,10 +51,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.fa2: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.d6c: %Op.type.fa2 = struct_value () [template] +// CHECK:STDOUT: %ModAssign.facet: %ModAssign.type = facet_value %C, %impl_witness.5ee [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] +// CHECK:STDOUT: %.86c: type = fn_type_with_self_type %Op.type.860, %Mod.facet [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] +// CHECK:STDOUT: %.e7d: type = fn_type_with_self_type %Op.type.fae, %ModAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -198,10 +202,10 @@ 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.860 = impl_witness_access constants.%impl_witness.5d5, element0 [template = constants.%Op.777] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.86c = impl_witness_access constants.%impl_witness.5d5, element0 [template = constants.%Op.777] +// CHECK:STDOUT: %bound_method: = 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: %Op.call: init %C = call %bound_method(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,10 +214,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %a.ref: %ptr.019 = 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.fae = impl_witness_access constants.%impl_witness.5ee, element0 [template = constants.%Op.d6c] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.e7d = impl_witness_access constants.%impl_witness.5ee, element0 [template = constants.%Op.d6c] +// CHECK:STDOUT: %bound_method: = bound_method %.loc31, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc31 -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index 2f92c29474d4c..179a6b364a7fa 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -43,6 +43,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %impl_witness.289: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.fa5: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.550: %Op.type.fa5 = struct_value () [template] +// CHECK:STDOUT: %Mul.facet: %Mul.type = facet_value %C, %impl_witness.289 [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %MulAssign.type: type = facet_type <@MulAssign> [template] // CHECK:STDOUT: %Op.type.340: type = fn_type @Op.3 [template] @@ -50,10 +51,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.c02: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.a8c: %Op.type.c02 = struct_value () [template] +// CHECK:STDOUT: %MulAssign.facet: %MulAssign.type = facet_value %C, %impl_witness.de9 [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] +// CHECK:STDOUT: %.221: type = fn_type_with_self_type %Op.type.3ae, %Mul.facet [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] +// CHECK:STDOUT: %.037: type = fn_type_with_self_type %Op.type.340, %MulAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -198,10 +202,10 @@ 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.3ae = impl_witness_access constants.%impl_witness.289, element0 [template = constants.%Op.550] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.221 = impl_witness_access constants.%impl_witness.289, element0 [template = constants.%Op.550] +// CHECK:STDOUT: %bound_method: = 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: %Op.call: init %C = call %bound_method(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,10 +214,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %a.ref: %ptr.019 = 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.340 = impl_witness_access constants.%impl_witness.de9, element0 [template = constants.%Op.a8c] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.037 = impl_witness_access constants.%impl_witness.de9, element0 [template = constants.%Op.a8c] +// CHECK:STDOUT: %bound_method: = bound_method %.loc31, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc31 -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index 271822e636cd0..a7cadd1b102c1 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -35,9 +35,11 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.67d: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.64c: %Op.type.67d = struct_value () [template] +// CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %C, %impl_witness [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] +// CHECK:STDOUT: %.362: type = fn_type_with_self_type %Op.type.e42, %Negate.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -117,10 +119,10 @@ 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.e42 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.64c] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.362 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.64c] +// CHECK:STDOUT: %bound_method: = 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 +// CHECK:STDOUT: %Op.call: init %C = call %bound_method(%a.ref) to %.loc23 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon b/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon index ade7acd6041ac..338d6fb11a97f 100644 --- a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon @@ -136,10 +136,11 @@ fn F() { ()[()]; } // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%At.decl) [template] // CHECK:STDOUT: %At.type.8fc: type = fn_type @At.2 [template] // CHECK:STDOUT: %At.8ba: %At.type.8fc = struct_value () [template] -// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.518 = facet_value %empty_tuple.type, %impl_witness [symbolic] +// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.4ab = 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: %.b91: type = fn_type_with_self_type %At.type.082, %IndexWith.facet [template] // CHECK:STDOUT: %At.bound: = bound_method %empty_tuple, %At.8ba [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -272,9 +273,9 @@ 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.082 = impl_witness_access constants.%impl_witness, element0 [template = constants.%At.8ba] -// 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: %impl.elem0: %.b91 = impl_witness_access constants.%impl_witness, element0 [template = constants.%At.8ba] +// CHECK:STDOUT: %bound_method: = bound_method %.loc15_11.2, %impl.elem0 [template = constants.%At.bound] +// CHECK:STDOUT: %At.call: init %empty_tuple.type = call %bound_method(%.loc15_11.2, %.loc15_15) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index d42852b6fa8b1..7008f5619f86e 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -97,14 +97,19 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %Greater.afe: %Greater.type.0a1 = struct_value () [template] // CHECK:STDOUT: %GreaterOrEquivalent.type.caf: type = fn_type @GreaterOrEquivalent.2 [template] // CHECK:STDOUT: %GreaterOrEquivalent.03b: %GreaterOrEquivalent.type.caf = struct_value () [template] +// CHECK:STDOUT: %Ordered.facet: %Ordered.type = facet_value %C, %impl_witness [template] // CHECK:STDOUT: %TestLess.type: type = fn_type @TestLess [template] // CHECK:STDOUT: %TestLess: %TestLess.type = struct_value () [template] +// CHECK:STDOUT: %.7d6: type = fn_type_with_self_type %Less.type.341, %Ordered.facet [template] // CHECK:STDOUT: %TestLessEqual.type: type = fn_type @TestLessEqual [template] // CHECK:STDOUT: %TestLessEqual: %TestLessEqual.type = struct_value () [template] +// CHECK:STDOUT: %.635: type = fn_type_with_self_type %LessOrEquivalent.type.859, %Ordered.facet [template] // CHECK:STDOUT: %TestGreater.type: type = fn_type @TestGreater [template] // CHECK:STDOUT: %TestGreater: %TestGreater.type = struct_value () [template] +// CHECK:STDOUT: %.104: type = fn_type_with_self_type %Greater.type.270, %Ordered.facet [template] // CHECK:STDOUT: %TestGreaterEqual.type: type = fn_type @TestGreaterEqual [template] // CHECK:STDOUT: %TestGreaterEqual: %TestGreaterEqual.type = struct_value () [template] +// CHECK:STDOUT: %.086: type = fn_type_with_self_type %GreaterOrEquivalent.type.8af, %Ordered.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -326,9 +331,9 @@ 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.elem0: %Less.type.341 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Less.738] -// 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: %impl.elem0: %.7d6 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Less.738] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %Less.call: init bool = call %bound_method(%a.ref, %b.ref) // CHECK:STDOUT: %.loc14_15.1: bool = value_of_initializer %Less.call // CHECK:STDOUT: %.loc14_15.2: bool = converted %Less.call, %.loc14_15.1 // CHECK:STDOUT: return %.loc14_15.2 @@ -338,9 +343,9 @@ 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.859 = impl_witness_access constants.%impl_witness, element1 [template = constants.%LessOrEquivalent.010] -// 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: %impl.elem1: %.635 = impl_witness_access constants.%impl_witness, element1 [template = constants.%LessOrEquivalent.010] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem1 +// CHECK:STDOUT: %LessOrEquivalent.call: init bool = call %bound_method(%a.ref, %b.ref) // CHECK:STDOUT: %.loc18_16.1: bool = value_of_initializer %LessOrEquivalent.call // CHECK:STDOUT: %.loc18_16.2: bool = converted %LessOrEquivalent.call, %.loc18_16.1 // CHECK:STDOUT: return %.loc18_16.2 @@ -350,9 +355,9 @@ 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.270 = impl_witness_access constants.%impl_witness, element2 [template = constants.%Greater.afe] -// 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: %impl.elem2: %.104 = impl_witness_access constants.%impl_witness, element2 [template = constants.%Greater.afe] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem2 +// CHECK:STDOUT: %Greater.call: init bool = call %bound_method(%a.ref, %b.ref) // CHECK:STDOUT: %.loc22_15.1: bool = value_of_initializer %Greater.call // CHECK:STDOUT: %.loc22_15.2: bool = converted %Greater.call, %.loc22_15.1 // CHECK:STDOUT: return %.loc22_15.2 @@ -362,9 +367,9 @@ 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.8af = impl_witness_access constants.%impl_witness, element3 [template = constants.%GreaterOrEquivalent.03b] -// 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: %impl.elem3: %.086 = impl_witness_access constants.%impl_witness, element3 [template = constants.%GreaterOrEquivalent.03b] +// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem3 +// CHECK:STDOUT: %GreaterOrEquivalent.call: init bool = call %bound_method(%a.ref, %b.ref) // CHECK:STDOUT: %.loc26_16.1: bool = value_of_initializer %GreaterOrEquivalent.call // CHECK:STDOUT: %.loc26_16.2: bool = converted %GreaterOrEquivalent.call, %.loc26_16.1 // CHECK:STDOUT: return %.loc26_16.2 diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index de302c8e69eaa..89463a478a770 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -43,6 +43,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %impl_witness.404: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.092: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.79a: %Op.type.092 = struct_value () [template] +// CHECK:STDOUT: %RightShift.facet: %RightShift.type = facet_value %C, %impl_witness.404 [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %RightShiftAssign.type: type = facet_type <@RightShiftAssign> [template] // CHECK:STDOUT: %Op.type.6f6: type = fn_type @Op.3 [template] @@ -50,10 +51,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.aab: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.7b2: %Op.type.aab = struct_value () [template] +// CHECK:STDOUT: %RightShiftAssign.facet: %RightShiftAssign.type = facet_value %C, %impl_witness.686 [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] +// CHECK:STDOUT: %.882: type = fn_type_with_self_type %Op.type.4f4, %RightShift.facet [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] +// CHECK:STDOUT: %.f3e: type = fn_type_with_self_type %Op.type.6f6, %RightShiftAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -198,10 +202,10 @@ 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.4f4 = impl_witness_access constants.%impl_witness.404, element0 [template = constants.%Op.79a] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.882 = impl_witness_access constants.%impl_witness.404, element0 [template = constants.%Op.79a] +// CHECK:STDOUT: %bound_method: = 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: %Op.call: init %C = call %bound_method(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,10 +214,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %a.ref: %ptr.019 = 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.6f6 = impl_witness_access constants.%impl_witness.686, element0 [template = constants.%Op.7b2] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.f3e = impl_witness_access constants.%impl_witness.686, element0 [template = constants.%Op.7b2] +// CHECK:STDOUT: %bound_method: = bound_method %.loc31, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc31 -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 8ea6f29e54aa4..2aed204304b43 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -43,6 +43,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %impl_witness.3b8: = impl_witness (@impl.1.%Op.decl) [template] // CHECK:STDOUT: %Op.type.c74: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.151: %Op.type.c74 = struct_value () [template] +// CHECK:STDOUT: %Sub.facet: %Sub.type = facet_value %C, %impl_witness.3b8 [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %SubAssign.type: type = facet_type <@SubAssign> [template] // CHECK:STDOUT: %Op.type.f0d: type = fn_type @Op.3 [template] @@ -50,10 +51,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.966: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.a55: %Op.type.966 = struct_value () [template] +// CHECK:STDOUT: %SubAssign.facet: %SubAssign.type = facet_value %C, %impl_witness.91c [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] +// CHECK:STDOUT: %.f35: type = fn_type_with_self_type %Op.type.111, %Sub.facet [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] +// CHECK:STDOUT: %.3d8: type = fn_type_with_self_type %Op.type.f0d, %SubAssign.facet [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -198,10 +202,10 @@ 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.111 = impl_witness_access constants.%impl_witness.3b8, element0 [template = constants.%Op.151] -// CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.f35 = impl_witness_access constants.%impl_witness.3b8, element0 [template = constants.%Op.151] +// CHECK:STDOUT: %bound_method: = 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: %Op.call: init %C = call %bound_method(%a.ref, %b.ref) to %.loc26 // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,10 +214,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %a.ref: %ptr.019 = 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.f0d = impl_witness_access constants.%impl_witness.91c, element0 [template = constants.%Op.a55] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc31, %impl.elem0 +// CHECK:STDOUT: %impl.elem0: %.3d8 = impl_witness_access constants.%impl_witness.91c, element0 [template = constants.%Op.a55] +// CHECK:STDOUT: %bound_method: = bound_method %.loc31, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc31 -// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, %b.ref) +// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%addr, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index 5dae67e6920b1..a57aaddd0d0ba 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -47,10 +47,13 @@ fn Main() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -97,10 +100,10 @@ fn Main() { // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%x.var, %.loc4 // CHECK:STDOUT: %package.ref: = name_ref package, package [template = package] @@ -116,10 +119,13 @@ fn Main() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -168,10 +174,10 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_3.2: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %x.var, %.loc7_3.2 // CHECK:STDOUT: %.loc7_10: type = splice_block %i32.loc7 [template = constants.%i32] { @@ -199,10 +205,10 @@ fn Main() { // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%x.var, %.loc4 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index 8609f089231d8..99fb5fc1c2b43 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -28,10 +28,13 @@ var b: i32 = a; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -67,10 +70,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%a.var, %.loc4 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon index d2caeecf44109..68401a7a8ae3b 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon @@ -99,6 +99,8 @@ export C2(T:! type); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Foo.C1: %C1.type = import_ref Foo//a, C1, loaded [template = constants.%C1.generic] // CHECK:STDOUT: %Foo.C2: %C2.type = import_ref Foo//a, C2, loaded [template = constants.%C2.generic] +// CHECK:STDOUT: %Foo.import_ref.f6b058.1: type = import_ref Foo//a, loc4_10, loaded [symbolic = @C1.%T (constants.%T)] +// CHECK:STDOUT: %Foo.import_ref.f6b058.2: type = import_ref Foo//a, loc5_10, loaded [symbolic = @C2.%T (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -113,14 +115,14 @@ export C2(T:! type); // CHECK:STDOUT: %C2: %C2.type = export C2, imports.%Foo.C2 [template = constants.%C2.generic] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C1(constants.%T: type) [from "a.carbon"] { +// CHECK:STDOUT: generic class @C1(imports.%Foo.import_ref.f6b058.1: type) [from "a.carbon"] { // 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: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C2(constants.%T: type) [from "a.carbon"] { +// CHECK:STDOUT: generic class @C2(imports.%Foo.import_ref.f6b058.2: type) [from "a.carbon"] { // 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: diff --git a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon index 53e80b4c38cfa..a627aa5b1e5e7 100644 --- a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon @@ -207,8 +207,8 @@ var n: {} = i32; // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %N: %T = bind_symbolic_name N, 1 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %N: %T = bind_symbolic_name N, 1 [symbolic] // CHECK:STDOUT: %N.patt.51ccc0.2: %T = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Int.specific_fn: = specific_function %Int, @Int(Core.IntLiteral, %int_32) [template] // CHECK:STDOUT: } @@ -218,6 +218,8 @@ var n: {} = i32; // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: import Core//prelude_fake_int // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.f6b: type = import_ref Core//prelude_fake_int, loc4_8, loaded [symbolic = @Int.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.546: @Int.%T (%T) = import_ref Core//prelude_fake_int, loc4_18, loaded [symbolic = @Int.%N (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -238,7 +240,7 @@ var n: {} = i32; // CHECK:STDOUT: %n: ref %empty_struct_type = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Int(constants.%T: type, constants.%N: %T) [from "prelude_fake_int.carbon"] { +// CHECK:STDOUT: generic fn @Int(imports.%Core.import_ref.f6b: type, imports.%Core.import_ref.546: @Int.%T (%T)) [from "prelude_fake_int.carbon"] { // 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: %N: %T = bind_symbolic_name N, 1 [symbolic = %N (constants.%N)] diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index eb0e863ec4ef0..ba8138efa0f8a 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -21,10 +21,13 @@ fn F() -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -65,10 +68,10 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: assign %n.var, %.loc12_3.2 // CHECK:STDOUT: %.loc12_10: type = splice_block %i32.loc12 [template = constants.%i32] { diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 9db37640a2bc2..7851304e2d3af 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -32,10 +32,13 @@ fn F() { // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -79,17 +82,17 @@ fn F() { // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc12: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc12_46.1: %struct_type.a.b.cfd = struct_literal (%int_1.loc12, %int_2.loc12) -// CHECK:STDOUT: %impl.elem0.loc12_46.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12_46.1: = bound_method %int_1.loc12, %impl.elem0.loc12_46.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc12_46.1: init %i32 = call %Convert.specific_fn.loc12_46.1(%int_1.loc12) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc12_46.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12_46.1: = bound_method %int_1.loc12, %impl.elem0.loc12_46.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc12_46.1: = specific_function %bound_method.loc12_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc12_46.1: init %i32 = call %specific_fn.loc12_46.1(%int_1.loc12) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_46.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_46.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc12_46.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12_46.2: = bound_method %int_2.loc12, %impl.elem0.loc12_46.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc12_46.2: init %i32 = call %Convert.specific_fn.loc12_46.2(%int_2.loc12) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc12_46.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12_46.2: = bound_method %int_2.loc12, %impl.elem0.loc12_46.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc12_46.2: = specific_function %bound_method.loc12_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc12_46.2: init %i32 = call %specific_fn.loc12_46.2(%int_2.loc12) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_46.5: init %i32 = converted %int_2.loc12, %int.convert_checked.loc12_46.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_46.6: ref %i32 = struct_access %s.var, element1 // CHECK:STDOUT: %.loc12_46.7: init %i32 = initialize_from %.loc12_46.5 to %.loc12_46.6 [template = constants.%int_2.ef8] @@ -159,17 +162,17 @@ fn F() { // CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc18: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc18_28.1: %tuple.type.f94 = tuple_literal (%int_1.loc18, %int_2.loc18) -// CHECK:STDOUT: %impl.elem0.loc18_28.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc18_28.1: = bound_method %int_1.loc18, %impl.elem0.loc18_28.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc18_28.1: init %i32 = call %Convert.specific_fn.loc18_28.1(%int_1.loc18) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc18_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18_28.1: = bound_method %int_1.loc18, %impl.elem0.loc18_28.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc18_28.1: = specific_function %bound_method.loc18_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc18_28.1: init %i32 = call %specific_fn.loc18_28.1(%int_1.loc18) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_28.2: init %i32 = converted %int_1.loc18, %int.convert_checked.loc18_28.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc18_28.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc18_28.2: = bound_method %int_2.loc18, %impl.elem0.loc18_28.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc18_28.2: init %i32 = call %Convert.specific_fn.loc18_28.2(%int_2.loc18) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc18_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18_28.2: = bound_method %int_2.loc18, %impl.elem0.loc18_28.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc18_28.2: = specific_function %bound_method.loc18_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc18_28.2: init %i32 = call %specific_fn.loc18_28.2(%int_2.loc18) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_28.4: init %i32 = converted %int_2.loc18, %int.convert_checked.loc18_28.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc18: ref %i32 = tuple_access %t.var, element1 // CHECK:STDOUT: %.loc18_28.5: init %i32 = initialize_from %.loc18_28.4 to %tuple.elem1.loc18 [template = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index 35dab8a96f250..f7d98224213d5 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -23,10 +23,13 @@ fn F() -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -67,10 +70,10 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: assign %n.var, %.loc12_3.2 // CHECK:STDOUT: %.loc12_10: type = splice_block %i32.loc12 [template = constants.%i32] { diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index eca6470c69d12..b766ad324df93 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -27,10 +27,13 @@ var a: i32* = a_ref; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -79,10 +82,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%a_orig.var, %.loc4 // CHECK:STDOUT: %a_orig.ref: ref %i32 = name_ref a_orig, file.%a_orig diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 1770eeb82975a..23c3976083e12 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -30,10 +30,13 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -78,10 +81,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.2: %i32 = converted %int_0, %.loc12_11.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc12_11.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 7a724a412ba61..4c1207f230cb2 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -41,10 +41,13 @@ fn G() -> C { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -131,10 +134,10 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_12.2: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: assign %v.var, %.loc12_12.2 // CHECK:STDOUT: %.loc12_19: type = splice_block %i32.loc12 [template = constants.%i32] { @@ -155,17 +158,17 @@ fn G() -> C { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc25_38.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc25_38.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc25_38.1: = bound_method %int_1, %impl.elem0.loc25_38.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc25_38.1: init %i32 = call %Convert.specific_fn.loc25_38.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc25_38.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc25_38.1: = bound_method %int_1, %impl.elem0.loc25_38.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc25_38.1: = specific_function %bound_method.loc25_38.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc25_38.1: init %i32 = call %specific_fn.loc25_38.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc25_38.2: init %i32 = converted %int_1, %int.convert_checked.loc25_38.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc25_38.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc25_38.2: = bound_method %int_2, %impl.elem0.loc25_38.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc25_38.2: init %i32 = call %Convert.specific_fn.loc25_38.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc25_38.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc25_38.2: = bound_method %int_2, %impl.elem0.loc25_38.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc25_38.2: = specific_function %bound_method.loc25_38.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc25_38.2: init %i32 = call %specific_fn.loc25_38.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_38.5: init %i32 = converted %int_2, %int.convert_checked.loc25_38.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_38.6: ref %i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc25_38.7: init %i32 = initialize_from %.loc25_38.5 to %.loc25_38.6 [template = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 9074bf6b5f237..97380693919a9 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -49,10 +49,13 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %SameScope: %SameScope.type = struct_value () [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -112,10 +115,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_14.2: init %i32 = converted %int_0.loc13, %int.convert_checked.loc13 [template = constants.%int_0.6a9] // CHECK:STDOUT: assign %v.var, %.loc13_14.2 // CHECK:STDOUT: %.loc13_21: type = splice_block %i32.loc13 [template = constants.%i32] { @@ -129,10 +132,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_1, %impl.elem0.loc21 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc21: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc21: = bound_method %int_1, %impl.elem0.loc21 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc21: = specific_function %bound_method.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %specific_fn.loc21(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_14.2: init %i32 = converted %int_1, %int.convert_checked.loc21 [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %w.var, %.loc21_14.2 // CHECK:STDOUT: %.loc21_21: type = splice_block %i32.loc21 [template = constants.%i32] { @@ -144,10 +147,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_0.loc23: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_0.loc23, %impl.elem0.loc23 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_0.loc23) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc23: = bound_method %int_0.loc23, %impl.elem0.loc23 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %bound_method.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %specific_fn.loc23(%int_0.loc23) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_11.1: %i32 = value_of_initializer %int.convert_checked.loc23 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_11.2: %i32 = converted %int_0.loc23, %.loc23_11.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc23_11.2 @@ -165,10 +168,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_0.loc28: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc28: = specific_function %Convert.bound.loc28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %Convert.specific_fn.loc28(%int_0.loc28) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc28: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc28: = specific_function %bound_method.loc28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %specific_fn.loc28(%int_0.loc28) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc28_14.2: init %i32 = converted %int_0.loc28, %int.convert_checked.loc28 [template = constants.%int_0.6a9] // CHECK:STDOUT: assign %v.var, %.loc28_14.2 // CHECK:STDOUT: %.loc28_21: type = splice_block %i32.loc28 [template = constants.%i32] { @@ -186,10 +189,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc37: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc37: = bound_method %int_1, %impl.elem0.loc37 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc37: = specific_function %Convert.bound.loc37, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc37: init %i32 = call %Convert.specific_fn.loc37(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc37: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc37: = bound_method %int_1, %impl.elem0.loc37 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc37: = specific_function %bound_method.loc37, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc37: init %i32 = call %specific_fn.loc37(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc37_16.2: init %i32 = converted %int_1, %int.convert_checked.loc37 [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %w.var, %.loc37_16.2 // CHECK:STDOUT: %.loc37_23: type = splice_block %i32.loc37 [template = constants.%i32] { @@ -204,10 +207,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc27: // CHECK:STDOUT: %int_0.loc40: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc40: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc40: = bound_method %int_0.loc40, %impl.elem0.loc40 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc40: = specific_function %Convert.bound.loc40, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc40: init %i32 = call %Convert.specific_fn.loc40(%int_0.loc40) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc40: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc40: = bound_method %int_0.loc40, %impl.elem0.loc40 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc40: = specific_function %bound_method.loc40, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc40: init %i32 = call %specific_fn.loc40(%int_0.loc40) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc40_11.1: %i32 = value_of_initializer %int.convert_checked.loc40 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc40_11.2: %i32 = converted %int_0.loc40, %.loc40_11.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc40_11.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 415f0123fbf64..8ddf02929c57b 100644 --- a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon +++ b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon @@ -90,7 +90,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.c2a: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.40d: %Convert.type.c2a = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.07f = facet_value Core.IntLiteral, %impl_witness [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.11a = facet_value Core.IntLiteral, %impl_witness [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -300,6 +300,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %assoc0.a81: %ImplicitAs.assoc_type.740 = assoc_entity element0, imports.%Core.import_ref.1c7 [template] // CHECK:STDOUT: %assoc0.43d: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.207 [symbolic] // CHECK:STDOUT: %impl_witness.39c7: = impl_witness (imports.%Core.import_ref.f35) [template] +// CHECK:STDOUT: %ImplicitAs.facet.085: %ImplicitAs.type.61e = facet_value Core.IntLiteral, %impl_witness.39c7 [template] +// CHECK:STDOUT: %.624: type = fn_type_with_self_type %Convert.type.059, %ImplicitAs.facet.085 [template] // CHECK:STDOUT: %Convert.type.49f: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.cb5: %Convert.type.49f = struct_value () [template] // CHECK:STDOUT: %Convert.bound.04a: = bound_method %int_0.5c6, %Convert.cb5 [template] @@ -314,7 +316,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %impl_witness.39cb: = impl_witness (@impl.2.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.fff: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.606: %Convert.type.fff = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.3d3: %ImplicitAs.type.d62 = facet_value %C.808, %impl_witness.39cb [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet.a04: %ImplicitAs.type.94e = facet_value %C.808, %impl_witness.39cb [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.bound.92d: = bound_method %int_1.5b8, %Convert.cb5 [template] // CHECK:STDOUT: %int_1.f38: %i32.builtin = int_value 1 [template] @@ -322,7 +324,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %impl_witness.ecb: = impl_witness (@impl.3.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.89f: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.689: %Convert.type.89f = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.18c: %ImplicitAs.type.d62 = facet_value %C.8be, %impl_witness.ecb [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet.827: %ImplicitAs.type.94e = facet_value %C.8be, %impl_witness.ecb [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.bound.1b9: = bound_method %int_2.ecc, %Convert.cb5 [template] // CHECK:STDOUT: %int_2.5a1: %i32.builtin = int_value 2 [template] @@ -330,7 +332,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %impl_witness.8b8: = impl_witness (@impl.4.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.e90: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.ec9: %Convert.type.e90 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.105: %ImplicitAs.type.d62 = facet_value %C.c17, %impl_witness.8b8 [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet.f40: %ImplicitAs.type.94e = facet_value %C.c17, %impl_witness.8b8 [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %Convert.bound.b6b: = bound_method %int_3.1ba, %Convert.cb5 [template] // CHECK:STDOUT: %int_3.a0f: %i32.builtin = int_value 3 [template] @@ -338,7 +340,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %impl_witness.1c0: = impl_witness (@impl.5.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.5db: type = fn_type @Convert.6 [template] // CHECK:STDOUT: %Convert.193: %Convert.type.5db = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.97e: %ImplicitAs.type.d62 = facet_value %C.414, %impl_witness.1c0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet.4b0: %ImplicitAs.type.94e = facet_value %C.414, %impl_witness.1c0 [template] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.bound.626: = bound_method %int_4.0c1, %Convert.cb5 [template] // CHECK:STDOUT: %int_4.4f1: %i32.builtin = int_value 4 [template] @@ -346,7 +348,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %impl_witness.7c9: = impl_witness (@impl.6.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.4e7: type = fn_type @Convert.7 [template] // CHECK:STDOUT: %Convert.52a: %Convert.type.4e7 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.045: %ImplicitAs.type.d62 = facet_value %C.488, %impl_witness.7c9 [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet.e09: %ImplicitAs.type.94e = facet_value %C.488, %impl_witness.7c9 [template] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.bound.910: = bound_method %int_5.64b, %Convert.cb5 [template] // CHECK:STDOUT: %int_5.967: %i32.builtin = int_value 5 [template] @@ -354,7 +356,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %impl_witness.4b9: = impl_witness (@impl.7.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.658: type = fn_type @Convert.8 [template] // CHECK:STDOUT: %Convert.9b6: %Convert.type.658 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.36d: %ImplicitAs.type.d62 = facet_value %C.3e2, %impl_witness.4b9 [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet.210: %ImplicitAs.type.94e = facet_value %C.3e2, %impl_witness.4b9 [template] // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %Convert.bound.e3a: = bound_method %int_6.462, %Convert.cb5 [template] // CHECK:STDOUT: %int_6.ec5: %i32.builtin = int_value 6 [template] @@ -362,7 +364,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %impl_witness.4bf: = impl_witness (@impl.8.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.623: type = fn_type @Convert.9 [template] // CHECK:STDOUT: %Convert.8c9: %Convert.type.623 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.dc0: %ImplicitAs.type.d62 = facet_value %C.78c, %impl_witness.4bf [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet.e67: %ImplicitAs.type.94e = facet_value %C.78c, %impl_witness.4bf [template] // CHECK:STDOUT: %int_7.29f: Core.IntLiteral = int_value 7 [template] // CHECK:STDOUT: %Convert.bound.06a: = bound_method %int_7.29f, %Convert.cb5 [template] // CHECK:STDOUT: %int_7.6ae: %i32.builtin = int_value 7 [template] @@ -370,7 +372,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %impl_witness.74c: = impl_witness (@impl.9.%Convert.decl) [template] // CHECK:STDOUT: %Convert.type.3f8: type = fn_type @Convert.10 [template] // CHECK:STDOUT: %Convert.71a: %Convert.type.3f8 = struct_value () [template] -// CHECK:STDOUT: %ImplicitAs.facet.8ea: %ImplicitAs.type.d62 = facet_value %C.6aa, %impl_witness.74c [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet.367: %ImplicitAs.type.94e = facet_value %C.6aa, %impl_witness.74c [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -380,9 +382,12 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//default, ImplicitAs, loaded [template = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %Core.import_ref.f6b058.1: type = import_ref Core//default, loc8_22, loaded [symbolic = @ImplicitAs.%T (constants.%T)] // CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//default, inst49 [no loc], unloaded // CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//default, loc9_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43d)] // CHECK:STDOUT: %Core.Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//default, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)] +// CHECK:STDOUT: %Core.import_ref.f6b058.2: type = import_ref Core//default, loc8_22, loaded [symbolic = @ImplicitAs.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//default, inst49 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self)] // CHECK:STDOUT: %Core.import_ref.1c7: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//default, loc9_32, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)] // CHECK:STDOUT: %Core.import_ref.de9: = import_ref Core//default, loc12_38, loaded [template = constants.%impl_witness.39c7] // CHECK:STDOUT: %Core.import_ref.872: type = import_ref Core//default, loc12_17, loaded [template = Core.IntLiteral] @@ -422,9 +427,9 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.04a] -// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_0) [template = constants.%int_0.a54] +// CHECK:STDOUT: %impl.elem0: %.624 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.04a] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %bound_method(%int_0) [template = constants.%int_0.a54] // CHECK:STDOUT: %.loc10_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_0.a54] // CHECK:STDOUT: %.loc10_9.2: %i32.builtin = converted %int_0, %.loc10_9.1 [template = constants.%int_0.a54] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_0.a54) [template = constants.%C.808] @@ -437,9 +442,9 @@ fn F0(n: i32) -> P.D { // 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.5b8] -// CHECK:STDOUT: %impl.elem0: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.92d] -// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_1) [template = constants.%int_1.f38] +// CHECK:STDOUT: %impl.elem0: %.624 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.92d] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %bound_method(%int_1) [template = constants.%int_1.f38] // CHECK:STDOUT: %.loc11_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_1.f38] // CHECK:STDOUT: %.loc11_9.2: %i32.builtin = converted %int_1, %.loc11_9.1 [template = constants.%int_1.f38] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1.f38) [template = constants.%C.8be] @@ -452,9 +457,9 @@ fn F0(n: i32) -> P.D { // 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.ecc] -// CHECK:STDOUT: %impl.elem0: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.1b9] -// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_2) [template = constants.%int_2.5a1] +// CHECK:STDOUT: %impl.elem0: %.624 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.1b9] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %bound_method(%int_2) [template = constants.%int_2.5a1] // CHECK:STDOUT: %.loc12_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_2.5a1] // CHECK:STDOUT: %.loc12_9.2: %i32.builtin = converted %int_2, %.loc12_9.1 [template = constants.%int_2.5a1] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_2.5a1) [template = constants.%C.c17] @@ -467,9 +472,9 @@ fn F0(n: i32) -> P.D { // 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.1ba] -// CHECK:STDOUT: %impl.elem0: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound.b6b] -// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_3) [template = constants.%int_3.a0f] +// CHECK:STDOUT: %impl.elem0: %.624 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound.b6b] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %bound_method(%int_3) [template = constants.%int_3.a0f] // CHECK:STDOUT: %.loc13_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_3.a0f] // CHECK:STDOUT: %.loc13_9.2: %i32.builtin = converted %int_3, %.loc13_9.1 [template = constants.%int_3.a0f] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_3.a0f) [template = constants.%C.414] @@ -482,9 +487,9 @@ fn F0(n: i32) -> P.D { // 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.0c1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound.626] -// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_4) [template = constants.%int_4.4f1] +// CHECK:STDOUT: %impl.elem0: %.624 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound.626] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %bound_method(%int_4) [template = constants.%int_4.4f1] // CHECK:STDOUT: %.loc14_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_4.4f1] // CHECK:STDOUT: %.loc14_9.2: %i32.builtin = converted %int_4, %.loc14_9.1 [template = constants.%int_4.4f1] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_4.4f1) [template = constants.%C.488] @@ -497,9 +502,9 @@ fn F0(n: i32) -> P.D { // 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.64b] -// CHECK:STDOUT: %impl.elem0: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.910] -// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_5) [template = constants.%int_5.967] +// CHECK:STDOUT: %impl.elem0: %.624 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.910] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %bound_method(%int_5) [template = constants.%int_5.967] // CHECK:STDOUT: %.loc15_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_5.967] // CHECK:STDOUT: %.loc15_9.2: %i32.builtin = converted %int_5, %.loc15_9.1 [template = constants.%int_5.967] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_5.967) [template = constants.%C.3e2] @@ -512,9 +517,9 @@ fn F0(n: i32) -> P.D { // 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.462] -// CHECK:STDOUT: %impl.elem0: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_6, %impl.elem0 [template = constants.%Convert.bound.e3a] -// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_6) [template = constants.%int_6.ec5] +// CHECK:STDOUT: %impl.elem0: %.624 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method: = bound_method %int_6, %impl.elem0 [template = constants.%Convert.bound.e3a] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %bound_method(%int_6) [template = constants.%int_6.ec5] // CHECK:STDOUT: %.loc16_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_6.ec5] // CHECK:STDOUT: %.loc16_9.2: %i32.builtin = converted %int_6, %.loc16_9.1 [template = constants.%int_6.ec5] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_6.ec5) [template = constants.%C.78c] @@ -527,9 +532,9 @@ fn F0(n: i32) -> P.D { // 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.29f] -// CHECK:STDOUT: %impl.elem0: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_7, %impl.elem0 [template = constants.%Convert.bound.06a] -// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_7) [template = constants.%int_7.6ae] +// CHECK:STDOUT: %impl.elem0: %.624 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method: = bound_method %int_7, %impl.elem0 [template = constants.%Convert.bound.06a] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %bound_method(%int_7) [template = constants.%int_7.6ae] // CHECK:STDOUT: %.loc17_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_7.6ae] // CHECK:STDOUT: %.loc17_9.2: %i32.builtin = converted %int_7, %.loc17_9.1 [template = constants.%int_7.6ae] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_7.6ae) [template = constants.%C.6aa] @@ -541,7 +546,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.9.%Convert.decl) [template = constants.%impl_witness.74c] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(constants.%T: type) [from "core.carbon"] { +// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.f6b058.1: type) [from "core.carbon"] { // 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: @@ -768,15 +773,15 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_0.loc8_31: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // CHECK:STDOUT: %int_0.loc8_39: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // CHECK:STDOUT: %.loc8_40.1: %struct_type.n.m.819 = struct_literal (%int_0.loc8_31, %int_0.loc8_39) -// CHECK:STDOUT: %impl.elem0.loc8_40.1: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc8_40.1: = bound_method %int_0.loc8_31, %impl.elem0.loc8_40.1 [template = constants.%Convert.bound.04a] -// 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.a54] +// CHECK:STDOUT: %impl.elem0.loc8_40.1: %.624 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc8_40.1: = bound_method %int_0.loc8_31, %impl.elem0.loc8_40.1 [template = constants.%Convert.bound.04a] +// CHECK:STDOUT: %int.convert_checked.loc8_40.1: init %i32.builtin = call %bound_method.loc8_40.1(%int_0.loc8_31) [template = constants.%int_0.a54] // CHECK:STDOUT: %.loc8_40.2: init %i32.builtin = converted %int_0.loc8_31, %int.convert_checked.loc8_40.1 [template = constants.%int_0.a54] // 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.a54] -// CHECK:STDOUT: %impl.elem0.loc8_40.2: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc8_40.2: = bound_method %int_0.loc8_39, %impl.elem0.loc8_40.2 [template = constants.%Convert.bound.04a] -// 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.a54] +// CHECK:STDOUT: %impl.elem0.loc8_40.2: %.624 = impl_witness_access constants.%impl_witness.39c7, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc8_40.2: = bound_method %int_0.loc8_39, %impl.elem0.loc8_40.2 [template = constants.%Convert.bound.04a] +// CHECK:STDOUT: %int.convert_checked.loc8_40.2: init %i32.builtin = call %bound_method.loc8_40.2(%int_0.loc8_39) [template = constants.%int_0.a54] // CHECK:STDOUT: %.loc8_40.5: init %i32.builtin = converted %int_0.loc8_39, %int.convert_checked.loc8_40.2 [template = constants.%int_0.a54] // CHECK:STDOUT: %.loc8_40.6: ref %i32.builtin = class_element_access %return, element1 // CHECK:STDOUT: %.loc8_40.7: init %i32.builtin = initialize_from %.loc8_40.5 to %.loc8_40.6 [template = constants.%int_0.a54] @@ -785,7 +790,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: return %.loc8_41 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.1(constants.%T: type, constants.%Self: %ImplicitAs.type.d62) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Convert.1(imports.%Core.import_ref.f6b058.2: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "core.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)] // CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)] @@ -914,10 +919,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %assoc0 => constants.%assoc0.69d // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.3d3) { +// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.a04) { // CHECK:STDOUT: %T => constants.%D // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.94e -// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.3d3 +// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.a04 // CHECK:STDOUT: %Self.as_type => constants.%C.808 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -928,10 +933,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.18c) { +// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.827) { // CHECK:STDOUT: %T => constants.%D // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.94e -// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.18c +// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.827 // CHECK:STDOUT: %Self.as_type => constants.%C.8be // CHECK:STDOUT: } // CHECK:STDOUT: @@ -942,10 +947,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.105) { +// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.f40) { // CHECK:STDOUT: %T => constants.%D // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.94e -// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.105 +// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.f40 // CHECK:STDOUT: %Self.as_type => constants.%C.c17 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -956,10 +961,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.97e) { +// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.4b0) { // CHECK:STDOUT: %T => constants.%D // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.94e -// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.97e +// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.4b0 // CHECK:STDOUT: %Self.as_type => constants.%C.414 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -970,10 +975,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.045) { +// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.e09) { // CHECK:STDOUT: %T => constants.%D // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.94e -// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.045 +// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.e09 // CHECK:STDOUT: %Self.as_type => constants.%C.488 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -984,10 +989,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.36d) { +// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.210) { // CHECK:STDOUT: %T => constants.%D // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.94e -// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.36d +// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.210 // CHECK:STDOUT: %Self.as_type => constants.%C.3e2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -998,10 +1003,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.dc0) { +// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.e67) { // CHECK:STDOUT: %T => constants.%D // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.94e -// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.dc0 +// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.e67 // CHECK:STDOUT: %Self.as_type => constants.%C.78c // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1012,10 +1017,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.8ea) { +// CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%ImplicitAs.facet.367) { // CHECK:STDOUT: %T => constants.%D // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.94e -// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.8ea +// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.367 // CHECK:STDOUT: %Self.as_type => constants.%C.6aa // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1055,6 +1060,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %assoc0.a81: %ImplicitAs.assoc_type.740 = assoc_entity element0, imports.%Core.import_ref.1c7 [template] // CHECK:STDOUT: %assoc0.43d: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.207 [symbolic] // CHECK:STDOUT: %impl_witness.39c: = impl_witness (imports.%Core.import_ref.f35) [template] +// CHECK:STDOUT: %ImplicitAs.facet.085: %ImplicitAs.type.61e = facet_value Core.IntLiteral, %impl_witness.39c [template] +// CHECK:STDOUT: %.624: type = fn_type_with_self_type %Convert.type.059, %ImplicitAs.facet.085 [template] // CHECK:STDOUT: %Convert.type.49f: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.cb5: %Convert.type.49f = struct_value () [template] // CHECK:STDOUT: %Convert.bound.04a: = bound_method %int_0.5c6, %Convert.cb5 [template] @@ -1081,48 +1088,64 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_7.6ae: %i32.builtin = int_value 7 [template] // CHECK:STDOUT: %C.f0a: type = class_type @C, @C(%int_7.6ae) [template] // CHECK:STDOUT: %impl_witness.368: = impl_witness (imports.%P.import_ref.5f3) [template] +// CHECK:STDOUT: %ImplicitAs.facet.fc3: %ImplicitAs.type.5f9 = facet_value %C.76d, %impl_witness.368 [template] +// CHECK:STDOUT: %.a6f: type = fn_type_with_self_type %Convert.type.334, %ImplicitAs.facet.fc3 [template] // CHECK:STDOUT: %Convert.type.c72: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.4f5: %Convert.type.c72 = struct_value () [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.bound.92d: = bound_method %int_1.5b8, %Convert.cb5 [template] // CHECK:STDOUT: %C.val.172: %C.012 = struct_value () [template] // CHECK:STDOUT: %impl_witness.29f: = impl_witness (imports.%P.import_ref.4da) [template] +// CHECK:STDOUT: %ImplicitAs.facet.5d2: %ImplicitAs.type.5f9 = facet_value %C.012, %impl_witness.29f [template] +// CHECK:STDOUT: %.a51: type = fn_type_with_self_type %Convert.type.334, %ImplicitAs.facet.5d2 [template] // CHECK:STDOUT: %Convert.type.d88: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.ecc: %Convert.type.d88 = struct_value () [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.bound.1b9: = bound_method %int_2.ecc, %Convert.cb5 [template] // CHECK:STDOUT: %C.val.418: %C.3e6 = struct_value () [template] // CHECK:STDOUT: %impl_witness.3ac: = impl_witness (imports.%P.import_ref.ebf) [template] +// CHECK:STDOUT: %ImplicitAs.facet.8f4: %ImplicitAs.type.5f9 = facet_value %C.3e6, %impl_witness.3ac [template] +// CHECK:STDOUT: %.d2a: type = fn_type_with_self_type %Convert.type.334, %ImplicitAs.facet.8f4 [template] // CHECK:STDOUT: %Convert.type.c17: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.c2b: %Convert.type.c17 = struct_value () [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %Convert.bound.b6b: = bound_method %int_3.1ba, %Convert.cb5 [template] // CHECK:STDOUT: %C.val.bba: %C.4d9 = struct_value () [template] // CHECK:STDOUT: %impl_witness.b40: = impl_witness (imports.%P.import_ref.f13) [template] +// CHECK:STDOUT: %ImplicitAs.facet.1e6: %ImplicitAs.type.5f9 = facet_value %C.4d9, %impl_witness.b40 [template] +// CHECK:STDOUT: %.6c2: type = fn_type_with_self_type %Convert.type.334, %ImplicitAs.facet.1e6 [template] // CHECK:STDOUT: %Convert.type.70f: type = fn_type @Convert.6 [template] // CHECK:STDOUT: %Convert.2b5: %Convert.type.70f = struct_value () [template] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.bound.626: = bound_method %int_4.0c1, %Convert.cb5 [template] // CHECK:STDOUT: %C.val.4b6: %C.a67 = struct_value () [template] // CHECK:STDOUT: %impl_witness.20f: = impl_witness (imports.%P.import_ref.97a) [template] +// CHECK:STDOUT: %ImplicitAs.facet.686: %ImplicitAs.type.5f9 = facet_value %C.a67, %impl_witness.20f [template] +// CHECK:STDOUT: %.e54: type = fn_type_with_self_type %Convert.type.334, %ImplicitAs.facet.686 [template] // CHECK:STDOUT: %Convert.type.782: type = fn_type @Convert.7 [template] // CHECK:STDOUT: %Convert.625: %Convert.type.782 = struct_value () [template] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.bound.910: = bound_method %int_5.64b, %Convert.cb5 [template] // CHECK:STDOUT: %C.val.75e: %C.65c = struct_value () [template] // CHECK:STDOUT: %impl_witness.9b3: = impl_witness (imports.%P.import_ref.e04) [template] +// CHECK:STDOUT: %ImplicitAs.facet.585: %ImplicitAs.type.5f9 = facet_value %C.65c, %impl_witness.9b3 [template] +// CHECK:STDOUT: %.a23: type = fn_type_with_self_type %Convert.type.334, %ImplicitAs.facet.585 [template] // CHECK:STDOUT: %Convert.type.0e6: type = fn_type @Convert.8 [template] // CHECK:STDOUT: %Convert.73d: %Convert.type.0e6 = struct_value () [template] // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %Convert.bound.e3a: = bound_method %int_6.462, %Convert.cb5 [template] // CHECK:STDOUT: %C.val.02a: %C.898 = struct_value () [template] // CHECK:STDOUT: %impl_witness.b5b: = impl_witness (imports.%P.import_ref.6aa) [template] +// CHECK:STDOUT: %ImplicitAs.facet.6e7: %ImplicitAs.type.5f9 = facet_value %C.898, %impl_witness.b5b [template] +// CHECK:STDOUT: %.73d: type = fn_type_with_self_type %Convert.type.334, %ImplicitAs.facet.6e7 [template] // CHECK:STDOUT: %Convert.type.9e9: type = fn_type @Convert.9 [template] // CHECK:STDOUT: %Convert.e8e: %Convert.type.9e9 = struct_value () [template] // CHECK:STDOUT: %int_7.29f: Core.IntLiteral = int_value 7 [template] // CHECK:STDOUT: %Convert.bound.06a: = bound_method %int_7.29f, %Convert.cb5 [template] // CHECK:STDOUT: %C.val.654: %C.f0a = struct_value () [template] // CHECK:STDOUT: %impl_witness.dfb: = impl_witness (imports.%P.import_ref.243) [template] +// CHECK:STDOUT: %ImplicitAs.facet.2de: %ImplicitAs.type.5f9 = facet_value %C.f0a, %impl_witness.dfb [template] +// CHECK:STDOUT: %.e43: type = fn_type_with_self_type %Convert.type.334, %ImplicitAs.facet.2de [template] // CHECK:STDOUT: %Convert.type.fc1: type = fn_type @Convert.10 [template] // CHECK:STDOUT: %Convert.430: %Convert.type.fc1 = struct_value () [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] @@ -1147,11 +1170,15 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.import_ref.a99 = import_ref P//library, loc7_16, unloaded // CHECK:STDOUT: %P.import_ref.9d2 = import_ref P//library, loc7_28, unloaded // CHECK:STDOUT: %P.C: %C.type = import_ref P//library, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %P.import_ref.512: %i32.builtin = import_ref P//library, loc6_9, loaded [symbolic = @C.%N (constants.%N)] // CHECK:STDOUT: %P.import_ref.8f2: = import_ref P//library, loc6_19, loaded [template = constants.%complete_type.357] // CHECK:STDOUT: %P.import_ref.d9b = import_ref P//library, inst42 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.f6b058.1: type = import_ref Core//default, loc8_22, loaded [symbolic = @ImplicitAs.%T (constants.%T)] // CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//default, inst49 [no loc], unloaded // CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//default, loc9_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43d)] // CHECK:STDOUT: %Core.Convert = import_ref Core//default, Convert, unloaded +// CHECK:STDOUT: %Core.import_ref.f6b058.2: type = import_ref Core//default, loc8_22, loaded [symbolic = @ImplicitAs.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//default, inst49 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self)] // CHECK:STDOUT: %Core.import_ref.1c7: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//default, loc9_32, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)] // CHECK:STDOUT: %Core.import_ref.de9: = import_ref Core//default, loc12_38, loaded [template = constants.%impl_witness.39c] // CHECK:STDOUT: %Core.import_ref.872: type = import_ref Core//default, loc12_17, loaded [template = Core.IntLiteral] @@ -1212,7 +1239,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(constants.%T: type) [from "core.carbon"] { +// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.f6b058.1: type) [from "core.carbon"] { // 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: @@ -1286,7 +1313,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: .m = imports.%P.import_ref.9d2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%N: %i32.builtin) [from "library.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%P.import_ref.512: %i32.builtin) [from "library.carbon"] { // CHECK:STDOUT: %N: %i32.builtin = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] // CHECK:STDOUT: @@ -1312,9 +1339,9 @@ 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.%P.C [template = constants.%C.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc8_34: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc8_34: = bound_method %int_0, %impl.elem0.loc8_34 [template = constants.%Convert.bound.04a] -// CHECK:STDOUT: %int.convert_checked.loc8: init %i32.builtin = call %Convert.bound.loc8_34(%int_0) [template = constants.%int_0.a54] +// CHECK:STDOUT: %impl.elem0.loc8_34: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc8_34: = bound_method %int_0, %impl.elem0.loc8_34 [template = constants.%Convert.bound.04a] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32.builtin = call %bound_method.loc8_34(%int_0) [template = constants.%int_0.a54] // CHECK:STDOUT: %.loc8_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc8 [template = constants.%int_0.a54] // CHECK:STDOUT: %.loc8_34.2: %i32.builtin = converted %int_0, %.loc8_34.1 [template = constants.%int_0.a54] // CHECK:STDOUT: %C.loc8: type = class_type @C, @C(constants.%int_0.a54) [template = constants.%C.76d] @@ -1322,11 +1349,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc8_24.3: init %C.76d = class_init (), %.loc8_24.2 [template = constants.%C.val.3c3] // CHECK:STDOUT: %.loc8_24.4: ref %C.76d = temporary %.loc8_24.2, %.loc8_24.3 // CHECK:STDOUT: %.loc8_26.1: ref %C.76d = converted %.loc8_24.1, %.loc8_24.4 -// CHECK:STDOUT: %impl.elem0.loc8_35: %Convert.type.334 = impl_witness_access constants.%impl_witness.368, element0 [template = constants.%Convert.4f5] -// CHECK:STDOUT: %Convert.bound.loc8_35: = bound_method %.loc8_26.1, %impl.elem0.loc8_35 +// CHECK:STDOUT: %impl.elem0.loc8_35: %.a6f = impl_witness_access constants.%impl_witness.368, element0 [template = constants.%Convert.4f5] +// CHECK:STDOUT: %bound_method.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.76d = bind_value %.loc8_26.1 -// CHECK:STDOUT: %Convert.call.loc8: init %D = call %Convert.bound.loc8_35(%.loc8_26.2) to %.loc8_35.1 +// CHECK:STDOUT: %Convert.call.loc8: init %D = call %bound_method.loc8_35(%.loc8_26.2) to %.loc8_35.1 // CHECK:STDOUT: %.loc8_35.2: init %D = converted %.loc8_26.1, %Convert.call.loc8 // CHECK:STDOUT: return %.loc8_35.2 to %return // CHECK:STDOUT: @@ -1339,9 +1366,9 @@ 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.%P.C [template = constants.%C.generic] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc9_34: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc9_34: = bound_method %int_1, %impl.elem0.loc9_34 [template = constants.%Convert.bound.92d] -// CHECK:STDOUT: %int.convert_checked.loc9: init %i32.builtin = call %Convert.bound.loc9_34(%int_1) [template = constants.%int_1.f38] +// CHECK:STDOUT: %impl.elem0.loc9_34: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc9_34: = bound_method %int_1, %impl.elem0.loc9_34 [template = constants.%Convert.bound.92d] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32.builtin = call %bound_method.loc9_34(%int_1) [template = constants.%int_1.f38] // CHECK:STDOUT: %.loc9_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc9 [template = constants.%int_1.f38] // CHECK:STDOUT: %.loc9_34.2: %i32.builtin = converted %int_1, %.loc9_34.1 [template = constants.%int_1.f38] // CHECK:STDOUT: %C.loc9: type = class_type @C, @C(constants.%int_1.f38) [template = constants.%C.012] @@ -1349,11 +1376,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc9_24.3: init %C.012 = class_init (), %.loc9_24.2 [template = constants.%C.val.172] // CHECK:STDOUT: %.loc9_24.4: ref %C.012 = temporary %.loc9_24.2, %.loc9_24.3 // CHECK:STDOUT: %.loc9_26.1: ref %C.012 = converted %.loc9_24.1, %.loc9_24.4 -// CHECK:STDOUT: %impl.elem0.loc9_35: %Convert.type.334 = impl_witness_access constants.%impl_witness.29f, element0 [template = constants.%Convert.ecc] -// CHECK:STDOUT: %Convert.bound.loc9_35: = bound_method %.loc9_26.1, %impl.elem0.loc9_35 +// CHECK:STDOUT: %impl.elem0.loc9_35: %.a51 = impl_witness_access constants.%impl_witness.29f, element0 [template = constants.%Convert.ecc] +// CHECK:STDOUT: %bound_method.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.012 = bind_value %.loc9_26.1 -// CHECK:STDOUT: %Convert.call.loc9: init %D = call %Convert.bound.loc9_35(%.loc9_26.2) to %.loc9_35.1 +// CHECK:STDOUT: %Convert.call.loc9: init %D = call %bound_method.loc9_35(%.loc9_26.2) to %.loc9_35.1 // CHECK:STDOUT: %.loc9_35.2: init %D = converted %.loc9_26.1, %Convert.call.loc9 // CHECK:STDOUT: return %.loc9_35.2 to %return // CHECK:STDOUT: @@ -1366,9 +1393,9 @@ 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.%P.C [template = constants.%C.generic] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc10_34: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc10_34: = bound_method %int_2, %impl.elem0.loc10_34 [template = constants.%Convert.bound.1b9] -// CHECK:STDOUT: %int.convert_checked.loc10: init %i32.builtin = call %Convert.bound.loc10_34(%int_2) [template = constants.%int_2.5a1] +// CHECK:STDOUT: %impl.elem0.loc10_34: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc10_34: = bound_method %int_2, %impl.elem0.loc10_34 [template = constants.%Convert.bound.1b9] +// CHECK:STDOUT: %int.convert_checked.loc10: init %i32.builtin = call %bound_method.loc10_34(%int_2) [template = constants.%int_2.5a1] // CHECK:STDOUT: %.loc10_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc10 [template = constants.%int_2.5a1] // CHECK:STDOUT: %.loc10_34.2: %i32.builtin = converted %int_2, %.loc10_34.1 [template = constants.%int_2.5a1] // CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%int_2.5a1) [template = constants.%C.3e6] @@ -1376,11 +1403,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc10_24.3: init %C.3e6 = class_init (), %.loc10_24.2 [template = constants.%C.val.418] // CHECK:STDOUT: %.loc10_24.4: ref %C.3e6 = temporary %.loc10_24.2, %.loc10_24.3 // CHECK:STDOUT: %.loc10_26.1: ref %C.3e6 = converted %.loc10_24.1, %.loc10_24.4 -// CHECK:STDOUT: %impl.elem0.loc10_35: %Convert.type.334 = impl_witness_access constants.%impl_witness.3ac, element0 [template = constants.%Convert.c2b] -// CHECK:STDOUT: %Convert.bound.loc10_35: = bound_method %.loc10_26.1, %impl.elem0.loc10_35 +// CHECK:STDOUT: %impl.elem0.loc10_35: %.d2a = impl_witness_access constants.%impl_witness.3ac, element0 [template = constants.%Convert.c2b] +// CHECK:STDOUT: %bound_method.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.3e6 = bind_value %.loc10_26.1 -// CHECK:STDOUT: %Convert.call.loc10: init %D = call %Convert.bound.loc10_35(%.loc10_26.2) to %.loc10_35.1 +// CHECK:STDOUT: %Convert.call.loc10: init %D = call %bound_method.loc10_35(%.loc10_26.2) to %.loc10_35.1 // CHECK:STDOUT: %.loc10_35.2: init %D = converted %.loc10_26.1, %Convert.call.loc10 // CHECK:STDOUT: return %.loc10_35.2 to %return // CHECK:STDOUT: @@ -1393,9 +1420,9 @@ 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.%P.C [template = constants.%C.generic] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] -// CHECK:STDOUT: %impl.elem0.loc11_34: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc11_34: = bound_method %int_3, %impl.elem0.loc11_34 [template = constants.%Convert.bound.b6b] -// CHECK:STDOUT: %int.convert_checked.loc11: init %i32.builtin = call %Convert.bound.loc11_34(%int_3) [template = constants.%int_3.a0f] +// CHECK:STDOUT: %impl.elem0.loc11_34: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc11_34: = bound_method %int_3, %impl.elem0.loc11_34 [template = constants.%Convert.bound.b6b] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32.builtin = call %bound_method.loc11_34(%int_3) [template = constants.%int_3.a0f] // CHECK:STDOUT: %.loc11_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc11 [template = constants.%int_3.a0f] // CHECK:STDOUT: %.loc11_34.2: %i32.builtin = converted %int_3, %.loc11_34.1 [template = constants.%int_3.a0f] // CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%int_3.a0f) [template = constants.%C.4d9] @@ -1403,11 +1430,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc11_24.3: init %C.4d9 = class_init (), %.loc11_24.2 [template = constants.%C.val.bba] // CHECK:STDOUT: %.loc11_24.4: ref %C.4d9 = temporary %.loc11_24.2, %.loc11_24.3 // CHECK:STDOUT: %.loc11_26.1: ref %C.4d9 = converted %.loc11_24.1, %.loc11_24.4 -// CHECK:STDOUT: %impl.elem0.loc11_35: %Convert.type.334 = impl_witness_access constants.%impl_witness.b40, element0 [template = constants.%Convert.2b5] -// CHECK:STDOUT: %Convert.bound.loc11_35: = bound_method %.loc11_26.1, %impl.elem0.loc11_35 +// CHECK:STDOUT: %impl.elem0.loc11_35: %.6c2 = impl_witness_access constants.%impl_witness.b40, element0 [template = constants.%Convert.2b5] +// CHECK:STDOUT: %bound_method.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.4d9 = bind_value %.loc11_26.1 -// CHECK:STDOUT: %Convert.call.loc11: init %D = call %Convert.bound.loc11_35(%.loc11_26.2) to %.loc11_35.1 +// CHECK:STDOUT: %Convert.call.loc11: init %D = call %bound_method.loc11_35(%.loc11_26.2) to %.loc11_35.1 // CHECK:STDOUT: %.loc11_35.2: init %D = converted %.loc11_26.1, %Convert.call.loc11 // CHECK:STDOUT: return %.loc11_35.2 to %return // CHECK:STDOUT: @@ -1420,9 +1447,9 @@ 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.%P.C [template = constants.%C.generic] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] -// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc12_34: = bound_method %int_4, %impl.elem0.loc12_34 [template = constants.%Convert.bound.626] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32.builtin = call %Convert.bound.loc12_34(%int_4) [template = constants.%int_4.4f1] +// CHECK:STDOUT: %impl.elem0.loc12_34: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc12_34: = bound_method %int_4, %impl.elem0.loc12_34 [template = constants.%Convert.bound.626] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32.builtin = call %bound_method.loc12_34(%int_4) [template = constants.%int_4.4f1] // CHECK:STDOUT: %.loc12_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc12 [template = constants.%int_4.4f1] // CHECK:STDOUT: %.loc12_34.2: %i32.builtin = converted %int_4, %.loc12_34.1 [template = constants.%int_4.4f1] // CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%int_4.4f1) [template = constants.%C.a67] @@ -1430,11 +1457,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc12_24.3: init %C.a67 = class_init (), %.loc12_24.2 [template = constants.%C.val.4b6] // CHECK:STDOUT: %.loc12_24.4: ref %C.a67 = temporary %.loc12_24.2, %.loc12_24.3 // CHECK:STDOUT: %.loc12_26.1: ref %C.a67 = converted %.loc12_24.1, %.loc12_24.4 -// CHECK:STDOUT: %impl.elem0.loc12_35: %Convert.type.334 = impl_witness_access constants.%impl_witness.20f, element0 [template = constants.%Convert.625] -// CHECK:STDOUT: %Convert.bound.loc12_35: = bound_method %.loc12_26.1, %impl.elem0.loc12_35 +// CHECK:STDOUT: %impl.elem0.loc12_35: %.e54 = impl_witness_access constants.%impl_witness.20f, element0 [template = constants.%Convert.625] +// CHECK:STDOUT: %bound_method.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.a67 = bind_value %.loc12_26.1 -// CHECK:STDOUT: %Convert.call.loc12: init %D = call %Convert.bound.loc12_35(%.loc12_26.2) to %.loc12_35.1 +// CHECK:STDOUT: %Convert.call.loc12: init %D = call %bound_method.loc12_35(%.loc12_26.2) to %.loc12_35.1 // CHECK:STDOUT: %.loc12_35.2: init %D = converted %.loc12_26.1, %Convert.call.loc12 // CHECK:STDOUT: return %.loc12_35.2 to %return // CHECK:STDOUT: @@ -1447,9 +1474,9 @@ 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.%P.C [template = constants.%C.generic] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.64b] -// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc13_34: = bound_method %int_5, %impl.elem0.loc13_34 [template = constants.%Convert.bound.910] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32.builtin = call %Convert.bound.loc13_34(%int_5) [template = constants.%int_5.967] +// CHECK:STDOUT: %impl.elem0.loc13_34: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc13_34: = bound_method %int_5, %impl.elem0.loc13_34 [template = constants.%Convert.bound.910] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32.builtin = call %bound_method.loc13_34(%int_5) [template = constants.%int_5.967] // CHECK:STDOUT: %.loc13_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc13 [template = constants.%int_5.967] // CHECK:STDOUT: %.loc13_34.2: %i32.builtin = converted %int_5, %.loc13_34.1 [template = constants.%int_5.967] // CHECK:STDOUT: %C.loc13: type = class_type @C, @C(constants.%int_5.967) [template = constants.%C.65c] @@ -1457,11 +1484,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc13_24.3: init %C.65c = class_init (), %.loc13_24.2 [template = constants.%C.val.75e] // CHECK:STDOUT: %.loc13_24.4: ref %C.65c = temporary %.loc13_24.2, %.loc13_24.3 // CHECK:STDOUT: %.loc13_26.1: ref %C.65c = converted %.loc13_24.1, %.loc13_24.4 -// CHECK:STDOUT: %impl.elem0.loc13_35: %Convert.type.334 = impl_witness_access constants.%impl_witness.9b3, element0 [template = constants.%Convert.73d] -// CHECK:STDOUT: %Convert.bound.loc13_35: = bound_method %.loc13_26.1, %impl.elem0.loc13_35 +// CHECK:STDOUT: %impl.elem0.loc13_35: %.a23 = impl_witness_access constants.%impl_witness.9b3, element0 [template = constants.%Convert.73d] +// CHECK:STDOUT: %bound_method.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.65c = bind_value %.loc13_26.1 -// CHECK:STDOUT: %Convert.call.loc13: init %D = call %Convert.bound.loc13_35(%.loc13_26.2) to %.loc13_35.1 +// CHECK:STDOUT: %Convert.call.loc13: init %D = call %bound_method.loc13_35(%.loc13_26.2) to %.loc13_35.1 // CHECK:STDOUT: %.loc13_35.2: init %D = converted %.loc13_26.1, %Convert.call.loc13 // CHECK:STDOUT: return %.loc13_35.2 to %return // CHECK:STDOUT: @@ -1474,9 +1501,9 @@ 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.%P.C [template = constants.%C.generic] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.462] -// CHECK:STDOUT: %impl.elem0.loc14_34: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc14_34: = bound_method %int_6, %impl.elem0.loc14_34 [template = constants.%Convert.bound.e3a] -// CHECK:STDOUT: %int.convert_checked.loc14: init %i32.builtin = call %Convert.bound.loc14_34(%int_6) [template = constants.%int_6.ec5] +// CHECK:STDOUT: %impl.elem0.loc14_34: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc14_34: = bound_method %int_6, %impl.elem0.loc14_34 [template = constants.%Convert.bound.e3a] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32.builtin = call %bound_method.loc14_34(%int_6) [template = constants.%int_6.ec5] // CHECK:STDOUT: %.loc14_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc14 [template = constants.%int_6.ec5] // CHECK:STDOUT: %.loc14_34.2: %i32.builtin = converted %int_6, %.loc14_34.1 [template = constants.%int_6.ec5] // CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%int_6.ec5) [template = constants.%C.898] @@ -1484,11 +1511,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc14_24.3: init %C.898 = class_init (), %.loc14_24.2 [template = constants.%C.val.02a] // CHECK:STDOUT: %.loc14_24.4: ref %C.898 = temporary %.loc14_24.2, %.loc14_24.3 // CHECK:STDOUT: %.loc14_26.1: ref %C.898 = converted %.loc14_24.1, %.loc14_24.4 -// CHECK:STDOUT: %impl.elem0.loc14_35: %Convert.type.334 = impl_witness_access constants.%impl_witness.b5b, element0 [template = constants.%Convert.e8e] -// CHECK:STDOUT: %Convert.bound.loc14_35: = bound_method %.loc14_26.1, %impl.elem0.loc14_35 +// CHECK:STDOUT: %impl.elem0.loc14_35: %.73d = impl_witness_access constants.%impl_witness.b5b, element0 [template = constants.%Convert.e8e] +// CHECK:STDOUT: %bound_method.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.898 = bind_value %.loc14_26.1 -// CHECK:STDOUT: %Convert.call.loc14: init %D = call %Convert.bound.loc14_35(%.loc14_26.2) to %.loc14_35.1 +// CHECK:STDOUT: %Convert.call.loc14: init %D = call %bound_method.loc14_35(%.loc14_26.2) to %.loc14_35.1 // CHECK:STDOUT: %.loc14_35.2: init %D = converted %.loc14_26.1, %Convert.call.loc14 // CHECK:STDOUT: return %.loc14_35.2 to %return // CHECK:STDOUT: @@ -1501,9 +1528,9 @@ 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.%P.C [template = constants.%C.generic] // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7.29f] -// CHECK:STDOUT: %impl.elem0.loc15_34: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] -// CHECK:STDOUT: %Convert.bound.loc15_34: = bound_method %int_7, %impl.elem0.loc15_34 [template = constants.%Convert.bound.06a] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32.builtin = call %Convert.bound.loc15_34(%int_7) [template = constants.%int_7.6ae] +// CHECK:STDOUT: %impl.elem0.loc15_34: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5] +// CHECK:STDOUT: %bound_method.loc15_34: = bound_method %int_7, %impl.elem0.loc15_34 [template = constants.%Convert.bound.06a] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32.builtin = call %bound_method.loc15_34(%int_7) [template = constants.%int_7.6ae] // CHECK:STDOUT: %.loc15_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_7.6ae] // CHECK:STDOUT: %.loc15_34.2: %i32.builtin = converted %int_7, %.loc15_34.1 [template = constants.%int_7.6ae] // CHECK:STDOUT: %C.loc15: type = class_type @C, @C(constants.%int_7.6ae) [template = constants.%C.f0a] @@ -1511,11 +1538,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc15_24.3: init %C.f0a = class_init (), %.loc15_24.2 [template = constants.%C.val.654] // CHECK:STDOUT: %.loc15_24.4: ref %C.f0a = temporary %.loc15_24.2, %.loc15_24.3 // CHECK:STDOUT: %.loc15_26.1: ref %C.f0a = converted %.loc15_24.1, %.loc15_24.4 -// CHECK:STDOUT: %impl.elem0.loc15_35: %Convert.type.334 = impl_witness_access constants.%impl_witness.dfb, element0 [template = constants.%Convert.430] -// CHECK:STDOUT: %Convert.bound.loc15_35: = bound_method %.loc15_26.1, %impl.elem0.loc15_35 +// CHECK:STDOUT: %impl.elem0.loc15_35: %.e43 = impl_witness_access constants.%impl_witness.dfb, element0 [template = constants.%Convert.430] +// CHECK:STDOUT: %bound_method.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.f0a = bind_value %.loc15_26.1 -// CHECK:STDOUT: %Convert.call.loc15: init %D = call %Convert.bound.loc15_35(%.loc15_26.2) to %.loc15_35.1 +// CHECK:STDOUT: %Convert.call.loc15: init %D = call %bound_method.loc15_35(%.loc15_26.2) to %.loc15_35.1 // CHECK:STDOUT: %.loc15_35.2: init %D = converted %.loc15_26.1, %Convert.call.loc15 // CHECK:STDOUT: return %.loc15_35.2 to %return // CHECK:STDOUT: @@ -1527,7 +1554,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: return %Make.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.1(constants.%T: type, constants.%Self: %ImplicitAs.type.d62) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Convert.1(imports.%Core.import_ref.f6b058.2: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "core.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)] // CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)] diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 48869646537bf..3a38ccd53a645 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -37,10 +37,13 @@ fn G() -> i32 { // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -122,17 +125,17 @@ fn G() -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc17_43.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc17_43.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_43.1: = bound_method %int_1, %impl.elem0.loc17_43.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc17_43.1: init %i32 = call %Convert.specific_fn.loc17_43.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc17_43.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_43.1: = bound_method %int_1, %impl.elem0.loc17_43.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc17_43.1: = specific_function %bound_method.loc17_43.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc17_43.1: init %i32 = call %specific_fn.loc17_43.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_43.2: init %i32 = converted %int_1, %int.convert_checked.loc17_43.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc17_43.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc17_43.2: = bound_method %int_2, %impl.elem0.loc17_43.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc17_43.2: init %i32 = call %Convert.specific_fn.loc17_43.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc17_43.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc17_43.2: = bound_method %int_2, %impl.elem0.loc17_43.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc17_43.2: = specific_function %bound_method.loc17_43.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc17_43.2: init %i32 = call %specific_fn.loc17_43.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_43.5: init %i32 = converted %int_2, %int.convert_checked.loc17_43.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_43.6: ref %i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc17_43.7: init %i32 = initialize_from %.loc17_43.5 to %.loc17_43.6 [template = constants.%int_2.ef8] @@ -152,10 +155,10 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %result.var: ref %i32 = var result // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc22_12.2: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: assign %result.var, %.loc22_12.2 // CHECK:STDOUT: %.loc22_24: type = splice_block %i32.loc22 [template = constants.%i32] { diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index 79bf922e2ff2a..50bb0c9587a3a 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -36,10 +36,13 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %UnrelatedScopes: %UnrelatedScopes.type = struct_value () [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -111,10 +114,10 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_14.2: init %i32 = converted %int_0.loc13, %int.convert_checked.loc13 [template = constants.%int_0.6a9] // CHECK:STDOUT: assign %v.var, %.loc13_14.2 // CHECK:STDOUT: %.loc13_21: type = splice_block %i32.loc13 [template = constants.%i32] { @@ -135,10 +138,10 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_14.2: init %i32 = converted %int_1, %int.convert_checked.loc16 [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %w.var, %.loc16_14.2 // CHECK:STDOUT: %.loc16_21: type = splice_block %i32.loc16 [template = constants.%i32] { @@ -150,10 +153,10 @@ 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.5c6] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_0.loc18, %impl.elem0.loc18 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_0.loc18) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc18: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18: = bound_method %int_0.loc18, %impl.elem0.loc18 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %bound_method.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %specific_fn.loc18(%int_0.loc18) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc18_11.1: %i32 = value_of_initializer %int.convert_checked.loc18 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc18_11.2: %i32 = converted %int_0.loc18, %.loc18_11.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc18_11.2 @@ -171,10 +174,10 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_0, %impl.elem0.loc23 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc23: = bound_method %int_0, %impl.elem0.loc23 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %bound_method.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %specific_fn.loc23(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_14.2: init %i32 = converted %int_0, %int.convert_checked.loc23 [template = constants.%int_0.6a9] // CHECK:STDOUT: assign %v.var, %.loc23_14.2 // CHECK:STDOUT: %.loc23_21: type = splice_block %i32.loc23 [template = constants.%i32] { @@ -192,10 +195,10 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_1, %impl.elem0.loc26 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc26: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc26: = bound_method %int_1, %impl.elem0.loc26 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc26: = specific_function %bound_method.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %specific_fn.loc26(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc26_12.2: init %i32 = converted %int_1, %int.convert_checked.loc26 [template = constants.%int_1.5d2] // CHECK:STDOUT: assign %w.var, %.loc26_12.2 // CHECK:STDOUT: %.loc26_19: type = splice_block %i32.loc26 [template = constants.%i32] { diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index ef7e30a96678d..f8c6fc5f4a5b4 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -22,10 +22,13 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %struct_type.a.a6c: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1ba, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [template] @@ -63,10 +66,10 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc12_17.1: %struct_type.a.a6c = struct_literal (%int_3) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.822] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc12_17.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_3.822] // CHECK:STDOUT: %.loc12_17.3: %i32 = converted %int_3, %.loc12_17.2 [template = constants.%int_3.822] // CHECK:STDOUT: %struct: %struct_type.a.ba9 = struct_value (%.loc12_17.3) [template = constants.%struct] diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index da4586c6ebb24..20bda1e5fdeff 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -25,10 +25,13 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %int_15.447: Core.IntLiteral = int_value 15 [template] // CHECK:STDOUT: %int_35.c79: Core.IntLiteral = int_value 35 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.75f: = bound_method %int_15.447, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.c46: = specific_function %Convert.bound.75f, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_15.7f7: %i32 = int_value 15 [template] @@ -73,17 +76,17 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %int_15: Core.IntLiteral = int_value 15 [template = constants.%int_15.447] // CHECK:STDOUT: %int_35: Core.IntLiteral = int_value 35 [template = constants.%int_35.c79] // CHECK:STDOUT: %.loc13_17.1: %tuple.type.f94 = tuple_literal (%int_15, %int_35) -// CHECK:STDOUT: %impl.elem0.loc13_17.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_17.1: = bound_method %int_15, %impl.elem0.loc13_17.1 [template = constants.%Convert.bound.75f] -// 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.c46] -// CHECK:STDOUT: %int.convert_checked.loc13_17.1: init %i32 = call %Convert.specific_fn.loc13_17.1(%int_15) [template = constants.%int_15.7f7] +// CHECK:STDOUT: %impl.elem0.loc13_17.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_17.1: = bound_method %int_15, %impl.elem0.loc13_17.1 [template = constants.%Convert.bound.75f] +// CHECK:STDOUT: %specific_fn.loc13_17.1: = specific_function %bound_method.loc13_17.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c46] +// CHECK:STDOUT: %int.convert_checked.loc13_17.1: init %i32 = call %specific_fn.loc13_17.1(%int_15) [template = constants.%int_15.7f7] // CHECK:STDOUT: %.loc13_17.2: init %i32 = converted %int_15, %int.convert_checked.loc13_17.1 [template = constants.%int_15.7f7] // 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.7f7] -// CHECK:STDOUT: %impl.elem0.loc13_17.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc13_17.2: = bound_method %int_35, %impl.elem0.loc13_17.2 [template = constants.%Convert.bound.76a] -// 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.9b5] -// CHECK:STDOUT: %int.convert_checked.loc13_17.2: init %i32 = call %Convert.specific_fn.loc13_17.2(%int_35) [template = constants.%int_35.c78] +// CHECK:STDOUT: %impl.elem0.loc13_17.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc13_17.2: = bound_method %int_35, %impl.elem0.loc13_17.2 [template = constants.%Convert.bound.76a] +// CHECK:STDOUT: %specific_fn.loc13_17.2: = specific_function %bound_method.loc13_17.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b5] +// CHECK:STDOUT: %int.convert_checked.loc13_17.2: init %i32 = call %specific_fn.loc13_17.2(%int_35) [template = constants.%int_35.c78] // CHECK:STDOUT: %.loc13_17.4: init %i32 = converted %int_35, %int.convert_checked.loc13_17.2 [template = constants.%int_35.c78] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return, element1 // CHECK:STDOUT: %.loc13_17.5: init %i32 = initialize_from %.loc13_17.4 to %tuple.elem1 [template = constants.%int_35.c78] diff --git a/toolchain/check/testdata/return/value.carbon b/toolchain/check/testdata/return/value.carbon index a63df0e617237..5c133d2e83441 100644 --- a/toolchain/check/testdata/return/value.carbon +++ b/toolchain/check/testdata/return/value.carbon @@ -20,10 +20,13 @@ fn Main() -> i32 { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -58,10 +61,10 @@ fn Main() -> i32 { // CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.2: %i32 = converted %int_0, %.loc12_11.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc12_11.2 diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index 26c25ee178a45..99055b16bd43c 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -23,10 +23,13 @@ var y: i32 = x.b; // CHECK:STDOUT: %struct_type.a.ba9: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %struct_type.a.a6c: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.0c1, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [template] @@ -76,10 +79,10 @@ var y: i32 = x.b; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] // CHECK:STDOUT: %.loc11_27.1: %struct_type.a.a6c = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.940] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_4) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_4, %int.convert_checked [template = constants.%int_4.940] // CHECK:STDOUT: %.loc11_27.3: init %struct_type.a.ba9 = struct_init (%.loc11_27.2) to file.%x.var [template = constants.%struct] // CHECK:STDOUT: %.loc11_1: init %struct_type.a.ba9 = converted %.loc11_27.1, %.loc11_27.3 [template = constants.%struct] diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index a9b246a09665f..7034ec67e8ae9 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -60,10 +60,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %struct_type.a.ba9: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %struct_type.a.a6c: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -170,16 +173,16 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc9_28.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_28.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc9_28.1: = bound_method %int_1, %impl.elem0.loc9_28.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc9_28.1: init %i32 = call %Convert.specific_fn.loc9_28.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc9_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc9_28.1: = bound_method %int_1, %impl.elem0.loc9_28.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc9_28.1: = specific_function %bound_method.loc9_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc9_28.1: init %i32 = call %specific_fn.loc9_28.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_28.2: %i32 = value_of_initializer %int.convert_checked.loc9_28.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_28.3: %i32 = converted %int_1, %.loc9_28.2 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc9_28.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc9_28.2: = bound_method %int_2, %impl.elem0.loc9_28.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc9_28.2: init %i32 = call %Convert.specific_fn.loc9_28.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc9_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc9_28.2: = bound_method %int_2, %impl.elem0.loc9_28.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc9_28.2: = specific_function %bound_method.loc9_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc9_28.2: init %i32 = call %specific_fn.loc9_28.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_28.4: %i32 = value_of_initializer %int.convert_checked.loc9_28.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_28.5: %i32 = converted %int_2, %.loc9_28.4 [template = constants.%int_2.ef8] // CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%.loc9_28.3, %.loc9_28.5) [template = constants.%struct.ed5] @@ -211,10 +214,10 @@ 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.5c6] // CHECK:STDOUT: %.loc4_31.1: %struct_type.a.a6c = struct_literal (%int_0.loc4) -// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc4: = specific_function %Convert.bound.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc4: = specific_function %bound_method.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_31.2: init %i32 = converted %int_0.loc4, %int.convert_checked.loc4 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_31.3: init %struct_type.a.ba9 = struct_init (%.loc4_31.2) to file.%a_ref.var [template = constants.%struct.92d] // CHECK:STDOUT: %.loc4_1: init %struct_type.a.ba9 = converted %.loc4_31.1, %.loc4_31.3 [template = constants.%struct.92d] @@ -225,18 +228,18 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_29.1: %struct_type.b.c.9af = struct_literal (%int_0.loc6_17, %.loc6_28.1) // CHECK:STDOUT: %int_0.loc6_37: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // CHECK:STDOUT: %.loc6_38.1: %struct_type.a.d.b82 = struct_literal (%.loc6_29.1, %int_0.loc6_37) -// CHECK:STDOUT: %impl.elem0.loc6_29: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc6_29: = bound_method %int_0.loc6_17, %impl.elem0.loc6_29 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc6_29: = specific_function %Convert.bound.loc6_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc6_29: init %i32 = call %Convert.specific_fn.loc6_29(%int_0.loc6_17) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc6_29: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6_29: = bound_method %int_0.loc6_17, %impl.elem0.loc6_29 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc6_29: = specific_function %bound_method.loc6_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc6_29: init %i32 = call %specific_fn.loc6_29(%int_0.loc6_17) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_29.2: init %i32 = converted %int_0.loc6_17, %int.convert_checked.loc6_29 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_38.2: ref %struct_type.b.c.929 = 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.6a9] -// CHECK:STDOUT: %impl.elem0.loc6_28: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc6_28: = bound_method %int_0.loc6_26, %impl.elem0.loc6_28 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc6_28: = specific_function %Convert.bound.loc6_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6_28(%int_0.loc6_26) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc6_28: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6_28: = bound_method %int_0.loc6_26, %impl.elem0.loc6_28 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc6_28: = specific_function %bound_method.loc6_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %specific_fn.loc6_28(%int_0.loc6_26) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_28.2: init %i32 = converted %int_0.loc6_26, %int.convert_checked.loc6_28 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_29.5: ref %tuple.type.a1c = struct_access %.loc6_38.2, element1 // CHECK:STDOUT: %.loc6_28.3: init %tuple.type.a1c = tuple_init (%.loc6_28.2) to %.loc6_29.5 [template = constants.%tuple] @@ -244,10 +247,10 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_29.7: init %tuple.type.a1c = initialize_from %.loc6_29.6 to %.loc6_29.5 [template = constants.%tuple] // CHECK:STDOUT: %.loc6_29.8: init %struct_type.b.c.929 = struct_init (%.loc6_29.4, %.loc6_29.7) to %.loc6_38.2 [template = constants.%struct.381] // CHECK:STDOUT: %.loc6_38.3: init %struct_type.b.c.929 = converted %.loc6_29.1, %.loc6_29.8 [template = constants.%struct.381] -// CHECK:STDOUT: %impl.elem0.loc6_38: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc6_38: = bound_method %int_0.loc6_37, %impl.elem0.loc6_38 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc6_38: = specific_function %Convert.bound.loc6_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc6_38: init %i32 = call %Convert.specific_fn.loc6_38(%int_0.loc6_37) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc6_38: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6_38: = bound_method %int_0.loc6_37, %impl.elem0.loc6_38 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc6_38: = specific_function %bound_method.loc6_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc6_38: init %i32 = call %specific_fn.loc6_38(%int_0.loc6_37) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_38.4: init %i32 = converted %int_0.loc6_37, %int.convert_checked.loc6_38 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_38.5: ref %i32 = struct_access file.%b_ref.var, element1 // CHECK:STDOUT: %.loc6_38.6: init %i32 = initialize_from %.loc6_38.4 to %.loc6_38.5 [template = constants.%int_0.6a9] @@ -287,10 +290,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.847: = impl_witness (imports.%Implicit.import_ref.773), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [template] +// CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.dc5: = bound_method %int_1.5b8, %Convert.4cb [template] // CHECK:STDOUT: %Convert.specific_fn.51b: = specific_function %Convert.bound.dc5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [template] @@ -314,8 +320,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import_ref.a11: %struct_type.a.b.5ca = import_ref Implicit//default, loc8_9, loaded [symbolic = @C.%S (constants.%S)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1073 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1126 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -371,16 +378,16 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc6_25.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc6_25.1: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] -// CHECK:STDOUT: %Convert.bound.loc6_25.1: = bound_method %int_1, %impl.elem0.loc6_25.1 [template = constants.%Convert.bound.dc5] -// CHECK:STDOUT: %Convert.specific_fn.loc6_25.1: = specific_function %Convert.bound.loc6_25.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.51b] -// CHECK:STDOUT: %int.convert_checked.loc6_25.1: init %i32 = call %Convert.specific_fn.loc6_25.1(%int_1) [template = constants.%int_1.47b] +// CHECK:STDOUT: %impl.elem0.loc6_25.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] +// CHECK:STDOUT: %bound_method.loc6_25.1: = bound_method %int_1, %impl.elem0.loc6_25.1 [template = constants.%Convert.bound.dc5] +// CHECK:STDOUT: %specific_fn.loc6_25.1: = specific_function %bound_method.loc6_25.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.51b] +// CHECK:STDOUT: %int.convert_checked.loc6_25.1: init %i32 = call %specific_fn.loc6_25.1(%int_1) [template = constants.%int_1.47b] // CHECK:STDOUT: %.loc6_25.2: %i32 = value_of_initializer %int.convert_checked.loc6_25.1 [template = constants.%int_1.47b] // CHECK:STDOUT: %.loc6_25.3: %i32 = converted %int_1, %.loc6_25.2 [template = constants.%int_1.47b] -// CHECK:STDOUT: %impl.elem0.loc6_25.2: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] -// CHECK:STDOUT: %Convert.bound.loc6_25.2: = bound_method %int_2, %impl.elem0.loc6_25.2 [template = constants.%Convert.bound.30f] -// CHECK:STDOUT: %Convert.specific_fn.loc6_25.2: = specific_function %Convert.bound.loc6_25.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b5] -// CHECK:STDOUT: %int.convert_checked.loc6_25.2: init %i32 = call %Convert.specific_fn.loc6_25.2(%int_2) [template = constants.%int_2.d0d] +// CHECK:STDOUT: %impl.elem0.loc6_25.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] +// CHECK:STDOUT: %bound_method.loc6_25.2: = bound_method %int_2, %impl.elem0.loc6_25.2 [template = constants.%Convert.bound.30f] +// CHECK:STDOUT: %specific_fn.loc6_25.2: = specific_function %bound_method.loc6_25.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b5] +// CHECK:STDOUT: %int.convert_checked.loc6_25.2: init %i32 = call %specific_fn.loc6_25.2(%int_2) [template = constants.%int_2.d0d] // CHECK:STDOUT: %.loc6_25.4: %i32 = value_of_initializer %int.convert_checked.loc6_25.2 [template = constants.%int_2.d0d] // CHECK:STDOUT: %.loc6_25.5: %i32 = converted %int_2, %.loc6_25.4 [template = constants.%int_2.d0d] // CHECK:STDOUT: %struct: %struct_type.a.b.5ca = struct_value (%.loc6_25.3, %.loc6_25.5) [template = constants.%struct] @@ -390,7 +397,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %c: ref %C.a8a = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%S: %struct_type.a.b.5ca) [from "implicit.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.a11: %struct_type.a.b.5ca) [from "implicit.carbon"] { // CHECK:STDOUT: %S: %struct_type.a.b.5ca = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] // CHECK:STDOUT: %S.patt: %struct_type.a.b.5ca = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] // CHECK:STDOUT: @@ -488,8 +495,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import_ref.a11: %struct_type.a.b = import_ref Implicit//default, loc8_9, loaded [symbolic = @C.%S (constants.%S)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1073 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1126 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -518,7 +526,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %c_bad: = bind_name c_bad, // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%S: %struct_type.a.b) [from "implicit.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.a11: %struct_type.a.b) [from "implicit.carbon"] { // CHECK:STDOUT: %S: %struct_type.a.b = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] // CHECK:STDOUT: %S.patt: %struct_type.a.b = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] // CHECK:STDOUT: @@ -570,10 +578,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.847: = impl_witness (imports.%Implicit.import_ref.773), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [template] +// CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.a00: = bound_method %int_3.1ba, %Convert.4cb [template] // CHECK:STDOUT: %Convert.specific_fn.dec: = specific_function %Convert.bound.a00, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.d47: %i32 = int_value 3 [template] @@ -600,8 +611,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import_ref.a11: %struct_type.a.b.5ca = import_ref Implicit//default, loc8_9, loaded [symbolic = @C.%S (constants.%S)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1073 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1126 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -626,16 +638,16 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] // CHECK:STDOUT: %.loc10_29.1: %struct_type.a.b.cfd = struct_literal (%int_3, %int_4) -// CHECK:STDOUT: %impl.elem0.loc10_29.1: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] -// CHECK:STDOUT: %Convert.bound.loc10_29.1: = bound_method %int_3, %impl.elem0.loc10_29.1 [template = constants.%Convert.bound.a00] -// CHECK:STDOUT: %Convert.specific_fn.loc10_29.1: = specific_function %Convert.bound.loc10_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.dec] -// CHECK:STDOUT: %int.convert_checked.loc10_29.1: init %i32 = call %Convert.specific_fn.loc10_29.1(%int_3) [template = constants.%int_3.d47] +// CHECK:STDOUT: %impl.elem0.loc10_29.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] +// CHECK:STDOUT: %bound_method.loc10_29.1: = bound_method %int_3, %impl.elem0.loc10_29.1 [template = constants.%Convert.bound.a00] +// CHECK:STDOUT: %specific_fn.loc10_29.1: = specific_function %bound_method.loc10_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.dec] +// CHECK:STDOUT: %int.convert_checked.loc10_29.1: init %i32 = call %specific_fn.loc10_29.1(%int_3) [template = constants.%int_3.d47] // CHECK:STDOUT: %.loc10_29.2: %i32 = value_of_initializer %int.convert_checked.loc10_29.1 [template = constants.%int_3.d47] // CHECK:STDOUT: %.loc10_29.3: %i32 = converted %int_3, %.loc10_29.2 [template = constants.%int_3.d47] -// CHECK:STDOUT: %impl.elem0.loc10_29.2: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] -// CHECK:STDOUT: %Convert.bound.loc10_29.2: = bound_method %int_4, %impl.elem0.loc10_29.2 [template = constants.%Convert.bound.694] -// CHECK:STDOUT: %Convert.specific_fn.loc10_29.2: = specific_function %Convert.bound.loc10_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.739] -// CHECK:STDOUT: %int.convert_checked.loc10_29.2: init %i32 = call %Convert.specific_fn.loc10_29.2(%int_4) [template = constants.%int_4.ea3] +// CHECK:STDOUT: %impl.elem0.loc10_29.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] +// CHECK:STDOUT: %bound_method.loc10_29.2: = bound_method %int_4, %impl.elem0.loc10_29.2 [template = constants.%Convert.bound.694] +// CHECK:STDOUT: %specific_fn.loc10_29.2: = specific_function %bound_method.loc10_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.739] +// CHECK:STDOUT: %int.convert_checked.loc10_29.2: init %i32 = call %specific_fn.loc10_29.2(%int_4) [template = constants.%int_4.ea3] // CHECK:STDOUT: %.loc10_29.4: %i32 = value_of_initializer %int.convert_checked.loc10_29.2 [template = constants.%int_4.ea3] // CHECK:STDOUT: %.loc10_29.5: %i32 = converted %int_4, %.loc10_29.4 [template = constants.%int_4.ea3] // CHECK:STDOUT: %struct: %struct_type.a.b.5ca = struct_value (%.loc10_29.3, %.loc10_29.5) [template = constants.%struct.8e6] @@ -645,7 +657,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %c_bad: ref %C.5a7 = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%S: %struct_type.a.b.5ca) [from "implicit.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.a11: %struct_type.a.b.5ca) [from "implicit.carbon"] { // CHECK:STDOUT: %S: %struct_type.a.b.5ca = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] // CHECK:STDOUT: %S.patt: %struct_type.a.b.5ca = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 6a21cb9f876cd..5fa5ca8263630 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -24,10 +24,13 @@ var z: i32 = y; // CHECK:STDOUT: %float: f64 = float_literal 0 [template] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.a.b.fbb: type = struct_type {.a: f64, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -96,10 +99,10 @@ var z: i32 = y; // CHECK:STDOUT: %.loc11_46.1: %struct_type.a.b.fbb = 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.5d2] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_46.4: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_46.5: ref %i32 = struct_access file.%x.var, element1 // CHECK:STDOUT: %.loc11_46.6: init %i32 = initialize_from %.loc11_46.4 to %.loc11_46.5 [template = constants.%int_1.5d2] diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index 3f4911045025e..eeb46285aabfd 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -19,10 +19,13 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %struct_type.a.ba9: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %struct_type.a.a6c: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.0c1, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [template] @@ -73,10 +76,10 @@ var y: {.a: i32} = x; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] // CHECK:STDOUT: %.loc11_27.1: %struct_type.a.a6c = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.940] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_4) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_4, %int.convert_checked [template = constants.%int_4.940] // CHECK:STDOUT: %.loc11_27.3: init %struct_type.a.ba9 = struct_init (%.loc11_27.2) to file.%x.var [template = constants.%struct] // CHECK:STDOUT: %.loc11_1: init %struct_type.a.ba9 = converted %.loc11_27.1, %.loc11_27.3 [template = constants.%struct] diff --git a/toolchain/check/testdata/struct/partially_const.carbon b/toolchain/check/testdata/struct/partially_const.carbon index 7bde72308946b..9fa4f022e591b 100644 --- a/toolchain/check/testdata/struct/partially_const.carbon +++ b/toolchain/check/testdata/struct/partially_const.carbon @@ -22,10 +22,13 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %struct_type.a.b.c.1ee: type = struct_type {.a: Core.IntLiteral, .b: %i32, .c: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -76,19 +79,19 @@ 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.5c6] // CHECK:STDOUT: %.loc12_33.1: %struct_type.a.b.c.1ee = struct_literal (%int_0.loc12_16, %n.ref, %int_0.loc12_32) -// CHECK:STDOUT: %impl.elem0.loc12_33.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0.loc12_33.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12_33.1: = bound_method %int_0.loc12_16, %impl.elem0.loc12_33.1 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc12_33.1: = specific_function %bound_method.loc12_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc12_33.1: init %i32 = call %specific_fn.loc12_33.1(%int_0.loc12_16) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_33.2: init %i32 = converted %int_0.loc12_16, %int.convert_checked.loc12_33.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_33.3: ref %i32 = struct_access %return, element0 // CHECK:STDOUT: %.loc12_33.4: init %i32 = initialize_from %.loc12_33.2 to %.loc12_33.3 [template = constants.%int_0.6a9] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0.loc12_33.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12_33.2: = bound_method %int_0.loc12_32, %impl.elem0.loc12_33.2 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc12_33.2: = specific_function %bound_method.loc12_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc12_33.2: init %i32 = call %specific_fn.loc12_33.2(%int_0.loc12_32) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_33.7: init %i32 = converted %int_0.loc12_32, %int.convert_checked.loc12_33.2 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_33.8: ref %i32 = struct_access %return, element2 // CHECK:STDOUT: %.loc12_33.9: init %i32 = initialize_from %.loc12_33.7 to %.loc12_33.8 [template = constants.%int_0.6a9] diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index d0fa6c31ee2d2..4e2c8ffec9266 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -23,10 +23,13 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %struct_type.a.b.057: type = struct_type {.a: Core.IntLiteral, .b: %tuple.type.985} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -91,17 +94,17 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc11_49.1: %tuple.type.985 = tuple_literal (%int_2) // CHECK:STDOUT: %.loc11_50.1: %struct_type.a.b.057 = struct_literal (%int_1, %.loc11_49.1) -// CHECK:STDOUT: %impl.elem0.loc11_50: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_50: = bound_method %int_1, %impl.elem0.loc11_50 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc11_50: = specific_function %Convert.bound.loc11_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_50: init %i32 = call %Convert.specific_fn.loc11_50(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc11_50: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_50: = bound_method %int_1, %impl.elem0.loc11_50 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11_50: = specific_function %bound_method.loc11_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc11_50: init %i32 = call %specific_fn.loc11_50(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_50.2: init %i32 = converted %int_1, %int.convert_checked.loc11_50 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc11_49: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_49: = bound_method %int_2, %impl.elem0.loc11_49 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc11_49: = specific_function %Convert.bound.loc11_49, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc11_49: init %i32 = call %Convert.specific_fn.loc11_49(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc11_49: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_49: = bound_method %int_2, %impl.elem0.loc11_49 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_49: = specific_function %bound_method.loc11_49, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc11_49: init %i32 = call %specific_fn.loc11_49(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_49.2: init %i32 = converted %int_2, %int.convert_checked.loc11_49 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_50.5: ref %tuple.type.a1c = struct_access file.%x.var, element1 // CHECK:STDOUT: %.loc11_49.3: init %tuple.type.a1c = tuple_init (%.loc11_49.2) to %.loc11_50.5 [template = constants.%tuple] diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index 7d8c2ae5f1363..d7a5be9b12361 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -23,10 +23,13 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -64,16 +67,16 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %i32.loc11_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b.loc11: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.501] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc11_44.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_44.1: = bound_method @__global_init.%int_1.loc11, %impl.elem0.loc11_44.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_44.1: init %i32 = call %Convert.specific_fn.loc11_44.1(@__global_init.%int_1.loc11) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc11_44.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_44.1: = bound_method @__global_init.%int_1.loc11, %impl.elem0.loc11_44.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11_44.1: = specific_function %bound_method.loc11_44.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc11_44.1: init %i32 = call %specific_fn.loc11_44.1(@__global_init.%int_1.loc11) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_44.1: %i32 = value_of_initializer %int.convert_checked.loc11_44.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_44.2: %i32 = converted @__global_init.%int_1.loc11, %.loc11_44.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc11_44.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_44.2: = bound_method @__global_init.%int_2.loc11, %impl.elem0.loc11_44.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc11_44.2: init %i32 = call %Convert.specific_fn.loc11_44.2(@__global_init.%int_2.loc11) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc11_44.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_44.2: = bound_method @__global_init.%int_2.loc11, %impl.elem0.loc11_44.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_44.2: = specific_function %bound_method.loc11_44.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc11_44.2: init %i32 = call %specific_fn.loc11_44.2(@__global_init.%int_2.loc11) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_44.3: %i32 = value_of_initializer %int.convert_checked.loc11_44.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_44.4: %i32 = converted @__global_init.%int_2.loc11, %.loc11_44.3 [template = constants.%int_2.ef8] // CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%.loc11_44.2, %.loc11_44.4) [template = constants.%struct] @@ -127,17 +130,17 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc14_44.1: %struct_type.a.b.cfd = struct_literal (%int_1.loc14, %int_2.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_44.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_44.1: = bound_method %int_1.loc14, %impl.elem0.loc14_44.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_44.1: init %i32 = call %Convert.specific_fn.loc14_44.1(%int_1.loc14) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc14_44.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_44.1: = bound_method %int_1.loc14, %impl.elem0.loc14_44.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14_44.1: = specific_function %bound_method.loc14_44.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc14_44.1: init %i32 = call %specific_fn.loc14_44.1(%int_1.loc14) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_44.2: init %i32 = converted %int_1.loc14, %int.convert_checked.loc14_44.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc14_44.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_44.2: = bound_method %int_2.loc14, %impl.elem0.loc14_44.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc14_44.2: init %i32 = call %Convert.specific_fn.loc14_44.2(%int_2.loc14) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc14_44.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_44.2: = bound_method %int_2.loc14, %impl.elem0.loc14_44.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_44.2: = specific_function %bound_method.loc14_44.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc14_44.2: init %i32 = call %specific_fn.loc14_44.2(%int_2.loc14) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_44.5: init %i32 = converted %int_2.loc14, %int.convert_checked.loc14_44.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_44.6: ref %i32 = struct_access file.%x.var, element1 // CHECK:STDOUT: %.loc14_44.7: init %i32 = initialize_from %.loc14_44.5 to %.loc14_44.6 [template = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/tuple/access/element_access.carbon b/toolchain/check/testdata/tuple/access/element_access.carbon index 597febf4ca1af..1bae4e8fab563 100644 --- a/toolchain/check/testdata/tuple/access/element_access.carbon +++ b/toolchain/check/testdata/tuple/access/element_access.carbon @@ -21,10 +21,13 @@ var c: i32 = b.0; // CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -89,10 +92,10 @@ var c: i32 = b.0; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.985 = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.1e1] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_21.2: init %i32 = converted %int_12, %int.convert_checked [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_21.3: init %tuple.type.a1c = tuple_init (%.loc11_21.2) to file.%a.var [template = constants.%tuple] // CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_21.1, %.loc11_21.3 [template = constants.%tuple] diff --git a/toolchain/check/testdata/tuple/access/fail_access_error.carbon b/toolchain/check/testdata/tuple/access/fail_access_error.carbon index d0b7b4765a1cc..21b2fc953bd34 100644 --- a/toolchain/check/testdata/tuple/access/fail_access_error.carbon +++ b/toolchain/check/testdata/tuple/access/fail_access_error.carbon @@ -25,10 +25,13 @@ var b: i32 = a.(oops); // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -85,17 +88,17 @@ var b: i32 = a.(oops); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.462] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221] -// 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.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.1e1] // 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.1e1] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9] -// 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.631] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [template = constants.%int_6.e56] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [template = constants.%int_6.e56] diff --git a/toolchain/check/testdata/tuple/access/fail_large_index.carbon b/toolchain/check/testdata/tuple/access/fail_large_index.carbon index 1a0c9e7170efa..51e44f869c518 100644 --- a/toolchain/check/testdata/tuple/access/fail_large_index.carbon +++ b/toolchain/check/testdata/tuple/access/fail_large_index.carbon @@ -30,10 +30,13 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -110,10 +113,10 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.985 = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.1e1] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_21.2: init %i32 = converted %int_12, %int.convert_checked [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_21.3: init %tuple.type.a1c = tuple_init (%.loc11_21.2) to file.%a.var [template = constants.%tuple] // CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_21.1, %.loc11_21.3 [template = constants.%tuple] diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index d4174e75ff79e..9860111686670 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -25,10 +25,14 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -39,6 +43,8 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template] // CHECK:STDOUT: %impl_witness.0f6: = impl_witness (imports.%Core.import_ref.c15) [template] // CHECK:STDOUT: %Op.type.e42: type = fn_type @Op.13 [template] +// CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value Core.IntLiteral, %impl_witness.0f6 [template] +// CHECK:STDOUT: %.45d: type = fn_type_with_self_type %Op.type.e42, %Negate.facet [template] // CHECK:STDOUT: %Op.type.1be: type = fn_type @Op.14 [template] // CHECK:STDOUT: %Op.bba: %Op.type.1be = struct_value () [template] // CHECK:STDOUT: %Op.bound: = bound_method %int_10, %Op.bba [template] @@ -93,17 +99,17 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.462] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221] -// 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.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.1e1] // 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.1e1] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9] -// 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.631] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [template = constants.%int_6.e56] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [template = constants.%int_6.e56] @@ -112,9 +118,9 @@ var b: i32 = a.(-10); // CHECK:STDOUT: assign file.%a.var, %.loc11_1 // CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10] -// CHECK:STDOUT: %impl.elem0.loc16: %Op.type.e42 = impl_witness_access constants.%impl_witness.0f6, element0 [template = constants.%Op.bba] -// CHECK:STDOUT: %Op.bound: = bound_method %int_10, %impl.elem0.loc16 [template = constants.%Op.bound] -// CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %Op.bound(%int_10) [template = constants.%int_-10] +// CHECK:STDOUT: %impl.elem0.loc16: %.45d = impl_witness_access constants.%impl_witness.0f6, element0 [template = constants.%Op.bba] +// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_10, %impl.elem0.loc16 [template = constants.%Op.bound] +// CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %bound_method.loc16(%int_10) [template = constants.%int_-10] // CHECK:STDOUT: %.loc16_17.1: Core.IntLiteral = value_of_initializer %int.snegate [template = constants.%int_-10] // CHECK:STDOUT: %.loc16_17.2: Core.IntLiteral = converted %int.snegate, %.loc16_17.1 [template = constants.%int_-10] // CHECK:STDOUT: assign file.%b.var, 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 b97a8c0dd5f09..6146616025ecf 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon @@ -26,10 +26,13 @@ var c: i32 = a.(b); // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template] @@ -101,17 +104,17 @@ var c: i32 = a.(b); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc11_26.1: %tuple.type.f94 = tuple_literal (%int_2, %int_3) -// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_2, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_26.1: = bound_method %int_2, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_26.1: = specific_function %bound_method.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %specific_fn.loc11_26.1(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_26.2: init %i32 = converted %int_2, %int.convert_checked.loc11_26.1 [template = constants.%int_2.ef8] // 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_3, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_26.2: = bound_method %int_3, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc11_26.2: = specific_function %bound_method.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %specific_fn.loc11_26.2(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc11_26.4: init %i32 = converted %int_3, %int.convert_checked.loc11_26.2 [template = constants.%int_3.822] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_26.5: init %i32 = initialize_from %.loc11_26.4 to %tuple.elem1 [template = constants.%int_3.822] @@ -119,10 +122,10 @@ var c: i32 = a.(b); // CHECK:STDOUT: %.loc11_1: init %tuple.type.d07 = converted %.loc11_26.1, %.loc11_26.6 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_1 // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_0, %impl.elem0.loc12 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_0, %impl.elem0.loc12 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12: init %i32 = converted %int_0, %int.convert_checked.loc12 [template = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%b.var, %.loc12 // CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a 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 fc8c72367e4f6..506da64004f81 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -28,10 +28,13 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -89,17 +92,17 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.462] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221] -// 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.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.1e1] // 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.1e1] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9] -// 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.631] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [template = constants.%int_6.e56] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [template = constants.%int_6.e56] 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 af5d7ab81289b..c861b506604a8 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -36,10 +36,13 @@ fn Main() { // CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [template] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.64b, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [template] @@ -77,18 +80,18 @@ fn Main() { // CHECK:STDOUT: %int_5.loc18_30: Core.IntLiteral = int_value 5 [template = constants.%int_5.64b] // CHECK:STDOUT: %int_5.loc18_33: Core.IntLiteral = int_value 5 [template = constants.%int_5.64b] // 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.0f6] +// CHECK:STDOUT: %impl.elem0.loc18_34.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18_34.1: = bound_method %int_5.loc18_30, %impl.elem0.loc18_34.1 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc18_34.1: = specific_function %bound_method.loc18_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc18_34.1: init %i32 = call %specific_fn.loc18_34.1(%int_5.loc18_30) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc18_34.2: init %i32 = converted %int_5.loc18_30, %int.convert_checked.loc18_34.1 [template = constants.%int_5.0f6] // 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.0f6] -// CHECK:STDOUT: %impl.elem0.loc18_34.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.0f6] +// CHECK:STDOUT: %impl.elem0.loc18_34.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18_34.2: = bound_method %int_5.loc18_33, %impl.elem0.loc18_34.2 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc18_34.2: = specific_function %bound_method.loc18_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc18_34.2: init %i32 = call %specific_fn.loc18_34.2(%int_5.loc18_33) [template = constants.%int_5.0f6] // CHECK:STDOUT: %.loc18_34.5: init %i32 = converted %int_5.loc18_33, %int.convert_checked.loc18_34.2 [template = constants.%int_5.0f6] // CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %.loc18_34.6: ref %i32 = array_index %non_tuple.var, %int_1.loc18 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 b3cb8d1afbcb5..1842e5745441a 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 @@ -25,10 +25,13 @@ var b: i32 = a.2; // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -86,17 +89,17 @@ var b: i32 = a.2; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.462] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221] -// 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.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.1e1] // 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.1e1] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9] -// 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.631] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [template = constants.%int_6.e56] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [template = constants.%int_6.e56] 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 2892b85bc266f..51ace958d9b85 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 @@ -25,10 +25,13 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_34.3f9: Core.IntLiteral = int_value 34 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -88,17 +91,17 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3] // CHECK:STDOUT: %int_34: Core.IntLiteral = int_value 34 [template = constants.%int_34.3f9] // CHECK:STDOUT: %.loc11_28.1: %tuple.type.f94 = tuple_literal (%int_12, %int_34) -// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_28.1: = bound_method %int_12, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.221] -// 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.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %Convert.specific_fn.loc11_28.1(%int_12) [template = constants.%int_12.1e1] +// CHECK:STDOUT: %impl.elem0.loc11_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_28.1: = bound_method %int_12, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc11_28.1: = specific_function %bound_method.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] +// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %specific_fn.loc11_28.1(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_28.2: init %i32 = converted %int_12, %int.convert_checked.loc11_28.1 [template = constants.%int_12.1e1] // 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.1e1] -// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_28.2: = bound_method %int_34, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.82c] -// 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.6d4] -// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %Convert.specific_fn.loc11_28.2(%int_34) [template = constants.%int_34.980] +// CHECK:STDOUT: %impl.elem0.loc11_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_28.2: = bound_method %int_34, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.82c] +// CHECK:STDOUT: %specific_fn.loc11_28.2: = specific_function %bound_method.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6d4] +// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %specific_fn.loc11_28.2(%int_34) [template = constants.%int_34.980] // CHECK:STDOUT: %.loc11_28.4: init %i32 = converted %int_34, %int.convert_checked.loc11_28.2 [template = constants.%int_34.980] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_28.5: init %i32 = initialize_from %.loc11_28.4 to %tuple.elem1 [template = constants.%int_34.980] diff --git a/toolchain/check/testdata/tuple/access/index_not_literal.carbon b/toolchain/check/testdata/tuple/access/index_not_literal.carbon index 68c91c37d0bb0..74d334d6de739 100644 --- a/toolchain/check/testdata/tuple/access/index_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/index_not_literal.carbon @@ -25,11 +25,15 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_34.3f9: Core.IntLiteral = int_value 34 [template] // CHECK:STDOUT: %tuple.type.3c2: type = tuple_type (bool, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [template] // CHECK:STDOUT: %Convert.bound.82c: = bound_method %int_34.3f9, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.6d4: = specific_function %Convert.bound.82c, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_34.980: %i32 = int_value 34 [template] @@ -38,16 +42,21 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %struct_type.index.b1b: type = struct_type {.index: Core.IntLiteral} [template] // CHECK:STDOUT: %struct.972: %struct_type.index.b1b = struct_value (%int_1.5b8) [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [template] // CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.4, @As(%i32) [template] // CHECK:STDOUT: %impl_witness.882: = impl_witness (imports.%Core.import_ref.78a), @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template] +// CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [template] +// CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [template] // CHECK:STDOUT: %Convert.bound.129: = bound_method %int_0.5c6, %Convert.197 [template] // CHECK:STDOUT: %Convert.specific_fn.dc5: = specific_function %Convert.bound.129, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [template] +// CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [template] // CHECK:STDOUT: %Convert.bound.0fd: = bound_method %int_0.6a9, %Convert.960 [template] // CHECK:STDOUT: %Convert.specific_fn.f3f: = specific_function %Convert.bound.0fd, @Convert.3(%int_32) [template] // CHECK:STDOUT: %Convert.bound.c1b: = bound_method %int_1.5b8, %Convert.197 [template] @@ -134,10 +143,10 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %.loc11_31.1: %tuple.type.3c2 = 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.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_34, %impl.elem0.loc11 [template = constants.%Convert.bound.82c] -// CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6d4] -// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_34) [template = constants.%int_34.980] +// CHECK:STDOUT: %impl.elem0.loc11: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11: = bound_method %int_34, %impl.elem0.loc11 [template = constants.%Convert.bound.82c] +// CHECK:STDOUT: %specific_fn.loc11: = specific_function %bound_method.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6d4] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %specific_fn.loc11(%int_34) [template = constants.%int_34.980] // CHECK:STDOUT: %.loc11_31.3: init %i32 = converted %int_34, %int.convert_checked.loc11 [template = constants.%int_34.980] // CHECK:STDOUT: %tuple.elem1.loc11: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_31.4: init %i32 = initialize_from %.loc11_31.3 to %tuple.elem1.loc11 [template = constants.%int_34.980] @@ -157,16 +166,16 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // 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.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] -// CHECK:STDOUT: %Convert.bound.loc13_20.1: = bound_method %int_0, %impl.elem0.loc13_20.1 [template = constants.%Convert.bound.129] -// 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.dc5] -// CHECK:STDOUT: %int.convert_checked.loc13_20.1: init %i32 = call %Convert.specific_fn.loc13_20.1(%int_0) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc13_20.1: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] +// CHECK:STDOUT: %bound_method.loc13_20.1: = bound_method %int_0, %impl.elem0.loc13_20.1 [template = constants.%Convert.bound.129] +// CHECK:STDOUT: %specific_fn.loc13_20.1: = specific_function %bound_method.loc13_20.1, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.dc5] +// CHECK:STDOUT: %int.convert_checked.loc13_20.1: init %i32 = call %specific_fn.loc13_20.1(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_0, %.loc13_20.1 [template = constants.%int_0.6a9] -// CHECK:STDOUT: %impl.elem0.loc13_20.2: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] -// CHECK:STDOUT: %Convert.bound.loc13_20.2: = bound_method %.loc13_20.2, %impl.elem0.loc13_20.2 [template = constants.%Convert.bound.0fd] -// 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.f3f] -// 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.5c6] +// CHECK:STDOUT: %impl.elem0.loc13_20.2: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] +// CHECK:STDOUT: %bound_method.loc13_20.2: = bound_method %.loc13_20.2, %impl.elem0.loc13_20.2 [template = constants.%Convert.bound.0fd] +// CHECK:STDOUT: %specific_fn.loc13_20.2: = specific_function %bound_method.loc13_20.2, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.f3f] +// CHECK:STDOUT: %int.convert_checked.loc13_20.2: init Core.IntLiteral = call %specific_fn.loc13_20.2(%.loc13_20.2) [template = constants.%int_0.5c6] // CHECK:STDOUT: %.loc13_20.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_20.2 [template = constants.%int_0.5c6] // CHECK:STDOUT: %.loc13_20.4: Core.IntLiteral = converted %.loc13_20.2, %.loc13_20.3 [template = constants.%int_0.5c6] // CHECK:STDOUT: %tuple.elem0.loc13: ref bool = tuple_access %a.ref.loc13, element0 @@ -176,20 +185,20 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // 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.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] -// CHECK:STDOUT: %Convert.bound.loc14_29: = bound_method %int_1.loc14, %impl.elem0.loc14_29 [template = constants.%Convert.bound.c1b] -// CHECK:STDOUT: %Convert.specific_fn.loc14_29: = specific_function %Convert.bound.loc14_29, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.f9a] -// CHECK:STDOUT: %int.convert_checked.loc14_29: init %i32 = call %Convert.specific_fn.loc14_29(%int_1.loc14) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc14_29: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] +// CHECK:STDOUT: %bound_method.loc14_29: = bound_method %int_1.loc14, %impl.elem0.loc14_29 [template = constants.%Convert.bound.c1b] +// CHECK:STDOUT: %specific_fn.loc14_29: = specific_function %bound_method.loc14_29, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.f9a] +// CHECK:STDOUT: %int.convert_checked.loc14_29: init %i32 = call %specific_fn.loc14_29(%int_1.loc14) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_29.1: %i32 = value_of_initializer %int.convert_checked.loc14_29 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_29.2: %i32 = converted %int_1.loc14, %.loc14_29.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_35.1: %struct_type.index.6ea = struct_literal (%.loc14_29.2) // CHECK:STDOUT: %struct.loc14: %struct_type.index.6ea = struct_value (%.loc14_29.2) [template = constants.%struct.63a] // CHECK:STDOUT: %.loc14_35.2: %struct_type.index.6ea = converted %.loc14_35.1, %struct.loc14 [template = constants.%struct.63a] // CHECK:STDOUT: %.loc14_36.1: %i32 = struct_access %.loc14_35.2, element0 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc14_36: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] -// CHECK:STDOUT: %Convert.bound.loc14_36: = bound_method %.loc14_36.1, %impl.elem0.loc14_36 [template = constants.%Convert.bound.faf] -// CHECK:STDOUT: %Convert.specific_fn.loc14_36: = specific_function %Convert.bound.loc14_36, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.a84] -// CHECK:STDOUT: %int.convert_checked.loc14_36: init Core.IntLiteral = call %Convert.specific_fn.loc14_36(%.loc14_36.1) [template = constants.%int_1.5b8] +// CHECK:STDOUT: %impl.elem0.loc14_36: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960] +// CHECK:STDOUT: %bound_method.loc14_36: = bound_method %.loc14_36.1, %impl.elem0.loc14_36 [template = constants.%Convert.bound.faf] +// CHECK:STDOUT: %specific_fn.loc14_36: = specific_function %bound_method.loc14_36, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.a84] +// CHECK:STDOUT: %int.convert_checked.loc14_36: init Core.IntLiteral = call %specific_fn.loc14_36(%.loc14_36.1) [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc14_36.2: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_36 [template = constants.%int_1.5b8] // CHECK:STDOUT: %.loc14_36.3: Core.IntLiteral = converted %.loc14_36.1, %.loc14_36.2 [template = constants.%int_1.5b8] // CHECK:STDOUT: %tuple.elem1.loc14: ref %i32 = tuple_access %a.ref.loc14, element1 diff --git a/toolchain/check/testdata/tuple/access/return_value_access.carbon b/toolchain/check/testdata/tuple/access/return_value_access.carbon index d7c46ca9e0dda..13efe05bed092 100644 --- a/toolchain/check/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/check/testdata/tuple/access/return_value_access.carbon @@ -25,10 +25,13 @@ fn Run() -> i32 { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -81,10 +84,10 @@ fn Run() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.985 = tuple_literal (%int_0) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.6a9] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_30.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_30.3: %i32 = converted %int_0, %.loc11_30.2 [template = constants.%int_0.6a9] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc11_30.3) [template = constants.%tuple] diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index a5f5f62fd62b0..ce57964f81184 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -27,10 +27,13 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [template] // CHECK:STDOUT: %tuple.type.2c1: type = tuple_type (Core.IntLiteral, f64) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template] @@ -72,10 +75,10 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [template = constants.%float] // CHECK:STDOUT: %.loc18_30.1: %tuple.type.2c1 = tuple_literal (%int_2, %float) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.ef8] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_30.2: init %i32 = converted %int_2, %int.convert_checked [template = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%x.var, element0 // CHECK:STDOUT: %.loc18_30.3: init %i32 = initialize_from %.loc18_30.2 to %tuple.elem0 [template = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index b44565ce0dbde..dfe182d9b7aab 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -63,10 +63,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template] @@ -185,16 +188,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc9_18.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_18.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc9_18.1: = bound_method %int_1, %impl.elem0.loc9_18.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %Convert.specific_fn.loc9_18.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc9_18.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc9_18.1: = bound_method %int_1, %impl.elem0.loc9_18.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc9_18.1: = specific_function %bound_method.loc9_18.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %specific_fn.loc9_18.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_18.2: %i32 = value_of_initializer %int.convert_checked.loc9_18.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_18.3: %i32 = converted %int_1, %.loc9_18.2 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc9_18.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc9_18.2: = bound_method %int_2, %impl.elem0.loc9_18.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %Convert.specific_fn.loc9_18.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc9_18.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc9_18.2: = bound_method %int_2, %impl.elem0.loc9_18.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc9_18.2: = specific_function %bound_method.loc9_18.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %specific_fn.loc9_18.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_18.4: %i32 = value_of_initializer %int.convert_checked.loc9_18.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_18.5: %i32 = converted %int_2, %.loc9_18.4 [template = constants.%int_2.ef8] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc9_18.3, %.loc9_18.5) [template = constants.%tuple.21c] @@ -226,10 +229,10 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] // CHECK:STDOUT: %.loc4_24.1: %tuple.type.985 = tuple_literal (%int_0.loc4) -// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc4: = specific_function %Convert.bound.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc4: = specific_function %bound_method.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_24.2: init %i32 = converted %int_0.loc4, %int.convert_checked.loc4 [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_24.3: init %tuple.type.a1c = tuple_init (%.loc4_24.2) to file.%a_ref.var [template = constants.%tuple.592] // CHECK:STDOUT: %.loc4_1: init %tuple.type.a1c = converted %.loc4_24.1, %.loc4_24.3 [template = constants.%tuple.592] @@ -242,37 +245,37 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %.loc5_59.1: %tuple.type.f94 = tuple_literal (%int_2, %int_3) // CHECK:STDOUT: %.loc5_60.1: %tuple.type.d47 = tuple_literal (%.loc5_51.1, %.loc5_59.1) -// CHECK:STDOUT: %impl.elem0.loc5_47: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc5_47: = bound_method %int_0.loc5, %impl.elem0.loc5_47 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc5_47: = specific_function %Convert.bound.loc5_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %Convert.specific_fn.loc5_47(%int_0.loc5) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc5_47: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc5_47: = bound_method %int_0.loc5, %impl.elem0.loc5_47 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc5_47: = specific_function %bound_method.loc5_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %specific_fn.loc5_47(%int_0.loc5) [template = constants.%int_0.6a9] // CHECK:STDOUT: %.loc5_47.2: init %i32 = converted %int_0.loc5, %int.convert_checked.loc5_47 [template = constants.%int_0.6a9] // CHECK:STDOUT: %tuple.elem0.loc5_60: ref %tuple.type.fe6 = tuple_access file.%b_ref.var, element0 // CHECK:STDOUT: %tuple.elem0.loc5_51: ref %tuple.type.a1c = tuple_access %tuple.elem0.loc5_60, element0 // CHECK:STDOUT: %.loc5_47.3: init %tuple.type.a1c = tuple_init (%.loc5_47.2) to %tuple.elem0.loc5_51 [template = constants.%tuple.592] // CHECK:STDOUT: %.loc5_51.2: init %tuple.type.a1c = converted %.loc5_47.1, %.loc5_47.3 [template = constants.%tuple.592] // CHECK:STDOUT: %.loc5_51.3: init %tuple.type.a1c = initialize_from %.loc5_51.2 to %tuple.elem0.loc5_51 [template = constants.%tuple.592] -// CHECK:STDOUT: %impl.elem0.loc5_51: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc5_51: = bound_method %int_1, %impl.elem0.loc5_51 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc5_51: = specific_function %Convert.bound.loc5_51, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %Convert.specific_fn.loc5_51(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc5_51: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc5_51: = bound_method %int_1, %impl.elem0.loc5_51 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc5_51: = specific_function %bound_method.loc5_51, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %specific_fn.loc5_51(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc5_51.4: init %i32 = converted %int_1, %int.convert_checked.loc5_51 [template = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem1.loc5_51: ref %i32 = tuple_access %tuple.elem0.loc5_60, element1 // CHECK:STDOUT: %.loc5_51.5: init %i32 = initialize_from %.loc5_51.4 to %tuple.elem1.loc5_51 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc5_51.6: init %tuple.type.fe6 = tuple_init (%.loc5_51.3, %.loc5_51.5) to %tuple.elem0.loc5_60 [template = constants.%tuple.236] // CHECK:STDOUT: %.loc5_60.2: init %tuple.type.fe6 = converted %.loc5_51.1, %.loc5_51.6 [template = constants.%tuple.236] -// CHECK:STDOUT: %impl.elem0.loc5_59.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc5_59.1: = bound_method %int_2, %impl.elem0.loc5_59.1 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %Convert.specific_fn.loc5_59.1(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc5_59.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc5_59.1: = bound_method %int_2, %impl.elem0.loc5_59.1 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc5_59.1: = specific_function %bound_method.loc5_59.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %specific_fn.loc5_59.1(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc5_59.2: init %i32 = converted %int_2, %int.convert_checked.loc5_59.1 [template = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc5_60: ref %tuple.type.d07 = 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.ef8] -// CHECK:STDOUT: %impl.elem0.loc5_59.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc5_59.2: = bound_method %int_3, %impl.elem0.loc5_59.2 [template = constants.%Convert.bound.b30] -// 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.b42] -// CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %Convert.specific_fn.loc5_59.2(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc5_59.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc5_59.2: = bound_method %int_3, %impl.elem0.loc5_59.2 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc5_59.2: = specific_function %bound_method.loc5_59.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %specific_fn.loc5_59.2(%int_3) [template = constants.%int_3.822] // CHECK:STDOUT: %.loc5_59.4: init %i32 = converted %int_3, %int.convert_checked.loc5_59.2 [template = constants.%int_3.822] // CHECK:STDOUT: %tuple.elem1.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element1 // CHECK:STDOUT: %.loc5_59.5: init %i32 = initialize_from %.loc5_59.4 to %tuple.elem1.loc5_59 [template = constants.%int_3.822] @@ -316,10 +319,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.847: = impl_witness (imports.%Implicit.import_ref.773), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [template] +// CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.dc5: = bound_method %int_1.5b8, %Convert.4cb [template] // CHECK:STDOUT: %Convert.specific_fn.51b: = specific_function %Convert.bound.dc5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [template] @@ -343,8 +349,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import_ref.554: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1108 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1161 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -407,16 +414,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc6_15.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc6_15.1: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] -// CHECK:STDOUT: %Convert.bound.loc6_15.1: = bound_method %int_1, %impl.elem0.loc6_15.1 [template = constants.%Convert.bound.dc5] -// CHECK:STDOUT: %Convert.specific_fn.loc6_15.1: = specific_function %Convert.bound.loc6_15.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.51b] -// CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %Convert.specific_fn.loc6_15.1(%int_1) [template = constants.%int_1.47b] +// CHECK:STDOUT: %impl.elem0.loc6_15.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] +// CHECK:STDOUT: %bound_method.loc6_15.1: = bound_method %int_1, %impl.elem0.loc6_15.1 [template = constants.%Convert.bound.dc5] +// CHECK:STDOUT: %specific_fn.loc6_15.1: = specific_function %bound_method.loc6_15.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.51b] +// CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %specific_fn.loc6_15.1(%int_1) [template = constants.%int_1.47b] // CHECK:STDOUT: %.loc6_15.2: %i32 = value_of_initializer %int.convert_checked.loc6_15.1 [template = constants.%int_1.47b] // CHECK:STDOUT: %.loc6_15.3: %i32 = converted %int_1, %.loc6_15.2 [template = constants.%int_1.47b] -// CHECK:STDOUT: %impl.elem0.loc6_15.2: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] -// CHECK:STDOUT: %Convert.bound.loc6_15.2: = bound_method %int_2, %impl.elem0.loc6_15.2 [template = constants.%Convert.bound.30f] -// CHECK:STDOUT: %Convert.specific_fn.loc6_15.2: = specific_function %Convert.bound.loc6_15.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b5] -// CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %Convert.specific_fn.loc6_15.2(%int_2) [template = constants.%int_2.d0d] +// CHECK:STDOUT: %impl.elem0.loc6_15.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] +// CHECK:STDOUT: %bound_method.loc6_15.2: = bound_method %int_2, %impl.elem0.loc6_15.2 [template = constants.%Convert.bound.30f] +// CHECK:STDOUT: %specific_fn.loc6_15.2: = specific_function %bound_method.loc6_15.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b5] +// CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %specific_fn.loc6_15.2(%int_2) [template = constants.%int_2.d0d] // CHECK:STDOUT: %.loc6_15.4: %i32 = value_of_initializer %int.convert_checked.loc6_15.2 [template = constants.%int_2.d0d] // CHECK:STDOUT: %.loc6_15.5: %i32 = converted %int_2, %.loc6_15.4 [template = constants.%int_2.d0d] // CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%.loc6_15.3, %.loc6_15.5) [template = constants.%tuple] @@ -426,7 +433,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %c: ref %C.cf0 = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%X: %tuple.type.c2c) [from "implicit.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.554: %tuple.type.c2c) [from "implicit.carbon"] { // CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)] // CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)] // CHECK:STDOUT: @@ -533,8 +540,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import_ref.554: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1108 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1161 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -564,7 +572,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %c_bad: = bind_name c_bad, // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%X: %tuple.type.c2c) [from "implicit.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.554: %tuple.type.c2c) [from "implicit.carbon"] { // CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)] // CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)] // CHECK:STDOUT: @@ -616,10 +624,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.847: = impl_witness (imports.%Implicit.import_ref.773), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [template] +// CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.a00: = bound_method %int_3.1ba, %Convert.4cb [template] // CHECK:STDOUT: %Convert.specific_fn.dec: = specific_function %Convert.bound.a00, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.d47: %i32 = int_value 3 [template] @@ -646,8 +657,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import_ref.554: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1108 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1161 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -672,16 +684,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] // CHECK:STDOUT: %.loc11_19.1: %tuple.type.f94 = tuple_literal (%int_3, %int_4) -// CHECK:STDOUT: %impl.elem0.loc11_19.1: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] -// CHECK:STDOUT: %Convert.bound.loc11_19.1: = bound_method %int_3, %impl.elem0.loc11_19.1 [template = constants.%Convert.bound.a00] -// CHECK:STDOUT: %Convert.specific_fn.loc11_19.1: = specific_function %Convert.bound.loc11_19.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.dec] -// CHECK:STDOUT: %int.convert_checked.loc11_19.1: init %i32 = call %Convert.specific_fn.loc11_19.1(%int_3) [template = constants.%int_3.d47] +// CHECK:STDOUT: %impl.elem0.loc11_19.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] +// CHECK:STDOUT: %bound_method.loc11_19.1: = bound_method %int_3, %impl.elem0.loc11_19.1 [template = constants.%Convert.bound.a00] +// CHECK:STDOUT: %specific_fn.loc11_19.1: = specific_function %bound_method.loc11_19.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.dec] +// CHECK:STDOUT: %int.convert_checked.loc11_19.1: init %i32 = call %specific_fn.loc11_19.1(%int_3) [template = constants.%int_3.d47] // CHECK:STDOUT: %.loc11_19.2: %i32 = value_of_initializer %int.convert_checked.loc11_19.1 [template = constants.%int_3.d47] // CHECK:STDOUT: %.loc11_19.3: %i32 = converted %int_3, %.loc11_19.2 [template = constants.%int_3.d47] -// CHECK:STDOUT: %impl.elem0.loc11_19.2: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] -// CHECK:STDOUT: %Convert.bound.loc11_19.2: = bound_method %int_4, %impl.elem0.loc11_19.2 [template = constants.%Convert.bound.694] -// CHECK:STDOUT: %Convert.specific_fn.loc11_19.2: = specific_function %Convert.bound.loc11_19.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.739] -// CHECK:STDOUT: %int.convert_checked.loc11_19.2: init %i32 = call %Convert.specific_fn.loc11_19.2(%int_4) [template = constants.%int_4.ea3] +// CHECK:STDOUT: %impl.elem0.loc11_19.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb] +// CHECK:STDOUT: %bound_method.loc11_19.2: = bound_method %int_4, %impl.elem0.loc11_19.2 [template = constants.%Convert.bound.694] +// CHECK:STDOUT: %specific_fn.loc11_19.2: = specific_function %bound_method.loc11_19.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.739] +// CHECK:STDOUT: %int.convert_checked.loc11_19.2: init %i32 = call %specific_fn.loc11_19.2(%int_4) [template = constants.%int_4.ea3] // CHECK:STDOUT: %.loc11_19.4: %i32 = value_of_initializer %int.convert_checked.loc11_19.2 [template = constants.%int_4.ea3] // CHECK:STDOUT: %.loc11_19.5: %i32 = converted %int_4, %.loc11_19.4 [template = constants.%int_4.ea3] // CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%.loc11_19.3, %.loc11_19.5) [template = constants.%tuple.5de] @@ -691,7 +703,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %c_bad: ref %C.ed5 = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%X: %tuple.type.c2c) [from "implicit.carbon"] { +// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.554: %tuple.type.c2c) [from "implicit.carbon"] { // CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)] // CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/nested_tuple.carbon b/toolchain/check/testdata/tuple/nested_tuple.carbon index 389f98f071e91..3f12c3c571438 100644 --- a/toolchain/check/testdata/tuple/nested_tuple.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple.carbon @@ -24,10 +24,13 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.acf: type = tuple_type (%tuple.type.f94, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template] @@ -83,27 +86,27 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %.loc11_36.1: %tuple.type.f94 = tuple_literal (%int_12, %int_76) // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.462] // CHECK:STDOUT: %.loc11_40.1: %tuple.type.acf = tuple_literal (%.loc11_36.1, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_36.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_36.1: = bound_method %int_12, %impl.elem0.loc11_36.1 [template = constants.%Convert.bound.221] -// 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.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_36.1: init %i32 = call %Convert.specific_fn.loc11_36.1(%int_12) [template = constants.%int_12.1e1] +// CHECK:STDOUT: %impl.elem0.loc11_36.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_36.1: = bound_method %int_12, %impl.elem0.loc11_36.1 [template = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc11_36.1: = specific_function %bound_method.loc11_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9] +// CHECK:STDOUT: %int.convert_checked.loc11_36.1: init %i32 = call %specific_fn.loc11_36.1(%int_12) [template = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_36.2: init %i32 = converted %int_12, %int.convert_checked.loc11_36.1 [template = constants.%int_12.1e1] // CHECK:STDOUT: %tuple.elem0.loc11_40: ref %tuple.type.d07 = 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.1e1] -// CHECK:STDOUT: %impl.elem0.loc11_36.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_36.2: = bound_method %int_76, %impl.elem0.loc11_36.2 [template = constants.%Convert.bound.033] -// 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.454] -// CHECK:STDOUT: %int.convert_checked.loc11_36.2: init %i32 = call %Convert.specific_fn.loc11_36.2(%int_76) [template = constants.%int_76.8dd] +// CHECK:STDOUT: %impl.elem0.loc11_36.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_36.2: = bound_method %int_76, %impl.elem0.loc11_36.2 [template = constants.%Convert.bound.033] +// CHECK:STDOUT: %specific_fn.loc11_36.2: = specific_function %bound_method.loc11_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.454] +// CHECK:STDOUT: %int.convert_checked.loc11_36.2: init %i32 = call %specific_fn.loc11_36.2(%int_76) [template = constants.%int_76.8dd] // CHECK:STDOUT: %.loc11_36.4: init %i32 = converted %int_76, %int.convert_checked.loc11_36.2 [template = constants.%int_76.8dd] // CHECK:STDOUT: %tuple.elem1.loc11_36: ref %i32 = tuple_access %tuple.elem0.loc11_40, element1 // CHECK:STDOUT: %.loc11_36.5: init %i32 = initialize_from %.loc11_36.4 to %tuple.elem1.loc11_36 [template = constants.%int_76.8dd] // CHECK:STDOUT: %.loc11_36.6: init %tuple.type.d07 = tuple_init (%.loc11_36.3, %.loc11_36.5) to %tuple.elem0.loc11_40 [template = constants.%tuple.737] // CHECK:STDOUT: %.loc11_40.2: init %tuple.type.d07 = converted %.loc11_36.1, %.loc11_36.6 [template = constants.%tuple.737] -// CHECK:STDOUT: %impl.elem0.loc11_40: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_40: = bound_method %int_6, %impl.elem0.loc11_40 [template = constants.%Convert.bound.ce9] -// CHECK:STDOUT: %Convert.specific_fn.loc11_40: = specific_function %Convert.bound.loc11_40, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631] -// CHECK:STDOUT: %int.convert_checked.loc11_40: init %i32 = call %Convert.specific_fn.loc11_40(%int_6) [template = constants.%int_6.e56] +// CHECK:STDOUT: %impl.elem0.loc11_40: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_40: = bound_method %int_6, %impl.elem0.loc11_40 [template = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_40: = specific_function %bound_method.loc11_40, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631] +// CHECK:STDOUT: %int.convert_checked.loc11_40: init %i32 = call %specific_fn.loc11_40(%int_6) [template = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_40.3: init %i32 = converted %int_6, %int.convert_checked.loc11_40 [template = constants.%int_6.e56] // CHECK:STDOUT: %tuple.elem1.loc11_40: ref %i32 = tuple_access file.%x.var, element1 // CHECK:STDOUT: %.loc11_40.4: init %i32 = initialize_from %.loc11_40.3 to %tuple.elem1.loc11_40 [template = constants.%int_6.e56] diff --git a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon index 49a52d4365d3e..e1b6e95156204 100644 --- a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon @@ -38,10 +38,13 @@ fn H() { // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.667: type = tuple_type (Core.IntLiteral, %tuple.type.189, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template] @@ -142,17 +145,17 @@ fn H() { // CHECK:STDOUT: %F.call: init %tuple.type.189 = call %F.ref() to %tuple.elem1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %.loc18_50.1: %tuple.type.667 = tuple_literal (%int_1, %F.call, %int_2) -// CHECK:STDOUT: %impl.elem0.loc18_50.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc18_50.1: = bound_method %int_1, %impl.elem0.loc18_50.1 [template = constants.%Convert.bound.ab5] -// 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.70c] -// CHECK:STDOUT: %int.convert_checked.loc18_50.1: init %i32 = call %Convert.specific_fn.loc18_50.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc18_50.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18_50.1: = bound_method %int_1, %impl.elem0.loc18_50.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc18_50.1: = specific_function %bound_method.loc18_50.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc18_50.1: init %i32 = call %specific_fn.loc18_50.1(%int_1) [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_50.2: init %i32 = converted %int_1, %int.convert_checked.loc18_50.1 [template = constants.%int_1.5d2] // 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.5d2] -// CHECK:STDOUT: %impl.elem0.loc18_50.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc18_50.2: = bound_method %int_2, %impl.elem0.loc18_50.2 [template = constants.%Convert.bound.ef9] -// 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.787] -// CHECK:STDOUT: %int.convert_checked.loc18_50.2: init %i32 = call %Convert.specific_fn.loc18_50.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc18_50.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc18_50.2: = bound_method %int_2, %impl.elem0.loc18_50.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc18_50.2: = specific_function %bound_method.loc18_50.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc18_50.2: init %i32 = call %specific_fn.loc18_50.2(%int_2) [template = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_50.4: init %i32 = converted %int_2, %int.convert_checked.loc18_50.2 [template = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %v.var, element2 // CHECK:STDOUT: %.loc18_50.5: init %i32 = initialize_from %.loc18_50.4 to %tuple.elem2 [template = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/tuple/one_element.carbon b/toolchain/check/testdata/tuple/one_element.carbon index 56efd1e54da7c..8608829f41a0c 100644 --- a/toolchain/check/testdata/tuple/one_element.carbon +++ b/toolchain/check/testdata/tuple/one_element.carbon @@ -20,10 +20,13 @@ var y: (i32,) = x; // CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.0c1, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [template] @@ -76,10 +79,10 @@ var y: (i32,) = x; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] // CHECK:STDOUT: %.loc11_20.1: %tuple.type.985 = tuple_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// 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.940] +// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_4) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc11_20.2: init %i32 = converted %int_4, %int.convert_checked [template = constants.%int_4.940] // CHECK:STDOUT: %.loc11_20.3: init %tuple.type.a1c = tuple_init (%.loc11_20.2) to file.%x.var [template = constants.%tuple] // CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_20.1, %.loc11_20.3 [template = constants.%tuple] diff --git a/toolchain/check/testdata/tuple/two_elements.carbon b/toolchain/check/testdata/tuple/two_elements.carbon index 23bf7345263eb..1b2c761f7e747 100644 --- a/toolchain/check/testdata/tuple/two_elements.carbon +++ b/toolchain/check/testdata/tuple/two_elements.carbon @@ -24,10 +24,13 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %int_102.b54: Core.IntLiteral = int_value 102 [template] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %impl_witness.d39: = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template] +// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [template] // CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [template] @@ -66,16 +69,16 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %.loc11_17.2: %tuple.type.24b = tuple_literal (%i32.loc11_9, %i32.loc11_14) // CHECK:STDOUT: %.loc11_17.3: type = converted %.loc11_17.2, constants.%tuple.type.d07 [template = constants.%tuple.type.d07] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_28.1: = bound_method @__global_init.%int_4.loc11, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.ac3] -// 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.450] -// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %Convert.specific_fn.loc11_28.1(@__global_init.%int_4.loc11) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc11_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_28.1: = bound_method @__global_init.%int_4.loc11, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc11_28.1: = specific_function %bound_method.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %specific_fn.loc11_28.1(@__global_init.%int_4.loc11) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc11_28.1: %i32 = value_of_initializer %int.convert_checked.loc11_28.1 [template = constants.%int_4.940] // CHECK:STDOUT: %.loc11_28.2: %i32 = converted @__global_init.%int_4.loc11, %.loc11_28.1 [template = constants.%int_4.940] -// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc11_28.2: = bound_method @__global_init.%int_102.loc11, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.063] -// 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.9b4] -// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %Convert.specific_fn.loc11_28.2(@__global_init.%int_102.loc11) [template = constants.%int_102.b91] +// CHECK:STDOUT: %impl.elem0.loc11_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_28.2: = bound_method @__global_init.%int_102.loc11, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.063] +// CHECK:STDOUT: %specific_fn.loc11_28.2: = specific_function %bound_method.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b4] +// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %specific_fn.loc11_28.2(@__global_init.%int_102.loc11) [template = constants.%int_102.b91] // CHECK:STDOUT: %.loc11_28.3: %i32 = value_of_initializer %int.convert_checked.loc11_28.2 [template = constants.%int_102.b91] // CHECK:STDOUT: %.loc11_28.4: %i32 = converted @__global_init.%int_102.loc11, %.loc11_28.3 [template = constants.%int_102.b91] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc11_28.2, %.loc11_28.4) [template = constants.%tuple] @@ -132,17 +135,17 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %int_4.loc14: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] // CHECK:STDOUT: %int_102.loc14: Core.IntLiteral = int_value 102 [template = constants.%int_102.b54] // CHECK:STDOUT: %.loc14_28.1: %tuple.type.f94 = tuple_literal (%int_4.loc14, %int_102.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_28.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_28.1: = bound_method %int_4.loc14, %impl.elem0.loc14_28.1 [template = constants.%Convert.bound.ac3] -// 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.450] -// CHECK:STDOUT: %int.convert_checked.loc14_28.1: init %i32 = call %Convert.specific_fn.loc14_28.1(%int_4.loc14) [template = constants.%int_4.940] +// CHECK:STDOUT: %impl.elem0.loc14_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_28.1: = bound_method %int_4.loc14, %impl.elem0.loc14_28.1 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc14_28.1: = specific_function %bound_method.loc14_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc14_28.1: init %i32 = call %specific_fn.loc14_28.1(%int_4.loc14) [template = constants.%int_4.940] // CHECK:STDOUT: %.loc14_28.2: init %i32 = converted %int_4.loc14, %int.convert_checked.loc14_28.1 [template = constants.%int_4.940] // 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.940] -// CHECK:STDOUT: %impl.elem0.loc14_28.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc14_28.2: = bound_method %int_102.loc14, %impl.elem0.loc14_28.2 [template = constants.%Convert.bound.063] -// 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.9b4] -// CHECK:STDOUT: %int.convert_checked.loc14_28.2: init %i32 = call %Convert.specific_fn.loc14_28.2(%int_102.loc14) [template = constants.%int_102.b91] +// CHECK:STDOUT: %impl.elem0.loc14_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc14_28.2: = bound_method %int_102.loc14, %impl.elem0.loc14_28.2 [template = constants.%Convert.bound.063] +// CHECK:STDOUT: %specific_fn.loc14_28.2: = specific_function %bound_method.loc14_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b4] +// CHECK:STDOUT: %int.convert_checked.loc14_28.2: init %i32 = call %specific_fn.loc14_28.2(%int_102.loc14) [template = constants.%int_102.b91] // CHECK:STDOUT: %.loc14_28.4: init %i32 = converted %int_102.loc14, %int.convert_checked.loc14_28.2 [template = constants.%int_102.b91] // CHECK:STDOUT: %tuple.elem1.loc14: ref %i32 = tuple_access file.%x.var, element1 // CHECK:STDOUT: %.loc14_28.5: init %i32 = initialize_from %.loc14_28.4 to %tuple.elem1.loc14 [template = constants.%int_102.b91] diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index d1d2b4acedf06..991b9ed139731 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -603,8 +603,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Impls.type: type = fn_type @Impls [template] // CHECK:STDOUT: %Impls: %Impls.type = struct_value () [template] // CHECK:STDOUT: %J_where.type: type = facet_type <@J where TODO> [template] -// CHECK:STDOUT: %V: %J_where.type = bind_symbolic_name V, 0 [symbolic] // CHECK:STDOUT: %V.patt: %J_where.type = symbolic_binding_pattern V, 0 [symbolic] +// CHECK:STDOUT: %V: %J_where.type = bind_symbolic_name V, 0 [symbolic] // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %Y: %J_where.type = bind_symbolic_name Y, 0 [symbolic] // CHECK:STDOUT: %Y.patt: %J_where.type = symbolic_binding_pattern Y, 0 [symbolic] @@ -625,7 +625,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref = import_ref Main//state_constraints, inst17 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.8fd = import_ref Main//state_constraints, inst17 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.81e: %J_where.type = import_ref Main//state_constraints, loc13_10, loaded [symbolic = @Impls.%V (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -671,7 +672,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: interface @J [from "state_constraints.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%Main.import_ref +// CHECK:STDOUT: .Self = imports.%Main.import_ref.8fd // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: @@ -696,7 +697,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Impls(constants.%V: %J_where.type) [from "state_constraints.carbon"] { +// CHECK:STDOUT: generic fn @Impls(imports.%Main.import_ref.81e: %J_where.type) [from "state_constraints.carbon"] { // CHECK:STDOUT: %V: %J_where.type = bind_symbolic_name V, 0 [symbolic = %V (constants.%V)] // CHECK:STDOUT: %V.patt: %J_where.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt (constants.%V.patt)] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/dot_self_index.carbon b/toolchain/check/testdata/where_expr/dot_self_index.carbon index 8e1985cfa9d81..58f8b4c357f92 100644 --- a/toolchain/check/testdata/where_expr/dot_self_index.carbon +++ b/toolchain/check/testdata/where_expr/dot_self_index.carbon @@ -42,7 +42,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %assoc0.68f673.2: %Empty.assoc_type.54c14f.2 = assoc_entity element0, @Empty.%A [symbolic] // CHECK:STDOUT: %.Self.as_type.a75: type = facet_access_type %.Self.c95 [symbolic] // CHECK:STDOUT: %.Self.as_wit.da4: = facet_access_witness %.Self.c95 [symbolic] -// CHECK:STDOUT: %Empty.facet.bea: %Empty.type.3e5fde.1 = facet_value %.Self.as_type.a75, %.Self.as_wit.da4 [symbolic] +// CHECK:STDOUT: %Empty.facet.bea: %Empty.type.3e5fde.2 = facet_value %.Self.as_type.a75, %.Self.as_wit.da4 [symbolic] // CHECK:STDOUT: %impl.elem0.41c: type = impl_witness_access %.Self.as_wit.da4, element0 [symbolic] // CHECK:STDOUT: %ptr.79f: type = ptr_type %T [symbolic] // CHECK:STDOUT: %Empty_where.type.4ed: type = facet_type <@Empty, @Empty(%T) where %impl.elem0.41c = %ptr.79f> [symbolic] @@ -59,7 +59,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %assoc0.0c3: %Empty.assoc_type.a46 = assoc_entity element0, @Empty.%A [template] // CHECK:STDOUT: %.Self.as_type.920: type = facet_access_type %.Self.e6e [symbolic] // CHECK:STDOUT: %.Self.as_wit.581: = facet_access_witness %.Self.e6e [symbolic] -// CHECK:STDOUT: %Empty.facet.a44: %Empty.type.3e5fde.1 = facet_value %.Self.as_type.920, %.Self.as_wit.581 [symbolic] +// CHECK:STDOUT: %Empty.facet.933: %Empty.type.f0b = facet_value %.Self.as_type.920, %.Self.as_wit.581 [symbolic] // CHECK:STDOUT: %impl.elem0.797: type = impl_witness_access %.Self.as_wit.581, element0 [symbolic] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [template] // CHECK:STDOUT: %Empty_where.type.a58: type = facet_type <@Empty, @Empty(%i32) where %impl.elem0.797 = %ptr.235> [template] @@ -276,7 +276,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %assoc0 => constants.%assoc0.0c3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(constants.%i32, constants.%Empty.facet.a44) {} +// CHECK:STDOUT: specific @A(constants.%i32, constants.%Empty.facet.933) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%i32, bool) { // CHECK:STDOUT: %T.loc18_6.2 => constants.%i32 diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index 5fd141e25c8c0..464da6a0c2aa0 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -1185,8 +1185,8 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.as_wit.cef: = facet_access_witness %.Self.9aa [symbolic] // CHECK:STDOUT: %impl.elem0.51b: type = impl_witness_access %.Self.as_wit.cef, element0 [symbolic] // CHECK:STDOUT: %N_where.type: type = facet_type <@N where %impl.elem0.51b = %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] +// CHECK:STDOUT: %T: %N_where.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %NestedRewrite.type: type = fn_type @NestedRewrite [template] @@ -1200,8 +1200,8 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.as_wit.a35: = facet_access_witness %.Self.e46 [symbolic] // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.a35, element1 [symbolic] // CHECK:STDOUT: %A_where.type.791: type = facet_type <@A where %impl.elem1 = %empty_tuple.type and %impl.elem0.1d3 = bool> [template] -// CHECK:STDOUT: %D: %A_where.type.791 = bind_symbolic_name D, 0 [symbolic] // CHECK:STDOUT: %D.patt: %A_where.type.791 = symbolic_binding_pattern D, 0 [symbolic] +// CHECK:STDOUT: %D: %A_where.type.791 = bind_symbolic_name D, 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: } @@ -1221,11 +1221,13 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %Main.import_ref.169 = import_ref Main//equal_constraint, inst17 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.020 = import_ref Main//equal_constraint, loc5_8, unloaded // CHECK:STDOUT: %Main.P = import_ref Main//equal_constraint, P, unloaded +// CHECK:STDOUT: %Main.import_ref.bdf: %N_where.type = import_ref Main//equal_constraint, loc8_10, loaded [symbolic = @Equal.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.b61 = import_ref Main//nested_rewrites, inst17 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.91a = import_ref Main//nested_rewrites, loc5_8, unloaded // CHECK:STDOUT: %Main.import_ref.55d = import_ref Main//nested_rewrites, loc6_8, unloaded // CHECK:STDOUT: %Main.B = import_ref Main//nested_rewrites, B, unloaded // CHECK:STDOUT: %Main.C = import_ref Main//nested_rewrites, C, unloaded +// CHECK:STDOUT: %Main.import_ref.e0c: %A_where.type.791 = import_ref Main//nested_rewrites, loc9_18, loaded [symbolic = @NestedRewrite.%D (constants.%D)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1269,14 +1271,14 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Equal(constants.%T: %N_where.type) [from "equal_constraint.carbon"] { +// CHECK:STDOUT: generic fn @Equal(imports.%Main.import_ref.bdf: %N_where.type) [from "equal_constraint.carbon"] { // CHECK:STDOUT: %T: %N_where.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T.patt: %N_where.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: %N_where.type); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @NestedRewrite(constants.%D: %A_where.type.791) [from "nested_rewrites.carbon"] { +// CHECK:STDOUT: generic fn @NestedRewrite(imports.%Main.import_ref.e0c: %A_where.type.791) [from "nested_rewrites.carbon"] { // CHECK:STDOUT: %D: %A_where.type.791 = bind_symbolic_name D, 0 [symbolic = %D (constants.%D)] // CHECK:STDOUT: %D.patt: %A_where.type.791 = symbolic_binding_pattern D, 0 [symbolic = %D.patt (constants.%D.patt)] // CHECK:STDOUT: diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 3dae1fbccf4f6..d4187d2df0e15 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -569,11 +569,12 @@ static auto BuildTypeForInst(FileContext& context, InstT /*inst*/) } template - requires(InstT::Kind.template IsAnyOf< - SemIR::AssociatedEntityType, SemIR::FacetAccessType, - SemIR::FacetType, SemIR::FunctionType, SemIR::GenericClassType, - SemIR::GenericInterfaceType, SemIR::UnboundElementType, - SemIR::WhereExpr>()) + requires( + InstT::Kind.template IsAnyOf< + SemIR::AssociatedEntityType, SemIR::FacetAccessType, SemIR::FacetType, + SemIR::FunctionType, SemIR::FunctionTypeWithSelfType, + SemIR::GenericClassType, SemIR::GenericInterfaceType, + SemIR::UnboundElementType, SemIR::WhereExpr>()) static auto BuildTypeForInst(FileContext& context, InstT /*inst*/) -> llvm::Type* { // Return an empty struct as a placeholder. diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index 361faffa646f9..6018d06352a47 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -263,6 +263,7 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case FloatLiteral::Kind: case FloatType::Kind: case FunctionType::Kind: + case FunctionTypeWithSelfType::Kind: case GenericClassType::Kind: case GenericInterfaceType::Kind: case ImplWitness::Kind: diff --git a/toolchain/sem_ir/function.cpp b/toolchain/sem_ir/function.cpp index fd4745fe582de..5dbf0e6445cc1 100644 --- a/toolchain/sem_ir/function.cpp +++ b/toolchain/sem_ir/function.cpp @@ -14,6 +14,7 @@ auto GetCalleeFunction(const File& sem_ir, InstId callee_id) -> CalleeFunction { CalleeFunction result = {.function_id = FunctionId::None, .enclosing_specific_id = SpecificId::None, .resolved_specific_id = SpecificId::None, + .self_type_id = InstId::None, .self_id = InstId::None, .is_error = false}; @@ -28,19 +29,24 @@ auto GetCalleeFunction(const File& sem_ir, InstId callee_id) -> CalleeFunction { callee_id = bound_method->function_decl_id; } - // Identify the function we're calling. + // Identify the function we're calling by its type. auto val_id = sem_ir.constant_values().GetConstantInstId(callee_id); if (!val_id.has_value()) { return result; } - auto val_inst = sem_ir.insts().Get(val_id); - auto struct_val = val_inst.TryAs(); - if (!struct_val) { - result.is_error = val_inst.type_id() == SemIR::ErrorInst::SingletonTypeId; - return result; + auto fn_type_inst = + sem_ir.types().GetAsInst(sem_ir.insts().Get(val_id).type_id()); + + if (auto impl_fn_type = fn_type_inst.TryAs()) { + // Combine the associated function's `Self` with the interface function + // data. + result.self_type_id = impl_fn_type->self_id; + fn_type_inst = sem_ir.insts().Get(impl_fn_type->interface_function_type_id); } - auto fn_type = sem_ir.types().TryGetAs(struct_val->type_id); + + auto fn_type = fn_type_inst.TryAs(); if (!fn_type) { + result.is_error = fn_type_inst.Is(); return result; } diff --git a/toolchain/sem_ir/function.h b/toolchain/sem_ir/function.h index 94360d5c3dd90..b7dd7de8dff93 100644 --- a/toolchain/sem_ir/function.h +++ b/toolchain/sem_ir/function.h @@ -104,6 +104,8 @@ struct CalleeFunction { SemIR::SpecificId enclosing_specific_id; // The specific for the callee itself, in a resolved call. SemIR::SpecificId resolved_specific_id; + // The bound `Self` type. `None` if not a bound interface member. + SemIR::InstId self_type_id; // The bound `self` parameter. `None` if not a method. SemIR::InstId self_id; // True if an error instruction was found. diff --git a/toolchain/sem_ir/generic.h b/toolchain/sem_ir/generic.h index da11888b0d6e9..8603a6480f9ca 100644 --- a/toolchain/sem_ir/generic.h +++ b/toolchain/sem_ir/generic.h @@ -115,6 +115,13 @@ class SpecificStore : public Yaml::Printable { return specifics_.Get(specific_id); } + // Gets the arguments of the specified specific, or `Empty` if `None` is + // passed. + auto GetArgsOrEmpty(SpecificId specific_id) const -> InstBlockId { + return specific_id.has_value() ? Get(specific_id).args_id + : InstBlockId::Empty; + } + // These are to support printable structures, and are not guaranteed. auto OutputYaml() const -> Yaml::OutputMapping { return specifics_.OutputYaml(); diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index b41aa1325ead5..98076d2af4286 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -63,6 +63,7 @@ CARBON_SEM_IR_INST_KIND(FloatLiteral) CARBON_SEM_IR_INST_KIND(FloatType) CARBON_SEM_IR_INST_KIND(FunctionDecl) CARBON_SEM_IR_INST_KIND(FunctionType) +CARBON_SEM_IR_INST_KIND(FunctionTypeWithSelfType) CARBON_SEM_IR_INST_KIND(GenericClassType) CARBON_SEM_IR_INST_KIND(GenericInterfaceType) CARBON_SEM_IR_INST_KIND(ImplDecl) diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index 745ef8372237a..fbb38d167c904 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -321,20 +321,40 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) break; } case CARBON_KIND(FunctionType inst): { - auto fn_name_id = sem_ir.functions().Get(inst.function_id).name_id; - out << ""; + const auto& fn = sem_ir.functions().Get(inst.function_id); + out << ""); + step_stack.PushQualifiedName(fn.parent_scope_id, fn.name_id); + break; + } + case CARBON_KIND(FunctionTypeWithSelfType inst): { + out << ""); + step_stack.PushInstId(inst.self_id); + step_stack.PushString(" in "); + if (auto fn_inst = sem_ir.insts().TryGetAs( + inst.interface_function_type_id)) { + const auto& fn = sem_ir.functions().Get(fn_inst->function_id); + step_stack.PushQualifiedName(fn.parent_scope_id, fn.name_id); + } else { + step_stack.PushInstId(inst.interface_function_type_id); + } break; } case CARBON_KIND(GenericClassType inst): { - auto class_name_id = sem_ir.classes().Get(inst.class_id).name_id; - out << ""; + const auto& class_info = sem_ir.classes().Get(inst.class_id); + out << ""); + step_stack.PushQualifiedName(class_info.parent_scope_id, + class_info.name_id); break; } case CARBON_KIND(GenericInterfaceType inst): { - auto interface_name_id = - sem_ir.interfaces().Get(inst.interface_id).name_id; - out << ""; + const auto& interface = sem_ir.interfaces().Get(inst.interface_id); + out << ""); + step_stack.PushQualifiedName(interface.parent_scope_id, + interface.name_id); break; } case CARBON_KIND(ImplWitnessAccess inst): { diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 0dfc6d17342c3..a471549f870ec 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -749,6 +749,26 @@ struct FunctionType { SpecificId specific_id; }; +// The type of an associated function within an `impl`, modeled as an underlying +// `FunctionType` plus the value of the `Self` parameter. This is the type of +// `(SelfType as Interface).AssociatedFunction`. +struct FunctionTypeWithSelfType { + static constexpr auto Kind = + InstKind::FunctionTypeWithSelfType.Define( + {.ir_name = "fn_type_with_self_type", + .is_type = InstIsType::Always, + .constant_kind = InstConstantKind::Conditional, + .is_lowered = false}); + + TypeId type_id; + // The type of the function within the interface. This includes the + // interface's SpecificId if applicable. This will be a `FunctionType` except + // in error cases. + InstId interface_function_type_id; + // The value to use for `Self` in this function. + InstId self_id; +}; + // The type of the name of a generic class. The corresponding value is an empty // `StructValue`. struct GenericClassType {