From d4c7ca42217f9ad0a65b30007ec6d4ef5915c840 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 24 Sep 2026 23:10:18 +0000 Subject: [PATCH] Support for dependent initialization in templates (#7801) Add support for deferring initialization as a template action, and performing the deferred initialization during template instantiation. This is substantially more complex than other conversion actions, for two primary reasons: * The initializer in the generic may have storage arguments as inputs. We model an initializing expression as having a "slot" where initialization writes the location that should be initialized by that initializing expression, and that needs to be an output of the initialization action. * Initialization from a tuple or struct literal needs to recurse into that literal, and the literal will have been spelled in the generic, meaning we don't have an `InstId` that can be used to name the specific version of the initializer as input for nested conversions. These issues are addressed by introducing two new features to the action machinery: In addition to `InstAction`, we now have `MultiInstAction`, which is an action that produces a tuple of instruction values instead of a single instruction value. Initialization actions produce one instruction for the final result, which is spliced at the point of initialization, plus one instruction for each storage argument, which are spliced into the storage argument slots in the original generic. During initialization, if we find one of those splices in the storage argument of an initializing expression, we return the new storage argument back to the initialization action to be included in the specific, instead of overwriting the storage argument in the generic. Actions whose `PerforrmAction` takes a `SpecificId` as input no longer perform automatic refinement of their operands to specific instructions. Instead, the action is given control over when and where it performs that refinement. In `InitializeAction`, we use this freedom to form a `SpecificInst` for the initializer in the primary output block, and form a `SpecificInst` for the target in the target block. When detecting whether we are initializing from a tuple or struct literal, we step over the `SpecificInst` and track its `SpecificId`, and if necessary create a new `SpecificInst` wrapping the sub-initializer when we recurse into the nested element conversion. Assisted-by: Claude and Gemini via Antigravity --- toolchain/check/action.cpp | 113 +- toolchain/check/action.h | 109 +- toolchain/check/convert.cpp | 435 +++- toolchain/check/convert.h | 4 + toolchain/check/eval.cpp | 32 +- toolchain/check/eval_inst.h | 1 + toolchain/check/generic.cpp | 16 +- toolchain/check/inst.cpp | 7 +- toolchain/check/inst.h | 23 +- toolchain/check/pending_block.h | 24 + .../array/init_dependent_bound.carbon | 78 +- .../check/testdata/class/destroy_calls.carbon | 172 +- toolchain/check/testdata/eval/call.carbon | 148 +- .../check/testdata/function/call/form.carbon | 108 +- .../testdata/generic/template/convert.carbon | 1775 ++++++++++++++++- .../generic/template/dependence.carbon | 101 +- .../generic/template/member_access.carbon | 173 +- .../template/member_out_of_line.carbon | 405 ++-- .../testdata/generic/template/operator.carbon | 141 +- .../template_access_assoc_const.carbon | 76 +- .../generic/template/unimplemented.carbon | 44 +- .../interop/cpp/class/import/template.carbon | 320 ++- .../interop/cpp/template/generic_call.carbon | 244 +-- .../lower/testdata/template/convert.carbon | 1124 +++++++++++ .../lower/testdata/template/merging.carbon | 28 +- .../lower/testdata/template/operator.carbon | 164 +- toolchain/sem_ir/expr_info.cpp | 5 +- toolchain/sem_ir/id_kind.h | 1 + toolchain/sem_ir/ids.h | 2 +- toolchain/sem_ir/inst_categories.h | 18 + toolchain/sem_ir/inst_fingerprinter.cpp | 15 + toolchain/sem_ir/inst_kind.def | 1 + toolchain/sem_ir/inst_kind.h | 28 +- toolchain/sem_ir/typed_insts.h | 27 + 34 files changed, 4416 insertions(+), 1546 deletions(-) create mode 100644 toolchain/lower/testdata/template/convert.carbon diff --git a/toolchain/check/action.cpp b/toolchain/check/action.cpp index 69d63775acdf..4c0308ef2283 100644 --- a/toolchain/check/action.cpp +++ b/toolchain/check/action.cpp @@ -102,9 +102,8 @@ auto OperandDependence(Context& context, SemIR::TypeInstId inst_id) template requires SemIR::Internal::IsIdKindType && SameAsOneOf + SemIR::BoolValue, SemIR::CallParamIndex, + SemIR::ClangDeclId, SemIR::ElementIndex, SemIR::NameId> static auto OperandDependenceInSpecific(Context& /*context*/, SemIR::SpecificId /*specific_id*/, IdT /*id*/) @@ -215,6 +214,19 @@ auto ActionIsPerformable(Context& context, SemIR::Inst action_inst, SemIR::ConstantDependence::Template; } +auto AddSpliceInst(Context& context, SemIR::InstId inst_value_id, + SemIR::TypeInstId result_type_inst_id) -> SemIR::InstId { + if (!result_type_inst_id.has_value()) { + result_type_inst_id = AddTypeInst( + context, SemIR::LocId(inst_value_id), + {.type_id = SemIR::TypeType::TypeId, .inst_id = inst_value_id}); + } + return AddInst( + context, SemIR::LocId(inst_value_id), + {.type_id = context.types().GetTypeIdForTypeInstId(result_type_inst_id), + .inst_id = inst_value_id}); +} + // Refine one operand of an action. Given an argument from a template, this // produces an argument that has the template-dependent parts replaced with // their concrete values, so that the action doesn't need to know which specific @@ -324,23 +336,19 @@ static auto RefineOperands(Context& context, SemIR::LocId loc_id, return action; } +auto AddDependentActionInst(Context& context, SemIR::LocIdAndInst action) + -> SemIR::InstId { + action.inst = RefineOperands(context, action.loc_id, action.inst); + return AddTemplateConstantInstToEvalBlock(context, action); +} + auto AddDependentActionSplice(Context& context, SemIR::LocIdAndInst action, SemIR::TypeInstId result_type_inst_id) -> SemIR::InstId { action.inst = RefineOperands(context, action.loc_id, action.inst); auto inst_id = AddDependentActionInst(context, action); - if (!result_type_inst_id.has_value()) { - result_type_inst_id = - AddTypeInst(context, action.loc_id, - SemIR::TypeOfInst{.type_id = SemIR::TypeType::TypeId, - .inst_id = inst_id}); - } - return AddInst( - context, action.loc_id, - SemIR::SpliceInst{.type_id = context.types().GetTypeIdForTypeInstId( - result_type_inst_id), - .inst_id = inst_id}); + return AddSpliceInst(context, inst_id, result_type_inst_id); } // Refine one operand of an action that is being performed within a specific. @@ -353,39 +361,58 @@ template requires SemIR::Internal::IsIdKindType static auto RefineTypedOperandInSpecific(Context& /*context*/, SemIR::SpecificId /*specific_id*/, - SemIR::LocId /*loc_id*/, IdT id) - -> IdT { + IdT id) -> IdT { return id; } -static auto RefineTypedOperandInSpecific(Context& context, - SemIR::SpecificId specific_id, - SemIR::LocId loc_id, - SemIR::MetaInstId inst_id) - -> SemIR::MetaInstId { - // If the operand isn't template-dependent within the generic, then either it - // doesn't depend on the specific at all, or evaluation has already replaced - // it with the corresponding instruction from the specific. - if (OperandDependence(context, inst_id) != - SemIR::ConstantDependence::Template) { +// Returns whether `inst_id`, which is an instruction within a generic, needs a +// `SpecificInst` in order to be referred to from within a specific. If the +// instruction isn't symbolic within the generic, then either it doesn't depend +// on the specific at all, or evaluation has already replaced it with the +// corresponding instruction from the specific. +static auto NeedsSpecificInst(Context& context, SemIR::InstId inst_id) -> bool { + return context.insts().Get(inst_id).type_id().is_symbolic() || + context.constant_values().Get(inst_id).is_symbolic(); +} + +auto AddSpecificInst(Context& context, SemIR::InstId inst_id, + SemIR::SpecificId specific_id) -> SemIR::InstId { + if (!NeedsSpecificInst(context, inst_id)) { return inst_id; } - // Produce an instruction with the same meaning as `inst_id`, but with the - // type and constant value that it has within the specific. This is added to - // the block of instructions produced by the action, so that it's evaluated - // before the instructions that use it. return AddInst( - context, loc_id, + context, SemIR::LocId(inst_id), {.type_id = GetTypeOfInstInSpecific(context.sem_ir(), specific_id, inst_id), .inst_id = inst_id, .specific_id = specific_id}); } +auto AddSpecificInstToPendingBlock(PendingBlock& block, SemIR::InstId inst_id, + SemIR::SpecificId specific_id) + -> SemIR::InstId { + if (!NeedsSpecificInst(block.context(), inst_id)) { + return inst_id; + } + + return block.AddInst( + SemIR::LocId(inst_id), + {.type_id = GetTypeOfInstInSpecific(block.context().sem_ir(), specific_id, + inst_id), + .inst_id = inst_id, + .specific_id = specific_id}); +} + +static auto RefineTypedOperandInSpecific(Context& context, + SemIR::SpecificId specific_id, + SemIR::MetaInstId inst_id) + -> SemIR::MetaInstId { + return AddSpecificInst(context, inst_id, specific_id); +} + static auto RefineTypedOperandInSpecific(Context& context, SemIR::SpecificId specific_id, - SemIR::LocId loc_id, SemIR::MetaInstBlockId inst_block_id) -> SemIR::MetaInstBlockId { auto block = context.inst_blocks().Get(inst_block_id); @@ -395,7 +422,7 @@ static auto RefineTypedOperandInSpecific(Context& context, bool any_changed = false; for (auto inst_id : block) { new_block.push_back(RefineTypedOperandInSpecific( - context, specific_id, loc_id, SemIR::MetaInstId(inst_id))); + context, specific_id, SemIR::MetaInstId(inst_id))); any_changed |= new_block.back() != inst_id; } if (!any_changed) { @@ -407,7 +434,6 @@ static auto RefineTypedOperandInSpecific(Context& context, template static auto RefineTypedOperandInSpecific(Context& context, SemIR::SpecificId specific_id, - SemIR::LocId loc_id, SemIR::BundleId bundle_id) -> SemIR::BundleId { auto bundle_tuple = context.bundles().GetAsTuple(bundle_id); @@ -416,7 +442,7 @@ static auto RefineTypedOperandInSpecific(Context& context, // This can't actually recurse, because bundles can't contain bundle // IDs. return BundleT{RefineTypedOperandInSpecific(context, specific_id, - loc_id, bundle_fields)...}; + bundle_fields)...}; }, bundle_tuple); return context.bundles().AddCanonical(refined_bundle); @@ -425,22 +451,19 @@ static auto RefineTypedOperandInSpecific(Context& context, // Dynamically dispatched wrapper for RefineTypedOperandInSpecific. static auto RefineOperandInSpecific(Context& context, SemIR::SpecificId specific_id, - SemIR::LocId loc_id, SemIR::IdAndKind arg) - -> int32_t { + SemIR::IdAndKind arg) -> int32_t { return arg.Dispatch([&](auto id) { - return SemIR::ToRaw( - RefineTypedOperandInSpecific(context, specific_id, loc_id, id)); + return SemIR::ToRaw(RefineTypedOperandInSpecific(context, specific_id, id)); }); } auto Internal::RefineOperandsInSpecific(Context& context, SemIR::SpecificId specific_id, - SemIR::LocId loc_id, SemIR::Inst action) - -> SemIR::Inst { - auto arg0 = RefineOperandInSpecific(context, specific_id, loc_id, - action.arg0_and_kind()); - auto arg1 = RefineOperandInSpecific(context, specific_id, loc_id, - action.arg1_and_kind()); + SemIR::Inst action) -> SemIR::Inst { + auto arg0 = + RefineOperandInSpecific(context, specific_id, action.arg0_and_kind()); + auto arg1 = + RefineOperandInSpecific(context, specific_id, action.arg1_and_kind()); action.SetArgs(arg0, arg1); return action; } diff --git a/toolchain/check/action.h b/toolchain/check/action.h index 2a79756c248a..d985953bd47b 100644 --- a/toolchain/check/action.h +++ b/toolchain/check/action.h @@ -7,6 +7,7 @@ #include "toolchain/check/context.h" #include "toolchain/check/inst.h" +#include "toolchain/check/pending_block.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/inst.h" #include "toolchain/sem_ir/inst_kind.h" @@ -21,6 +22,13 @@ using SpecificParamsForPerformAction = std::conditional_tvoid, auto()->void>; +template +// Computes the return type to use for PerformAction for InstT. +using ReturnTypeForPerformAction = + std::conditional_t, SemIR::InstId>; + // Computes the function type to use for PerformAction for InstT. template > @@ -29,10 +37,10 @@ struct FunctionTypeForPerformActionImpl { using Type = auto() -> void; }; template - requires(InstT::Kind.constant_kind() == SemIR::InstConstantKind::InstAction) + requires(InstT::Kind.is_action()) struct FunctionTypeForPerformActionImplvoid> { using Type = auto(Context& context, SpecificParams..., SemIR::LocId loc_id, - InstT inst) -> SemIR::InstId; + InstT inst) -> ReturnTypeForPerformAction; }; template using FunctionTypeForPerformAction = @@ -61,6 +69,16 @@ auto PerformAction() -> void = delete; // instructions produced by the action. Any instructions generated during // `PerformAction` will be spliced into the code at the point where the action // was created. +// +// For an instruction whose constant kind is MultiInstAction, the overload is +// the same but should return a `SmallVector` instead, providing +// multiple instructions to be spliced into different places in the generic; +// these instructions become the elements of the tuple of instruction values +// produced by the action. The first element is assumed to be spliced at the +// current location, and is treated specially: the instruction value in the +// result of the action will be a splice block containing any instructions +// generated by `PerformAction`, and the result value of that splice block is +// the first element in the returned vector. #define CARBON_SEM_IR_INST_KIND(Name) \ Internal::FunctionTypeForPerformAction PerformAction; #include "toolchain/sem_ir/inst_kind.def" @@ -84,6 +102,39 @@ auto OperandDependence(Context& context, SemIR::TypeInstId inst_id) auto OperandDependence(Context& context, SemIR::TypeId type_id) -> SemIR::ConstantDependence; +// Adds an instruction to the current block to splice in the given instruction +// value. `result_type_inst_id` specifies the type of the instruction, if known. +auto AddSpliceInst(Context& context, SemIR::InstId inst_value_id, + SemIR::TypeInstId result_type_inst_id) -> SemIR::InstId; + +// Returns an instruction with the same meaning as `inst_id`, which is an +// instruction within a generic, but with the type and constant value that it +// has within `specific_id`. If `inst_id` is not template-dependent within the +// generic, it is returned unchanged; otherwise a `SpecificInst` is added to the +// current block. +auto AddSpecificInst(Context& context, SemIR::InstId inst_id, + SemIR::SpecificId specific_id) -> SemIR::InstId; + +// Like the above, but any `SpecificInst` is added to `block` instead of to the +// current block. +auto AddSpecificInstToPendingBlock(PendingBlock& block, SemIR::InstId inst_id, + SemIR::SpecificId specific_id) + -> SemIR::InstId; + +// Adds an action instruction to the eval block to perform a dependent action. +// The result is not spliced into the current block. This should be used when +// the action instruction produces multiple instruction values, so its result +// cannot be spliced directly. +auto AddDependentActionInst(Context& context, SemIR::LocIdAndInst action) + -> SemIR::InstId; + +// Convenience wrapper for `AddDependentActionInst`. +template +auto AddDependentActionInst(Context& context, LocT loc, InstT inst) + -> SemIR::InstId { + return AddDependentActionInst(context, SemIR::LocIdAndInst(loc, inst)); +} + // Adds an instruction to the current block to splice in the result of // performing a dependent action. auto AddDependentActionSplice(Context& context, SemIR::LocIdAndInst action, @@ -91,7 +142,7 @@ auto AddDependentActionSplice(Context& context, SemIR::LocIdAndInst action, -> SemIR::InstId; // Convenience wrapper for `AddDependentActionSplice`. -template +template auto AddDependentActionSplice(Context& context, LocT loc, InstT inst, SemIR::TypeInstId result_type_inst_id) -> SemIR::InstId { @@ -155,16 +206,31 @@ namespace Internal { // directly. auto BeginPerformDelayedAction(Context& context) -> void; +// Refines the operands of an action that is about to be performed within +// `specific_id`, so that they refer to instructions in the specific rather +// than in the generic. Creates new `specific_inst` instructions in the current +// instruction block as necessary to do this. This is an implementation detail +// of PerformDelayedAction and should not be called directly. +auto RefineOperandsInSpecific(Context& context, SemIR::SpecificId specific_id, + SemIR::Inst action) -> SemIR::Inst; + // Calls the PerformAction function for the given action, passing in the // relevant arguments. template auto CallPerformAction(Context& context, SemIR::SpecificId specific_id, SemIR::LocId loc_id, ActionT action_inst) - -> SemIR::InstId { + -> ReturnTypeForPerformAction { if constexpr (ActionT::Kind.action_needs_specific_id()) { + // If the action takes a `SpecificId`, it's assumed to do whatever + // refinement of its operands is necessary itself. return PerformAction(context, specific_id, loc_id, action_inst); } else { - return PerformAction(context, loc_id, action_inst); + // Refine the operands of the action so that they refer to instructions in + // the specific rather than in the generic. Any instructions this creates + // are included in the block of instructions produced by the action. + SemIR::Inst refined_action = + Internal::RefineOperandsInSpecific(context, specific_id, action_inst); + return PerformAction(context, loc_id, refined_action.As()); } } @@ -173,18 +239,11 @@ auto CallPerformAction(Context& context, SemIR::SpecificId specific_id, // directly. auto EndPerformDelayedAction(Context& context, SemIR::InstId result_id) -> SemIR::InstId; - -// Refines the operands of an action that is about to be performed within -// `specific_id`, so that they refer to instructions in the specific rather -// than in the generic. This is an implementation detail of -// PerformDelayedAction and should not be called directly. -auto RefineOperandsInSpecific(Context& context, SemIR::SpecificId specific_id, - SemIR::LocId loc_id, SemIR::Inst action) - -> SemIR::Inst; } // namespace Internal // Performs an action as a result of evaluation of a template's eval block. template + requires(ActionT::Kind.constant_kind() == SemIR::InstConstantKind::InstAction) auto PerformDelayedAction(Context& context, SemIR::SpecificId specific_id, SemIR::LocId loc_id, ActionT action_inst) -> SemIR::InstId { @@ -192,15 +251,25 @@ auto PerformDelayedAction(Context& context, SemIR::SpecificId specific_id, return SemIR::InstId::None; } Internal::BeginPerformDelayedAction(context); - // Refine the operands of the action so that they refer to instructions in - // the specific rather than in the generic. Any instructions this creates are - // included in the block of instructions produced by the action. - SemIR::Inst refined_action = Internal::RefineOperandsInSpecific( - context, specific_id, loc_id, action_inst); - auto inst_id = Internal::CallPerformAction(context, specific_id, loc_id, - refined_action.As()); + auto inst_id = + Internal::CallPerformAction(context, specific_id, loc_id, action_inst); return Internal::EndPerformDelayedAction(context, inst_id); } +template + requires(ActionT::Kind.constant_kind() == + SemIR::InstConstantKind::MultiInstAction) +auto PerformDelayedAction(Context& context, SemIR::SpecificId specific_id, + SemIR::LocId loc_id, ActionT action_inst) + -> llvm::SmallVector { + if (!ActionIsPerformable(context, action_inst, specific_id)) { + return {}; + } + Internal::BeginPerformDelayedAction(context); + auto inst_ids = + Internal::CallPerformAction(context, specific_id, loc_id, action_inst); + inst_ids[0] = Internal::EndPerformDelayedAction(context, inst_ids[0]); + return inst_ids; +} } // namespace Carbon::Check diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index a7d9f9da68af..97f1527cbd85 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -36,6 +36,7 @@ #include "toolchain/sem_ir/generic.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/inst.h" +#include "toolchain/sem_ir/inst_categories.h" #include "toolchain/sem_ir/inst_kind.h" #include "toolchain/sem_ir/pattern.h" #include "toolchain/sem_ir/type.h" @@ -48,13 +49,55 @@ namespace Carbon::Check { -// If the initializing expression `init_id` has a storage argument that refers -// to a temporary, overwrites it with the inst at `target.storage_id`, and -// returns the ID that should now be used to refer to `init_id`'s storage. Has -// no effect and returns `target.storage_id` unchanged if `target.storage_id` is -// None, if `init_id` doesn't have a storage arg, or if the storage argument -// doesn't point to a temporary. In the latter case, we assume it was set -// correctly when the instruction was created. +namespace { +// Information about the kind of instruction referred to by a storage argument. +struct StorageArgKind { + enum Kind { Temporary, Splice, Other }; + + // The kind of storage argument. + Kind kind; + // For a spliced argument in a template, the splice index. Otherwise 0. + int index = 0; +}; +} // namespace + +// Returns information about the kind of instruction referred to by a storage +// argument. +static auto GetStorageArgKind(const SemIR::File& sem_ir, + SemIR::InstId storage_arg_id) -> StorageArgKind { + if (sem_ir.insts().Is(storage_arg_id)) { + return {.kind = StorageArgKind::Temporary}; + } + + auto storage_id = storage_arg_id; + if (auto splice_block = + sem_ir.insts().TryGetAs(storage_id)) { + storage_id = splice_block->result_id; + } + if (auto splice_inst = + sem_ir.insts().TryGetAs(storage_id)) { + auto tuple_access = + sem_ir.insts().GetAs(splice_inst->inst_id); + return {.kind = StorageArgKind::Splice, .index = tuple_access.index.index}; + } + return {.kind = StorageArgKind::Other}; +} + +// Updates the storage argument of an initializer to refer to the storage of the +// given conversion target. Consumes the target's `storage_id` instruction and +// returns a reference instruction that should be used to refer to the storage +// of the initializer. +// +// - If `target.storage_id` is None or the initializing expression `init_id` +// doesn't have a storage argument, has no effect. +// - If `init_id`'s storage argument refers to a temporary, overwrites it with +// the inst at `target.storage_id`. +// - If `init_id`'s storage argument refers to a splice, then we are performing +// instantiation of an initialization action; the storage for that slice is +// tracked in the `template_storage_args` on the `ConversionTarget` instead of +// modifying the template's IR. +// - Otherwise, `init_id`'s storage argument is assumed to have already been set +// to the correct storage when the instruction was created. static auto OverwriteTemporaryStorageArg(SemIR::File& sem_ir, SemIR::InstId init_id, const ConversionTarget& target) @@ -64,14 +107,79 @@ static auto OverwriteTemporaryStorageArg(SemIR::File& sem_ir, return SemIR::InstId::None; } auto storage_arg_id = FindStorageArgForInitializer(sem_ir, init_id); - if (!storage_arg_id.has_value() || storage_arg_id == target.storage_id || - !sem_ir.insts().Is(storage_arg_id)) { + if (!storage_arg_id.has_value() || storage_arg_id == target.storage_id) { + // This instruction does not refer to a nested storage argument, or already + // refers to the correct storage. return target.storage_id; } - // Replace the temporary in the storage argument with a reference to our - // target. - return target.storage_access_block->MergeReplacing(storage_arg_id, - target.storage_id); + + switch (auto kind = GetStorageArgKind(sem_ir, storage_arg_id); kind.kind) { + case StorageArgKind::Temporary: { + // Replace the temporary in the storage argument with a reference to our + // target. + return target.storage_access_block->MergeReplacing(storage_arg_id, + target.storage_id); + } + + case StorageArgKind::Splice: { + // If the existing storage refers to an instruction splice, provide the + // new storage to template instantiation. + CARBON_CHECK(kind.index < + static_cast(target.template_storage_args.size())); + auto new_storage_id = + target.storage_access_block->MergeInNoBlock(target.storage_id); + target.template_storage_args[kind.index] = new_storage_id; + return new_storage_id; + } + + case StorageArgKind::Other: { + // Something else is already in the storage argument: leave it alone. + // TODO: Should this happen? + // TODO: Should we return the InstId we found in the storage argument + // instead of the target's storage? + return target.storage_id; + } + } +} + +// Walks an expression that might be an initializing expression or might have a +// compound form that contains initializing expressions, and visits each storage +// argument found therein. +static auto VisitAllTemporaryStorageArgs( + Context& context, const ConversionTarget& target, + SemIR::InstId outer_init_id, + llvm::function_refvoid> visit) -> void { + CARBON_CHECK(target.is_initializer()); + + llvm::SmallVector worklist = {outer_init_id}; + while (!worklist.empty()) { + auto init_id = worklist.pop_back_val(); + + // For a tuple or struct literal, visit its elements. + if (auto compound_lit_inst = + context.insts().TryGetAsIfValid( + init_id)) { + // Reverse the elements so we pop them in order. + llvm::append_range(worklist, llvm::reverse(context.inst_blocks().Get( + compound_lit_inst->elements_id))); + continue; + } + + // If it's not an initializing expression, it doesn't have a storage + // argument. + auto category = SemIR::GetExprCategory(context.sem_ir(), init_id); + if (!SemIR::IsInitializerCategory(category)) { + continue; + } + + // For anything else, check for a storage argument, skipping storage that + // has already been populated. + auto storage_arg_id = + FindStorageArgForInitializer(context.sem_ir(), init_id); + if (storage_arg_id.has_value()) { + visit(storage_arg_id); + } + } } // Materializes and returns a temporary initialized from the initializer @@ -93,7 +201,7 @@ static auto MaterializeTemporary(Context& context, SemIR::InstId init_id) } CARBON_CHECK( - sem_ir.insts().Get(storage_id).kind() == SemIR::TemporaryStorage::Kind, + GetStorageArgKind(sem_ir, storage_id).kind != StorageArgKind::Other, "Storage arg for initializer does not contain a temporary; " "initialized multiple times? Have {0}", sem_ir.insts().Get(storage_id)); @@ -191,6 +299,49 @@ static auto GetAggregateElementConversionTargetKind(SemIR::File& sem_ir, return ConversionTarget::Value; } +namespace { +// The elements of the aggregate literal that a conversion is converting from. +struct LiteralElements { + // The block containing the elements of the literal, or `None` if we're not + // converting from a literal. + SemIR::InstBlockId elems_id = SemIR::InstBlockId::None; + // If the literal is an instruction within a generic that we're converting on + // behalf of a specific, the specific in which the elements should be + // interpreted. Otherwise `None`. + SemIR::SpecificId specific_id = SemIR::SpecificId::None; + + // Returns whether the aggregate expression was a literal. + auto has_value() const -> bool { return elems_id.has_value(); } +}; +} // namespace + +// If we're converting from an aggregate literal of kind `LiteralInstT`, returns +// its elements, so that we can convert them directly instead of forming the +// aggregate and indexing into it. When performing a conversion as an action +// within a specific, the literal is wrapped in a `SpecificInst`, and its +// elements are instructions within the generic, so the specific is returned +// along with them. Otherwise, returns no elements. +template +static auto GetAggregateLiteralElements(Context& context, + SemIR::InstId value_id) + -> LiteralElements { + auto value = context.insts().Get(value_id); + + // Look through a `SpecificInst`, which is used to refer to an instruction + // from a generic while performing an action within a specific. + auto specific_id = SemIR::SpecificId::None; + if (auto specific_inst = value.TryAs()) { + specific_id = specific_inst->specific_id; + value = context.insts().Get(specific_inst->inst_id); + } + + if (auto literal = value.TryAs()) { + return {.elems_id = literal->elements_id, .specific_id = specific_id}; + } + + return {}; +} + // Converts an element of one aggregate so that it can be used as an element of // another aggregate. // @@ -207,10 +358,10 @@ static auto GetAggregateElementConversionTargetKind(SemIR::File& sem_ir, template static auto ConvertAggregateElement( Context& context, SemIR::LocId loc_id, SemIR::InstId src_id, - SemIR::TypeInstId src_elem_type_inst, - llvm::ArrayRef src_literal_elems, + SemIR::TypeInstId src_elem_type_inst, const LiteralElements& src_literal, ConversionTarget::Kind kind, SemIR::InstId target_id, SemIR::TypeInstId target_elem_type_inst, PendingBlock* target_block, + llvm::MutableArrayRef template_storage_args, size_t src_field_index, size_t target_field_index) -> SemIR::InstId { auto src_elem_type = context.types().GetTypeIdForTypeInstId(src_elem_type_inst); @@ -220,11 +371,20 @@ static auto ConvertAggregateElement( // Compute the location of the source element. This goes into the current code // block, not into the target block. // TODO: Ideally we would discard this instruction if it's unused. - auto src_elem_id = !src_literal_elems.empty() - ? src_literal_elems[src_field_index] - : MakeElementAccessInst( - context, loc_id, src_id, src_elem_type, context, - src_field_index); + auto src_elem_id = SemIR::InstId::None; + if (!src_literal.has_value()) { + src_elem_id = MakeElementAccessInst( + context, loc_id, src_id, src_elem_type, context, src_field_index); + } else { + src_elem_id = + context.inst_blocks().Get(src_literal.elems_id)[src_field_index]; + if (src_literal.specific_id.has_value()) { + // The literal is an instruction in a generic, and so are its elements. + // Refer to the corresponding instruction in the specific instead. + src_elem_id = + AddSpecificInst(context, src_elem_id, src_literal.specific_id); + } + } // If we're performing a conversion rather than an initialization, we won't // have or need a target. @@ -239,6 +399,7 @@ static auto ConvertAggregateElement( target.storage_id = MakeElementAccessInst( context, loc_id, target_id, target_elem_type, *target_block, target_field_index); + target.template_storage_args = template_storage_args; return Convert(context, loc_id, src_elem_id, target); } @@ -252,16 +413,14 @@ static auto ConvertTupleToArray(Context& context, SemIR::TupleType tuple_type, auto& sem_ir = context.sem_ir(); auto tuple_elem_types = sem_ir.inst_blocks().Get(tuple_type.type_elements_id); - auto value = sem_ir.insts().Get(value_id); SemIR::LocId value_loc_id(value_id); // If we're initializing from a tuple literal, we will use its elements // directly. Otherwise, materialize a temporary if needed and index into the // result. - llvm::ArrayRef literal_elems; - if (auto tuple_literal = value.TryAs()) { - literal_elems = sem_ir.inst_blocks().Get(tuple_literal->elements_id); - } else { + auto literal = + GetAggregateLiteralElements(context, value_id); + if (!literal.has_value()) { value_id = MaterializeIfInitializer(context, value_id); } @@ -290,9 +449,9 @@ static auto ConvertTupleToArray(Context& context, SemIR::TupleType tuple_type, "with {1} element{1:s}", Diagnostics::IntAsSelect, Diagnostics::IntAsSelect); context.emitter().Emit(value_loc_id, - literal_elems.empty() - ? ArrayInitFromExprArgCountMismatch - : ArrayInitFromLiteralArgCountMismatch, + literal.has_value() + ? ArrayInitFromLiteralArgCountMismatch + : ArrayInitFromExprArgCountMismatch, *array_bound, tuple_elem_types.size()); } return SemIR::ErrorInst::InstId; @@ -323,9 +482,10 @@ static auto ConvertTupleToArray(Context& context, SemIR::TupleType tuple_type, // approach. auto init_id = ConvertAggregateElement( - context, value_loc_id, value_id, src_type_inst_id, literal_elems, + context, value_loc_id, value_id, src_type_inst_id, literal, ConversionTarget::InPlaceInitializing, return_slot_arg_id, - array_type.element_type_inst_id, target_block, i, i); + array_type.element_type_inst_id, target_block, + target.template_storage_args, i, i); if (init_id == SemIR::ErrorInst::InstId) { return SemIR::ErrorInst::InstId; } @@ -352,18 +512,14 @@ static auto ConvertTupleToTuple(Context& context, SemIR::TupleType src_type, auto src_elem_types = sem_ir.inst_blocks().Get(src_type.type_elements_id); auto dest_elem_types = sem_ir.inst_blocks().Get(dest_type.type_elements_id); - auto value = sem_ir.insts().Get(value_id); SemIR::LocId value_loc_id(value_id); // If we're initializing from a tuple literal, we will use its elements // directly. Otherwise, materialize a temporary if needed and index into the // result. - llvm::ArrayRef literal_elems; - auto literal_elems_id = SemIR::InstBlockId::None; - if (auto tuple_literal = value.TryAs()) { - literal_elems_id = tuple_literal->elements_id; - literal_elems = sem_ir.inst_blocks().Get(literal_elems_id); - } else { + auto literal = + GetAggregateLiteralElements(context, value_id); + if (!literal.has_value()) { value_id = MaterializeIfInitializer(context, value_id); } @@ -388,8 +544,8 @@ static auto ConvertTupleToTuple(Context& context, SemIR::TupleType src_type, // of the source. // TODO: Annotate diagnostics coming from here with the element index. auto new_block = - literal_elems_id.has_value() - ? SemIR::CopyOnWriteInstBlock(&sem_ir, literal_elems_id) + literal.elems_id.has_value() + ? SemIR::CopyOnWriteInstBlock(&sem_ir, literal.elems_id) : SemIR::CopyOnWriteInstBlock( &sem_ir, SemIR::CopyOnWriteInstBlock::UninitializedBlock{ src_elem_types.size()}); @@ -400,9 +556,9 @@ static auto ConvertTupleToTuple(Context& context, SemIR::TupleType src_type, // approach. auto init_id = ConvertAggregateElement( - context, value_loc_id, value_id, src_type_inst_id, literal_elems, + context, value_loc_id, value_id, src_type_inst_id, literal, inner_kind, target.storage_id, dest_type_inst_id, - target.storage_access_block, i, i); + target.storage_access_block, target.template_storage_args, i, i); if (init_id == SemIR::ErrorInst::InstId) { return SemIR::ErrorInst::InstId; } @@ -634,18 +790,14 @@ static auto ConvertStructToStructOrClass( auto dest_elem_fields_size = dest_elem_fields.size() - (dest_vptr_index.has_value() ? 1 : 0); - auto value = sem_ir.insts().Get(value_id); SemIR::LocId value_loc_id(value_id); // If we're initializing from a struct literal, we will use its elements // directly. Otherwise, materialize a temporary if needed and index into the // result. - llvm::ArrayRef literal_elems; - auto literal_elems_id = SemIR::InstBlockId::None; - if (auto struct_literal = value.TryAs()) { - literal_elems_id = struct_literal->elements_id; - literal_elems = sem_ir.inst_blocks().Get(literal_elems_id); - } else { + auto literal = + GetAggregateLiteralElements(context, value_id); + if (!literal.has_value()) { value_id = MaterializeIfInitializer(context, value_id); } @@ -661,7 +813,7 @@ static auto ConvertStructToStructOrClass( for (auto [i, field] : llvm::enumerate(src_elem_fields)) { if (!dest_field_names.Lookup(field.name_id)) { if (target.diagnose) { - if (literal_elems_id.has_value()) { + if (literal.elems_id.has_value()) { CARBON_DIAGNOSTIC(StructInitUnexpectedFieldInLiteral, Error, "struct {0} has no field named `{1}`", SemIR::TypeId, SemIR::NameId); @@ -693,9 +845,10 @@ static auto ConvertStructToStructOrClass( // of the source. // TODO: Annotate diagnostics coming from here with the element index. auto new_block = - literal_elems_id.has_value() && !dest_vptr_index.has_value() && - literal_elems.size() == dest_elem_fields_size - ? SemIR::CopyOnWriteInstBlock(&sem_ir, literal_elems_id) + (literal.has_value() && !dest_vptr_index.has_value() && + context.inst_blocks().Get(literal.elems_id).size() == + dest_elem_fields_size) + ? SemIR::CopyOnWriteInstBlock(&sem_ir, literal.elems_id) : SemIR::CopyOnWriteInstBlock( &sem_ir, SemIR::CopyOnWriteInstBlock::UninitializedBlock{ dest_elem_fields.size()}); @@ -770,9 +923,10 @@ static auto ConvertStructToStructOrClass( dest_field_index += 1; } init_id = ConvertAggregateElement( - context, value_loc_id, value_id, src_field.type_inst_id, - literal_elems, inner_kind, target.storage_id, dest_field_type_inst_id, - target.storage_access_block, src_field_index, dest_field_index); + context, value_loc_id, value_id, src_field.type_inst_id, literal, + inner_kind, target.storage_id, dest_field_type_inst_id, + target.storage_access_block, target.template_storage_args, + src_field_index, dest_field_index); } else { init_id = get_default(dest_field.name_id); } @@ -783,7 +937,7 @@ static auto ConvertStructToStructOrClass( if (!init_id.has_value()) { if (target.diagnose) { - if (literal_elems_id.has_value()) { + if (literal.elems_id.has_value()) { CARBON_DIAGNOSTIC( StructInitMissingFieldInLiteral, Error, "missing value for field `{0}` in struct initialization", @@ -1855,12 +2009,11 @@ auto CategoryConverter::DoStep(const SemIR::InstId expr_id, return Done{SemIR::ErrorInst::InstId}; case SemIR::ExprCategory::Dependent: - return Done{AddDependentActionSplice( + return Done{AddDependentActionSplice( context_, loc_id_, - SemIR::ConvertToCategoryAction{ - .type_id = SemIR::InstType::TypeId, - .inst_id = expr_id, - .conversion_kind = SemIR::ElementIndex(target_.kind)}, + {.type_id = SemIR::InstType::TypeId, + .inst_id = expr_id, + .conversion_kind = SemIR::ElementIndex(target_.kind)}, context_.types().GetTypeInstId( context_.insts().Get(expr_id).type_id()))}; @@ -2000,7 +2153,10 @@ static auto AddConvertActionIfDependent(Context& context, SemIR::LocId loc_id, return SemIR::InstId::None; } - if (OperandDependence(context, expr_id) < + // Compute the dependence that the action we create below is going to have. We + // do this separately from building the action in order to avoid creating the + // argument bundle in the case where we're not deferring conversion. + if (OperandDependence(context, SemIR::MetaInstId(expr_id)) < SemIR::ConstantDependence::Template && OperandDependence(context, target.type_id) < SemIR::ConstantDependence::Template) { @@ -2009,6 +2165,65 @@ static auto AddConvertActionIfDependent(Context& context, SemIR::LocId loc_id, auto target_type_inst_id = context.types().GetTypeInstId(target.type_id); + // If we are initializing and have a storage argument, we need to update any + // nested storage arguments within the initializer, but we don't know what to + // update them to yet, so create placeholders. + if (target.storage_id.has_value()) { + // Compute the return type of the action: this is a tuple of N+1 InstTypes, + // where N is the number of storage arguments in the initializer. + int32_t num_storage_args = 0; + VisitAllTemporaryStorageArgs( + context, target, expr_id, + [&](SemIR::InstId /*inst_id*/) { ++num_storage_args; }); + llvm::SmallVector action_type_elements_id( + num_storage_args + 1, SemIR::InstType::TypeInstId); + auto action_type_id = GetTupleType(context, action_type_elements_id); + + // Create the initialization action. + auto action_id = AddDependentActionInst( + context, loc_id, + {.type_id = action_type_id, + .init_id = expr_id, + .target_id = + context.bundles().AddCanonical(SemIR::InitializeAction::Target{ + .target_type_inst_id = target_type_inst_id, + .storage_id = target.storage_id, + .in_place = SemIR::BoolValue::From( + target.kind == ConversionTarget::InPlaceInitializing)})}); + + // Extract the first result: this is the instruction that performs the + // initialization and produces the result. + int32_t index = 0; + auto result_id = AddTemplateConstantInstToEvalBlock( + context, loc_id, + {.type_id = SemIR::InstType::TypeId, + .tuple_id = action_id, + .index = SemIR::ElementIndex(index++)}); + + // Walk the initializer, find all storage arguments, and replace each of + // them with a splice. + VisitAllTemporaryStorageArgs( + context, target, expr_id, [&](SemIR::InstId storage_arg_id) { + // Find the storage instructions in the action result. + auto storage_inst_id = + AddTemplateConstantInstToEvalBlock( + context, loc_id, + {.type_id = SemIR::InstType::TypeId, + .tuple_id = action_id, + .index = SemIR::ElementIndex(index++)}); + + // Create new storage and replace the current storage argument with + // it. + auto type_id = context.insts().Get(storage_arg_id).type_id(); + auto storage_id = + target.storage_access_block->AddInst( + loc_id, {.type_id = type_id, .inst_id = storage_inst_id}); + target.storage_access_block->MergeReplacing(storage_arg_id, + storage_id); + }); + return AddSpliceInst(context, result_id, target_type_inst_id); + } + // We don't use `HandleAction` here because it would call `PerformAction` // inline if it's performable, which would lead to infinite recursion. switch (target.kind) { @@ -2020,12 +2235,11 @@ static auto AddConvertActionIfDependent(Context& context, SemIR::LocId loc_id, } case ConversionTarget::Value: { // Special-cased action for the case where we know the target category. - return AddDependentActionSplice( + return AddDependentActionSplice( context, loc_id, - SemIR::ConvertToValueAction{ - .type_id = SemIR::InstType::TypeId, - .inst_id = expr_id, - .target_type_inst_id = target_type_inst_id}, + {.type_id = SemIR::InstType::TypeId, + .inst_id = expr_id, + .target_type_inst_id = target_type_inst_id}, target_type_inst_id); } case ConversionTarget::ValueOrRef: @@ -2033,16 +2247,17 @@ static auto AddConvertActionIfDependent(Context& context, SemIR::LocId loc_id, case ConversionTarget::RefParam: case ConversionTarget::UnmarkedRefParam: case ConversionTarget::ExplicitAs: - case ConversionTarget::ExplicitUnsafeAs: { - return AddDependentActionSplice( + case ConversionTarget::ExplicitUnsafeAs: + case ConversionTarget::Initializing: + case ConversionTarget::InPlaceInitializing: { + return AddDependentActionSplice( context, loc_id, - SemIR::ConvertAction{ - .type_id = SemIR::InstType::TypeId, - .inst_id = expr_id, - .target_id = - context.bundles().AddCanonical(SemIR::ConvertAction::Target{ - .target_type_inst_id = target_type_inst_id, - .conversion_kind = SemIR::ElementIndex(target.kind)})}, + {.type_id = SemIR::InstType::TypeId, + .inst_id = expr_id, + .target_id = + context.bundles().AddCanonical(SemIR::ConvertAction::Target{ + .target_type_inst_id = target_type_inst_id, + .conversion_kind = SemIR::ElementIndex(target.kind)})}, target_type_inst_id); } @@ -2051,12 +2266,6 @@ static auto AddConvertActionIfDependent(Context& context, SemIR::LocId loc_id, // category conversion. break; } - - case ConversionTarget::Initializing: - case ConversionTarget::InPlaceInitializing: { - // TODO: Handle dependent initializations. - break; - } } return SemIR::InstId::None; @@ -2097,6 +2306,66 @@ auto PerformAction(Context& context, SemIR::LocId loc_id, return PerformCategoryConversion(context, loc_id, expr_id, target); } +auto PerformAction(Context& context, SemIR::SpecificId specific_id, + SemIR::LocId loc_id, SemIR::InitializeAction action) + -> llvm::SmallVector { + // Build the list of results. We will overwrite the first element (the + // resulting initialization expression itself) after we finish conversion, and + // will overwrite the other elements (the storage arguments) when we encounter + // them during initialization. + auto result_tuple_type = + context.types().GetAs(action.type_id); + llvm::SmallVector result_ids( + context.inst_blocks().Get(result_tuple_type.type_elements_id).size(), + SemIR::InstId::None); + + const auto& target_bundle = context.bundles().Get(action.target_id); + PendingBlock target_block(&context); + auto specific_storage_id = AddSpecificInstToPendingBlock( + target_block, target_bundle.storage_id, specific_id); + ConversionTarget target = { + .kind = ConversionTarget::Kind(target_bundle.in_place.ToBool() + ? ConversionTarget::InPlaceInitializing + : ConversionTarget::Initializing), + .type_id = context.types().GetTypeIdForTypeInstId( + target_bundle.target_type_inst_id), + .storage_id = specific_storage_id, + .storage_access_block = &target_block, + .template_storage_args = result_ids}; + + // Form a specific initializer and initialize from it. + auto expr_id = AddSpecificInst(context, action.init_id, specific_id); + + // Perform the initialization. As a side effect, this will update + // `result_ids` to refer to parts of storage_id. + expr_id = PerformBuiltinConversion(context, loc_id, expr_id, target); + expr_id = PerformUserDefinedConversion(context, loc_id, expr_id, target); + result_ids[0] = PerformCategoryConversion(context, loc_id, expr_id, target); + + // Put a temporary in any storage argument that we didn't explicitly + // initialize. + int next_result_index = 1; + VisitAllTemporaryStorageArgs( + context, target, action.init_id, [&](SemIR::InstId storage_arg_id) { + // TODO: We shouldn't need to do this. Instead, we should turn off + // rewriting of `action.inst_id` and map into the specific ourselves + // where needed. + if (next_result_index >= static_cast(result_ids.size())) { + return; + } + if (!result_ids[next_result_index].has_value()) { + result_ids[next_result_index] = + AddInstInNoBlock( + context, SemIR::LocId(storage_arg_id), + {.type_id = context.insts().Get(storage_arg_id).type_id()}); + } + ++next_result_index; + }); + CARBON_CHECK(next_result_index == static_cast(result_ids.size())); + + return result_ids; +} + // Returns true if converting `expr_id` to `target` requires `target.type_id` // to be complete. static auto ConversionNeedsCompleteTarget(Context& context, diff --git a/toolchain/check/convert.h b/toolchain/check/convert.h index 6b058b8115c4..c33ed01098d1 100644 --- a/toolchain/check/convert.h +++ b/toolchain/check/convert.h @@ -72,6 +72,10 @@ struct ConversionTarget { // depends on. This block will be spliced or merged before any reference to // `storage_id`, and may be discarded if `storage_id` is not accessed. PendingBlock* storage_access_block = nullptr; + // For an initializer during template instantiation, the replacements for + // already-spliced storage arguments are written here, for use in the action + // result. + llvm::MutableArrayRef template_storage_args = {}; // Whether failure of conversion is an error and is diagnosed to the user. // When looking for a possible conversion but with graceful fallback, // `diagnose` should be false. If `diagnose` is false, an `ErrorInst` may be diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index e67c3c0207f8..9f7ece42e6eb 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -3121,10 +3121,34 @@ static auto TryEvalTypedInst(EvalContext& eval_context, SemIR::InstId inst_id, // The result is an instruction. return MakeConstantResult( eval_context.context(), - SemIR::InstValue{ - .type_id = GetSingletonType(eval_context.context(), - SemIR::InstType::TypeInstId), - .inst_id = result_inst_id}, + SemIR::InstValue{.type_id = SemIR::InstType::TypeId, + .inst_id = result_inst_id}, + Phase::Concrete); + } + // Couldn't perform the action because it's still dependent. + return MakeConstantResult(eval_context.context(), inst, + Phase::TemplateSymbolic); + } else if constexpr (ConstantKind == + SemIR::InstConstantKind::MultiInstAction) { + auto result_inst_ids = PerformDelayedAction( + eval_context.context(), eval_context.specific_id(), + SemIR::LocId(inst_id), inst.As()); + if (!result_inst_ids.empty()) { + // The result is a tuple of instruction values. + for (auto& result_inst_id : result_inst_ids) { + result_inst_id = + eval_context.constant_values().GetInstId(MakeConstantResult( + eval_context.context(), + SemIR::InstValue{.type_id = SemIR::InstType::TypeId, + .inst_id = result_inst_id}, + Phase::Concrete)); + } + return MakeConstantResult( + eval_context.context(), + SemIR::TupleValue{ + .type_id = inst.type_id(), + .elements_id = + eval_context.inst_blocks().AddCanonical(result_inst_ids)}, Phase::Concrete); } // Couldn't perform the action because it's still dependent. diff --git a/toolchain/check/eval_inst.h b/toolchain/check/eval_inst.h index b2ac7c1dc930..286ca77a54a4 100644 --- a/toolchain/check/eval_inst.h +++ b/toolchain/check/eval_inst.h @@ -105,6 +105,7 @@ constexpr auto ConstantKindHasEvalConstantInst(SemIR::InstConstantKind kind) switch (kind) { case SemIR::InstConstantKind::Never: case SemIR::InstConstantKind::InstAction: + case SemIR::InstConstantKind::MultiInstAction: case SemIR::InstConstantKind::WheneverPossible: case SemIR::InstConstantKind::Always: case SemIR::InstConstantKind::AlwaysUnique: diff --git a/toolchain/check/generic.cpp b/toolchain/check/generic.cpp index 3ca8e481af43..7a692fdea87d 100644 --- a/toolchain/check/generic.cpp +++ b/toolchain/check/generic.cpp @@ -264,9 +264,23 @@ static auto AddGenericConstantToEvalBlock(Context& context, auto GetOrAddInstWithSpecificConstantValue(Context& context, SemIR::InstId inst_id) -> SemIR::InstId { - if (!context.constant_values().Get(inst_id).is_symbolic()) { + auto const_id = context.constant_values().GetAttached(inst_id); + if (!const_id.is_symbolic()) { return inst_id; } + + // If the instruction's constant value is is already attached to the current + // generic, we can use it directly. Otherwise, map to the unattached constant. + if (context.constant_values().IsAttached(const_id)) { + const auto& symbolic = + context.constant_values().GetSymbolicConstant(const_id); + if (symbolic.generic_id == + context.generic_region_stack().PeekPendingGeneric().generic_id) { + return inst_id; + } + inst_id = symbolic.inst_id; + } + return AddGenericConstantInstToEvalBlock(context, inst_id); } diff --git a/toolchain/check/inst.cpp b/toolchain/check/inst.cpp index ef0a8347adfd..e4b692d10ae6 100644 --- a/toolchain/check/inst.cpp +++ b/toolchain/check/inst.cpp @@ -81,11 +81,12 @@ auto AddInstInNoBlock(Context& context, SemIR::LocIdAndInst loc_id_and_inst) return inst_id; } -auto AddDependentActionInst(Context& context, - SemIR::LocIdAndInst loc_id_and_inst) +auto AddTemplateConstantInstToEvalBlock(Context& context, + SemIR::LocIdAndInst loc_id_and_inst) -> SemIR::InstId { auto inst_id = context.sem_ir().insts().AddInNoBlock(loc_id_and_inst); - CARBON_VLOG_TO(context.vlog_stream(), "AddDependentActionInst: {0}\n", + CARBON_VLOG_TO(context.vlog_stream(), + "AddTemplateConstantInstToEvalBlock: {0}\n", loc_id_and_inst.inst); // Set the constant value of this instruction to point back to itself. diff --git a/toolchain/check/inst.h b/toolchain/check/inst.h index 26a080d7abb8..1707cae7e9bc 100644 --- a/toolchain/check/inst.h +++ b/toolchain/check/inst.h @@ -109,27 +109,18 @@ auto EvalOrAddInst(Context& context, LocT loc, InstT inst) // Adds an instruction and enqueues it to be added to the eval block of the // enclosing generic, returning the produced ID. The instruction is expected to -// be a dependent template instantiation action. -auto AddDependentActionInst(Context& context, - SemIR::LocIdAndInst loc_id_and_inst) +// have a template constant value. +auto AddTemplateConstantInstToEvalBlock(Context& context, + SemIR::LocIdAndInst loc_id_and_inst) -> SemIR::InstId; -// Convenience wrapper for AddDependentActionInst. +// Convenience wrapper for AddTemplateConstantInstToEvalBlock. template requires std::convertible_to -auto AddDependentActionInst(Context& context, LocT loc, InstT inst) +auto AddTemplateConstantInstToEvalBlock(Context& context, LocT loc, InstT inst) -> SemIR::InstId { - return AddDependentActionInst(context, SemIR::LocIdAndInst(loc, inst)); -} - -// Like AddDependentActionInst, but for instructions with a type_id of -// `TypeType`, which is encoded in the return type of `TypeInstId`. -template - requires std::convertible_to -auto AddDependentActionTypeInst(Context& context, LocT loc, InstT inst) - -> SemIR::TypeInstId { - return context.types().GetAsTypeInstId( - AddDependentActionInst(context, loc, inst)); + return AddTemplateConstantInstToEvalBlock(context, + SemIR::LocIdAndInst(loc, inst)); } // Adds an instruction to the current block, returning the produced ID. The diff --git a/toolchain/check/pending_block.h b/toolchain/check/pending_block.h index f5c4f4632a02..6577adffc5e9 100644 --- a/toolchain/check/pending_block.h +++ b/toolchain/check/pending_block.h @@ -24,6 +24,8 @@ class PendingBlock { PendingBlock(const PendingBlock&) = delete; auto operator=(const PendingBlock&) -> PendingBlock& = delete; + auto context() -> Context& { return *context_; } + // A scope in which we will tentatively add instructions to a pending block. // If we leave the scope without inserting or merging the block, instructions // added after this point will be removed again. @@ -126,6 +128,28 @@ class PendingBlock { return result_id; } + // Merges this pending block into a single instruction that executes the + // instructions in the block and produces `value_id`. Cleanups are registered, + // but the new instruction is not added to a block; the caller is expected to + // add it somewhere suitable. This is used during template actions to produce + // the pending block as an action result. + auto MergeInNoBlock(SemIR::InstId value_id) -> SemIR::InstId { + auto result_id = value_id; + if (insts_.size() != 1 || insts_[0] != value_id) { + // Create a splice block if the block is not exactly `{value_id}`. + result_id = AddInstInNoBlock( + *context_, SemIR::LocId(value_id), + {.type_id = context_->insts().Get(value_id).type_id(), + .block_id = context_->inst_blocks().Add(insts_), + .result_id = value_id}); + } + + insts_.clear(); + + AddPendingCleanups(); + return result_id; + } + private: auto AddPendingCleanups() -> void { for (auto id : cleanups_) { diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index 27de2f66cae9..069b8534243f 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -210,12 +210,12 @@ fn H() { G(3); } // CHECK:STDOUT: %N.patt.38a: %pattern_type.6b6 = symbolic_binding_pattern N, 0, template [template] // CHECK:STDOUT: %N.37f: %i32 = symbolic_binding N, 0, template [template] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] -// CHECK:STDOUT: %.233: Core.IntLiteral = splice_inst @G.%.loc11_30.2 [template] -// CHECK:STDOUT: %array_type.3cc: type = array_type %.233, %i32 [template] -// CHECK:STDOUT: %require_complete.2bf: = require_complete_type %array_type.3cc [template] -// CHECK:STDOUT: %pattern_type.ed3: type = pattern_type %array_type.3cc [template] -// CHECK:STDOUT: %arr.patt.515: %pattern_type.ed3 = ref_binding_pattern arr [template] -// CHECK:STDOUT: %arr.var_patt.821: %pattern_type.ed3 = var_pattern %arr.patt.515 [template] +// CHECK:STDOUT: %.da2: Core.IntLiteral = splice_inst @G.%.loc11_30.2 [template] +// CHECK:STDOUT: %array_type.2dd: type = array_type %.da2, %i32 [template] +// CHECK:STDOUT: %require_complete.1f3: = require_complete_type %array_type.2dd [template] +// CHECK:STDOUT: %pattern_type.273: type = pattern_type %array_type.2dd [template] +// CHECK:STDOUT: %arr.patt.8e5: %pattern_type.273 = ref_binding_pattern arr [template] +// CHECK:STDOUT: %arr.var_patt.8ae: %pattern_type.273 = var_pattern %arr.patt.8e5 [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] @@ -227,10 +227,10 @@ fn H() { G(3); } // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] // CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] -// CHECK:STDOUT: %.19c: type = type_of_inst @G.%.loc11_3.5 [template] -// CHECK:STDOUT: %.11f: %.19c = splice_inst @G.%.loc11_3.5 [template] -// CHECK:STDOUT: %.e86: type = type_of_inst @G.%.loc11_3.8 [template] -// CHECK:STDOUT: %.9d4: %.e86 = splice_inst @G.%.loc11_3.8 [template] +// CHECK:STDOUT: %.8cb: type = type_of_inst @G.%.loc11_3.5 [template] +// CHECK:STDOUT: %.c23: %.8cb = splice_inst @G.%.loc11_3.5 [template] +// CHECK:STDOUT: %.57c: type = type_of_inst @G.%.loc11_3.8 [template] +// CHECK:STDOUT: %.e63: %.57c = splice_inst @G.%.loc11_3.8 [template] // CHECK:STDOUT: %From: Core.IntLiteral = symbolic_binding From, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.7cb: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete] // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.48d: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%From) [symbolic] @@ -245,7 +245,7 @@ fn H() { G(3); } // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: = bound_method %int_3.410, %Int.as.ImplicitAs.impl.Convert.69e [concrete] // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Int.as.ImplicitAs.impl.Convert.69e, @Int.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.545: = bound_method %int_3.410, %Int.as.ImplicitAs.impl.Convert.specific_fn [concrete] -// CHECK:STDOUT: %inst.splice_block.ca0: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.354: Core.IntLiteral = splice_block %.238 [concrete = %int_3.1ba] { // CHECK:STDOUT: %impl.elem0.923: %.e3f = impl_witness_access %ImplicitAs.impl_witness.590, element0 [concrete = %Int.as.ImplicitAs.impl.Convert.69e] // CHECK:STDOUT: %bound_method.1cb: = bound_method %int_3.410, %impl.elem0.923 [concrete = %Int.as.ImplicitAs.impl.Convert.bound] @@ -285,15 +285,15 @@ fn H() { G(3); } // CHECK:STDOUT: %Destroy.facet.149: %Destroy.type = facet_value %array_type.dc7, (%custom_witness.f8f19d.3) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.95e: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.149) [concrete] // CHECK:STDOUT: %.7f7: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.95e, %Destroy.facet.149 [concrete] -// CHECK:STDOUT: %inst.splice_block.11c: = inst_value [concrete] { -// CHECK:STDOUT: %.214: = splice_block %bound_method.e27 { -// CHECK:STDOUT: %.875: ref %array_type.dc7 = specific_inst @G.%arr.var, @G(%int_3.410) +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %.9a5: = splice_block %bound_method.529 { +// CHECK:STDOUT: %.460: ref %array_type.dc7 = specific_inst @G.%arr.var, @G(%int_3.410) // CHECK:STDOUT: %impl.elem2: %.7f7 = impl_witness_access %custom_witness.f8f19d.3, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.3] -// CHECK:STDOUT: %bound_method.e27: = bound_method %.875, %impl.elem2 +// CHECK:STDOUT: %bound_method.529: = bound_method %.460, %impl.elem2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %inst.call: = inst_value [concrete] { -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.214(%.875) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.9a5(%.460) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -353,42 +353,42 @@ fn H() { G(3); } // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc11_30.2: = convert_to_value_action %N.ref, Core.IntLiteral [template] -// CHECK:STDOUT: %.loc11_30.3: Core.IntLiteral = splice_inst %.loc11_30.2 [template = %.loc11_30.3 (constants.%.233)] -// CHECK:STDOUT: %array_type.loc11_31.2: type = array_type %.loc11_30.3, constants.%i32 [template = %array_type.loc11_31.2 (constants.%array_type.3cc)] -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc11_31.2 [template = %require_complete (constants.%require_complete.2bf)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc11_31.2 [template = %pattern_type (constants.%pattern_type.ed3)] -// CHECK:STDOUT: %arr.patt.loc11_17.2: @G.%pattern_type (%pattern_type.ed3) = ref_binding_pattern arr [template = %arr.patt.loc11_17.2 (constants.%arr.patt.515)] -// CHECK:STDOUT: %arr.var_patt.loc11_3.2: @G.%pattern_type (%pattern_type.ed3) = var_pattern %arr.patt.loc11_17.2 [template = %arr.var_patt.loc11_3.2 (constants.%arr.var_patt.821)] +// CHECK:STDOUT: %.loc11_30.3: Core.IntLiteral = splice_inst %.loc11_30.2 [template = %.loc11_30.3 (constants.%.da2)] +// CHECK:STDOUT: %array_type.loc11_31.2: type = array_type %.loc11_30.3, constants.%i32 [template = %array_type.loc11_31.2 (constants.%array_type.2dd)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc11_31.2 [template = %require_complete (constants.%require_complete.1f3)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc11_31.2 [template = %pattern_type (constants.%pattern_type.273)] +// CHECK:STDOUT: %arr.patt.loc11_17.2: @G.%pattern_type (%pattern_type.273) = ref_binding_pattern arr [template = %arr.patt.loc11_17.2 (constants.%arr.patt.8e5)] +// CHECK:STDOUT: %arr.var_patt.loc11_3.2: @G.%pattern_type (%pattern_type.273) = var_pattern %arr.patt.loc11_17.2 [template = %arr.var_patt.loc11_3.2 (constants.%arr.var_patt.8ae)] // CHECK:STDOUT: %.loc11_3.5: = compound_member_access_action %arr.var, constants.%assoc2 [template] -// CHECK:STDOUT: %.loc11_3.6: type = type_of_inst %.loc11_3.5 [template = %.loc11_3.6 (constants.%.19c)] -// CHECK:STDOUT: %.loc11_3.7: @G.%.loc11_3.6 (%.19c) = splice_inst %.loc11_3.5 [template = %.loc11_3.7 (constants.%.11f)] +// CHECK:STDOUT: %.loc11_3.6: type = type_of_inst %.loc11_3.5 [template = %.loc11_3.6 (constants.%.8cb)] +// CHECK:STDOUT: %.loc11_3.7: @G.%.loc11_3.6 (%.8cb) = splice_inst %.loc11_3.5 [template = %.loc11_3.7 (constants.%.c23)] // CHECK:STDOUT: %.loc11_3.8: = call_action (%.loc11_3.2), true [template] -// CHECK:STDOUT: %.loc11_3.9: type = type_of_inst %.loc11_3.8 [template = %.loc11_3.9 (constants.%.e86)] -// CHECK:STDOUT: %.loc11_3.10: @G.%.loc11_3.9 (%.e86) = splice_inst %.loc11_3.8 [template = %.loc11_3.10 (constants.%.9d4)] +// CHECK:STDOUT: %.loc11_3.9: type = type_of_inst %.loc11_3.8 [template = %.loc11_3.9 (constants.%.57c)] +// CHECK:STDOUT: %.loc11_3.10: @G.%.loc11_3.9 (%.57c) = splice_inst %.loc11_3.8 [template = %.loc11_3.10 (constants.%.e63)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.var: ref @G.%array_type.loc11_31.2 (%array_type.3cc) = var_storage %arr.var_patt.loc11_3.1 +// CHECK:STDOUT: %arr.var: ref @G.%array_type.loc11_31.2 (%array_type.2dd) = var_storage %arr.var_patt.loc11_3.1 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc11_43: %tuple.type = tuple_literal (%int_1, %int_2, %int_3) [concrete = constants.%tuple] // CHECK:STDOUT: assign %arr.var, -// CHECK:STDOUT: %.loc11_31: type = splice_block %array_type.loc11_31.1 [template = %array_type.loc11_31.2 (constants.%array_type.3cc)] { +// CHECK:STDOUT: %.loc11_31: type = splice_block %array_type.loc11_31.1 [template = %array_type.loc11_31.2 (constants.%array_type.2dd)] { // CHECK:STDOUT: %i32.loc11: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc5_16.2 [template = %N.loc5_16.1 (constants.%N.37f)] -// CHECK:STDOUT: %.loc11_30.1: Core.IntLiteral = splice_inst %.loc11_30.2 [template = %.loc11_30.3 (constants.%.233)] -// CHECK:STDOUT: %array_type.loc11_31.1: type = array_type %.loc11_30.1, %i32.loc11 [template = %array_type.loc11_31.2 (constants.%array_type.3cc)] +// CHECK:STDOUT: %.loc11_30.1: Core.IntLiteral = splice_inst %.loc11_30.2 [template = %.loc11_30.3 (constants.%.da2)] +// CHECK:STDOUT: %array_type.loc11_31.1: type = array_type %.loc11_30.1, %i32.loc11 [template = %array_type.loc11_31.2 (constants.%array_type.2dd)] // CHECK:STDOUT: } -// CHECK:STDOUT: %arr: ref @G.%array_type.loc11_31.2 (%array_type.3cc) = wrapper_binding arr, %arr.var +// CHECK:STDOUT: %arr: ref @G.%array_type.loc11_31.2 (%array_type.2dd) = wrapper_binding arr, %arr.var // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %arr.patt.loc11_17.1: @G.%pattern_type (%pattern_type.ed3) = ref_binding_pattern arr [template = %arr.patt.loc11_17.2 (constants.%arr.patt.515)] -// CHECK:STDOUT: %arr.var_patt.loc11_3.1: @G.%pattern_type (%pattern_type.ed3) = var_pattern %arr.patt.loc11_17.1 [template = %arr.var_patt.loc11_3.2 (constants.%arr.var_patt.821)] +// CHECK:STDOUT: %arr.patt.loc11_17.1: @G.%pattern_type (%pattern_type.273) = ref_binding_pattern arr [template = %arr.patt.loc11_17.2 (constants.%arr.patt.8e5)] +// CHECK:STDOUT: %arr.var_patt.loc11_3.1: @G.%pattern_type (%pattern_type.273) = var_pattern %arr.patt.loc11_17.1 [template = %arr.var_patt.loc11_3.2 (constants.%arr.var_patt.8ae)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_3.1: type = type_of_inst %.loc11_3.5 [template = %.loc11_3.6 (constants.%.19c)] -// CHECK:STDOUT: %.loc11_3.2: @G.%.loc11_3.6 (%.19c) = splice_inst %.loc11_3.5 [template = %.loc11_3.7 (constants.%.11f)] -// CHECK:STDOUT: %.loc11_3.3: type = type_of_inst %.loc11_3.8 [template = %.loc11_3.9 (constants.%.e86)] -// CHECK:STDOUT: %.loc11_3.4: @G.%.loc11_3.9 (%.e86) = splice_inst %.loc11_3.8 [template = %.loc11_3.10 (constants.%.9d4)] +// CHECK:STDOUT: %.loc11_3.1: type = type_of_inst %.loc11_3.5 [template = %.loc11_3.6 (constants.%.8cb)] +// CHECK:STDOUT: %.loc11_3.2: @G.%.loc11_3.6 (%.8cb) = splice_inst %.loc11_3.5 [template = %.loc11_3.7 (constants.%.c23)] +// CHECK:STDOUT: %.loc11_3.3: type = type_of_inst %.loc11_3.8 [template = %.loc11_3.9 (constants.%.57c)] +// CHECK:STDOUT: %.loc11_3.4: @G.%.loc11_3.9 (%.57c) = splice_inst %.loc11_3.8 [template = %.loc11_3.10 (constants.%.e63)] // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -442,14 +442,14 @@ fn H() { G(3); } // CHECK:STDOUT: %N.loc5_16.1 => constants.%int_3.410 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc11_30.2 => constants.%inst.splice_block.ca0 +// CHECK:STDOUT: %.loc11_30.2 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc11_30.3 => constants.%int_3.1ba // CHECK:STDOUT: %array_type.loc11_31.2 => constants.%array_type.dc7 // CHECK:STDOUT: %require_complete => constants.%complete_type.b77 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.771 // CHECK:STDOUT: %arr.patt.loc11_17.2 => constants.%arr.patt.316 // CHECK:STDOUT: %arr.var_patt.loc11_3.2 => constants.%arr.var_patt.c63 -// CHECK:STDOUT: %.loc11_3.5 => constants.%inst.splice_block.11c +// CHECK:STDOUT: %.loc11_3.5 => constants.%inst.splice_block.426619.2 // CHECK:STDOUT: %.loc11_3.6 => // CHECK:STDOUT: %.loc11_3.7 => invalid // CHECK:STDOUT: %.loc11_3.8 => constants.%inst.call diff --git a/toolchain/check/testdata/class/destroy_calls.carbon b/toolchain/check/testdata/class/destroy_calls.carbon index eb96067a3573..42a40d1802e9 100644 --- a/toolchain/check/testdata/class/destroy_calls.carbon +++ b/toolchain/check/testdata/class/destroy_calls.carbon @@ -1064,57 +1064,42 @@ fn G() { F({}); } // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %.c44: type = type_of_inst @F.%.loc7_20.5 [template] // CHECK:STDOUT: %.d24: %.c44 = splice_inst @F.%.loc7_20.5 [template] -// CHECK:STDOUT: %.8bb: type = splice_inst @F.%.loc7_20.8 [template] -// CHECK:STDOUT: %require_complete.afd: = require_complete_type %.8bb [template] -// CHECK:STDOUT: %pattern_type.6b2: type = pattern_type %.8bb [template] -// CHECK:STDOUT: %v.patt.404: %pattern_type.6b2 = ref_binding_pattern v [template] -// CHECK:STDOUT: %v.var_patt.3f1: %pattern_type.6b2 = var_pattern %v.patt.404 [template] +// CHECK:STDOUT: %.537: type = splice_inst @F.%.loc7_20.8 [template] +// CHECK:STDOUT: %require_complete.cb0: = require_complete_type %.537 [template] +// CHECK:STDOUT: %pattern_type.fcb: type = pattern_type %.537 [template] +// CHECK:STDOUT: %v.patt.126: %pattern_type.fcb = ref_binding_pattern v [template] +// CHECK:STDOUT: %v.var_patt.768: %pattern_type.fcb = var_pattern %v.patt.126 [template] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] -// CHECK:STDOUT: %.f8059f.1: type = type_of_inst @F.%.loc7_3.15 [template] -// CHECK:STDOUT: %.03555b.1: %.f8059f.1 = splice_inst @F.%.loc7_3.15 [template] -// CHECK:STDOUT: %.9aee9e.1: type = type_of_inst @F.%.loc7_3.18 [template] -// CHECK:STDOUT: %.880b95.1: %.9aee9e.1 = splice_inst @F.%.loc7_3.18 [template] -// CHECK:STDOUT: %.4cb: type = type_of_inst @F.%.loc7_3.21 [template] -// CHECK:STDOUT: %.315: %.4cb = splice_inst @F.%.loc7_3.21 [template] -// CHECK:STDOUT: %.d5b: type = type_of_inst @F.%.loc7_3.24 [template] -// CHECK:STDOUT: %.b20: %.d5b = splice_inst @F.%.loc7_3.24 [template] -// CHECK:STDOUT: %.d6d: %.8bb = splice_inst @F.%.loc7_3.27 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.5d6: %.537 = splice_inst @F.%tuple.elem0 [template] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Self: %Destroy.type = symbolic_binding Self, 0 [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self) [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] // CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] -// CHECK:STDOUT: %.ec4: type = type_of_inst @F.%.loc7_3.29 [template] -// CHECK:STDOUT: %.f75: %.ec4 = splice_inst @F.%.loc7_3.29 [template] -// CHECK:STDOUT: %.99a: type = type_of_inst @F.%.loc7_3.32 [template] -// CHECK:STDOUT: %.04f: %.99a = splice_inst @F.%.loc7_3.32 [template] +// CHECK:STDOUT: %.8cb: type = type_of_inst @F.%.loc7_3.8 [template] +// CHECK:STDOUT: %.c23: %.8cb = splice_inst @F.%.loc7_3.8 [template] +// CHECK:STDOUT: %.57c: type = type_of_inst @F.%.loc7_3.11 [template] +// CHECK:STDOUT: %.e63: %.57c = splice_inst @F.%.loc7_3.11 [template] // CHECK:STDOUT: %C.d8efcc.1: type = class_type @C, @C(%empty_struct_type) [concrete] // CHECK:STDOUT: %inst.class_type: = inst_value [concrete] { // CHECK:STDOUT: %C.d8efcc.2: type = class_type @C, @C(%empty_struct_type) [concrete = %C.d8efcc.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.1b2: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.6eb: type = splice_block %C.d8efcc.1 [concrete = %C.d8efcc.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: %pattern_type.2fd: type = pattern_type %C.d8efcc.1 [concrete] // CHECK:STDOUT: %v.patt.0e7: %pattern_type.2fd = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt.259: %pattern_type.2fd = var_pattern %v.patt.0e7 [concrete] -// CHECK:STDOUT: %.9bd: = call_action (%ImplicitAs.generic, %.8bb), false [template] -// CHECK:STDOUT: %.f8059f.2: type = type_of_inst %.9bd [template] -// CHECK:STDOUT: %.03555b.2: %.f8059f.2 = splice_inst %.9bd [template] -// CHECK:STDOUT: %.139: = access_member_action %.03555b.2, Convert [template] -// CHECK:STDOUT: %.9aee9e.2: type = type_of_inst %.139 [template] -// CHECK:STDOUT: %.880b95.2: %.9aee9e.2 = splice_inst %.139 [template] -// CHECK:STDOUT: %.143: = compound_member_access_action %empty_struct, %.880b95.2 [template] -// CHECK:STDOUT: %.4e6: type = type_of_inst %.143 [template] -// CHECK:STDOUT: %.398: %.4e6 = splice_inst %.143 [template] -// CHECK:STDOUT: %.37a: = call_action (%.398), true [template] -// CHECK:STDOUT: %.e10: type = type_of_inst %.37a [template] -// CHECK:STDOUT: %.0f6: %.e10 = splice_inst %.37a [template] -// CHECK:STDOUT: %.afa: = convert_to_category_action %.0f6, element10 [template] -// CHECK:STDOUT: %.610: %C.d8efcc.1 = splice_inst %.afa [template] +// CHECK:STDOUT: %C.val: %C.d8efcc.1 = struct_value () [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %.895: init %C.d8efcc.1 = splice_block %.57d [concrete = %C.val] { +// CHECK:STDOUT: %.711900.2: ref %C.d8efcc.1 = specific_inst @F.%v.var, @F(%empty_struct_type) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%inst.splice_block.426619.2) [concrete] // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %self.param_patt.52f: %pattern_type.a96 = ref_param_pattern [concrete] // CHECK:STDOUT: %self.patt.4b1: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt.52f [concrete] @@ -1134,15 +1119,15 @@ fn G() { F({}); } // CHECK:STDOUT: %Destroy.facet.097: %Destroy.type = facet_value %C.d8efcc.1, (%custom_witness.f8f19d.2) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.3da: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.097) [concrete] // CHECK:STDOUT: %.cbc: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.3da, %Destroy.facet.097 [concrete] -// CHECK:STDOUT: %inst.splice_block.51d: = inst_value [concrete] { -// CHECK:STDOUT: %.cb7: = splice_block %bound_method { -// CHECK:STDOUT: %.464: ref %C.d8efcc.1 = specific_inst @F.%v.var, @F(%empty_struct_type) +// CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { +// CHECK:STDOUT: %.42e: = splice_block %bound_method { +// CHECK:STDOUT: %.711900.1: ref %C.d8efcc.1 = specific_inst @F.%v.var, @F(%empty_struct_type) // CHECK:STDOUT: %impl.elem2: %.cbc = impl_witness_access %custom_witness.f8f19d.2, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.2] -// CHECK:STDOUT: %bound_method: = bound_method %.464, %impl.elem2 +// CHECK:STDOUT: %bound_method: = bound_method %.711900.1, %impl.elem2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %inst.call: = inst_value [concrete] { -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.cb7(%.464) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.42e(%.711900.1) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1202,63 +1187,43 @@ fn G() { F({}); } // CHECK:STDOUT: %.loc7_20.6: type = type_of_inst %.loc7_20.5 [template = %.loc7_20.6 (constants.%.c44)] // CHECK:STDOUT: %.loc7_20.7: @F.%.loc7_20.6 (%.c44) = splice_inst %.loc7_20.5 [template = %.loc7_20.7 (constants.%.d24)] // CHECK:STDOUT: %.loc7_20.8: = convert_to_value_action %.loc7_20.3, type [template] -// CHECK:STDOUT: %.loc7_20.9: type = splice_inst %.loc7_20.8 [template = %.loc7_20.9 (constants.%.8bb)] -// CHECK:STDOUT: %require_complete: = require_complete_type %.loc7_20.9 [template = %require_complete (constants.%require_complete.afd)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %.loc7_20.9 [template = %pattern_type (constants.%pattern_type.6b2)] -// CHECK:STDOUT: %v.patt.loc7_15.2: @F.%pattern_type (%pattern_type.6b2) = ref_binding_pattern v [template = %v.patt.loc7_15.2 (constants.%v.patt.404)] -// CHECK:STDOUT: %v.var_patt.loc7_3.2: @F.%pattern_type (%pattern_type.6b2) = var_pattern %v.patt.loc7_15.2 [template = %v.var_patt.loc7_3.2 (constants.%v.var_patt.3f1)] -// CHECK:STDOUT: %.loc7_3.15: = call_action (constants.%ImplicitAs.generic, constants.%.8bb), false [template] -// CHECK:STDOUT: %.loc7_3.16: type = type_of_inst %.loc7_3.15 [template = %.loc7_3.16 (constants.%.f8059f.1)] -// CHECK:STDOUT: %.loc7_3.17: @F.%.loc7_3.16 (%.f8059f.1) = splice_inst %.loc7_3.15 [template = %.loc7_3.17 (constants.%.03555b.1)] -// CHECK:STDOUT: %.loc7_3.18: = access_member_action %.loc7_3.2, Convert [template] -// CHECK:STDOUT: %.loc7_3.19: type = type_of_inst %.loc7_3.18 [template = %.loc7_3.19 (constants.%.9aee9e.1)] -// CHECK:STDOUT: %.loc7_3.20: @F.%.loc7_3.19 (%.9aee9e.1) = splice_inst %.loc7_3.18 [template = %.loc7_3.20 (constants.%.880b95.1)] -// CHECK:STDOUT: %.loc7_3.21: = compound_member_access_action %.loc7_25, %.loc7_3.4 [template] -// CHECK:STDOUT: %.loc7_3.22: type = type_of_inst %.loc7_3.21 [template = %.loc7_3.22 (constants.%.4cb)] -// CHECK:STDOUT: %.loc7_3.23: @F.%.loc7_3.22 (%.4cb) = splice_inst %.loc7_3.21 [template = %.loc7_3.23 (constants.%.315)] -// CHECK:STDOUT: %.loc7_3.24: = call_action (%.loc7_3.6), true [template] -// CHECK:STDOUT: %.loc7_3.25: type = type_of_inst %.loc7_3.24 [template = %.loc7_3.25 (constants.%.d5b)] -// CHECK:STDOUT: %.loc7_3.26: @F.%.loc7_3.25 (%.d5b) = splice_inst %.loc7_3.24 [template = %.loc7_3.26 (constants.%.b20)] -// CHECK:STDOUT: %.loc7_3.27: = convert_to_category_action %.loc7_3.9, element10 [template] -// CHECK:STDOUT: %.loc7_3.28: @F.%.loc7_20.9 (%.8bb) = splice_inst %.loc7_3.27 [template = %.loc7_3.28 (constants.%.d6d)] -// CHECK:STDOUT: %.loc7_3.29: = compound_member_access_action %v.var, constants.%assoc2 [template] -// CHECK:STDOUT: %.loc7_3.30: type = type_of_inst %.loc7_3.29 [template = %.loc7_3.30 (constants.%.ec4)] -// CHECK:STDOUT: %.loc7_3.31: @F.%.loc7_3.30 (%.ec4) = splice_inst %.loc7_3.29 [template = %.loc7_3.31 (constants.%.f75)] -// CHECK:STDOUT: %.loc7_3.32: = call_action (%.loc7_3.12), true [template] -// CHECK:STDOUT: %.loc7_3.33: type = type_of_inst %.loc7_3.32 [template = %.loc7_3.33 (constants.%.99a)] -// CHECK:STDOUT: %.loc7_3.34: @F.%.loc7_3.33 (%.99a) = splice_inst %.loc7_3.32 [template = %.loc7_3.34 (constants.%.04f)] +// CHECK:STDOUT: %.loc7_20.9: type = splice_inst %.loc7_20.8 [template = %.loc7_20.9 (constants.%.537)] +// CHECK:STDOUT: %require_complete: = require_complete_type %.loc7_20.9 [template = %require_complete (constants.%require_complete.cb0)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %.loc7_20.9 [template = %pattern_type (constants.%pattern_type.fcb)] +// CHECK:STDOUT: %v.patt.loc7_15.2: @F.%pattern_type (%pattern_type.fcb) = ref_binding_pattern v [template = %v.patt.loc7_15.2 (constants.%v.patt.126)] +// CHECK:STDOUT: %v.var_patt.loc7_3.2: @F.%pattern_type (%pattern_type.fcb) = var_pattern %v.patt.loc7_15.2 [template = %v.var_patt.loc7_3.2 (constants.%v.var_patt.768)] +// CHECK:STDOUT: %.loc7_3.6: %tuple.type = initialize_action %.loc7_25, %.loc7_20.9, %v.var, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc7_3.6, element0 [template] +// CHECK:STDOUT: %.loc7_3.7: @F.%.loc7_20.9 (%.537) = splice_inst %tuple.elem0 [template = %.loc7_3.7 (constants.%.5d6)] +// CHECK:STDOUT: %.loc7_3.8: = compound_member_access_action %v.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc7_3.9: type = type_of_inst %.loc7_3.8 [template = %.loc7_3.9 (constants.%.8cb)] +// CHECK:STDOUT: %.loc7_3.10: @F.%.loc7_3.9 (%.8cb) = splice_inst %.loc7_3.8 [template = %.loc7_3.10 (constants.%.c23)] +// CHECK:STDOUT: %.loc7_3.11: = call_action (%.loc7_3.3), true [template] +// CHECK:STDOUT: %.loc7_3.12: type = type_of_inst %.loc7_3.11 [template = %.loc7_3.12 (constants.%.57c)] +// CHECK:STDOUT: %.loc7_3.13: @F.%.loc7_3.12 (%.57c) = splice_inst %.loc7_3.11 [template = %.loc7_3.13 (constants.%.e63)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %v.var: ref @F.%.loc7_20.9 (%.8bb) = var_storage %v.var_patt.loc7_3.1 +// CHECK:STDOUT: %v.var: ref @F.%.loc7_20.9 (%.537) = var_storage %v.var_patt.loc7_3.1 // CHECK:STDOUT: %.loc7_25: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc7_3.1: type = type_of_inst %.loc7_3.15 [template = %.loc7_3.16 (constants.%.f8059f.1)] -// CHECK:STDOUT: %.loc7_3.2: @F.%.loc7_3.16 (%.f8059f.1) = splice_inst %.loc7_3.15 [template = %.loc7_3.17 (constants.%.03555b.1)] -// CHECK:STDOUT: %.loc7_3.3: type = type_of_inst %.loc7_3.18 [template = %.loc7_3.19 (constants.%.9aee9e.1)] -// CHECK:STDOUT: %.loc7_3.4: @F.%.loc7_3.19 (%.9aee9e.1) = splice_inst %.loc7_3.18 [template = %.loc7_3.20 (constants.%.880b95.1)] -// CHECK:STDOUT: %.loc7_3.5: type = type_of_inst %.loc7_3.21 [template = %.loc7_3.22 (constants.%.4cb)] -// CHECK:STDOUT: %.loc7_3.6: @F.%.loc7_3.22 (%.4cb) = splice_inst %.loc7_3.21 [template = %.loc7_3.23 (constants.%.315)] -// CHECK:STDOUT: %.loc7_3.7: type = type_of_inst %.loc7_3.24 [template = %.loc7_3.25 (constants.%.d5b)] -// CHECK:STDOUT: %.loc7_3.8: @F.%.loc7_3.25 (%.d5b) = splice_inst %.loc7_3.24 [template = %.loc7_3.26 (constants.%.b20)] -// CHECK:STDOUT: %.loc7_3.9: @F.%.loc7_20.9 (%.8bb) = converted %.loc7_25, %.loc7_3.8 [template = %.loc7_3.26 (constants.%.b20)] -// CHECK:STDOUT: %.loc7_3.10: @F.%.loc7_20.9 (%.8bb) = splice_inst %.loc7_3.27 [template = %.loc7_3.28 (constants.%.d6d)] -// CHECK:STDOUT: assign %v.var, %.loc7_3.10 -// CHECK:STDOUT: %.loc7_20.1: type = splice_block %.loc7_20.4 [template = %.loc7_20.9 (constants.%.8bb)] { +// CHECK:STDOUT: %.loc7_3.1: @F.%.loc7_20.9 (%.537) = splice_inst %tuple.elem0 [template = %.loc7_3.7 (constants.%.5d6)] +// CHECK:STDOUT: assign %v.var, %.loc7_3.1 +// CHECK:STDOUT: %.loc7_20.1: type = splice_block %.loc7_20.4 [template = %.loc7_20.9 (constants.%.537)] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_16.2 [template = %T.loc6_16.1 (constants.%T)] // CHECK:STDOUT: %.loc7_20.2: type = type_of_inst %.loc7_20.5 [template = %.loc7_20.6 (constants.%.c44)] // CHECK:STDOUT: %.loc7_20.3: @F.%.loc7_20.6 (%.c44) = splice_inst %.loc7_20.5 [template = %.loc7_20.7 (constants.%.d24)] -// CHECK:STDOUT: %.loc7_20.4: type = splice_inst %.loc7_20.8 [template = %.loc7_20.9 (constants.%.8bb)] +// CHECK:STDOUT: %.loc7_20.4: type = splice_inst %.loc7_20.8 [template = %.loc7_20.9 (constants.%.537)] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref @F.%.loc7_20.9 (%.8bb) = wrapper_binding v, %v.var +// CHECK:STDOUT: %v: ref @F.%.loc7_20.9 (%.537) = wrapper_binding v, %v.var // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt.loc7_15.1: @F.%pattern_type (%pattern_type.6b2) = ref_binding_pattern v [template = %v.patt.loc7_15.2 (constants.%v.patt.404)] -// CHECK:STDOUT: %v.var_patt.loc7_3.1: @F.%pattern_type (%pattern_type.6b2) = var_pattern %v.patt.loc7_15.1 [template = %v.var_patt.loc7_3.2 (constants.%v.var_patt.3f1)] +// CHECK:STDOUT: %v.patt.loc7_15.1: @F.%pattern_type (%pattern_type.fcb) = ref_binding_pattern v [template = %v.patt.loc7_15.2 (constants.%v.patt.126)] +// CHECK:STDOUT: %v.var_patt.loc7_3.1: @F.%pattern_type (%pattern_type.fcb) = var_pattern %v.patt.loc7_15.1 [template = %v.var_patt.loc7_3.2 (constants.%v.var_patt.768)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_3.11: type = type_of_inst %.loc7_3.29 [template = %.loc7_3.30 (constants.%.ec4)] -// CHECK:STDOUT: %.loc7_3.12: @F.%.loc7_3.30 (%.ec4) = splice_inst %.loc7_3.29 [template = %.loc7_3.31 (constants.%.f75)] -// CHECK:STDOUT: %.loc7_3.13: type = type_of_inst %.loc7_3.32 [template = %.loc7_3.33 (constants.%.99a)] -// CHECK:STDOUT: %.loc7_3.14: @F.%.loc7_3.33 (%.99a) = splice_inst %.loc7_3.32 [template = %.loc7_3.34 (constants.%.04f)] +// CHECK:STDOUT: %.loc7_3.2: type = type_of_inst %.loc7_3.8 [template = %.loc7_3.9 (constants.%.8cb)] +// CHECK:STDOUT: %.loc7_3.3: @F.%.loc7_3.9 (%.8cb) = splice_inst %.loc7_3.8 [template = %.loc7_3.10 (constants.%.c23)] +// CHECK:STDOUT: %.loc7_3.4: type = type_of_inst %.loc7_3.11 [template = %.loc7_3.12 (constants.%.57c)] +// CHECK:STDOUT: %.loc7_3.5: @F.%.loc7_3.12 (%.57c) = splice_inst %.loc7_3.11 [template = %.loc7_3.13 (constants.%.e63)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1301,31 +1266,20 @@ fn G() { F({}); } // CHECK:STDOUT: %.loc7_20.5 => constants.%inst.class_type // CHECK:STDOUT: %.loc7_20.6 => type // CHECK:STDOUT: %.loc7_20.7 => constants.%C.d8efcc.1 -// CHECK:STDOUT: %.loc7_20.8 => constants.%inst.splice_block.1b2 +// CHECK:STDOUT: %.loc7_20.8 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc7_20.9 => constants.%C.d8efcc.1 // CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.2fd // CHECK:STDOUT: %v.patt.loc7_15.2 => constants.%v.patt.0e7 // CHECK:STDOUT: %v.var_patt.loc7_3.2 => constants.%v.var_patt.259 -// CHECK:STDOUT: %.loc7_3.15 => constants.%.9bd -// CHECK:STDOUT: %.loc7_3.16 => constants.%.f8059f.2 -// CHECK:STDOUT: %.loc7_3.17 => constants.%.03555b.2 -// CHECK:STDOUT: %.loc7_3.18 => constants.%.139 -// CHECK:STDOUT: %.loc7_3.19 => constants.%.9aee9e.2 -// CHECK:STDOUT: %.loc7_3.20 => constants.%.880b95.2 -// CHECK:STDOUT: %.loc7_3.21 => constants.%.143 -// CHECK:STDOUT: %.loc7_3.22 => constants.%.4e6 -// CHECK:STDOUT: %.loc7_3.23 => constants.%.398 -// CHECK:STDOUT: %.loc7_3.24 => constants.%.37a -// CHECK:STDOUT: %.loc7_3.25 => constants.%.e10 -// CHECK:STDOUT: %.loc7_3.26 => constants.%.0f6 -// CHECK:STDOUT: %.loc7_3.27 => constants.%.afa -// CHECK:STDOUT: %.loc7_3.28 => constants.%.610 -// CHECK:STDOUT: %.loc7_3.29 => constants.%inst.splice_block.51d -// CHECK:STDOUT: %.loc7_3.30 => -// CHECK:STDOUT: %.loc7_3.31 => invalid -// CHECK:STDOUT: %.loc7_3.32 => constants.%inst.call -// CHECK:STDOUT: %.loc7_3.33 => constants.%empty_tuple.type -// CHECK:STDOUT: %.loc7_3.34 => invalid +// CHECK:STDOUT: %.loc7_3.6 => constants.%tuple +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block.426619.2 +// CHECK:STDOUT: %.loc7_3.7 => constants.%C.val +// CHECK:STDOUT: %.loc7_3.8 => constants.%inst.splice_block.426619.3 +// CHECK:STDOUT: %.loc7_3.9 => +// CHECK:STDOUT: %.loc7_3.10 => invalid +// CHECK:STDOUT: %.loc7_3.11 => constants.%inst.call +// CHECK:STDOUT: %.loc7_3.12 => constants.%empty_tuple.type +// CHECK:STDOUT: %.loc7_3.13 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/call.carbon b/toolchain/check/testdata/eval/call.carbon index 19462476ab7a..21dc85da786b 100644 --- a/toolchain/check/testdata/eval/call.carbon +++ b/toolchain/check/testdata/eval/call.carbon @@ -81,7 +81,7 @@ fn G(generic N: i32) { fn H() { G(3); } -// --- fail_todo_dependent_call_type.carbon +// --- dependent_call_type.carbon library "[[@TEST_NAME]]"; @@ -97,13 +97,6 @@ fn UseFGenerically(generic X: i32) { //@dump-sem-ir-end fn UseFSpecifically() { - // CHECK:STDERR: fail_todo_dependent_call_type.carbon:[[@LINE+7]]:3: error: unable to monomorphize specific `UseFGenerically(3)` [ResolvingSpecificHere] - // CHECK:STDERR: UseFGenerically(3); - // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_dependent_call_type.carbon:[[@LINE-8]]:3: note: cannot access member of interface `Core.ImplicitAs(C)` in type `{}` that does not implement that interface [MissingImplInMemberAccess] - // CHECK:STDERR: var unused v: F(X) = {}; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: UseFGenerically(3); } @@ -169,7 +162,7 @@ fn H() { //@dump-sem-ir-end } -// CHECK:STDOUT: --- fail_todo_dependent_call_type.carbon +// CHECK:STDOUT: --- dependent_call_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: type: type = facet_type [concrete] @@ -193,53 +186,30 @@ fn H() { // CHECK:STDOUT: %v.patt.bcc: %pattern_type.231 = ref_binding_pattern v [template] // CHECK:STDOUT: %v.var_patt.53d: %pattern_type.231 = var_pattern %v.patt.bcc [template] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] -// CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3aa: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] -// CHECK:STDOUT: %Self.294: %ImplicitAs.type.3aa = symbolic_binding Self, 1 [symbolic] -// CHECK:STDOUT: %ImplicitAs.assoc_type.fcc: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.97e: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Dest, %Self.294) [symbolic] -// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.945: %ImplicitAs.WithSelf.Convert.type.97e = struct_value () [symbolic] -// CHECK:STDOUT: %.53a63: type = type_of_inst @UseFGenerically.%.loc11_3.15 [template] -// CHECK:STDOUT: %.4e4: %.53a63 = splice_inst @UseFGenerically.%.loc11_3.15 [template] -// CHECK:STDOUT: %.7df: type = type_of_inst @UseFGenerically.%.loc11_3.18 [template] -// CHECK:STDOUT: %.6c2: %.7df = splice_inst @UseFGenerically.%.loc11_3.18 [template] -// CHECK:STDOUT: %.abc: type = type_of_inst @UseFGenerically.%.loc11_3.21 [template] -// CHECK:STDOUT: %.031: %.abc = splice_inst @UseFGenerically.%.loc11_3.21 [template] -// CHECK:STDOUT: %.649: type = type_of_inst @UseFGenerically.%.loc11_3.24 [template] -// CHECK:STDOUT: %.88d: %.649 = splice_inst @UseFGenerically.%.loc11_3.24 [template] -// CHECK:STDOUT: %.e0f: %F.call = splice_inst @UseFGenerically.%.loc11_3.27 [template] +// CHECK:STDOUT: %tuple.type.f7a: type = tuple_type () [concrete] +// CHECK:STDOUT: %.519: %F.call = splice_inst @UseFGenerically.%tuple.elem0 [template] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] // CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] -// CHECK:STDOUT: %.ddf: type = type_of_inst @UseFGenerically.%.loc11_3.29 [template] -// CHECK:STDOUT: %.7d7: %.ddf = splice_inst @UseFGenerically.%.loc11_3.29 [template] -// CHECK:STDOUT: %.e9b: type = type_of_inst @UseFGenerically.%.loc11_3.32 [template] -// CHECK:STDOUT: %.1f2: %.e9b = splice_inst @UseFGenerically.%.loc11_3.32 [template] -// CHECK:STDOUT: %assoc0.0ac: %ImplicitAs.assoc_type.fcc = assoc_entity element0, imports.%Core.import_ref.f9d [symbolic] +// CHECK:STDOUT: %.8cb: type = type_of_inst @UseFGenerically.%.loc11_3.8 [template] +// CHECK:STDOUT: %.c23: %.8cb = splice_inst @UseFGenerically.%.loc11_3.8 [template] +// CHECK:STDOUT: %.57c: type = type_of_inst @UseFGenerically.%.loc11_3.11 [template] +// CHECK:STDOUT: %.e63: %.57c = splice_inst @UseFGenerically.%.loc11_3.11 [template] // CHECK:STDOUT: %int_3.410: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] // CHECK:STDOUT: %v.patt.5c6: %pattern_type.98b = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt.a6f: %pattern_type.98b = var_pattern %v.patt.5c6 [concrete] -// CHECK:STDOUT: %ImplicitAs.type.dee0b8.1: type = facet_type <@ImplicitAs, @ImplicitAs(%C)> [concrete] -// CHECK:STDOUT: %inst.facet_type: = inst_value [concrete] { -// CHECK:STDOUT: %ImplicitAs.type.dee0b8.2: type = facet_type <@ImplicitAs, @ImplicitAs(%C)> [concrete = %ImplicitAs.type.dee0b8.1] -// CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.assoc_type.cf6: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%C) [concrete] -// CHECK:STDOUT: %assoc0.6c9: %ImplicitAs.assoc_type.cf6 = assoc_entity element0, imports.%Core.import_ref.cb2 [concrete] -// CHECK:STDOUT: %inst.splice_block.369: = inst_value [concrete] { -// CHECK:STDOUT: %.8a8: %ImplicitAs.assoc_type.cf6 = splice_block %Convert.ref [concrete = %assoc0.6c9] { -// CHECK:STDOUT: %.76b: %ImplicitAs.assoc_type.cf6 = specific_constant imports.%Core.import_ref.484, @ImplicitAs.WithSelf(%C, %Self.294) [concrete = %assoc0.6c9] -// CHECK:STDOUT: %Convert.ref: %ImplicitAs.assoc_type.cf6 = name_ref Convert, %.76b [concrete = %assoc0.6c9] +// CHECK:STDOUT: %C.val: %C = struct_value () [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { +// CHECK:STDOUT: %.d7f: init %C = splice_block %.c83 [concrete = %C.val] { +// CHECK:STDOUT: %.6ba47e.2: ref %C = specific_inst @UseFGenerically.%v.var, @UseFGenerically(%int_3.410) +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.edd: = inst_value [concrete] { -// CHECK:STDOUT: %.432: = splice_block [concrete = ] {} -// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple.242: %tuple.type.f7a = tuple_value (%inst.splice_block.426619.1) [concrete] // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %self.param_patt.52f: %pattern_type.a96 = ref_param_pattern [concrete] // CHECK:STDOUT: %self.patt.4b1: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt.52f [concrete] @@ -259,23 +229,20 @@ fn H() { // CHECK:STDOUT: %Destroy.facet.601: %Destroy.type = facet_value %C, (%custom_witness.f8f19d.2) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.c6a: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.601) [concrete] // CHECK:STDOUT: %.977: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.c6a, %Destroy.facet.601 [concrete] -// CHECK:STDOUT: %inst.splice_block.ae2: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { // CHECK:STDOUT: %.db6: = splice_block %bound_method.db6 { -// CHECK:STDOUT: %.6ba: ref %C = specific_inst @UseFGenerically.%v.var, @UseFGenerically(%int_3.410) +// CHECK:STDOUT: %.6ba47e.1: ref %C = specific_inst @UseFGenerically.%v.var, @UseFGenerically(%int_3.410) // CHECK:STDOUT: %impl.elem2: %.977 = impl_witness_access %custom_witness.f8f19d.2, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.2] -// CHECK:STDOUT: %bound_method.db6: = bound_method %.6ba, %impl.elem2 +// CHECK:STDOUT: %bound_method.db6: = bound_method %.6ba47e.1, %impl.elem2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %inst.call: = inst_value [concrete] { -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.db6(%.6ba) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.db6(%.6ba47e.1) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.484: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.fcc) = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%assoc0 (constants.%assoc0.0ac)] -// CHECK:STDOUT: %Core.import_ref.cb2: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type.97e) = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert.945)] // CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] -// CHECK:STDOUT: %Core.import_ref.f9d = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generated { @@ -331,42 +298,22 @@ fn H() { // CHECK:STDOUT: %pattern_type: type = pattern_type %F.call.loc11_20.2 [template = %pattern_type (constants.%pattern_type.231)] // CHECK:STDOUT: %v.patt.loc11_15.2: @UseFGenerically.%pattern_type (%pattern_type.231) = ref_binding_pattern v [template = %v.patt.loc11_15.2 (constants.%v.patt.bcc)] // CHECK:STDOUT: %v.var_patt.loc11_3.2: @UseFGenerically.%pattern_type (%pattern_type.231) = var_pattern %v.patt.loc11_15.2 [template = %v.var_patt.loc11_3.2 (constants.%v.var_patt.53d)] -// CHECK:STDOUT: %.loc11_3.15: = call_action (constants.%ImplicitAs.generic, %F.call.loc11_20.2), false [template] -// CHECK:STDOUT: %.loc11_3.16: type = type_of_inst %.loc11_3.15 [template = %.loc11_3.16 (constants.%.53a63)] -// CHECK:STDOUT: %.loc11_3.17: @UseFGenerically.%.loc11_3.16 (%.53a63) = splice_inst %.loc11_3.15 [template = %.loc11_3.17 (constants.%.4e4)] -// CHECK:STDOUT: %.loc11_3.18: = access_member_action %.loc11_3.2, Convert [template] -// CHECK:STDOUT: %.loc11_3.19: type = type_of_inst %.loc11_3.18 [template = %.loc11_3.19 (constants.%.7df)] -// CHECK:STDOUT: %.loc11_3.20: @UseFGenerically.%.loc11_3.19 (%.7df) = splice_inst %.loc11_3.18 [template = %.loc11_3.20 (constants.%.6c2)] -// CHECK:STDOUT: %.loc11_3.21: = compound_member_access_action %.loc11_25, %.loc11_3.4 [template] -// CHECK:STDOUT: %.loc11_3.22: type = type_of_inst %.loc11_3.21 [template = %.loc11_3.22 (constants.%.abc)] -// CHECK:STDOUT: %.loc11_3.23: @UseFGenerically.%.loc11_3.22 (%.abc) = splice_inst %.loc11_3.21 [template = %.loc11_3.23 (constants.%.031)] -// CHECK:STDOUT: %.loc11_3.24: = call_action (%.loc11_3.6), true [template] -// CHECK:STDOUT: %.loc11_3.25: type = type_of_inst %.loc11_3.24 [template = %.loc11_3.25 (constants.%.649)] -// CHECK:STDOUT: %.loc11_3.26: @UseFGenerically.%.loc11_3.25 (%.649) = splice_inst %.loc11_3.24 [template = %.loc11_3.26 (constants.%.88d)] -// CHECK:STDOUT: %.loc11_3.27: = convert_to_category_action %.loc11_3.9, element10 [template] -// CHECK:STDOUT: %.loc11_3.28: @UseFGenerically.%F.call.loc11_20.2 (%F.call) = splice_inst %.loc11_3.27 [template = %.loc11_3.28 (constants.%.e0f)] -// CHECK:STDOUT: %.loc11_3.29: = compound_member_access_action %v.var, constants.%assoc2 [template] -// CHECK:STDOUT: %.loc11_3.30: type = type_of_inst %.loc11_3.29 [template = %.loc11_3.30 (constants.%.ddf)] -// CHECK:STDOUT: %.loc11_3.31: @UseFGenerically.%.loc11_3.30 (%.ddf) = splice_inst %.loc11_3.29 [template = %.loc11_3.31 (constants.%.7d7)] -// CHECK:STDOUT: %.loc11_3.32: = call_action (%.loc11_3.12), true [template] -// CHECK:STDOUT: %.loc11_3.33: type = type_of_inst %.loc11_3.32 [template = %.loc11_3.33 (constants.%.e9b)] -// CHECK:STDOUT: %.loc11_3.34: @UseFGenerically.%.loc11_3.33 (%.e9b) = splice_inst %.loc11_3.32 [template = %.loc11_3.34 (constants.%.1f2)] +// CHECK:STDOUT: %.loc11_3.6: %tuple.type.f7a = initialize_action %.loc11_25, %F.call.loc11_20.2, %v.var, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc11_3.6, element0 [template] +// CHECK:STDOUT: %.loc11_3.7: @UseFGenerically.%F.call.loc11_20.2 (%F.call) = splice_inst %tuple.elem0 [template = %.loc11_3.7 (constants.%.519)] +// CHECK:STDOUT: %.loc11_3.8: = compound_member_access_action %v.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc11_3.9: type = type_of_inst %.loc11_3.8 [template = %.loc11_3.9 (constants.%.8cb)] +// CHECK:STDOUT: %.loc11_3.10: @UseFGenerically.%.loc11_3.9 (%.8cb) = splice_inst %.loc11_3.8 [template = %.loc11_3.10 (constants.%.c23)] +// CHECK:STDOUT: %.loc11_3.11: = call_action (%.loc11_3.3), true [template] +// CHECK:STDOUT: %.loc11_3.12: type = type_of_inst %.loc11_3.11 [template = %.loc11_3.12 (constants.%.57c)] +// CHECK:STDOUT: %.loc11_3.13: @UseFGenerically.%.loc11_3.12 (%.57c) = splice_inst %.loc11_3.11 [template = %.loc11_3.13 (constants.%.e63)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v.var: ref @UseFGenerically.%F.call.loc11_20.2 (%F.call) = var_storage %v.var_patt.loc11_3.1 // CHECK:STDOUT: %.loc11_25: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc11_3.1: type = type_of_inst %.loc11_3.15 [template = %.loc11_3.16 (constants.%.53a63)] -// CHECK:STDOUT: %.loc11_3.2: @UseFGenerically.%.loc11_3.16 (%.53a63) = splice_inst %.loc11_3.15 [template = %.loc11_3.17 (constants.%.4e4)] -// CHECK:STDOUT: %.loc11_3.3: type = type_of_inst %.loc11_3.18 [template = %.loc11_3.19 (constants.%.7df)] -// CHECK:STDOUT: %.loc11_3.4: @UseFGenerically.%.loc11_3.19 (%.7df) = splice_inst %.loc11_3.18 [template = %.loc11_3.20 (constants.%.6c2)] -// CHECK:STDOUT: %.loc11_3.5: type = type_of_inst %.loc11_3.21 [template = %.loc11_3.22 (constants.%.abc)] -// CHECK:STDOUT: %.loc11_3.6: @UseFGenerically.%.loc11_3.22 (%.abc) = splice_inst %.loc11_3.21 [template = %.loc11_3.23 (constants.%.031)] -// CHECK:STDOUT: %.loc11_3.7: type = type_of_inst %.loc11_3.24 [template = %.loc11_3.25 (constants.%.649)] -// CHECK:STDOUT: %.loc11_3.8: @UseFGenerically.%.loc11_3.25 (%.649) = splice_inst %.loc11_3.24 [template = %.loc11_3.26 (constants.%.88d)] -// CHECK:STDOUT: %.loc11_3.9: @UseFGenerically.%F.call.loc11_20.2 (%F.call) = converted %.loc11_25, %.loc11_3.8 [template = %.loc11_3.26 (constants.%.88d)] -// CHECK:STDOUT: %.loc11_3.10: @UseFGenerically.%F.call.loc11_20.2 (%F.call) = splice_inst %.loc11_3.27 [template = %.loc11_3.28 (constants.%.e0f)] -// CHECK:STDOUT: assign %v.var, %.loc11_3.10 +// CHECK:STDOUT: %.loc11_3.1: @UseFGenerically.%F.call.loc11_20.2 (%F.call) = splice_inst %tuple.elem0 [template = %.loc11_3.7 (constants.%.519)] +// CHECK:STDOUT: assign %v.var, %.loc11_3.1 // CHECK:STDOUT: %.loc11_20.1: type = splice_block %.loc11_20.3 [template = %F.call.loc11_20.2 (constants.%F.call)] { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %X.ref: %i32 = name_ref X, %X.loc10_29.2 [symbolic = %X.loc10_29.1 (constants.%X)] @@ -379,10 +326,10 @@ fn H() { // CHECK:STDOUT: %v.patt.loc11_15.1: @UseFGenerically.%pattern_type (%pattern_type.231) = ref_binding_pattern v [template = %v.patt.loc11_15.2 (constants.%v.patt.bcc)] // CHECK:STDOUT: %v.var_patt.loc11_3.1: @UseFGenerically.%pattern_type (%pattern_type.231) = var_pattern %v.patt.loc11_15.1 [template = %v.var_patt.loc11_3.2 (constants.%v.var_patt.53d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_3.11: type = type_of_inst %.loc11_3.29 [template = %.loc11_3.30 (constants.%.ddf)] -// CHECK:STDOUT: %.loc11_3.12: @UseFGenerically.%.loc11_3.30 (%.ddf) = splice_inst %.loc11_3.29 [template = %.loc11_3.31 (constants.%.7d7)] -// CHECK:STDOUT: %.loc11_3.13: type = type_of_inst %.loc11_3.32 [template = %.loc11_3.33 (constants.%.e9b)] -// CHECK:STDOUT: %.loc11_3.14: @UseFGenerically.%.loc11_3.33 (%.e9b) = splice_inst %.loc11_3.32 [template = %.loc11_3.34 (constants.%.1f2)] +// CHECK:STDOUT: %.loc11_3.2: type = type_of_inst %.loc11_3.8 [template = %.loc11_3.9 (constants.%.8cb)] +// CHECK:STDOUT: %.loc11_3.3: @UseFGenerically.%.loc11_3.9 (%.8cb) = splice_inst %.loc11_3.8 [template = %.loc11_3.10 (constants.%.c23)] +// CHECK:STDOUT: %.loc11_3.4: type = type_of_inst %.loc11_3.11 [template = %.loc11_3.12 (constants.%.57c)] +// CHECK:STDOUT: %.loc11_3.5: @UseFGenerically.%.loc11_3.12 (%.57c) = splice_inst %.loc11_3.11 [template = %.loc11_3.13 (constants.%.e63)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -427,26 +374,15 @@ fn H() { // CHECK:STDOUT: %pattern_type => constants.%pattern_type.98b // CHECK:STDOUT: %v.patt.loc11_15.2 => constants.%v.patt.5c6 // CHECK:STDOUT: %v.var_patt.loc11_3.2 => constants.%v.var_patt.a6f -// CHECK:STDOUT: %.loc11_3.15 => constants.%inst.facet_type -// CHECK:STDOUT: %.loc11_3.16 => type -// CHECK:STDOUT: %.loc11_3.17 => constants.%ImplicitAs.type.dee0b8.1 -// CHECK:STDOUT: %.loc11_3.18 => constants.%inst.splice_block.369 -// CHECK:STDOUT: %.loc11_3.19 => constants.%ImplicitAs.assoc_type.cf6 -// CHECK:STDOUT: %.loc11_3.20 => constants.%assoc0.6c9 -// CHECK:STDOUT: %.loc11_3.21 => constants.%inst.splice_block.edd -// CHECK:STDOUT: %.loc11_3.22 => -// CHECK:STDOUT: %.loc11_3.23 => -// CHECK:STDOUT: %.loc11_3.24 => -// CHECK:STDOUT: %.loc11_3.25 => -// CHECK:STDOUT: %.loc11_3.26 => -// CHECK:STDOUT: %.loc11_3.27 => -// CHECK:STDOUT: %.loc11_3.28 => -// CHECK:STDOUT: %.loc11_3.29 => constants.%inst.splice_block.ae2 -// CHECK:STDOUT: %.loc11_3.30 => -// CHECK:STDOUT: %.loc11_3.31 => invalid -// CHECK:STDOUT: %.loc11_3.32 => constants.%inst.call -// CHECK:STDOUT: %.loc11_3.33 => constants.%empty_tuple.type -// CHECK:STDOUT: %.loc11_3.34 => invalid +// CHECK:STDOUT: %.loc11_3.6 => constants.%tuple.242 +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block.426619.1 +// CHECK:STDOUT: %.loc11_3.7 => constants.%C.val +// CHECK:STDOUT: %.loc11_3.8 => constants.%inst.splice_block.426619.2 +// CHECK:STDOUT: %.loc11_3.9 => +// CHECK:STDOUT: %.loc11_3.10 => invalid +// CHECK:STDOUT: %.loc11_3.11 => constants.%inst.call +// CHECK:STDOUT: %.loc11_3.12 => constants.%empty_tuple.type +// CHECK:STDOUT: %.loc11_3.13 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- return_in_place_discarded.carbon diff --git a/toolchain/check/testdata/function/call/form.carbon b/toolchain/check/testdata/function/call/form.carbon index 9b7343857939..37898e4c1838 100644 --- a/toolchain/check/testdata/function/call/form.carbon +++ b/toolchain/check/testdata/function/call/form.carbon @@ -788,22 +788,22 @@ fn G() { // CHECK:STDOUT: %Fm: Core.Form = symbolic_binding Fm, 0 [symbolic] // CHECK:STDOUT: %.42f: type = type_component_of %Fm [symbolic] // CHECK:STDOUT: %pattern_type.177: type = pattern_type %.42f [symbolic] -// CHECK:STDOUT: %.f15: %pattern_type.177 = splice_inst @F.%.loc4_30.3 [template] -// CHECK:STDOUT: %v.patt.664: %pattern_type.177 = wrapper_binding_pattern v, %.f15 [template] -// CHECK:STDOUT: %.677: %pattern_type.177 = splice_inst @F.%.loc4_37.3 [template] -// CHECK:STDOUT: %return.patt.113: %pattern_type.177 = return_slot_pattern %.677, %.42f [template] -// CHECK:STDOUT: %.5e7cab.1: %.42f = splice_inst @F.%.loc4_30.5 [template] -// CHECK:STDOUT: %.6c4f01.1: %.42f = splice_inst @F.%.loc4_37.5 [template] -// CHECK:STDOUT: %.cfa: = form_param_pattern_action %Fm, v [template] -// CHECK:STDOUT: %.26b: %pattern_type.177 = splice_inst %.cfa [template] -// CHECK:STDOUT: %v.patt.cee: %pattern_type.177 = wrapper_binding_pattern v, %.26b [template] -// CHECK:STDOUT: %.94f: = out_form_param_pattern_action %Fm [template] -// CHECK:STDOUT: %.1ac: %pattern_type.177 = splice_inst %.94f [template] -// CHECK:STDOUT: %return.patt.333: %pattern_type.177 = return_slot_pattern %.1ac, %.42f [template] -// CHECK:STDOUT: %.095: = callee_pattern_match_action %.f15, call_param0 [template] -// CHECK:STDOUT: %.5e7cab.2: %.42f = splice_inst %.095 [template] -// CHECK:STDOUT: %.efc: = callee_pattern_match_action %.677, call_param1 [template] -// CHECK:STDOUT: %.6c4f01.2: %.42f = splice_inst %.efc [template] +// CHECK:STDOUT: %.481d89.1: %pattern_type.177 = splice_inst @F.%.loc4_30.3 [template] +// CHECK:STDOUT: %v.patt.db46d6.1: %pattern_type.177 = wrapper_binding_pattern v, %.481d89.1 [template] +// CHECK:STDOUT: %.05fee9.1: %pattern_type.177 = splice_inst @F.%.loc4_37.3 [template] +// CHECK:STDOUT: %return.patt.94bfcb.1: %pattern_type.177 = return_slot_pattern %.05fee9.1, %.42f [template] +// CHECK:STDOUT: %.59eb0c.1: %.42f = splice_inst @F.%.loc4_30.5 [template] +// CHECK:STDOUT: %.4d6629.1: %.42f = splice_inst @F.%.loc4_37.5 [template] +// CHECK:STDOUT: %.c5c: = form_param_pattern_action %Fm, v [template] +// CHECK:STDOUT: %.481d89.2: %pattern_type.177 = splice_inst %.c5c [template] +// CHECK:STDOUT: %v.patt.db46d6.2: %pattern_type.177 = wrapper_binding_pattern v, %.481d89.2 [template] +// CHECK:STDOUT: %.2e1: = out_form_param_pattern_action %Fm [template] +// CHECK:STDOUT: %.05fee9.2: %pattern_type.177 = splice_inst %.2e1 [template] +// CHECK:STDOUT: %return.patt.94bfcb.2: %pattern_type.177 = return_slot_pattern %.05fee9.2, %.42f [template] +// CHECK:STDOUT: %.0c9: = callee_pattern_match_action %.481d89.1, call_param0 [template] +// CHECK:STDOUT: %.59eb0c.2: %.42f = splice_inst %.0c9 [template] +// CHECK:STDOUT: %.ed0: = callee_pattern_match_action %.05fee9.1, call_param1 [template] +// CHECK:STDOUT: %.4d6629.2: %.42f = splice_inst %.ed0 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -854,8 +854,8 @@ fn G() { // CHECK:STDOUT: %return.param_patt.a9a4c7.2: %pattern_type.6b6 = out_param_pattern [concrete = %return.param_patt.a9a4c7.1] // CHECK:STDOUT: } // CHECK:STDOUT: %return.patt.e1b: %pattern_type.6b6 = return_slot_pattern %return.param_patt.a9a4c7.1, %i32 [concrete] -// CHECK:STDOUT: %.b27: %i32 = splice_inst %.095 [template] -// CHECK:STDOUT: %.d33: %i32 = splice_inst %.efc [template] +// CHECK:STDOUT: %.777: %i32 = splice_inst %.0c9 [template] +// CHECK:STDOUT: %.ed8: %i32 = splice_inst %.ed0 [template] // CHECK:STDOUT: %F.specific_fn.8ea: = specific_function %F, @F(%.795f) [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] @@ -982,10 +982,10 @@ fn G() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %Fm.patt.loc4_16.1: %pattern_type.13f = symbolic_binding_pattern Fm, 0 [symbolic = %Fm.patt.loc4_16.2 (constants.%Fm.patt)] -// CHECK:STDOUT: %.loc4_30.2: @F.%pattern_type (%pattern_type.177) = splice_inst %.loc4_30.3 [template = %.loc4_30.4 (constants.%.f15)] -// CHECK:STDOUT: %v.patt.loc4_30.1: @F.%pattern_type (%pattern_type.177) = wrapper_binding_pattern v, %.loc4_30.2 [template = %v.patt.loc4_30.2 (constants.%v.patt.664)] -// CHECK:STDOUT: %.loc4_37.2: @F.%pattern_type (%pattern_type.177) = splice_inst %.loc4_37.3 [template = %.loc4_37.4 (constants.%.677)] -// CHECK:STDOUT: %return.patt.loc4_37.1: @F.%pattern_type (%pattern_type.177) = return_slot_pattern %.loc4_37.2, %.loc4_41 [template = %return.patt.loc4_37.2 (constants.%return.patt.113)] +// CHECK:STDOUT: %.loc4_30.2: @F.%pattern_type (%pattern_type.177) = splice_inst %.loc4_30.3 [template = %.loc4_30.4 (constants.%.481d89.1)] +// CHECK:STDOUT: %v.patt.loc4_30.1: @F.%pattern_type (%pattern_type.177) = wrapper_binding_pattern v, %.loc4_30.2 [template = %v.patt.loc4_30.2 (constants.%v.patt.db46d6.1)] +// CHECK:STDOUT: %.loc4_37.2: @F.%pattern_type (%pattern_type.177) = splice_inst %.loc4_37.3 [template = %.loc4_37.4 (constants.%.05fee9.1)] +// CHECK:STDOUT: %return.patt.loc4_37.1: @F.%pattern_type (%pattern_type.177) = return_slot_pattern %.loc4_37.2, %.loc4_41 [template = %return.patt.loc4_37.2 (constants.%return.patt.94bfcb.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %Fm.ref.loc4_41: Core.Form = name_ref Fm, %Fm.loc4_16.2 [symbolic = %Fm.loc4_16.1 (constants.%Fm)] // CHECK:STDOUT: %.loc4_41: type = type_component_of %Fm.ref.loc4_41 [symbolic = %.loc4_33.1 (constants.%.42f)] @@ -995,13 +995,13 @@ fn G() { // CHECK:STDOUT: %Form.ref: type = name_ref Form, imports.%Core.Form [concrete = Core.Form] // CHECK:STDOUT: } // CHECK:STDOUT: %Fm.loc4_16.2: Core.Form = symbolic_binding Fm, 0 [symbolic = %Fm.loc4_16.1 (constants.%Fm)] -// CHECK:STDOUT: %.loc4_30.1: @F.%.loc4_33.1 (%.42f) = splice_inst %.loc4_30.5 [template = %.loc4_30.6 (constants.%.5e7cab.1)] +// CHECK:STDOUT: %.loc4_30.1: @F.%.loc4_33.1 (%.42f) = splice_inst %.loc4_30.5 [template = %.loc4_30.6 (constants.%.59eb0c.1)] // CHECK:STDOUT: %.loc4_33.2: Core.Form = splice_block %Fm.ref.loc4_33 [symbolic = %Fm.loc4_16.1 (constants.%Fm)] { // CHECK:STDOUT: %Fm.ref.loc4_33: Core.Form = name_ref Fm, %Fm.loc4_16.2 [symbolic = %Fm.loc4_16.1 (constants.%Fm)] // CHECK:STDOUT: %.loc4_33.3: type = type_component_of %Fm.ref.loc4_33 [symbolic = %.loc4_33.1 (constants.%.42f)] // CHECK:STDOUT: } // CHECK:STDOUT: %v: @F.%.loc4_33.1 (%.42f) = wrapper_binding v, %.loc4_30.1 -// CHECK:STDOUT: %.loc4_37.1: @F.%.loc4_33.1 (%.42f) = splice_inst %.loc4_37.5 [template = %.loc4_37.6 (constants.%.6c4f01.1)] +// CHECK:STDOUT: %.loc4_37.1: @F.%.loc4_33.1 (%.42f) = splice_inst %.loc4_37.5 [template = %.loc4_37.6 (constants.%.4d6629.1)] // CHECK:STDOUT: %return: @F.%.loc4_33.1 (%.42f) = return_slot %.loc4_37.1 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} @@ -1013,15 +1013,15 @@ fn G() { // CHECK:STDOUT: %.loc4_33.1: type = type_component_of %Fm.loc4_16.1 [symbolic = %.loc4_33.1 (constants.%.42f)] // CHECK:STDOUT: %.loc4_30.3: = form_param_pattern_action %Fm.ref.loc4_33, v [template] // CHECK:STDOUT: %pattern_type: type = pattern_type %.loc4_33.1 [symbolic = %pattern_type (constants.%pattern_type.177)] -// CHECK:STDOUT: %.loc4_30.4: @F.%pattern_type (%pattern_type.177) = splice_inst %.loc4_30.3 [template = %.loc4_30.4 (constants.%.f15)] -// CHECK:STDOUT: %v.patt.loc4_30.2: @F.%pattern_type (%pattern_type.177) = wrapper_binding_pattern v, %.loc4_30.4 [template = %v.patt.loc4_30.2 (constants.%v.patt.664)] +// CHECK:STDOUT: %.loc4_30.4: @F.%pattern_type (%pattern_type.177) = splice_inst %.loc4_30.3 [template = %.loc4_30.4 (constants.%.481d89.1)] +// CHECK:STDOUT: %v.patt.loc4_30.2: @F.%pattern_type (%pattern_type.177) = wrapper_binding_pattern v, %.loc4_30.4 [template = %v.patt.loc4_30.2 (constants.%v.patt.db46d6.1)] // CHECK:STDOUT: %.loc4_37.3: = out_form_param_pattern_action %Fm.ref.loc4_41 [template] -// CHECK:STDOUT: %.loc4_37.4: @F.%pattern_type (%pattern_type.177) = splice_inst %.loc4_37.3 [template = %.loc4_37.4 (constants.%.677)] -// CHECK:STDOUT: %return.patt.loc4_37.2: @F.%pattern_type (%pattern_type.177) = return_slot_pattern %.loc4_37.4, %.loc4_33.1 [template = %return.patt.loc4_37.2 (constants.%return.patt.113)] -// CHECK:STDOUT: %.loc4_30.5: = callee_pattern_match_action constants.%.f15, call_param0 [template] -// CHECK:STDOUT: %.loc4_30.6: @F.%.loc4_33.1 (%.42f) = splice_inst %.loc4_30.5 [template = %.loc4_30.6 (constants.%.5e7cab.1)] -// CHECK:STDOUT: %.loc4_37.5: = callee_pattern_match_action constants.%.677, call_param1 [template] -// CHECK:STDOUT: %.loc4_37.6: @F.%.loc4_33.1 (%.42f) = splice_inst %.loc4_37.5 [template = %.loc4_37.6 (constants.%.6c4f01.1)] +// CHECK:STDOUT: %.loc4_37.4: @F.%pattern_type (%pattern_type.177) = splice_inst %.loc4_37.3 [template = %.loc4_37.4 (constants.%.05fee9.1)] +// CHECK:STDOUT: %return.patt.loc4_37.2: @F.%pattern_type (%pattern_type.177) = return_slot_pattern %.loc4_37.4, %.loc4_33.1 [template = %return.patt.loc4_37.2 (constants.%return.patt.94bfcb.1)] +// CHECK:STDOUT: %.loc4_30.5: = callee_pattern_match_action constants.%.481d89.1, call_param0 [template] +// CHECK:STDOUT: %.loc4_30.6: @F.%.loc4_33.1 (%.42f) = splice_inst %.loc4_30.5 [template = %.loc4_30.6 (constants.%.59eb0c.1)] +// CHECK:STDOUT: %.loc4_37.5: = callee_pattern_match_action constants.%.05fee9.1, call_param1 [template] +// CHECK:STDOUT: %.loc4_37.6: @F.%.loc4_33.1 (%.42f) = splice_inst %.loc4_37.5 [template = %.loc4_37.6 (constants.%.4d6629.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %.loc4_33.1 [symbolic = %require_complete (constants.%require_complete.c9b)] @@ -1136,17 +1136,17 @@ fn G() { // CHECK:STDOUT: %Fm.patt.loc4_16.2 => constants.%Fm.patt // CHECK:STDOUT: %Fm.loc4_16.1 => constants.%Fm // CHECK:STDOUT: %.loc4_33.1 => constants.%.42f -// CHECK:STDOUT: %.loc4_30.3 => constants.%.cfa +// CHECK:STDOUT: %.loc4_30.3 => constants.%.c5c // CHECK:STDOUT: %pattern_type => constants.%pattern_type.177 -// CHECK:STDOUT: %.loc4_30.4 => constants.%.26b -// CHECK:STDOUT: %v.patt.loc4_30.2 => constants.%v.patt.cee -// CHECK:STDOUT: %.loc4_37.3 => constants.%.94f -// CHECK:STDOUT: %.loc4_37.4 => constants.%.1ac -// CHECK:STDOUT: %return.patt.loc4_37.2 => constants.%return.patt.333 -// CHECK:STDOUT: %.loc4_30.5 => constants.%.095 -// CHECK:STDOUT: %.loc4_30.6 => constants.%.5e7cab.2 -// CHECK:STDOUT: %.loc4_37.5 => constants.%.efc -// CHECK:STDOUT: %.loc4_37.6 => constants.%.6c4f01.2 +// CHECK:STDOUT: %.loc4_30.4 => constants.%.481d89.2 +// CHECK:STDOUT: %v.patt.loc4_30.2 => constants.%v.patt.db46d6.2 +// CHECK:STDOUT: %.loc4_37.3 => constants.%.2e1 +// CHECK:STDOUT: %.loc4_37.4 => constants.%.05fee9.2 +// CHECK:STDOUT: %return.patt.loc4_37.2 => constants.%return.patt.94bfcb.2 +// CHECK:STDOUT: %.loc4_30.5 => constants.%.0c9 +// CHECK:STDOUT: %.loc4_30.6 => constants.%.59eb0c.2 +// CHECK:STDOUT: %.loc4_37.5 => constants.%.ed0 +// CHECK:STDOUT: %.loc4_37.6 => constants.%.4d6629.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%.795f) { @@ -1160,10 +1160,10 @@ fn G() { // CHECK:STDOUT: %.loc4_37.3 => constants.%inst.out_param_pattern // CHECK:STDOUT: %.loc4_37.4 => constants.%return.param_patt.a9a4c7.1 // CHECK:STDOUT: %return.patt.loc4_37.2 => constants.%return.patt.e1b -// CHECK:STDOUT: %.loc4_30.5 => constants.%.095 -// CHECK:STDOUT: %.loc4_30.6 => constants.%.b27 -// CHECK:STDOUT: %.loc4_37.5 => constants.%.efc -// CHECK:STDOUT: %.loc4_37.6 => constants.%.d33 +// CHECK:STDOUT: %.loc4_30.5 => constants.%.0c9 +// CHECK:STDOUT: %.loc4_30.6 => constants.%.777 +// CHECK:STDOUT: %.loc4_37.5 => constants.%.ed0 +// CHECK:STDOUT: %.loc4_37.6 => constants.%.ed8 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a @@ -1180,10 +1180,10 @@ fn G() { // CHECK:STDOUT: %.loc4_37.3 => constants.%inst.ref_return_pattern // CHECK:STDOUT: %.loc4_37.4 => constants.%.ae0167.1 // CHECK:STDOUT: %return.patt.loc4_37.2 => constants.%return.patt.c62 -// CHECK:STDOUT: %.loc4_30.5 => constants.%.095 -// CHECK:STDOUT: %.loc4_30.6 => constants.%.b27 -// CHECK:STDOUT: %.loc4_37.5 => constants.%.efc -// CHECK:STDOUT: %.loc4_37.6 => constants.%.d33 +// CHECK:STDOUT: %.loc4_30.5 => constants.%.0c9 +// CHECK:STDOUT: %.loc4_30.6 => constants.%.777 +// CHECK:STDOUT: %.loc4_37.5 => constants.%.ed0 +// CHECK:STDOUT: %.loc4_37.6 => constants.%.ed8 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a @@ -1200,10 +1200,10 @@ fn G() { // CHECK:STDOUT: %.loc4_37.3 => constants.%inst.value_return_pattern // CHECK:STDOUT: %.loc4_37.4 => constants.%.1a588f.1 // CHECK:STDOUT: %return.patt.loc4_37.2 => constants.%return.patt.45a -// CHECK:STDOUT: %.loc4_30.5 => constants.%.095 -// CHECK:STDOUT: %.loc4_30.6 => constants.%.b27 -// CHECK:STDOUT: %.loc4_37.5 => constants.%.efc -// CHECK:STDOUT: %.loc4_37.6 => constants.%.d33 +// CHECK:STDOUT: %.loc4_30.5 => constants.%.0c9 +// CHECK:STDOUT: %.loc4_30.6 => constants.%.777 +// CHECK:STDOUT: %.loc4_37.5 => constants.%.ed0 +// CHECK:STDOUT: %.loc4_37.6 => constants.%.ed8 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a diff --git a/toolchain/check/testdata/generic/template/convert.carbon b/toolchain/check/testdata/generic/template/convert.carbon index 36f4cd5d3a99..0d703a8cf223 100644 --- a/toolchain/check/testdata/generic/template/convert.carbon +++ b/toolchain/check/testdata/generic/template/convert.carbon @@ -61,6 +61,93 @@ fn Test(d: D) -> i32 { return F(d); } +// --- initialize_dependent_target_from_literal.carbon + +library "[[@TEST_NAME]]"; + +//@dump-sem-ir-begin +fn F(template T: type) { + var unused w: T = 0; +} +//@dump-sem-ir-end + +fn G() { + F(i32); +} + +// --- initialize_primitive.carbon + +library "[[@TEST_NAME]]"; + +//@dump-sem-ir-begin +fn F[template T: type](x: T) { + var unused w: i32 = x; +} +//@dump-sem-ir-end + +fn G() { + F(0 as i32); +} + +// --- initialize_from_tuple.carbon + +library "[[@TEST_NAME]]"; + +class X {} +fn Make() -> X; + +//@dump-sem-ir-begin +fn F(template T: type) { + var unused w: T = (Make(), Make(), Make()); +} +//@dump-sem-ir-end + +class Y {} + +impl (X, X, X) as Core.ImplicitAs(Y) { + fn Convert(unused self: (X, X, X)) -> Y { return {}; } +} + +fn G() { + F((X, X, X)); + + F(array(X, 3)); + + F(Y); +} + +// --- initialize_from_nested_literal.carbon + +library "[[@TEST_NAME]]"; + +class X {} +fn Make() -> X; + +//@dump-sem-ir-begin +fn F(template T: type) { + var unused w: T = ({.a = Make(), .b = Make()}, Make()); +} +//@dump-sem-ir-end + +class Y { + impl X as Core.ImplicitAs(Y) { + fn Convert(self: X) -> Y; + } +} + +class Z { + var a: X; + var b: Y; +} + +fn G() { + F(({.a: X, .b: X}, X)); + + F(({.a: Y, .b: Y}, Y)); + + F((Z, Y)); +} + // --- as.carbon library "[[@TEST_NAME]]"; @@ -183,7 +270,7 @@ fn Test(d: D) { // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] // CHECK:STDOUT: %n.patt.c48: %pattern_type.6b6 = value_binding_pattern n [concrete] -// CHECK:STDOUT: %.040: %i32 = splice_inst @F.%.loc6_16.2 [template] +// CHECK:STDOUT: %.6ec: %i32 = splice_inst @F.%.loc6_16.2 [template] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic] @@ -261,12 +348,12 @@ fn Test(d: D) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.loc5_16.1 [template = %require_complete (constants.%require_complete.944)] // CHECK:STDOUT: %.loc6_16.2: = convert_to_value_action %x.ref, constants.%i32 [template] -// CHECK:STDOUT: %.loc6_16.3: %i32 = splice_inst %.loc6_16.2 [template = %.loc6_16.3 (constants.%.040)] +// CHECK:STDOUT: %.loc6_16.3: %i32 = splice_inst %.loc6_16.2 [template = %.loc6_16.3 (constants.%.6ec)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%T.loc5_16.1 (%T.67db0b.1)) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @F.%T.loc5_16.1 (%T.67db0b.1) = name_ref x, %x -// CHECK:STDOUT: %.loc6_16.1: %i32 = splice_inst %.loc6_16.2 [template = %.loc6_16.3 (constants.%.040)] +// CHECK:STDOUT: %.loc6_16.1: %i32 = splice_inst %.loc6_16.2 [template = %.loc6_16.3 (constants.%.6ec)] // CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %n: %i32 = wrapper_binding n, %.loc6_16.1 // CHECK:STDOUT: name_binding_decl { @@ -316,6 +403,1640 @@ fn Test(d: D) { // CHECK:STDOUT: %.loc6_16.3 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: --- initialize_dependent_target_from_literal.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: type: type = facet_type [concrete] +// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template] +// CHECK:STDOUT: %T: type = symbolic_binding T, 0, template [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %require_complete.944: = require_complete_type %T [template] +// CHECK:STDOUT: %pattern_type.51d1c4.1: type = pattern_type %T [template] +// CHECK:STDOUT: %w.patt.f6d: %pattern_type.51d1c4.1 = ref_binding_pattern w [template] +// CHECK:STDOUT: %w.var_patt.7fe: %pattern_type.51d1c4.1 = var_pattern %w.patt.f6d [template] +// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] +// CHECK:STDOUT: %tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.38e: %T = splice_inst @F.%tuple.elem0 [template] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] +// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] +// CHECK:STDOUT: %.8cb: type = type_of_inst @F.%.loc6_3.8 [template] +// CHECK:STDOUT: %.c23: %.8cb = splice_inst @F.%.loc6_3.8 [template] +// CHECK:STDOUT: %.57c: type = type_of_inst @F.%.loc6_3.11 [template] +// CHECK:STDOUT: %.e63: %.57c = splice_inst @F.%.loc6_3.11 [template] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %w.patt.859: %pattern_type.6b6 = ref_binding_pattern w [concrete] +// CHECK:STDOUT: %w.var_patt.82c: %pattern_type.6b6 = var_pattern %w.patt.859 [concrete] +// CHECK:STDOUT: %ImplicitAs.type.914: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] +// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.845: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74 = struct_value () [symbolic] +// CHECK:STDOUT: %ImplicitAs.impl_witness.a2a: = impl_witness imports.%ImplicitAs.impl_witness_table.1aa, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.2ba: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.2ba = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.914 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.a2a) [concrete] +// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8eb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] +// CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8eb, %ImplicitAs.facet [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.6e0: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_0.3c0: %i32 = int_value 0 [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { +// CHECK:STDOUT: %.c7a: init %i32 = splice_block %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = %int_0.3c0] { +// CHECK:STDOUT: %impl.elem0.0e6: %.b7a = impl_witness_access %ImplicitAs.impl_witness.a2a, element0 [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39] +// CHECK:STDOUT: %bound_method.6ac: = bound_method %int_0.5c6, %impl.elem0.0e6 [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.0e6, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.9e8: = bound_method %int_0.5c6, %specific_fn [concrete = %bound_method.6e0] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.9e8(%int_0.5c6) [concrete = %int_0.3c0] +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%inst.splice_block.426619.1) [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc6_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc6_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc6_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc6_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc6_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.2: = custom_witness (%Destroy.WithSelf.Op.403171.2, %Destroy.WithSelf.SubobjectDestroy.d01daf.2, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.b41: %Destroy.type = facet_value %i32, (%custom_witness.f8f19d.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.11b: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.b41) [concrete] +// CHECK:STDOUT: %.bbc: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.11b, %Destroy.facet.b41 [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %.b4c: = splice_block %bound_method.521 { +// CHECK:STDOUT: %.0a7: ref %i32 = specific_inst @F.%w.var, @F(%i32) +// CHECK:STDOUT: %impl.elem2: %.bbc = impl_witness_access %custom_witness.f8f19d.2, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.2] +// CHECK:STDOUT: %bound_method.521: = bound_method %.0a7, %impl.elem2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.call: = inst_value [concrete] { +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.b4c(%.0a7) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] +// CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc6_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc6_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc6_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc6_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { +// CHECK:STDOUT: %T.patt.loc5_16.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.loc5_18.1: type = splice_block %.loc5_18.2 [concrete = type] { +// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %.loc5_18.2: type = type_literal type [concrete = type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc5_16.2: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(%T.loc5_16.2: type) { +// CHECK:STDOUT: %T.patt.loc5_16.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.loc5_16.1: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type %T.loc5_16.1 [template = %require_complete (constants.%require_complete.944)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc5_16.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)] +// CHECK:STDOUT: %w.patt.loc6_15.2: @F.%pattern_type (%pattern_type.51d1c4.1) = ref_binding_pattern w [template = %w.patt.loc6_15.2 (constants.%w.patt.f6d)] +// CHECK:STDOUT: %w.var_patt.loc6_3.2: @F.%pattern_type (%pattern_type.51d1c4.1) = var_pattern %w.patt.loc6_15.2 [template = %w.var_patt.loc6_3.2 (constants.%w.var_patt.7fe)] +// CHECK:STDOUT: %.loc6_3.6: %tuple.type = initialize_action %int_0, %T.loc5_16.1, %w.var, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc6_3.6, element0 [template] +// CHECK:STDOUT: %.loc6_3.7: @F.%T.loc5_16.1 (%T) = splice_inst %tuple.elem0 [template = %.loc6_3.7 (constants.%.38e)] +// CHECK:STDOUT: %.loc6_3.8: = compound_member_access_action %w.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc6_3.9: type = type_of_inst %.loc6_3.8 [template = %.loc6_3.9 (constants.%.8cb)] +// CHECK:STDOUT: %.loc6_3.10: @F.%.loc6_3.9 (%.8cb) = splice_inst %.loc6_3.8 [template = %.loc6_3.10 (constants.%.c23)] +// CHECK:STDOUT: %.loc6_3.11: = call_action (%.loc6_3.3), true [template] +// CHECK:STDOUT: %.loc6_3.12: type = type_of_inst %.loc6_3.11 [template = %.loc6_3.12 (constants.%.57c)] +// CHECK:STDOUT: %.loc6_3.13: @F.%.loc6_3.12 (%.57c) = splice_inst %.loc6_3.11 [template = %.loc6_3.13 (constants.%.e63)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %w.var: ref @F.%T.loc5_16.1 (%T) = var_storage %w.var_patt.loc6_3.1 +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] +// CHECK:STDOUT: %.loc6_3.1: @F.%T.loc5_16.1 (%T) = splice_inst %tuple.elem0 [template = %.loc6_3.7 (constants.%.38e)] +// CHECK:STDOUT: assign %w.var, %.loc6_3.1 +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc5_16.2 [template = %T.loc5_16.1 (constants.%T)] +// CHECK:STDOUT: %w: ref @F.%T.loc5_16.1 (%T) = wrapper_binding w, %w.var +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %w.patt.loc6_15.1: @F.%pattern_type (%pattern_type.51d1c4.1) = ref_binding_pattern w [template = %w.patt.loc6_15.2 (constants.%w.patt.f6d)] +// CHECK:STDOUT: %w.var_patt.loc6_3.1: @F.%pattern_type (%pattern_type.51d1c4.1) = var_pattern %w.patt.loc6_15.1 [template = %w.var_patt.loc6_3.2 (constants.%w.var_patt.7fe)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc6_3.2: type = type_of_inst %.loc6_3.8 [template = %.loc6_3.9 (constants.%.8cb)] +// CHECK:STDOUT: %.loc6_3.3: @F.%.loc6_3.9 (%.8cb) = splice_inst %.loc6_3.8 [template = %.loc6_3.10 (constants.%.c23)] +// CHECK:STDOUT: %.loc6_3.4: type = type_of_inst %.loc6_3.11 [template = %.loc6_3.12 (constants.%.57c)] +// CHECK:STDOUT: %.loc6_3.5: @F.%.loc6_3.12 (%.57c) = splice_inst %.loc6_3.11 [template = %.loc6_3.13 (constants.%.e63)] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc6_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc6_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc6_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc6_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%T) { +// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc5_16.1 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%i32) { +// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc5_16.1 => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.f8a +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6b6 +// CHECK:STDOUT: %w.patt.loc6_15.2 => constants.%w.patt.859 +// CHECK:STDOUT: %w.var_patt.loc6_3.2 => constants.%w.var_patt.82c +// CHECK:STDOUT: %.loc6_3.6 => constants.%tuple +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block.426619.1 +// CHECK:STDOUT: %.loc6_3.7 => constants.%int_0.3c0 +// CHECK:STDOUT: %.loc6_3.8 => constants.%inst.splice_block.426619.2 +// CHECK:STDOUT: %.loc6_3.9 => +// CHECK:STDOUT: %.loc6_3.10 => invalid +// CHECK:STDOUT: %.loc6_3.11 => constants.%inst.call +// CHECK:STDOUT: %.loc6_3.12 => constants.%empty_tuple.type +// CHECK:STDOUT: %.loc6_3.13 => invalid +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- initialize_primitive.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: type: type = facet_type [concrete] +// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete] +// CHECK:STDOUT: %T.patt.3a0592.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template] +// CHECK:STDOUT: %T.67db0b.1: type = symbolic_binding T, 0, template [template] +// CHECK:STDOUT: %pattern_type.51d1c4.1: type = pattern_type %T.67db0b.1 [template] +// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d1c4.1 = value_param_pattern [template] +// CHECK:STDOUT: %x.patt.260: %pattern_type.51d1c4.1 = wrapper_binding_pattern x, %x.param_patt.91d [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %require_complete.944: = require_complete_type %T.67db0b.1 [template] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %w.patt: %pattern_type.6b6 = ref_binding_pattern w [concrete] +// CHECK:STDOUT: %w.var_patt: %pattern_type.6b6 = var_pattern %w.patt [concrete] +// CHECK:STDOUT: %tuple.type.f7a: type = tuple_type () [concrete] +// CHECK:STDOUT: %.a11: %i32 = splice_inst @F.%tuple.elem0 [template] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc6_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc6_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc6_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc6_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc6_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %x.param_patt.cee: %pattern_type.6b6 = value_param_pattern [concrete] +// CHECK:STDOUT: %x.patt.e3b: %pattern_type.6b6 = wrapper_binding_pattern x, %x.param_patt.cee [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.b51: = impl_witness imports.%Copy.impl_witness_table.8d2, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.3f6: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.4f6: %Int.as.Copy.impl.Op.type.3f6 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.b51) [concrete] +// CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] +// CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %inst.splice_block: = inst_value [concrete] { +// CHECK:STDOUT: %.388: init %i32 = splice_block %Int.as.Copy.impl.Op.call { +// CHECK:STDOUT: %.3e2: %i32 = specific_inst @F.%x.ref, @F(%i32) +// CHECK:STDOUT: %impl.elem0.882: %.737 = impl_witness_access %Copy.impl_witness.b51, element0 [concrete = %Int.as.Copy.impl.Op.4f6] +// CHECK:STDOUT: %bound_method.606: = bound_method %.3e2, %impl.elem0.882 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.882, @Int.as.Copy.impl.Op(%int_32) [concrete = %Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.65e: = bound_method %.3e2, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.65e(%.3e2) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple.242: %tuple.type.f7a = tuple_value (%inst.splice_block) [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)] +// CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc6_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc6_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc6_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc6_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { +// CHECK:STDOUT: %T.patt.loc5_16.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt.3a0592.1)] +// CHECK:STDOUT: %x.param_patt.loc5_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc5_25.2 (constants.%x.param_patt.91d)] +// CHECK:STDOUT: %x.patt.loc5_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc5_25.1 [template = %x.patt.loc5_25.2 (constants.%x.patt.260)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.loc5_18.1: type = splice_block %.loc5_18.2 [concrete = type] { +// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %.loc5_18.2: type = type_literal type [concrete = type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc5_16.2: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T.67db0b.1)] +// CHECK:STDOUT: %x.param: @F.%T.loc5_16.1 (%T.67db0b.1) = value_param call_param0 +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc5_16.2 [template = %T.loc5_16.1 (constants.%T.67db0b.1)] +// CHECK:STDOUT: %x: @F.%T.loc5_16.1 (%T.67db0b.1) = wrapper_binding x, %x.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(%T.loc5_16.2: type) { +// CHECK:STDOUT: %T.patt.loc5_16.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt.3a0592.1)] +// CHECK:STDOUT: %T.loc5_16.1: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T.67db0b.1)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc5_16.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)] +// CHECK:STDOUT: %x.param_patt.loc5_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc5_25.2 (constants.%x.param_patt.91d)] +// CHECK:STDOUT: %x.patt.loc5_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc5_25.2 [template = %x.patt.loc5_25.2 (constants.%x.patt.260)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type %T.loc5_16.1 [template = %require_complete (constants.%require_complete.944)] +// CHECK:STDOUT: %.loc6_3.2: %tuple.type.f7a = initialize_action %x.ref, constants.%i32, %w.var, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc6_3.2, element0 [template] +// CHECK:STDOUT: %.loc6_3.3: %i32 = splice_inst %tuple.elem0 [template = %.loc6_3.3 (constants.%.a11)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%x.param: @F.%T.loc5_16.1 (%T.67db0b.1)) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %w.var: ref %i32 = var_storage %w.var_patt +// CHECK:STDOUT: %x.ref: @F.%T.loc5_16.1 (%T.67db0b.1) = name_ref x, %x +// CHECK:STDOUT: %.loc6_3.1: %i32 = splice_inst %tuple.elem0 [template = %.loc6_3.3 (constants.%.a11)] +// CHECK:STDOUT: assign %w.var, %.loc6_3.1 +// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %w: ref %i32 = wrapper_binding w, %w.var +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %w.patt: %pattern_type.6b6 = ref_binding_pattern w [concrete = constants.%w.patt] +// CHECK:STDOUT: %w.var_patt: %pattern_type.6b6 = var_pattern %w.patt [concrete = constants.%w.var_patt] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %w.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%w.var) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc6_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc6_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc6_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc6_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%T.67db0b.1) { +// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt.3a0592.1 +// CHECK:STDOUT: %T.loc5_16.1 => constants.%T.67db0b.1 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d1c4.1 +// CHECK:STDOUT: %x.param_patt.loc5_25.2 => constants.%x.param_patt.91d +// CHECK:STDOUT: %x.patt.loc5_25.2 => constants.%x.patt.260 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%i32) { +// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt.3a0592.1 +// CHECK:STDOUT: %T.loc5_16.1 => constants.%i32 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6b6 +// CHECK:STDOUT: %x.param_patt.loc5_25.2 => constants.%x.param_patt.cee +// CHECK:STDOUT: %x.patt.loc5_25.2 => constants.%x.patt.e3b +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.f8a +// CHECK:STDOUT: %.loc6_3.2 => constants.%tuple.242 +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block +// CHECK:STDOUT: %.loc6_3.3 => invalid +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- initialize_from_tuple.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: type: type = facet_type [concrete] +// CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %pattern_type.6cb: type = pattern_type %X [concrete] +// CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] +// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template] +// CHECK:STDOUT: %T: type = symbolic_binding T, 0, template [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %require_complete.944: = require_complete_type %T [template] +// CHECK:STDOUT: %pattern_type.51d1c4.1: type = pattern_type %T [template] +// CHECK:STDOUT: %w.patt.f6d: %pattern_type.51d1c4.1 = ref_binding_pattern w [template] +// CHECK:STDOUT: %w.var_patt.7fe: %pattern_type.51d1c4.1 = var_pattern %w.patt.f6d [template] +// CHECK:STDOUT: %tuple.type.92e: type = tuple_type (%X, %X, %X) [concrete] +// CHECK:STDOUT: %tuple.type.f39: type = tuple_type (, , , ) [concrete] +// CHECK:STDOUT: %.4e3: %X = splice_inst @F.%tuple.elem1 [template] +// CHECK:STDOUT: %.c57: %X = splice_inst @F.%tuple.elem2 [template] +// CHECK:STDOUT: %.ceb: %X = splice_inst @F.%tuple.elem3 [template] +// CHECK:STDOUT: %.b00: %T = splice_inst @F.%tuple.elem0 [template] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] +// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] +// CHECK:STDOUT: %.8cb: type = type_of_inst @F.%.loc9_3.14 [template] +// CHECK:STDOUT: %.c23: %.8cb = splice_inst @F.%.loc9_3.14 [template] +// CHECK:STDOUT: %.57c: type = type_of_inst @F.%.loc9_3.17 [template] +// CHECK:STDOUT: %.e63: %.57c = splice_inst @F.%.loc9_3.17 [template] +// CHECK:STDOUT: %Y: type = class_type @Y [concrete] +// CHECK:STDOUT: %ImplicitAs.type.836: type = facet_type <@ImplicitAs, @ImplicitAs(%Y)> [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness @tuple.type.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] +// CHECK:STDOUT: %pattern_type.eca: type = pattern_type %tuple.type.92e [concrete] +// CHECK:STDOUT: %pattern_type.7ab: type = pattern_type %Y [concrete] +// CHECK:STDOUT: %tuple.type.as.ImplicitAs.impl.Convert.type: type = fn_type @tuple.type.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %tuple.type.as.ImplicitAs.impl.Convert: %tuple.type.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.836 = facet_value %tuple.type.92e, (%ImplicitAs.impl_witness) [concrete] +// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.354: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Y, %ImplicitAs.facet) [concrete] +// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete] +// CHECK:STDOUT: %array_type: type = array_type %int_3, %X [concrete] +// CHECK:STDOUT: %complete_type.8ad: = complete_type_witness %tuple.type.92e [concrete] +// CHECK:STDOUT: %w.patt.689: %pattern_type.eca = ref_binding_pattern w [concrete] +// CHECK:STDOUT: %w.var_patt.e50: %pattern_type.eca = var_pattern %w.patt.689 [concrete] +// CHECK:STDOUT: %inst.tuple_init: = inst_value [concrete] { +// CHECK:STDOUT: %.61c5: init %tuple.type.92e to %.b1e3d3.2 = tuple_init (@F.%Make.call.loc9_27, @F.%Make.call.loc9_35, @F.%Make.call.loc9_43) +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { +// CHECK:STDOUT: %.4d5: ref %X = splice_block %tuple.elem0 { +// CHECK:STDOUT: %.b1e3d3.2: ref %tuple.type.92e = specific_inst @F.%w.var, @F(%tuple.type.92e) +// CHECK:STDOUT: %tuple.elem0: ref %X = tuple_access %.b1e3d3.2, element0 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.tuple_access.426619.1: = inst_value [concrete] { +// CHECK:STDOUT: %tuple.elem1: ref %X = tuple_access %.b1e3d3.2, element1 +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.tuple_access.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %tuple.elem2: ref %X = tuple_access %.b1e3d3.2, element2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple.1ed7a0.1: %tuple.type.f39 = tuple_value (%inst.tuple_init, %inst.splice_block.426619.1, %inst.tuple_access.426619.1, %inst.tuple_access.426619.2) [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] +// CHECK:STDOUT: %self.param_patt.52f: %pattern_type.a96 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4b1: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt.52f [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b09: %pattern_type.eca = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.6d4: %pattern_type.eca = wrapper_binding_pattern self, %self.param_patt.b09 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.3: = custom_witness (%Destroy.WithSelf.Op.403171.3, %Destroy.WithSelf.SubobjectDestroy.d01daf.3, %Destroy.WithSelf.SelfDestruct.db3fdb.3), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.51e: %Destroy.type = facet_value %tuple.type.92e, (%custom_witness.f8f19d.3) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.614: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.51e) [concrete] +// CHECK:STDOUT: %.9f8: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.614, %Destroy.facet.51e [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %.955: = splice_block %bound_method.2c0 { +// CHECK:STDOUT: %.b1e3d3.1: ref %tuple.type.92e = specific_inst @F.%w.var, @F(%tuple.type.92e) +// CHECK:STDOUT: %impl.elem2.39d: %.9f8 = impl_witness_access %custom_witness.f8f19d.3, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.3] +// CHECK:STDOUT: %bound_method.2c0: = bound_method %.b1e3d3.1, %impl.elem2.39d +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.call.426619.1: = inst_value [concrete] { +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.67d: init %empty_tuple.type = call %.955(%.b1e3d3.1) +// CHECK:STDOUT: } +// CHECK:STDOUT: %complete_type.3e8: = complete_type_witness %array_type [concrete] +// CHECK:STDOUT: %pattern_type.92a: type = pattern_type %array_type [concrete] +// CHECK:STDOUT: %w.patt.f13: %pattern_type.92a = ref_binding_pattern w [concrete] +// CHECK:STDOUT: %w.var_patt.c83: %pattern_type.92a = var_pattern %w.patt.f13 [concrete] +// CHECK:STDOUT: %int_0.5c61a1.1: Core.IntLiteral = int_value 0 [concrete] +// CHECK:STDOUT: %int_1.5b8115.1: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %int_2.ecc8af.1: Core.IntLiteral = int_value 2 [concrete] +// CHECK:STDOUT: %inst.array_init: = inst_value [concrete] { +// CHECK:STDOUT: %.dc3: init %array_type to %.c5e285.2 = array_init (@F.%Make.call.loc9_27, @F.%Make.call.loc9_35, @F.%Make.call.loc9_43) +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { +// CHECK:STDOUT: %.c80: ref %X = splice_block %.f75 { +// CHECK:STDOUT: %.c5e285.2: ref %array_type = specific_inst @F.%w.var, @F(%array_type) +// CHECK:STDOUT: %int_0.5c61a1.2: Core.IntLiteral = int_value 0 [concrete = %int_0.5c61a1.1] +// CHECK:STDOUT: %.f75: ref %X = array_index %.c5e285.2, %int_0.5c61a1.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.splice_block.426619.4: = inst_value [concrete] { +// CHECK:STDOUT: %.53e: ref %X = splice_block %.efc { +// CHECK:STDOUT: %int_1.5b8115.2: Core.IntLiteral = int_value 1 [concrete = %int_1.5b8115.1] +// CHECK:STDOUT: %.efc: ref %X = array_index %.c5e285.2, %int_1.5b8115.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.splice_block.426619.5: = inst_value [concrete] { +// CHECK:STDOUT: %.1e2: ref %X = splice_block %.d3b { +// CHECK:STDOUT: %int_2.ecc8af.2: Core.IntLiteral = int_value 2 [concrete = %int_2.ecc8af.1] +// CHECK:STDOUT: %.d3b: ref %X = array_index %.c5e285.2, %int_2.ecc8af.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple.1ed7a0.2: %tuple.type.f39 = tuple_value (%inst.array_init, %inst.splice_block.426619.3, %inst.splice_block.426619.4, %inst.splice_block.426619.5) [concrete] +// CHECK:STDOUT: %self.param_patt.8dc: %pattern_type.92a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.6fb: %pattern_type.92a = wrapper_binding_pattern self, %self.param_patt.8dc [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.4: = custom_witness (%Destroy.WithSelf.Op.403171.4, %Destroy.WithSelf.SubobjectDestroy.d01daf.4, %Destroy.WithSelf.SelfDestruct.db3fdb.4), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.792: %Destroy.type = facet_value %array_type, (%custom_witness.f8f19d.4) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.387: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.792) [concrete] +// CHECK:STDOUT: %.e83: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.387, %Destroy.facet.792 [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.6: = inst_value [concrete] { +// CHECK:STDOUT: %.85a: = splice_block %bound_method.5ba { +// CHECK:STDOUT: %.c5e285.1: ref %array_type = specific_inst @F.%w.var, @F(%array_type) +// CHECK:STDOUT: %impl.elem2.96d: %.e83 = impl_witness_access %custom_witness.f8f19d.4, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.4] +// CHECK:STDOUT: %bound_method.5ba: = bound_method %.c5e285.1, %impl.elem2.96d +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.call.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.014: init %empty_tuple.type = call %.85a(%.c5e285.1) +// CHECK:STDOUT: } +// CHECK:STDOUT: %w.patt.22a: %pattern_type.7ab = ref_binding_pattern w [concrete] +// CHECK:STDOUT: %w.var_patt.565: %pattern_type.7ab = var_pattern %w.patt.22a [concrete] +// CHECK:STDOUT: %.e93: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.354, %ImplicitAs.facet [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.7: = inst_value [concrete] { +// CHECK:STDOUT: %.5fb: init %Y = splice_block %tuple.type.as.ImplicitAs.impl.Convert.call { +// CHECK:STDOUT: %impl.elem0.bd3: %.e93 = impl_witness_access %ImplicitAs.impl_witness, element0 [concrete = %tuple.type.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.7c0: = bound_method @F.%.loc9_44, %impl.elem0.bd3 +// CHECK:STDOUT: %.cd3ce6.2: ref %Y = specific_inst @F.%w.var, @F(%Y) +// CHECK:STDOUT: %.71d: ref %X = temporary @F.%.loc9_3.1, @F.%Make.call.loc9_27 +// CHECK:STDOUT: %.173: %X = acquire_value %.71d +// CHECK:STDOUT: %.61c8: ref %X = temporary @F.%.loc9_3.2, @F.%Make.call.loc9_35 +// CHECK:STDOUT: %.f2a: %X = acquire_value %.61c8 +// CHECK:STDOUT: %.55f: ref %X = temporary @F.%.loc9_3.3, @F.%Make.call.loc9_43 +// CHECK:STDOUT: %.eee: %X = acquire_value %.55f +// CHECK:STDOUT: %tuple.9aa: %tuple.type.92e = tuple_value (%.173, %.f2a, %.eee) +// CHECK:STDOUT: %.1f9: %tuple.type.92e = converted @F.%.loc9_44, %tuple.9aa +// CHECK:STDOUT: %tuple.type.as.ImplicitAs.impl.Convert.call: init %Y to %.cd3ce6.2 = call %bound_method.7c0(%.1f9) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.temporary_storage.426619.1: = inst_value [concrete] { +// CHECK:STDOUT: %.7a56fd.1: ref %X = temporary_storage +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.temporary_storage.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %.7a56fd.2: ref %X = temporary_storage +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.temporary_storage.426619.3: = inst_value [concrete] { +// CHECK:STDOUT: %.7a56fd.3: ref %X = temporary_storage +// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple.1ed7a0.3: %tuple.type.f39 = tuple_value (%inst.splice_block.426619.7, %inst.temporary_storage.426619.1, %inst.temporary_storage.426619.2, %inst.temporary_storage.426619.3) [concrete] +// CHECK:STDOUT: %self.param_patt.1fb: %pattern_type.7ab = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.eee: %pattern_type.7ab = wrapper_binding_pattern self, %self.param_patt.1fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc9_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.5: = custom_witness (%Destroy.WithSelf.Op.403171.5, %Destroy.WithSelf.SubobjectDestroy.d01daf.5, %Destroy.WithSelf.SelfDestruct.db3fdb.5), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.09f: %Destroy.type = facet_value %Y, (%custom_witness.f8f19d.5) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.575: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.09f) [concrete] +// CHECK:STDOUT: %.dbd: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.575, %Destroy.facet.09f [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.8: = inst_value [concrete] { +// CHECK:STDOUT: %.477: = splice_block %bound_method.5af { +// CHECK:STDOUT: %.cd3ce6.1: ref %Y = specific_inst @F.%w.var, @F(%Y) +// CHECK:STDOUT: %impl.elem2.5d8: %.dbd = impl_witness_access %custom_witness.f8f19d.5, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.5] +// CHECK:STDOUT: %bound_method.5af: = bound_method %.cd3ce6.1, %impl.elem2.5d8 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.call.426619.3: = inst_value [concrete] { +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.160: init %empty_tuple.type = call %.477(%.cd3ce6.1) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a96 = ref_param_pattern [concrete = constants.%self.param_patt.52f] +// CHECK:STDOUT: %self.patt: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_struct_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_struct_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a96 = ref_param_pattern [concrete = constants.%self.param_patt.52f] +// CHECK:STDOUT: %self.patt: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_struct_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_struct_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.eca = ref_param_pattern [concrete = constants.%self.param_patt.b09] +// CHECK:STDOUT: %self.patt: %pattern_type.eca = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6d4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.92e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.92e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.eca = ref_param_pattern [concrete = constants.%self.param_patt.b09] +// CHECK:STDOUT: %self.patt: %pattern_type.eca = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6d4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.92e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.92e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.92a = ref_param_pattern [concrete = constants.%self.param_patt.8dc] +// CHECK:STDOUT: %self.patt: %pattern_type.92a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6fb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc9_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.92a = ref_param_pattern [concrete = constants.%self.param_patt.8dc] +// CHECK:STDOUT: %self.patt: %pattern_type.92a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6fb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7ab = ref_param_pattern [concrete = constants.%self.param_patt.1fb] +// CHECK:STDOUT: %self.patt: %pattern_type.7ab = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eee] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc9_3.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7ab = ref_param_pattern [concrete = constants.%self.param_patt.1fb] +// CHECK:STDOUT: %self.patt: %pattern_type.7ab = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eee] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { +// CHECK:STDOUT: %T.patt.loc8_16.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc8_16.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.loc8_18.1: type = splice_block %.loc8_18.2 [concrete = type] { +// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %.loc8_18.2: type = type_literal type [concrete = type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc8_16.2: type = symbolic_binding T, 0, template [template = %T.loc8_16.1 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(%T.loc8_16.2: type) { +// CHECK:STDOUT: %T.patt.loc8_16.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc8_16.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.loc8_16.1: type = symbolic_binding T, 0, template [template = %T.loc8_16.1 (constants.%T)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type %T.loc8_16.1 [template = %require_complete (constants.%require_complete.944)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc8_16.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)] +// CHECK:STDOUT: %w.patt.loc9_15.2: @F.%pattern_type (%pattern_type.51d1c4.1) = ref_binding_pattern w [template = %w.patt.loc9_15.2 (constants.%w.patt.f6d)] +// CHECK:STDOUT: %w.var_patt.loc9_3.2: @F.%pattern_type (%pattern_type.51d1c4.1) = var_pattern %w.patt.loc9_15.2 [template = %w.var_patt.loc9_3.2 (constants.%w.var_patt.7fe)] +// CHECK:STDOUT: %.loc9_3.9: %tuple.type.f39 = initialize_action %.loc9_44, %T.loc8_16.1, %w.var, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc9_3.9, element0 [template] +// CHECK:STDOUT: %tuple.elem1: = tuple_access %.loc9_3.9, element1 [template] +// CHECK:STDOUT: %.loc9_3.10: %X = splice_inst %tuple.elem1 [template = %.loc9_3.10 (constants.%.4e3)] +// CHECK:STDOUT: %tuple.elem2: = tuple_access %.loc9_3.9, element2 [template] +// CHECK:STDOUT: %.loc9_3.11: %X = splice_inst %tuple.elem2 [template = %.loc9_3.11 (constants.%.c57)] +// CHECK:STDOUT: %tuple.elem3: = tuple_access %.loc9_3.9, element3 [template] +// CHECK:STDOUT: %.loc9_3.12: %X = splice_inst %tuple.elem3 [template = %.loc9_3.12 (constants.%.ceb)] +// CHECK:STDOUT: %.loc9_3.13: @F.%T.loc8_16.1 (%T) = splice_inst %tuple.elem0 [template = %.loc9_3.13 (constants.%.b00)] +// CHECK:STDOUT: %.loc9_3.14: = compound_member_access_action %w.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc9_3.15: type = type_of_inst %.loc9_3.14 [template = %.loc9_3.15 (constants.%.8cb)] +// CHECK:STDOUT: %.loc9_3.16: @F.%.loc9_3.15 (%.8cb) = splice_inst %.loc9_3.14 [template = %.loc9_3.16 (constants.%.c23)] +// CHECK:STDOUT: %.loc9_3.17: = call_action (%.loc9_3.6), true [template] +// CHECK:STDOUT: %.loc9_3.18: type = type_of_inst %.loc9_3.17 [template = %.loc9_3.18 (constants.%.57c)] +// CHECK:STDOUT: %.loc9_3.19: @F.%.loc9_3.18 (%.57c) = splice_inst %.loc9_3.17 [template = %.loc9_3.19 (constants.%.e63)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %w.var: ref @F.%T.loc8_16.1 (%T) = var_storage %w.var_patt.loc9_3.1 +// CHECK:STDOUT: %Make.ref.loc9_22: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc9_3.1: %X = splice_inst %tuple.elem1 [template = %.loc9_3.10 (constants.%.4e3)] +// CHECK:STDOUT: %Make.call.loc9_27: init %X to %.loc9_3.1 = call %Make.ref.loc9_22() +// CHECK:STDOUT: %Make.ref.loc9_30: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc9_3.2: %X = splice_inst %tuple.elem2 [template = %.loc9_3.11 (constants.%.c57)] +// CHECK:STDOUT: %Make.call.loc9_35: init %X to %.loc9_3.2 = call %Make.ref.loc9_30() +// CHECK:STDOUT: %Make.ref.loc9_38: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc9_3.3: %X = splice_inst %tuple.elem3 [template = %.loc9_3.12 (constants.%.ceb)] +// CHECK:STDOUT: %Make.call.loc9_43: init %X to %.loc9_3.3 = call %Make.ref.loc9_38() +// CHECK:STDOUT: %.loc9_44: %tuple.type.92e = tuple_literal (%Make.call.loc9_27, %Make.call.loc9_35, %Make.call.loc9_43) +// CHECK:STDOUT: %.loc9_3.4: @F.%T.loc8_16.1 (%T) = splice_inst %tuple.elem0 [template = %.loc9_3.13 (constants.%.b00)] +// CHECK:STDOUT: assign %w.var, %.loc9_3.4 +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_16.2 [template = %T.loc8_16.1 (constants.%T)] +// CHECK:STDOUT: %w: ref @F.%T.loc8_16.1 (%T) = wrapper_binding w, %w.var +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %w.patt.loc9_15.1: @F.%pattern_type (%pattern_type.51d1c4.1) = ref_binding_pattern w [template = %w.patt.loc9_15.2 (constants.%w.patt.f6d)] +// CHECK:STDOUT: %w.var_patt.loc9_3.1: @F.%pattern_type (%pattern_type.51d1c4.1) = var_pattern %w.patt.loc9_15.1 [template = %w.var_patt.loc9_3.2 (constants.%w.var_patt.7fe)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc9_3.5: type = type_of_inst %.loc9_3.14 [template = %.loc9_3.15 (constants.%.8cb)] +// CHECK:STDOUT: %.loc9_3.6: @F.%.loc9_3.15 (%.8cb) = splice_inst %.loc9_3.14 [template = %.loc9_3.16 (constants.%.c23)] +// CHECK:STDOUT: %.loc9_3.7: type = type_of_inst %.loc9_3.17 [template = %.loc9_3.18 (constants.%.57c)] +// CHECK:STDOUT: %.loc9_3.8: @F.%.loc9_3.18 (%.57c) = splice_inst %.loc9_3.17 [template = %.loc9_3.19 (constants.%.e63)] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %empty_struct_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %tuple.type.92e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %tuple.type.92e) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %tuple.type.92e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.4(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.4(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.4(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.5(%self.param: ref %Y) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.5(%self.param: ref %Y) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.5(%self.param: ref %Y) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%T) { +// CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc8_16.1 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%tuple.type.92e) { +// CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc8_16.1 => constants.%tuple.type.92e +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.8ad +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.eca +// CHECK:STDOUT: %w.patt.loc9_15.2 => constants.%w.patt.689 +// CHECK:STDOUT: %w.var_patt.loc9_3.2 => constants.%w.var_patt.e50 +// CHECK:STDOUT: %.loc9_3.9 => constants.%tuple.1ed7a0.1 +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.tuple_init +// CHECK:STDOUT: %tuple.elem1 => constants.%inst.splice_block.426619.1 +// CHECK:STDOUT: %.loc9_3.10 => invalid +// CHECK:STDOUT: %tuple.elem2 => constants.%inst.tuple_access.426619.1 +// CHECK:STDOUT: %.loc9_3.11 => invalid +// CHECK:STDOUT: %tuple.elem3 => constants.%inst.tuple_access.426619.2 +// CHECK:STDOUT: %.loc9_3.12 => invalid +// CHECK:STDOUT: %.loc9_3.13 => invalid +// CHECK:STDOUT: %.loc9_3.14 => constants.%inst.splice_block.426619.2 +// CHECK:STDOUT: %.loc9_3.15 => +// CHECK:STDOUT: %.loc9_3.16 => invalid +// CHECK:STDOUT: %.loc9_3.17 => constants.%inst.call.426619.1 +// CHECK:STDOUT: %.loc9_3.18 => constants.%empty_tuple.type +// CHECK:STDOUT: %.loc9_3.19 => invalid +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%array_type) { +// CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc8_16.1 => constants.%array_type +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.3e8 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.92a +// CHECK:STDOUT: %w.patt.loc9_15.2 => constants.%w.patt.f13 +// CHECK:STDOUT: %w.var_patt.loc9_3.2 => constants.%w.var_patt.c83 +// CHECK:STDOUT: %.loc9_3.9 => constants.%tuple.1ed7a0.2 +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.array_init +// CHECK:STDOUT: %tuple.elem1 => constants.%inst.splice_block.426619.3 +// CHECK:STDOUT: %.loc9_3.10 => invalid +// CHECK:STDOUT: %tuple.elem2 => constants.%inst.splice_block.426619.4 +// CHECK:STDOUT: %.loc9_3.11 => invalid +// CHECK:STDOUT: %tuple.elem3 => constants.%inst.splice_block.426619.5 +// CHECK:STDOUT: %.loc9_3.12 => invalid +// CHECK:STDOUT: %.loc9_3.13 => invalid +// CHECK:STDOUT: %.loc9_3.14 => constants.%inst.splice_block.426619.6 +// CHECK:STDOUT: %.loc9_3.15 => +// CHECK:STDOUT: %.loc9_3.16 => invalid +// CHECK:STDOUT: %.loc9_3.17 => constants.%inst.call.426619.2 +// CHECK:STDOUT: %.loc9_3.18 => constants.%empty_tuple.type +// CHECK:STDOUT: %.loc9_3.19 => invalid +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%Y) { +// CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc8_16.1 => constants.%Y +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.357 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ab +// CHECK:STDOUT: %w.patt.loc9_15.2 => constants.%w.patt.22a +// CHECK:STDOUT: %w.var_patt.loc9_3.2 => constants.%w.var_patt.565 +// CHECK:STDOUT: %.loc9_3.9 => constants.%tuple.1ed7a0.3 +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block.426619.7 +// CHECK:STDOUT: %tuple.elem1 => constants.%inst.temporary_storage.426619.1 +// CHECK:STDOUT: %.loc9_3.10 => invalid +// CHECK:STDOUT: %tuple.elem2 => constants.%inst.temporary_storage.426619.2 +// CHECK:STDOUT: %.loc9_3.11 => invalid +// CHECK:STDOUT: %tuple.elem3 => constants.%inst.temporary_storage.426619.3 +// CHECK:STDOUT: %.loc9_3.12 => invalid +// CHECK:STDOUT: %.loc9_3.13 => invalid +// CHECK:STDOUT: %.loc9_3.14 => constants.%inst.splice_block.426619.8 +// CHECK:STDOUT: %.loc9_3.15 => +// CHECK:STDOUT: %.loc9_3.16 => invalid +// CHECK:STDOUT: %.loc9_3.17 => constants.%inst.call.426619.3 +// CHECK:STDOUT: %.loc9_3.18 => constants.%empty_tuple.type +// CHECK:STDOUT: %.loc9_3.19 => invalid +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- initialize_from_nested_literal.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: type: type = facet_type [concrete] +// CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %pattern_type.6cb: type = pattern_type %X [concrete] +// CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] +// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template] +// CHECK:STDOUT: %T: type = symbolic_binding T, 0, template [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %require_complete.944: = require_complete_type %T [template] +// CHECK:STDOUT: %pattern_type.51d1c4.1: type = pattern_type %T [template] +// CHECK:STDOUT: %w.patt.f6d: %pattern_type.51d1c4.1 = ref_binding_pattern w [template] +// CHECK:STDOUT: %w.var_patt.7fe: %pattern_type.51d1c4.1 = var_pattern %w.patt.f6d [template] +// CHECK:STDOUT: %struct_type.a.b.f38: type = struct_type {.a: %X, .b: %X} [concrete] +// CHECK:STDOUT: %tuple.type.4c2: type = tuple_type (%struct_type.a.b.f38, %X) [concrete] +// CHECK:STDOUT: %tuple.type.f39: type = tuple_type (, , , ) [concrete] +// CHECK:STDOUT: %.4e3: %X = splice_inst @F.%tuple.elem1 [template] +// CHECK:STDOUT: %.c57: %X = splice_inst @F.%tuple.elem2 [template] +// CHECK:STDOUT: %.ceb: %X = splice_inst @F.%tuple.elem3 [template] +// CHECK:STDOUT: %.b00: %T = splice_inst @F.%tuple.elem0 [template] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] +// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] +// CHECK:STDOUT: %.8cb: type = type_of_inst @F.%.loc9_3.14 [template] +// CHECK:STDOUT: %.c23: %.8cb = splice_inst @F.%.loc9_3.14 [template] +// CHECK:STDOUT: %.57c: type = type_of_inst @F.%.loc9_3.17 [template] +// CHECK:STDOUT: %.e63: %.57c = splice_inst @F.%.loc9_3.17 [template] +// CHECK:STDOUT: %Y: type = class_type @Y [concrete] +// CHECK:STDOUT: %ImplicitAs.type.836: type = facet_type <@ImplicitAs, @ImplicitAs(%Y)> [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness @X.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] +// CHECK:STDOUT: %pattern_type.7ab: type = pattern_type %Y [concrete] +// CHECK:STDOUT: %X.as.ImplicitAs.impl.Convert.type: type = fn_type @X.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %X.as.ImplicitAs.impl.Convert: %X.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.836 = facet_value %X, (%ImplicitAs.impl_witness) [concrete] +// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.bb3: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Y, %ImplicitAs.facet) [concrete] +// CHECK:STDOUT: %Z: type = class_type @Z [concrete] +// CHECK:STDOUT: %struct_type.a.b.297: type = struct_type {.a: %X, .b: %Y} [concrete] +// CHECK:STDOUT: %struct_type.a.b.095: type = struct_type {.a: %Y, .b: %Y} [concrete] +// CHECK:STDOUT: %tuple.type.2f4: type = tuple_type (%struct_type.a.b.095, %Y) [concrete] +// CHECK:STDOUT: %tuple.type.bb4: type = tuple_type (%Z, %Y) [concrete] +// CHECK:STDOUT: %complete_type.9dc: = complete_type_witness %tuple.type.4c2 [concrete] +// CHECK:STDOUT: %pattern_type.9a0: type = pattern_type %tuple.type.4c2 [concrete] +// CHECK:STDOUT: %w.patt.a80: %pattern_type.9a0 = ref_binding_pattern w [concrete] +// CHECK:STDOUT: %w.var_patt.607: %pattern_type.9a0 = var_pattern %w.patt.a80 [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { +// CHECK:STDOUT: %.e45: init %tuple.type.4c2 = splice_block %.b73 { +// CHECK:STDOUT: %.484: init %struct_type.a.b.f38 to %tuple.elem0.a28 = struct_init (@F.%Make.call.loc9_33, @F.%Make.call.loc9_46) +// CHECK:STDOUT: %.a09: init %struct_type.a.b.f38 = converted @F.%.loc9_47, %.484 +// CHECK:STDOUT: %.b73: init %tuple.type.4c2 to %.250153.2 = tuple_init (%.a09, @F.%Make.call.loc9_55) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %.550: ref %X = splice_block %.d62 { +// CHECK:STDOUT: %.250153.2: ref %tuple.type.4c2 = specific_inst @F.%w.var, @F(%tuple.type.4c2) +// CHECK:STDOUT: %tuple.elem0.a28: ref %struct_type.a.b.f38 = tuple_access %.250153.2, element0 +// CHECK:STDOUT: %.d62: ref %X = struct_access %tuple.elem0.a28, element0 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.struct_access: = inst_value [concrete] { +// CHECK:STDOUT: %.162: ref %X = struct_access %tuple.elem0.a28, element1 +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.tuple_access: = inst_value [concrete] { +// CHECK:STDOUT: %tuple.elem1.79b: ref %X = tuple_access %.250153.2, element1 +// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple.1ed7a0.1: %tuple.type.f39 = tuple_value (%inst.splice_block.426619.1, %inst.splice_block.426619.2, %inst.struct_access, %inst.tuple_access) [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] +// CHECK:STDOUT: %self.param_patt.52f: %pattern_type.a96 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4b1: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt.52f [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.4c3: type = pattern_type %struct_type.a.b.f38 [concrete] +// CHECK:STDOUT: %self.param_patt.bd8: %pattern_type.4c3 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7ce: %pattern_type.4c3 = wrapper_binding_pattern self, %self.param_patt.bd8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.165: %pattern_type.9a0 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c78: %pattern_type.9a0 = wrapper_binding_pattern self, %self.param_patt.165 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.4: = custom_witness (%Destroy.WithSelf.Op.403171.4, %Destroy.WithSelf.SubobjectDestroy.d01daf.4, %Destroy.WithSelf.SelfDestruct.db3fdb.4), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.e65: %Destroy.type = facet_value %tuple.type.4c2, (%custom_witness.f8f19d.4) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.a0f: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.e65) [concrete] +// CHECK:STDOUT: %.f15: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.a0f, %Destroy.facet.e65 [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { +// CHECK:STDOUT: %.b25: = splice_block %bound_method.773 { +// CHECK:STDOUT: %.250153.1: ref %tuple.type.4c2 = specific_inst @F.%w.var, @F(%tuple.type.4c2) +// CHECK:STDOUT: %impl.elem2.69b: %.f15 = impl_witness_access %custom_witness.f8f19d.4, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.4] +// CHECK:STDOUT: %bound_method.773: = bound_method %.250153.1, %impl.elem2.69b +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.call.426619.1: = inst_value [concrete] { +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.074: init %empty_tuple.type = call %.b25(%.250153.1) +// CHECK:STDOUT: } +// CHECK:STDOUT: %complete_type.8ea: = complete_type_witness %tuple.type.2f4 [concrete] +// CHECK:STDOUT: %pattern_type.2cd: type = pattern_type %tuple.type.2f4 [concrete] +// CHECK:STDOUT: %w.patt.e8c: %pattern_type.2cd = ref_binding_pattern w [concrete] +// CHECK:STDOUT: %w.var_patt.61a: %pattern_type.2cd = var_pattern %w.patt.e8c [concrete] +// CHECK:STDOUT: %.fd6: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.bb3, %ImplicitAs.facet [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.4: = inst_value [concrete] { +// CHECK:STDOUT: %.d1a: init %tuple.type.2f4 = splice_block %.0f6 { +// CHECK:STDOUT: %impl.elem0.94756c.3: %.fd6 = impl_witness_access %ImplicitAs.impl_witness, element0 [concrete = %X.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.d13: = bound_method @F.%Make.call.loc9_33, %impl.elem0.94756c.3 +// CHECK:STDOUT: %.9ba: ref %Y = splice_block %.e68 { +// CHECK:STDOUT: %.fe34fc.2: ref %tuple.type.2f4 = specific_inst @F.%w.var, @F(%tuple.type.2f4) +// CHECK:STDOUT: %tuple.elem0.25a: ref %struct_type.a.b.095 = tuple_access %.fe34fc.2, element0 +// CHECK:STDOUT: %.e68: ref %Y = struct_access %tuple.elem0.25a, element0 +// CHECK:STDOUT: } +// CHECK:STDOUT: %.71d: ref %X = temporary @F.%.loc9_3.1, @F.%Make.call.loc9_33 +// CHECK:STDOUT: %.173: %X = acquire_value %.71d +// CHECK:STDOUT: %X.as.ImplicitAs.impl.Convert.call.5f0: init %Y to %.9ba = call %bound_method.d13(%.173) +// CHECK:STDOUT: %.5ba: init %Y = converted @F.%Make.call.loc9_33, %X.as.ImplicitAs.impl.Convert.call.5f0 +// CHECK:STDOUT: %impl.elem0.94756c.4: %.fd6 = impl_witness_access %ImplicitAs.impl_witness, element0 [concrete = %X.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.a267a9.2: = bound_method @F.%Make.call.loc9_46, %impl.elem0.94756c.4 +// CHECK:STDOUT: %.9f2: ref %Y = struct_access %tuple.elem0.25a, element1 +// CHECK:STDOUT: %.61c809.2: ref %X = temporary @F.%.loc9_3.2, @F.%Make.call.loc9_46 +// CHECK:STDOUT: %.f2a65d.2: %X = acquire_value %.61c809.2 +// CHECK:STDOUT: %X.as.ImplicitAs.impl.Convert.call.2aa: init %Y to %.9f2 = call %bound_method.a267a9.2(%.f2a65d.2) +// CHECK:STDOUT: %.eb7: init %Y = converted @F.%Make.call.loc9_46, %X.as.ImplicitAs.impl.Convert.call.2aa +// CHECK:STDOUT: %.230: init %struct_type.a.b.095 to %tuple.elem0.25a = struct_init (%.5ba, %.eb7) +// CHECK:STDOUT: %.b92: init %struct_type.a.b.095 = converted @F.%.loc9_47, %.230 +// CHECK:STDOUT: %impl.elem0.94756c.5: %.fd6 = impl_witness_access %ImplicitAs.impl_witness, element0 [concrete = %X.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.1fb3b5.2: = bound_method @F.%Make.call.loc9_55, %impl.elem0.94756c.5 +// CHECK:STDOUT: %tuple.elem1.0e1: ref %Y = tuple_access %.fe34fc.2, element1 +// CHECK:STDOUT: %.55fb1a.2: ref %X = temporary @F.%.loc9_3.3, @F.%Make.call.loc9_55 +// CHECK:STDOUT: %.eeedf6.2: %X = acquire_value %.55fb1a.2 +// CHECK:STDOUT: %X.as.ImplicitAs.impl.Convert.call.a49: init %Y to %tuple.elem1.0e1 = call %bound_method.1fb3b5.2(%.eeedf6.2) +// CHECK:STDOUT: %.b3a: init %Y = converted @F.%Make.call.loc9_55, %X.as.ImplicitAs.impl.Convert.call.a49 +// CHECK:STDOUT: %.0f6: init %tuple.type.2f4 to %.fe34fc.2 = tuple_init (%.b92, %.b3a) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.temporary_storage.426619.1: = inst_value [concrete] { +// CHECK:STDOUT: %.7a56fd.1: ref %X = temporary_storage +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.temporary_storage.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %.7a56fd.2: ref %X = temporary_storage +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.temporary_storage.426619.3: = inst_value [concrete] { +// CHECK:STDOUT: %.7a56fd.3: ref %X = temporary_storage +// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple.1ed7a0.2: %tuple.type.f39 = tuple_value (%inst.splice_block.426619.4, %inst.temporary_storage.426619.1, %inst.temporary_storage.426619.2, %inst.temporary_storage.426619.3) [concrete] +// CHECK:STDOUT: %self.param_patt.1fb: %pattern_type.7ab = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.eee: %pattern_type.7ab = wrapper_binding_pattern self, %self.param_patt.1fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc9_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.83c: type = pattern_type %struct_type.a.b.095 [concrete] +// CHECK:STDOUT: %self.param_patt.201: %pattern_type.83c = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.2b2: %pattern_type.83c = wrapper_binding_pattern self, %self.param_patt.201 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc9_3.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.7ad: %pattern_type.2cd = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.be8: %pattern_type.2cd = wrapper_binding_pattern self, %self.param_patt.7ad [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc9_3.7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.7: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.7: = custom_witness (%Destroy.WithSelf.Op.403171.7, %Destroy.WithSelf.SubobjectDestroy.d01daf.7, %Destroy.WithSelf.SelfDestruct.db3fdb.7), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.585: %Destroy.type = facet_value %tuple.type.2f4, (%custom_witness.f8f19d.7) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.9d1: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.585) [concrete] +// CHECK:STDOUT: %.005: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.9d1, %Destroy.facet.585 [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.5: = inst_value [concrete] { +// CHECK:STDOUT: %.52d: = splice_block %bound_method.05a { +// CHECK:STDOUT: %.fe34fc.1: ref %tuple.type.2f4 = specific_inst @F.%w.var, @F(%tuple.type.2f4) +// CHECK:STDOUT: %impl.elem2.7f4: %.005 = impl_witness_access %custom_witness.f8f19d.7, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.7] +// CHECK:STDOUT: %bound_method.05a: = bound_method %.fe34fc.1, %impl.elem2.7f4 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.call.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.91b: init %empty_tuple.type = call %.52d(%.fe34fc.1) +// CHECK:STDOUT: } +// CHECK:STDOUT: %complete_type.561: = complete_type_witness %tuple.type.bb4 [concrete] +// CHECK:STDOUT: %pattern_type.8b0: type = pattern_type %tuple.type.bb4 [concrete] +// CHECK:STDOUT: %w.patt.d74: %pattern_type.8b0 = ref_binding_pattern w [concrete] +// CHECK:STDOUT: %w.var_patt.e1e: %pattern_type.8b0 = var_pattern %w.patt.d74 [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.6: = inst_value [concrete] { +// CHECK:STDOUT: %.20b: init %tuple.type.bb4 = splice_block %.725 { +// CHECK:STDOUT: %impl.elem0.94756c.1: %.fd6 = impl_witness_access %ImplicitAs.impl_witness, element0 [concrete = %X.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.a267a9.1: = bound_method @F.%Make.call.loc9_46, %impl.elem0.94756c.1 +// CHECK:STDOUT: %.25e: ref %Y = class_element_access %tuple.elem0.d0d, element1 +// CHECK:STDOUT: %.61c809.1: ref %X = temporary @F.%.loc9_3.2, @F.%Make.call.loc9_46 +// CHECK:STDOUT: %.f2a65d.1: %X = acquire_value %.61c809.1 +// CHECK:STDOUT: %X.as.ImplicitAs.impl.Convert.call.bb4: init %Y to %.25e = call %bound_method.a267a9.1(%.f2a65d.1) +// CHECK:STDOUT: %.684: init %Y = converted @F.%Make.call.loc9_46, %X.as.ImplicitAs.impl.Convert.call.bb4 +// CHECK:STDOUT: %.175: init %Z to %tuple.elem0.d0d = class_init (@F.%Make.call.loc9_33, %.684) +// CHECK:STDOUT: %.cca: init %Z = converted @F.%.loc9_47, %.175 +// CHECK:STDOUT: %impl.elem0.94756c.2: %.fd6 = impl_witness_access %ImplicitAs.impl_witness, element0 [concrete = %X.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.1fb3b5.1: = bound_method @F.%Make.call.loc9_55, %impl.elem0.94756c.2 +// CHECK:STDOUT: %tuple.elem1.c76: ref %Y = tuple_access %.6b01cf.2, element1 +// CHECK:STDOUT: %.55fb1a.1: ref %X = temporary @F.%.loc9_3.3, @F.%Make.call.loc9_55 +// CHECK:STDOUT: %.eeedf6.1: %X = acquire_value %.55fb1a.1 +// CHECK:STDOUT: %X.as.ImplicitAs.impl.Convert.call.19e: init %Y to %tuple.elem1.c76 = call %bound_method.1fb3b5.1(%.eeedf6.1) +// CHECK:STDOUT: %.b5d: init %Y = converted @F.%Make.call.loc9_55, %X.as.ImplicitAs.impl.Convert.call.19e +// CHECK:STDOUT: %.725: init %tuple.type.bb4 to %.6b01cf.2 = tuple_init (%.cca, %.b5d) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.splice_block.426619.7: = inst_value [concrete] { +// CHECK:STDOUT: %.1b8: ref %X = splice_block %.b76 { +// CHECK:STDOUT: %.6b01cf.2: ref %tuple.type.bb4 = specific_inst @F.%w.var, @F(%tuple.type.bb4) +// CHECK:STDOUT: %tuple.elem0.d0d: ref %Z = tuple_access %.6b01cf.2, element0 +// CHECK:STDOUT: %.b76: ref %X = class_element_access %tuple.elem0.d0d, element0 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.temporary_storage.426619.4: = inst_value [concrete] { +// CHECK:STDOUT: %.7a56fd.4: ref %X = temporary_storage +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.temporary_storage.426619.5: = inst_value [concrete] { +// CHECK:STDOUT: %.7a56fd.5: ref %X = temporary_storage +// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple.1ed7a0.3: %tuple.type.f39 = tuple_value (%inst.splice_block.426619.6, %inst.splice_block.426619.7, %inst.temporary_storage.426619.4, %inst.temporary_storage.426619.5) [concrete] +// CHECK:STDOUT: %pattern_type.483: type = pattern_type %struct_type.a.b.297 [concrete] +// CHECK:STDOUT: %self.param_patt.502: %pattern_type.483 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.93b: %pattern_type.483 = wrapper_binding_pattern self, %self.param_patt.502 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc9_3.8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.34e: type = pattern_type %Z [concrete] +// CHECK:STDOUT: %self.param_patt.37e: %pattern_type.34e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f3f: %pattern_type.34e = wrapper_binding_pattern self, %self.param_patt.37e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.loc9_3.9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.328: %pattern_type.8b0 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.289: %pattern_type.8b0 = wrapper_binding_pattern self, %self.param_patt.328 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.10: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.loc9_3.10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.10: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.10: = custom_witness (%Destroy.WithSelf.Op.403171.10, %Destroy.WithSelf.SubobjectDestroy.d01daf.10, %Destroy.WithSelf.SelfDestruct.db3fdb.10), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.128: %Destroy.type = facet_value %tuple.type.bb4, (%custom_witness.f8f19d.10) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.9b9: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.128) [concrete] +// CHECK:STDOUT: %.e5d: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.9b9, %Destroy.facet.128 [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.8: = inst_value [concrete] { +// CHECK:STDOUT: %.7bc: = splice_block %bound_method.782 { +// CHECK:STDOUT: %.6b01cf.1: ref %tuple.type.bb4 = specific_inst @F.%w.var, @F(%tuple.type.bb4) +// CHECK:STDOUT: %impl.elem2.1f7: %.e5d = impl_witness_access %custom_witness.f8f19d.10, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.10] +// CHECK:STDOUT: %bound_method.782: = bound_method %.6b01cf.1, %impl.elem2.1f7 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.call.426619.3: = inst_value [concrete] { +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.509: init %empty_tuple.type = call %.7bc(%.6b01cf.1) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a96 = ref_param_pattern [concrete = constants.%self.param_patt.52f] +// CHECK:STDOUT: %self.patt: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_struct_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_struct_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a96 = ref_param_pattern [concrete = constants.%self.param_patt.52f] +// CHECK:STDOUT: %self.patt: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_struct_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_struct_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4c3 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.4c3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ce] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.f38 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.f38 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4c3 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.4c3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ce] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.f38 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.f38 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9a0 = ref_param_pattern [concrete = constants.%self.param_patt.165] +// CHECK:STDOUT: %self.patt: %pattern_type.9a0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c78] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.4c2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.4c2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc9_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9a0 = ref_param_pattern [concrete = constants.%self.param_patt.165] +// CHECK:STDOUT: %self.patt: %pattern_type.9a0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c78] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.4c2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.4c2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7ab = ref_param_pattern [concrete = constants.%self.param_patt.1fb] +// CHECK:STDOUT: %self.patt: %pattern_type.7ab = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eee] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc9_3.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7ab = ref_param_pattern [concrete = constants.%self.param_patt.1fb] +// CHECK:STDOUT: %self.patt: %pattern_type.7ab = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eee] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.83c = ref_param_pattern [concrete = constants.%self.param_patt.201] +// CHECK:STDOUT: %self.patt: %pattern_type.83c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2b2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.095 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.095 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc9_3.6 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.83c = ref_param_pattern [concrete = constants.%self.param_patt.201] +// CHECK:STDOUT: %self.patt: %pattern_type.83c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2b2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.095 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.095 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.7 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2cd = ref_param_pattern [concrete = constants.%self.param_patt.7ad] +// CHECK:STDOUT: %self.patt: %pattern_type.2cd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.be8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.2f4 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.2f4 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc9_3.7 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2cd = ref_param_pattern [concrete = constants.%self.param_patt.7ad] +// CHECK:STDOUT: %self.patt: %pattern_type.2cd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.be8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.2f4 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.2f4 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.8 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.483 = ref_param_pattern [concrete = constants.%self.param_patt.502] +// CHECK:STDOUT: %self.patt: %pattern_type.483 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.93b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.297 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.297 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.8: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc9_3.8 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.483 = ref_param_pattern [concrete = constants.%self.param_patt.502] +// CHECK:STDOUT: %self.patt: %pattern_type.483 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.93b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.297 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.297 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.9 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.34e = ref_param_pattern [concrete = constants.%self.param_patt.37e] +// CHECK:STDOUT: %self.patt: %pattern_type.34e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f3f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Z = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Z = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.9: %Destroy.WithSelf.Op.type.ef016f.9 = fn_decl @Destroy.WithSelf.Op.loc9_3.9 [concrete = constants.%Destroy.WithSelf.Op.403171.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.34e = ref_param_pattern [concrete = constants.%self.param_patt.37e] +// CHECK:STDOUT: %self.patt: %pattern_type.34e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f3f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Z = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Z = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.10: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.10 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.10] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8b0 = ref_param_pattern [concrete = constants.%self.param_patt.328] +// CHECK:STDOUT: %self.patt: %pattern_type.8b0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.289] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.bb4 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.bb4 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.10: %Destroy.WithSelf.Op.type.ef016f.10 = fn_decl @Destroy.WithSelf.Op.loc9_3.10 [concrete = constants.%Destroy.WithSelf.Op.403171.10] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8b0 = ref_param_pattern [concrete = constants.%self.param_patt.328] +// CHECK:STDOUT: %self.patt: %pattern_type.8b0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.289] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.bb4 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.bb4 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { +// CHECK:STDOUT: %T.patt.loc8_16.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc8_16.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.loc8_18.1: type = splice_block %.loc8_18.2 [concrete = type] { +// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %.loc8_18.2: type = type_literal type [concrete = type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc8_16.2: type = symbolic_binding T, 0, template [template = %T.loc8_16.1 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(%T.loc8_16.2: type) { +// CHECK:STDOUT: %T.patt.loc8_16.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc8_16.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.loc8_16.1: type = symbolic_binding T, 0, template [template = %T.loc8_16.1 (constants.%T)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type %T.loc8_16.1 [template = %require_complete (constants.%require_complete.944)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc8_16.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)] +// CHECK:STDOUT: %w.patt.loc9_15.2: @F.%pattern_type (%pattern_type.51d1c4.1) = ref_binding_pattern w [template = %w.patt.loc9_15.2 (constants.%w.patt.f6d)] +// CHECK:STDOUT: %w.var_patt.loc9_3.2: @F.%pattern_type (%pattern_type.51d1c4.1) = var_pattern %w.patt.loc9_15.2 [template = %w.var_patt.loc9_3.2 (constants.%w.var_patt.7fe)] +// CHECK:STDOUT: %.loc9_3.9: %tuple.type.f39 = initialize_action %.loc9_56, %T.loc8_16.1, %w.var, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc9_3.9, element0 [template] +// CHECK:STDOUT: %tuple.elem1: = tuple_access %.loc9_3.9, element1 [template] +// CHECK:STDOUT: %.loc9_3.10: %X = splice_inst %tuple.elem1 [template = %.loc9_3.10 (constants.%.4e3)] +// CHECK:STDOUT: %tuple.elem2: = tuple_access %.loc9_3.9, element2 [template] +// CHECK:STDOUT: %.loc9_3.11: %X = splice_inst %tuple.elem2 [template = %.loc9_3.11 (constants.%.c57)] +// CHECK:STDOUT: %tuple.elem3: = tuple_access %.loc9_3.9, element3 [template] +// CHECK:STDOUT: %.loc9_3.12: %X = splice_inst %tuple.elem3 [template = %.loc9_3.12 (constants.%.ceb)] +// CHECK:STDOUT: %.loc9_3.13: @F.%T.loc8_16.1 (%T) = splice_inst %tuple.elem0 [template = %.loc9_3.13 (constants.%.b00)] +// CHECK:STDOUT: %.loc9_3.14: = compound_member_access_action %w.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc9_3.15: type = type_of_inst %.loc9_3.14 [template = %.loc9_3.15 (constants.%.8cb)] +// CHECK:STDOUT: %.loc9_3.16: @F.%.loc9_3.15 (%.8cb) = splice_inst %.loc9_3.14 [template = %.loc9_3.16 (constants.%.c23)] +// CHECK:STDOUT: %.loc9_3.17: = call_action (%.loc9_3.6), true [template] +// CHECK:STDOUT: %.loc9_3.18: type = type_of_inst %.loc9_3.17 [template = %.loc9_3.18 (constants.%.57c)] +// CHECK:STDOUT: %.loc9_3.19: @F.%.loc9_3.18 (%.57c) = splice_inst %.loc9_3.17 [template = %.loc9_3.19 (constants.%.e63)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %w.var: ref @F.%T.loc8_16.1 (%T) = var_storage %w.var_patt.loc9_3.1 +// CHECK:STDOUT: %Make.ref.loc9_28: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc9_3.1: %X = splice_inst %tuple.elem1 [template = %.loc9_3.10 (constants.%.4e3)] +// CHECK:STDOUT: %Make.call.loc9_33: init %X to %.loc9_3.1 = call %Make.ref.loc9_28() +// CHECK:STDOUT: %Make.ref.loc9_41: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc9_3.2: %X = splice_inst %tuple.elem2 [template = %.loc9_3.11 (constants.%.c57)] +// CHECK:STDOUT: %Make.call.loc9_46: init %X to %.loc9_3.2 = call %Make.ref.loc9_41() +// CHECK:STDOUT: %.loc9_47: %struct_type.a.b.f38 = struct_literal (%Make.call.loc9_33, %Make.call.loc9_46) +// CHECK:STDOUT: %Make.ref.loc9_50: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc9_3.3: %X = splice_inst %tuple.elem3 [template = %.loc9_3.12 (constants.%.ceb)] +// CHECK:STDOUT: %Make.call.loc9_55: init %X to %.loc9_3.3 = call %Make.ref.loc9_50() +// CHECK:STDOUT: %.loc9_56: %tuple.type.4c2 = tuple_literal (%.loc9_47, %Make.call.loc9_55) +// CHECK:STDOUT: %.loc9_3.4: @F.%T.loc8_16.1 (%T) = splice_inst %tuple.elem0 [template = %.loc9_3.13 (constants.%.b00)] +// CHECK:STDOUT: assign %w.var, %.loc9_3.4 +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_16.2 [template = %T.loc8_16.1 (constants.%T)] +// CHECK:STDOUT: %w: ref @F.%T.loc8_16.1 (%T) = wrapper_binding w, %w.var +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %w.patt.loc9_15.1: @F.%pattern_type (%pattern_type.51d1c4.1) = ref_binding_pattern w [template = %w.patt.loc9_15.2 (constants.%w.patt.f6d)] +// CHECK:STDOUT: %w.var_patt.loc9_3.1: @F.%pattern_type (%pattern_type.51d1c4.1) = var_pattern %w.patt.loc9_15.1 [template = %w.var_patt.loc9_3.2 (constants.%w.var_patt.7fe)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc9_3.5: type = type_of_inst %.loc9_3.14 [template = %.loc9_3.15 (constants.%.8cb)] +// CHECK:STDOUT: %.loc9_3.6: @F.%.loc9_3.15 (%.8cb) = splice_inst %.loc9_3.14 [template = %.loc9_3.16 (constants.%.c23)] +// CHECK:STDOUT: %.loc9_3.7: type = type_of_inst %.loc9_3.17 [template = %.loc9_3.18 (constants.%.57c)] +// CHECK:STDOUT: %.loc9_3.8: @F.%.loc9_3.18 (%.57c) = splice_inst %.loc9_3.17 [template = %.loc9_3.19 (constants.%.e63)] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %empty_struct_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %struct_type.a.b.f38) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %struct_type.a.b.f38) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %struct_type.a.b.f38) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.4(%self.param: ref %tuple.type.4c2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.4(%self.param: ref %tuple.type.4c2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.4(%self.param: ref %tuple.type.4c2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.5(%self.param: ref %Y) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.5(%self.param: ref %Y) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.5(%self.param: ref %Y) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.6(%self.param: ref %struct_type.a.b.095) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.6(%self.param: ref %struct_type.a.b.095) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.6(%self.param: ref %struct_type.a.b.095) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.7(%self.param: ref %tuple.type.2f4) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.7(%self.param: ref %tuple.type.2f4) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.7(%self.param: ref %tuple.type.2f4) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.8(%self.param: ref %struct_type.a.b.297) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.8(%self.param: ref %struct_type.a.b.297) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.8(%self.param: ref %struct_type.a.b.297) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.8(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.8(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.9(%self.param: ref %Z) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.9(%self.param: ref %Z) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.9(%self.param: ref %Z) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.9(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.9(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.10(%self.param: ref %tuple.type.bb4) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.10(%self.param: ref %tuple.type.bb4) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.10(%self.param: ref %tuple.type.bb4) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.10(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.10(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%T) { +// CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc8_16.1 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%tuple.type.4c2) { +// CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc8_16.1 => constants.%tuple.type.4c2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.9dc +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.9a0 +// CHECK:STDOUT: %w.patt.loc9_15.2 => constants.%w.patt.a80 +// CHECK:STDOUT: %w.var_patt.loc9_3.2 => constants.%w.var_patt.607 +// CHECK:STDOUT: %.loc9_3.9 => constants.%tuple.1ed7a0.1 +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block.426619.1 +// CHECK:STDOUT: %tuple.elem1 => constants.%inst.splice_block.426619.2 +// CHECK:STDOUT: %.loc9_3.10 => invalid +// CHECK:STDOUT: %tuple.elem2 => constants.%inst.struct_access +// CHECK:STDOUT: %.loc9_3.11 => invalid +// CHECK:STDOUT: %tuple.elem3 => constants.%inst.tuple_access +// CHECK:STDOUT: %.loc9_3.12 => invalid +// CHECK:STDOUT: %.loc9_3.13 => invalid +// CHECK:STDOUT: %.loc9_3.14 => constants.%inst.splice_block.426619.3 +// CHECK:STDOUT: %.loc9_3.15 => +// CHECK:STDOUT: %.loc9_3.16 => invalid +// CHECK:STDOUT: %.loc9_3.17 => constants.%inst.call.426619.1 +// CHECK:STDOUT: %.loc9_3.18 => constants.%empty_tuple.type +// CHECK:STDOUT: %.loc9_3.19 => invalid +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%tuple.type.2f4) { +// CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc8_16.1 => constants.%tuple.type.2f4 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.8ea +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.2cd +// CHECK:STDOUT: %w.patt.loc9_15.2 => constants.%w.patt.e8c +// CHECK:STDOUT: %w.var_patt.loc9_3.2 => constants.%w.var_patt.61a +// CHECK:STDOUT: %.loc9_3.9 => constants.%tuple.1ed7a0.2 +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block.426619.4 +// CHECK:STDOUT: %tuple.elem1 => constants.%inst.temporary_storage.426619.1 +// CHECK:STDOUT: %.loc9_3.10 => invalid +// CHECK:STDOUT: %tuple.elem2 => constants.%inst.temporary_storage.426619.2 +// CHECK:STDOUT: %.loc9_3.11 => invalid +// CHECK:STDOUT: %tuple.elem3 => constants.%inst.temporary_storage.426619.3 +// CHECK:STDOUT: %.loc9_3.12 => invalid +// CHECK:STDOUT: %.loc9_3.13 => invalid +// CHECK:STDOUT: %.loc9_3.14 => constants.%inst.splice_block.426619.5 +// CHECK:STDOUT: %.loc9_3.15 => +// CHECK:STDOUT: %.loc9_3.16 => invalid +// CHECK:STDOUT: %.loc9_3.17 => constants.%inst.call.426619.2 +// CHECK:STDOUT: %.loc9_3.18 => constants.%empty_tuple.type +// CHECK:STDOUT: %.loc9_3.19 => invalid +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%tuple.type.bb4) { +// CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T.patt +// CHECK:STDOUT: %T.loc8_16.1 => constants.%tuple.type.bb4 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.561 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.8b0 +// CHECK:STDOUT: %w.patt.loc9_15.2 => constants.%w.patt.d74 +// CHECK:STDOUT: %w.var_patt.loc9_3.2 => constants.%w.var_patt.e1e +// CHECK:STDOUT: %.loc9_3.9 => constants.%tuple.1ed7a0.3 +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block.426619.6 +// CHECK:STDOUT: %tuple.elem1 => constants.%inst.splice_block.426619.7 +// CHECK:STDOUT: %.loc9_3.10 => invalid +// CHECK:STDOUT: %tuple.elem2 => constants.%inst.temporary_storage.426619.4 +// CHECK:STDOUT: %.loc9_3.11 => invalid +// CHECK:STDOUT: %tuple.elem3 => constants.%inst.temporary_storage.426619.5 +// CHECK:STDOUT: %.loc9_3.12 => invalid +// CHECK:STDOUT: %.loc9_3.13 => invalid +// CHECK:STDOUT: %.loc9_3.14 => constants.%inst.splice_block.426619.8 +// CHECK:STDOUT: %.loc9_3.15 => +// CHECK:STDOUT: %.loc9_3.16 => invalid +// CHECK:STDOUT: %.loc9_3.17 => constants.%inst.call.426619.3 +// CHECK:STDOUT: %.loc9_3.18 => constants.%empty_tuple.type +// CHECK:STDOUT: %.loc9_3.19 => invalid +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- as.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -339,8 +2060,8 @@ fn Test(d: D) { // CHECK:STDOUT: %require_complete.944: = require_complete_type %T.67db0b.1 [template] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] -// CHECK:STDOUT: %.b5a: %i32 = splice_inst @AsI32.%.loc6_12.2 [template] -// CHECK:STDOUT: %.749: %i32 = splice_inst @AsI32.%.loc6_18.2 [template] +// CHECK:STDOUT: %.865: %i32 = splice_inst @AsI32.%.loc6_12.2 [template] +// CHECK:STDOUT: %.c28: %i32 = splice_inst @AsI32.%.loc6_18.2 [template] // CHECK:STDOUT: %x.param_patt.cee: %pattern_type.6b6 = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt.e3b: %pattern_type.6b6 = wrapper_binding_pattern x, %x.param_patt.cee [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] @@ -368,7 +2089,7 @@ fn Test(d: D) { // CHECK:STDOUT: %inst.specific_inst: = inst_value [concrete] { // CHECK:STDOUT: %.2f4: %i32 = specific_inst @AsI32.%x.ref, @AsI32(%i32) // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.675: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.7c4: init %i32 = splice_block %Int.as.Copy.impl.Op.call.556 { // CHECK:STDOUT: %impl.elem0.88228e.2: %.737 = impl_witness_access %Copy.impl_witness.b51, element0 [concrete = %Int.as.Copy.impl.Op.4f6] // CHECK:STDOUT: %bound_method.4e3: = bound_method %.2f4, %impl.elem0.88228e.2 @@ -378,7 +2099,7 @@ fn Test(d: D) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %.419: type = fn_type_with_self_type %As.WithSelf.Convert.type.087, %As.facet [concrete] -// CHECK:STDOUT: %inst.splice_block.995: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { // CHECK:STDOUT: %.c1e: %i32 = splice_block %.094 { // CHECK:STDOUT: %.71c: %C = specific_inst @AsI32.%x.ref, @AsI32(%C) // CHECK:STDOUT: %impl.elem0.47b: %.419 = impl_witness_access %As.impl_witness.80e, element0 [concrete = %C.as.As.impl.Convert] @@ -387,7 +2108,7 @@ fn Test(d: D) { // CHECK:STDOUT: %.094: %i32 = value_of_initializer %C.as.As.impl.Convert.call // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.bb7: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { // CHECK:STDOUT: %.a89: init %i32 = splice_block %Int.as.Copy.impl.Op.call.9fd { // CHECK:STDOUT: %impl.elem0.88228e.1: %.737 = impl_witness_access %Copy.impl_witness.b51, element0 [concrete = %Int.as.Copy.impl.Op.4f6] // CHECK:STDOUT: %bound_method.294: = bound_method %.c1e, %impl.elem0.88228e.1 @@ -436,16 +2157,16 @@ fn Test(d: D) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.loc5_20.1 [template = %require_complete (constants.%require_complete.944)] // CHECK:STDOUT: %.loc6_12.2: = convert_action %x.ref, constants.%i32, element7 [template] -// CHECK:STDOUT: %.loc6_12.3: %i32 = splice_inst %.loc6_12.2 [template = %.loc6_12.3 (constants.%.b5a)] +// CHECK:STDOUT: %.loc6_12.3: %i32 = splice_inst %.loc6_12.2 [template = %.loc6_12.3 (constants.%.865)] // CHECK:STDOUT: %.loc6_18.2: = convert_to_category_action %.loc6_12.1, element10 [template] -// CHECK:STDOUT: %.loc6_18.3: %i32 = splice_inst %.loc6_18.2 [template = %.loc6_18.3 (constants.%.749)] +// CHECK:STDOUT: %.loc6_18.3: %i32 = splice_inst %.loc6_18.2 [template = %.loc6_18.3 (constants.%.c28)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @AsI32.%T.loc5_20.1 (%T.67db0b.1)) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @AsI32.%T.loc5_20.1 (%T.67db0b.1) = name_ref x, %x // CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc6_12.1: %i32 = splice_inst %.loc6_12.2 [template = %.loc6_12.3 (constants.%.b5a)] -// CHECK:STDOUT: %.loc6_18.1: %i32 = splice_inst %.loc6_18.2 [template = %.loc6_18.3 (constants.%.749)] +// CHECK:STDOUT: %.loc6_12.1: %i32 = splice_inst %.loc6_12.2 [template = %.loc6_12.3 (constants.%.865)] +// CHECK:STDOUT: %.loc6_18.1: %i32 = splice_inst %.loc6_18.2 [template = %.loc6_18.3 (constants.%.c28)] // CHECK:STDOUT: return %.loc6_18.1 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -469,7 +2190,7 @@ fn Test(d: D) { // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a // CHECK:STDOUT: %.loc6_12.2 => constants.%inst.specific_inst // CHECK:STDOUT: %.loc6_12.3 => invalid -// CHECK:STDOUT: %.loc6_18.2 => constants.%inst.splice_block.675 +// CHECK:STDOUT: %.loc6_18.2 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc6_18.3 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: @@ -482,9 +2203,9 @@ fn Test(d: D) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.cdf -// CHECK:STDOUT: %.loc6_12.2 => constants.%inst.splice_block.995 +// CHECK:STDOUT: %.loc6_12.2 => constants.%inst.splice_block.426619.2 // CHECK:STDOUT: %.loc6_12.3 => invalid -// CHECK:STDOUT: %.loc6_18.2 => constants.%inst.splice_block.bb7 +// CHECK:STDOUT: %.loc6_18.2 => constants.%inst.splice_block.426619.3 // CHECK:STDOUT: %.loc6_18.3 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: @@ -507,8 +2228,8 @@ fn Test(d: D) { // CHECK:STDOUT: %require_complete.441: = require_complete_type %U.091 [template] // CHECK:STDOUT: %pattern_type.946: type = pattern_type %U.091 [template] // CHECK:STDOUT: %_.patt.972: %pattern_type.946 = value_binding_pattern _ [template] -// CHECK:STDOUT: %.c3c: %U.091 = splice_inst @AsType.%.loc6_16.3 [template] -// CHECK:STDOUT: %.726: %U.091 = splice_inst @AsType.%.loc6_16.5 [template] +// CHECK:STDOUT: %.70e: %U.091 = splice_inst @AsType.%.loc6_16.3 [template] +// CHECK:STDOUT: %.33e: %U.091 = splice_inst @AsType.%.loc6_16.5 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] @@ -532,11 +2253,11 @@ fn Test(d: D) { // CHECK:STDOUT: %inst.specific_inst: = inst_value [concrete] { // CHECK:STDOUT: %.5a5: %i32 = specific_inst @AsType.%x.ref, @AsType(%i32, %i32) // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.6e4: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.f67: %i32 = splice_block %.5a5 {} // CHECK:STDOUT: } // CHECK:STDOUT: %.419: type = fn_type_with_self_type %As.WithSelf.Convert.type.087, %As.facet [concrete] -// CHECK:STDOUT: %inst.splice_block.4b1: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { // CHECK:STDOUT: %.c88: %i32 = splice_block %.160 { // CHECK:STDOUT: %.c99: %C = specific_inst @AsType.%x.ref, @AsType(%C, %i32) // CHECK:STDOUT: %impl.elem0.47b: %.419 = impl_witness_access %As.impl_witness.80e, element0 [concrete = %C.as.As.impl.Convert] @@ -545,7 +2266,7 @@ fn Test(d: D) { // CHECK:STDOUT: %.160: %i32 = value_of_initializer %C.as.As.impl.Convert.call // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.a95: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { // CHECK:STDOUT: %.7f3: %i32 = splice_block %.c88 {} // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -588,16 +2309,16 @@ fn Test(d: D) { // CHECK:STDOUT: %pattern_type.loc6: type = pattern_type %U.loc5_45.1 [template = %pattern_type.loc6 (constants.%pattern_type.946)] // CHECK:STDOUT: %_.patt.loc6_8.2: @AsType.%pattern_type.loc6 (%pattern_type.946) = value_binding_pattern _ [template = %_.patt.loc6_8.2 (constants.%_.patt.972)] // CHECK:STDOUT: %.loc6_16.3: = convert_action %x.ref, %U.loc5_45.1, element7 [template] -// CHECK:STDOUT: %.loc6_16.4: @AsType.%U.loc5_45.1 (%U.091) = splice_inst %.loc6_16.3 [template = %.loc6_16.4 (constants.%.c3c)] +// CHECK:STDOUT: %.loc6_16.4: @AsType.%U.loc5_45.1 (%U.091) = splice_inst %.loc6_16.3 [template = %.loc6_16.4 (constants.%.70e)] // CHECK:STDOUT: %.loc6_16.5: = convert_to_category_action %.loc6_16.1, element1 [template] -// CHECK:STDOUT: %.loc6_16.6: @AsType.%U.loc5_45.1 (%U.091) = splice_inst %.loc6_16.5 [template = %.loc6_16.6 (constants.%.726)] +// CHECK:STDOUT: %.loc6_16.6: @AsType.%U.loc5_45.1 (%U.091) = splice_inst %.loc6_16.5 [template = %.loc6_16.6 (constants.%.33e)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @AsType.%T.loc5_21.1 (%T.67db0b.1)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @AsType.%T.loc5_21.1 (%T.67db0b.1) = name_ref x, %x // CHECK:STDOUT: %U.ref.loc6_19: type = name_ref U, %U.loc5_45.2 [template = %U.loc5_45.1 (constants.%U.091)] -// CHECK:STDOUT: %.loc6_16.1: @AsType.%U.loc5_45.1 (%U.091) = splice_inst %.loc6_16.3 [template = %.loc6_16.4 (constants.%.c3c)] -// CHECK:STDOUT: %.loc6_16.2: @AsType.%U.loc5_45.1 (%U.091) = splice_inst %.loc6_16.5 [template = %.loc6_16.6 (constants.%.726)] +// CHECK:STDOUT: %.loc6_16.1: @AsType.%U.loc5_45.1 (%U.091) = splice_inst %.loc6_16.3 [template = %.loc6_16.4 (constants.%.70e)] +// CHECK:STDOUT: %.loc6_16.2: @AsType.%U.loc5_45.1 (%U.091) = splice_inst %.loc6_16.5 [template = %.loc6_16.6 (constants.%.33e)] // CHECK:STDOUT: %U.ref.loc6_10: type = name_ref U, %U.loc5_45.2 [template = %U.loc5_45.1 (constants.%U.091)] // CHECK:STDOUT: %_: @AsType.%U.loc5_45.1 (%U.091) = wrapper_binding _, %.loc6_16.2 // CHECK:STDOUT: name_binding_decl { @@ -633,7 +2354,7 @@ fn Test(d: D) { // CHECK:STDOUT: %_.patt.loc6_8.2 => constants.%_.patt.bed // CHECK:STDOUT: %.loc6_16.3 => constants.%inst.specific_inst // CHECK:STDOUT: %.loc6_16.4 => invalid -// CHECK:STDOUT: %.loc6_16.5 => constants.%inst.splice_block.6e4 +// CHECK:STDOUT: %.loc6_16.5 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc6_16.6 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: @@ -651,9 +2372,9 @@ fn Test(d: D) { // CHECK:STDOUT: %require_complete.loc6 => constants.%complete_type.f8a // CHECK:STDOUT: %pattern_type.loc6 => constants.%pattern_type.6b6 // CHECK:STDOUT: %_.patt.loc6_8.2 => constants.%_.patt.bed -// CHECK:STDOUT: %.loc6_16.3 => constants.%inst.splice_block.4b1 +// CHECK:STDOUT: %.loc6_16.3 => constants.%inst.splice_block.426619.2 // CHECK:STDOUT: %.loc6_16.4 => invalid -// CHECK:STDOUT: %.loc6_16.5 => constants.%inst.splice_block.a95 +// CHECK:STDOUT: %.loc6_16.5 => constants.%inst.splice_block.426619.3 // CHECK:STDOUT: %.loc6_16.6 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/template/dependence.carbon b/toolchain/check/testdata/generic/template/dependence.carbon index d280849f52f9..eaa721cb30c4 100644 --- a/toolchain/check/testdata/generic/template/dependence.carbon +++ b/toolchain/check/testdata/generic/template/dependence.carbon @@ -63,11 +63,11 @@ fn F(template T: type, generic U: type) -> (T, U) { // CHECK:STDOUT: %Copy.WithSelf.Op.b85212.1: %Copy.WithSelf.Op.type.c85f21.1 = struct_value () [symbolic] // CHECK:STDOUT: %Copy.assoc_type: type = assoc_entity_type @Copy [concrete] // CHECK:STDOUT: %assoc0: %Copy.assoc_type = assoc_entity element0, imports.%Core.import_ref.b5f [concrete] -// CHECK:STDOUT: %.e37: type = type_of_inst @F.%.loc6_10.7 [template] -// CHECK:STDOUT: %.a2d: %.e37 = splice_inst @F.%.loc6_10.7 [template] -// CHECK:STDOUT: %.3bb: type = type_of_inst @F.%.loc6_10.10 [template] -// CHECK:STDOUT: %.fab: %.3bb = splice_inst @F.%.loc6_10.10 [template] -// CHECK:STDOUT: %.daa: %.3bb = splice_inst @F.%.loc6_12.2 [template] +// CHECK:STDOUT: %.8cb: type = type_of_inst @F.%.loc6_10.7 [template] +// CHECK:STDOUT: %.c23: %.8cb = splice_inst @F.%.loc6_10.7 [template] +// CHECK:STDOUT: %.57c: type = type_of_inst @F.%.loc6_10.10 [template] +// CHECK:STDOUT: %.e63: %.57c = splice_inst @F.%.loc6_10.10 [template] +// CHECK:STDOUT: %.254: %.57c = splice_inst @F.%.loc6_12.2 [template] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete] // CHECK:STDOUT: %ptr.74f: type = ptr_type %ptr.843 [concrete] @@ -92,7 +92,7 @@ fn F(template T: type, generic U: type) -> (T, U) { // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.843, (%Copy.impl_witness.5e7) [concrete] // CHECK:STDOUT: %Copy.WithSelf.Op.type.9ea: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] // CHECK:STDOUT: %.b77: type = fn_type_with_self_type %Copy.WithSelf.Op.type.9ea, %Copy.facet [concrete] -// CHECK:STDOUT: %inst.splice_block.b7d: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.97c: = splice_block %bound_method.d03 { // CHECK:STDOUT: %.091: %ptr.843 = specific_inst @F.%.loc6_10.2, @F(%empty_tuple.type) // CHECK:STDOUT: %impl.elem0.227: %.b77 = impl_witness_access %Copy.impl_witness.5e7, element0 [concrete = %ptr.as.Copy.impl.Op.ee1] @@ -100,14 +100,14 @@ fn F(template T: type, generic U: type) -> (T, U) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.ee1, @ptr.as.Copy.impl.Op(%empty_tuple.type) [concrete] -// CHECK:STDOUT: %inst.splice_block.61d: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { // CHECK:STDOUT: %.d08: init %ptr.843 = splice_block %ptr.as.Copy.impl.Op.call { // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.227, @ptr.as.Copy.impl.Op(%empty_tuple.type) [concrete = %ptr.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.733: = bound_method %.091, %specific_fn // CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.843 = call %bound_method.733(%.091) // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.97e: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { // CHECK:STDOUT: %.db1: init %ptr.843 = splice_block %.d08 {} // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -184,24 +184,24 @@ fn F(template T: type, generic U: type) -> (T, U) { // CHECK:STDOUT: %require_complete.loc5_25: = require_complete_type %ptr.loc5_29.1 [template = %require_complete.loc5_25 (constants.%require_complete.fbe)] // CHECK:STDOUT: %require_complete.loc5_32: = require_complete_type %ptr.loc5_28.1 [template = %require_complete.loc5_32 (constants.%require_complete.ef162c.1)] // CHECK:STDOUT: %.loc6_10.7: = compound_member_access_action %.loc6_10.2, constants.%assoc0 [template] -// CHECK:STDOUT: %.loc6_10.8: type = type_of_inst %.loc6_10.7 [template = %.loc6_10.8 (constants.%.e37)] -// CHECK:STDOUT: %.loc6_10.9: @F.%.loc6_10.8 (%.e37) = splice_inst %.loc6_10.7 [template = %.loc6_10.9 (constants.%.a2d)] +// CHECK:STDOUT: %.loc6_10.8: type = type_of_inst %.loc6_10.7 [template = %.loc6_10.8 (constants.%.8cb)] +// CHECK:STDOUT: %.loc6_10.9: @F.%.loc6_10.8 (%.8cb) = splice_inst %.loc6_10.7 [template = %.loc6_10.9 (constants.%.c23)] // CHECK:STDOUT: %.loc6_10.10: = call_action (%.loc6_10.4), true [template] -// CHECK:STDOUT: %.loc6_10.11: type = type_of_inst %.loc6_10.10 [template = %.loc6_10.11 (constants.%.3bb)] -// CHECK:STDOUT: %.loc6_10.12: @F.%.loc6_10.11 (%.3bb) = splice_inst %.loc6_10.10 [template = %.loc6_10.12 (constants.%.fab)] +// CHECK:STDOUT: %.loc6_10.11: type = type_of_inst %.loc6_10.10 [template = %.loc6_10.11 (constants.%.57c)] +// CHECK:STDOUT: %.loc6_10.12: @F.%.loc6_10.11 (%.57c) = splice_inst %.loc6_10.10 [template = %.loc6_10.12 (constants.%.e63)] // CHECK:STDOUT: %.loc6_12.2: = convert_to_category_action %.loc6_10.6, element10 [template] -// CHECK:STDOUT: %.loc6_12.3: @F.%.loc6_10.11 (%.3bb) = splice_inst %.loc6_12.2 [template = %.loc6_12.3 (constants.%.daa)] +// CHECK:STDOUT: %.loc6_12.3: @F.%.loc6_10.11 (%.57c) = splice_inst %.loc6_12.2 [template = %.loc6_12.3 (constants.%.254)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%ptr.loc5_29.1 (%ptr.125)) -> out %return.param: @F.%ptr.loc5_28.1 (%ptr.e8f8f9.1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @F.%ptr.loc5_29.1 (%ptr.125) = name_ref x, %x // CHECK:STDOUT: %.loc6_10.1: ref @F.%ptr.loc5_28.1 (%ptr.e8f8f9.1) = deref %x.ref // CHECK:STDOUT: %.loc6_10.2: @F.%ptr.loc5_28.1 (%ptr.e8f8f9.1) = acquire_value %.loc6_10.1 -// CHECK:STDOUT: %.loc6_10.3: type = type_of_inst %.loc6_10.7 [template = %.loc6_10.8 (constants.%.e37)] -// CHECK:STDOUT: %.loc6_10.4: @F.%.loc6_10.8 (%.e37) = splice_inst %.loc6_10.7 [template = %.loc6_10.9 (constants.%.a2d)] -// CHECK:STDOUT: %.loc6_10.5: type = type_of_inst %.loc6_10.10 [template = %.loc6_10.11 (constants.%.3bb)] -// CHECK:STDOUT: %.loc6_10.6: @F.%.loc6_10.11 (%.3bb) = splice_inst %.loc6_10.10 [template = %.loc6_10.12 (constants.%.fab)] -// CHECK:STDOUT: %.loc6_12.1: @F.%.loc6_10.11 (%.3bb) = splice_inst %.loc6_12.2 [template = %.loc6_12.3 (constants.%.daa)] +// CHECK:STDOUT: %.loc6_10.3: type = type_of_inst %.loc6_10.7 [template = %.loc6_10.8 (constants.%.8cb)] +// CHECK:STDOUT: %.loc6_10.4: @F.%.loc6_10.8 (%.8cb) = splice_inst %.loc6_10.7 [template = %.loc6_10.9 (constants.%.c23)] +// CHECK:STDOUT: %.loc6_10.5: type = type_of_inst %.loc6_10.10 [template = %.loc6_10.11 (constants.%.57c)] +// CHECK:STDOUT: %.loc6_10.6: @F.%.loc6_10.11 (%.57c) = splice_inst %.loc6_10.10 [template = %.loc6_10.12 (constants.%.e63)] +// CHECK:STDOUT: %.loc6_12.1: @F.%.loc6_10.11 (%.57c) = splice_inst %.loc6_12.2 [template = %.loc6_12.3 (constants.%.254)] // CHECK:STDOUT: return %.loc6_12.1 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -245,13 +245,13 @@ fn F(template T: type, generic U: type) -> (T, U) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc5_25 => constants.%complete_type.2f1 // CHECK:STDOUT: %require_complete.loc5_32 => constants.%complete_type.2ab -// CHECK:STDOUT: %.loc6_10.7 => constants.%inst.splice_block.b7d +// CHECK:STDOUT: %.loc6_10.7 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc6_10.8 => // CHECK:STDOUT: %.loc6_10.9 => invalid -// CHECK:STDOUT: %.loc6_10.10 => constants.%inst.splice_block.61d +// CHECK:STDOUT: %.loc6_10.10 => constants.%inst.splice_block.426619.2 // CHECK:STDOUT: %.loc6_10.11 => constants.%ptr.843 // CHECK:STDOUT: %.loc6_10.12 => invalid -// CHECK:STDOUT: %.loc6_12.2 => constants.%inst.splice_block.97e +// CHECK:STDOUT: %.loc6_12.2 => constants.%inst.splice_block.426619.3 // CHECK:STDOUT: %.loc6_12.3 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: @@ -270,32 +270,23 @@ fn F(template T: type, generic U: type) -> (T, U) { // CHECK:STDOUT: %tuple.type.a5e: type = tuple_type (%T, %U) [template] // CHECK:STDOUT: %.f18: Core.Form = init_form %tuple.type.a5e [template] // CHECK:STDOUT: %pattern_type.eee: type = pattern_type %tuple.type.a5e [template] -// CHECK:STDOUT: %return.param_patt.a41: %pattern_type.eee = out_param_pattern [template] -// CHECK:STDOUT: %return.patt.453: %pattern_type.eee = return_slot_pattern %return.param_patt.a41, %tuple.type.a5e [template] +// CHECK:STDOUT: %return.param_patt: %pattern_type.eee = out_param_pattern [template] +// CHECK:STDOUT: %return.patt: %pattern_type.eee = return_slot_pattern %return.param_patt, %tuple.type.a5e [template] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete: = require_complete_type %tuple.type.a5e [template] // CHECK:STDOUT: %.869: type = type_of_inst @F.%.loc6_16.3 [template] // CHECK:STDOUT: %.dca: %.869 = splice_inst @F.%.loc6_16.3 [template] -// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] -// CHECK:STDOUT: %.180: type = type_of_inst @F.%.loc6_17.11 [template] -// CHECK:STDOUT: %.6c2: %.180 = splice_inst @F.%.loc6_17.11 [template] -// CHECK:STDOUT: %.17f: type = type_of_inst @F.%.loc6_17.14 [template] -// CHECK:STDOUT: %.201: %.17f = splice_inst @F.%.loc6_17.14 [template] -// CHECK:STDOUT: %.888: type = type_of_inst @F.%.loc6_17.17 [template] -// CHECK:STDOUT: %.7f3: %.888 = splice_inst @F.%.loc6_17.17 [template] -// CHECK:STDOUT: %.adb: type = type_of_inst @F.%.loc6_17.20 [template] -// CHECK:STDOUT: %.e78: %.adb = splice_inst @F.%.loc6_17.20 [template] -// CHECK:STDOUT: %.a19: %tuple.type.a5e = splice_inst @F.%.loc6_17.23 [template] +// CHECK:STDOUT: %tuple.type.f7a: type = tuple_type () [concrete] +// CHECK:STDOUT: %.805: %tuple.type.a5e = splice_inst @F.%tuple.elem0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt.loc5_16.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt)] // CHECK:STDOUT: %U.patt.loc5_33.1: %pattern_type.9a5 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc5_33.2 (constants.%U.patt)] -// CHECK:STDOUT: %return.param_patt.loc5_49.1: @F.%pattern_type (%pattern_type.eee) = out_param_pattern [template = %return.param_patt.loc5_49.2 (constants.%return.param_patt.a41)] -// CHECK:STDOUT: %return.patt.loc5_41.1: @F.%pattern_type (%pattern_type.eee) = return_slot_pattern %return.param_patt.loc5_49.1, %.loc5_49.3 [template = %return.patt.loc5_41.2 (constants.%return.patt.453)] +// CHECK:STDOUT: %return.param_patt.loc5_49.1: @F.%pattern_type (%pattern_type.eee) = out_param_pattern [template = %return.param_patt.loc5_49.2 (constants.%return.param_patt)] +// CHECK:STDOUT: %return.patt.loc5_41.1: @F.%pattern_type (%pattern_type.eee) = return_slot_pattern %return.param_patt.loc5_49.1, %.loc5_49.3 [template = %return.patt.loc5_41.2 (constants.%return.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref.loc5: type = name_ref T, %T.loc5_16.2 [template = %T.loc5_16.1 (constants.%T)] // CHECK:STDOUT: %U.ref.loc5: type = name_ref U, %U.loc5_33.2 [symbolic = %U.loc5_33.1 (constants.%U)] @@ -326,28 +317,17 @@ fn F(template T: type, generic U: type) -> (T, U) { // CHECK:STDOUT: %tuple.type: type = tuple_type (%T.loc5_16.1, %U.loc5_33.1) [template = %tuple.type (constants.%tuple.type.a5e)] // CHECK:STDOUT: %.loc5_49.1: Core.Form = init_form %tuple.type [template = %.loc5_49.1 (constants.%.f18)] // CHECK:STDOUT: %pattern_type: type = pattern_type %tuple.type [template = %pattern_type (constants.%pattern_type.eee)] -// CHECK:STDOUT: %return.param_patt.loc5_49.2: @F.%pattern_type (%pattern_type.eee) = out_param_pattern [template = %return.param_patt.loc5_49.2 (constants.%return.param_patt.a41)] -// CHECK:STDOUT: %return.patt.loc5_41.2: @F.%pattern_type (%pattern_type.eee) = return_slot_pattern %return.param_patt.loc5_49.2, %tuple.type [template = %return.patt.loc5_41.2 (constants.%return.patt.453)] +// CHECK:STDOUT: %return.param_patt.loc5_49.2: @F.%pattern_type (%pattern_type.eee) = out_param_pattern [template = %return.param_patt.loc5_49.2 (constants.%return.param_patt)] +// CHECK:STDOUT: %return.patt.loc5_41.2: @F.%pattern_type (%pattern_type.eee) = return_slot_pattern %return.param_patt.loc5_49.2, %tuple.type [template = %return.patt.loc5_41.2 (constants.%return.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %tuple.type [template = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %.loc6_16.3: = call_action (%F.ref, %T.ref.loc6, %U.ref.loc6), false [template] // CHECK:STDOUT: %.loc6_16.4: type = type_of_inst %.loc6_16.3 [template = %.loc6_16.4 (constants.%.869)] // CHECK:STDOUT: %.loc6_16.5: @F.%.loc6_16.4 (%.869) = splice_inst %.loc6_16.3 [template = %.loc6_16.5 (constants.%.dca)] -// CHECK:STDOUT: %.loc6_17.11: = call_action (constants.%ImplicitAs.generic, %tuple.type), false [template] -// CHECK:STDOUT: %.loc6_17.12: type = type_of_inst %.loc6_17.11 [template = %.loc6_17.12 (constants.%.180)] -// CHECK:STDOUT: %.loc6_17.13: @F.%.loc6_17.12 (%.180) = splice_inst %.loc6_17.11 [template = %.loc6_17.13 (constants.%.6c2)] -// CHECK:STDOUT: %.loc6_17.14: = access_member_action %.loc6_17.2, Convert [template] -// CHECK:STDOUT: %.loc6_17.15: type = type_of_inst %.loc6_17.14 [template = %.loc6_17.15 (constants.%.17f)] -// CHECK:STDOUT: %.loc6_17.16: @F.%.loc6_17.15 (%.17f) = splice_inst %.loc6_17.14 [template = %.loc6_17.16 (constants.%.201)] -// CHECK:STDOUT: %.loc6_17.17: = compound_member_access_action %.loc6_16.2, %.loc6_17.4 [template] -// CHECK:STDOUT: %.loc6_17.18: type = type_of_inst %.loc6_17.17 [template = %.loc6_17.18 (constants.%.888)] -// CHECK:STDOUT: %.loc6_17.19: @F.%.loc6_17.18 (%.888) = splice_inst %.loc6_17.17 [template = %.loc6_17.19 (constants.%.7f3)] -// CHECK:STDOUT: %.loc6_17.20: = call_action (%.loc6_17.6), true [template] -// CHECK:STDOUT: %.loc6_17.21: type = type_of_inst %.loc6_17.20 [template = %.loc6_17.21 (constants.%.adb)] -// CHECK:STDOUT: %.loc6_17.22: @F.%.loc6_17.21 (%.adb) = splice_inst %.loc6_17.20 [template = %.loc6_17.22 (constants.%.e78)] -// CHECK:STDOUT: %.loc6_17.23: = convert_to_category_action %.loc6_17.9, element10 [template] -// CHECK:STDOUT: %.loc6_17.24: @F.%tuple.type (%tuple.type.a5e) = splice_inst %.loc6_17.23 [template = %.loc6_17.24 (constants.%.a19)] +// CHECK:STDOUT: %.loc6_17.2: %tuple.type.f7a = initialize_action %.loc6_16.2, %tuple.type, %return.param, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc6_17.2, element0 [template] +// CHECK:STDOUT: %.loc6_17.3: @F.%tuple.type (%tuple.type.a5e) = splice_inst %tuple.elem0 [template = %.loc6_17.3 (constants.%.805)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> out %return.param: @F.%tuple.type (%tuple.type.a5e) { // CHECK:STDOUT: !entry: @@ -356,17 +336,8 @@ fn F(template T: type, generic U: type) -> (T, U) { // CHECK:STDOUT: %U.ref.loc6: type = name_ref U, %U.loc5_33.2 [symbolic = %U.loc5_33.1 (constants.%U)] // CHECK:STDOUT: %.loc6_16.1: type = type_of_inst %.loc6_16.3 [template = %.loc6_16.4 (constants.%.869)] // CHECK:STDOUT: %.loc6_16.2: @F.%.loc6_16.4 (%.869) = splice_inst %.loc6_16.3 [template = %.loc6_16.5 (constants.%.dca)] -// CHECK:STDOUT: %.loc6_17.1: type = type_of_inst %.loc6_17.11 [template = %.loc6_17.12 (constants.%.180)] -// CHECK:STDOUT: %.loc6_17.2: @F.%.loc6_17.12 (%.180) = splice_inst %.loc6_17.11 [template = %.loc6_17.13 (constants.%.6c2)] -// CHECK:STDOUT: %.loc6_17.3: type = type_of_inst %.loc6_17.14 [template = %.loc6_17.15 (constants.%.17f)] -// CHECK:STDOUT: %.loc6_17.4: @F.%.loc6_17.15 (%.17f) = splice_inst %.loc6_17.14 [template = %.loc6_17.16 (constants.%.201)] -// CHECK:STDOUT: %.loc6_17.5: type = type_of_inst %.loc6_17.17 [template = %.loc6_17.18 (constants.%.888)] -// CHECK:STDOUT: %.loc6_17.6: @F.%.loc6_17.18 (%.888) = splice_inst %.loc6_17.17 [template = %.loc6_17.19 (constants.%.7f3)] -// CHECK:STDOUT: %.loc6_17.7: type = type_of_inst %.loc6_17.20 [template = %.loc6_17.21 (constants.%.adb)] -// CHECK:STDOUT: %.loc6_17.8: @F.%.loc6_17.21 (%.adb) = splice_inst %.loc6_17.20 [template = %.loc6_17.22 (constants.%.e78)] -// CHECK:STDOUT: %.loc6_17.9: @F.%tuple.type (%tuple.type.a5e) = converted %.loc6_16.2, %.loc6_17.8 [template = %.loc6_17.22 (constants.%.e78)] -// CHECK:STDOUT: %.loc6_17.10: @F.%tuple.type (%tuple.type.a5e) = splice_inst %.loc6_17.23 [template = %.loc6_17.24 (constants.%.a19)] -// CHECK:STDOUT: return %.loc6_17.10 to %return.param +// CHECK:STDOUT: %.loc6_17.1: @F.%tuple.type (%tuple.type.a5e) = splice_inst %tuple.elem0 [template = %.loc6_17.3 (constants.%.805)] +// CHECK:STDOUT: return %.loc6_17.1 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -379,7 +350,7 @@ fn F(template T: type, generic U: type) -> (T, U) { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.a5e // CHECK:STDOUT: %.loc5_49.1 => constants.%.f18 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.eee -// CHECK:STDOUT: %return.param_patt.loc5_49.2 => constants.%return.param_patt.a41 -// CHECK:STDOUT: %return.patt.loc5_41.2 => constants.%return.patt.453 +// CHECK:STDOUT: %return.param_patt.loc5_49.2 => constants.%return.param_patt +// CHECK:STDOUT: %return.patt.loc5_41.2 => constants.%return.patt // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/template/member_access.carbon b/toolchain/check/testdata/generic/template/member_access.carbon index 04d24fd2a180..a7ad26c97163 100644 --- a/toolchain/check/testdata/generic/template/member_access.carbon +++ b/toolchain/check/testdata/generic/template/member_access.carbon @@ -150,9 +150,9 @@ fn G() { // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.944: = require_complete_type %T.67db0b.1 [template] // CHECK:STDOUT: %n.patt: %pattern_type.6b6 = value_binding_pattern n [concrete] -// CHECK:STDOUT: %.7f2: type = type_of_inst @F.%.loc6_17.4 [template] -// CHECK:STDOUT: %.c64: %.7f2 = splice_inst @F.%.loc6_17.4 [template] -// CHECK:STDOUT: %.bd6: %i32 = splice_inst @F.%.loc6_17.7 [template] +// CHECK:STDOUT: %.237: type = type_of_inst @F.%.loc6_17.4 [template] +// CHECK:STDOUT: %.f96: %.237 = splice_inst @F.%.loc6_17.4 [template] +// CHECK:STDOUT: %.6ec: %i32 = splice_inst @F.%.loc6_17.7 [template] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic] @@ -174,7 +174,7 @@ fn G() { // CHECK:STDOUT: %pattern_type.860: type = pattern_type %struct_type.m.n [concrete] // CHECK:STDOUT: %x.param_patt.c8a: %pattern_type.860 = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt.3a7: %pattern_type.860 = wrapper_binding_pattern x, %x.param_patt.c8a [concrete] -// CHECK:STDOUT: %inst.splice_block.7b2: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.f8b: %i32 = splice_block %.232 { // CHECK:STDOUT: %.bfd: %C = specific_inst @F.%x.ref, @F(%C) // CHECK:STDOUT: %n.ref: %C.elem = name_ref n, @C.%field_decl [concrete = @C.%field_decl] @@ -182,17 +182,17 @@ fn G() { // CHECK:STDOUT: %.232: %i32 = acquire_value %.d33 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.5a9: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { // CHECK:STDOUT: %.4a9: %i32 = splice_block %.f8b {} // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type.08f: = complete_type_witness %struct_type.m.n [concrete] -// CHECK:STDOUT: %inst.splice_block.eb8: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { // CHECK:STDOUT: %.b1c: %i32 = splice_block %.465 { // CHECK:STDOUT: %.d1d: %struct_type.m.n = specific_inst @F.%x.ref, @F(%struct_type.m.n) // CHECK:STDOUT: %.465: %i32 = struct_access %.d1d, element1 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.68a: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.4: = inst_value [concrete] { // CHECK:STDOUT: %.013: %i32 = splice_block %.b1c {} // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -235,17 +235,17 @@ fn G() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.loc5_16.1 [template = %require_complete (constants.%require_complete.944)] // CHECK:STDOUT: %.loc6_17.4: = access_member_action %x.ref, n [template] -// CHECK:STDOUT: %.loc6_17.5: type = type_of_inst %.loc6_17.4 [template = %.loc6_17.5 (constants.%.7f2)] -// CHECK:STDOUT: %.loc6_17.6: @F.%.loc6_17.5 (%.7f2) = splice_inst %.loc6_17.4 [template = %.loc6_17.6 (constants.%.c64)] +// CHECK:STDOUT: %.loc6_17.5: type = type_of_inst %.loc6_17.4 [template = %.loc6_17.5 (constants.%.237)] +// CHECK:STDOUT: %.loc6_17.6: @F.%.loc6_17.5 (%.237) = splice_inst %.loc6_17.4 [template = %.loc6_17.6 (constants.%.f96)] // CHECK:STDOUT: %.loc6_17.7: = convert_to_value_action %.loc6_17.2, constants.%i32 [template] -// CHECK:STDOUT: %.loc6_17.8: %i32 = splice_inst %.loc6_17.7 [template = %.loc6_17.8 (constants.%.bd6)] +// CHECK:STDOUT: %.loc6_17.8: %i32 = splice_inst %.loc6_17.7 [template = %.loc6_17.8 (constants.%.6ec)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%T.loc5_16.1 (%T.67db0b.1)) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @F.%T.loc5_16.1 (%T.67db0b.1) = name_ref x, %x -// CHECK:STDOUT: %.loc6_17.1: type = type_of_inst %.loc6_17.4 [template = %.loc6_17.5 (constants.%.7f2)] -// CHECK:STDOUT: %.loc6_17.2: @F.%.loc6_17.5 (%.7f2) = splice_inst %.loc6_17.4 [template = %.loc6_17.6 (constants.%.c64)] -// CHECK:STDOUT: %.loc6_17.3: %i32 = splice_inst %.loc6_17.7 [template = %.loc6_17.8 (constants.%.bd6)] +// CHECK:STDOUT: %.loc6_17.1: type = type_of_inst %.loc6_17.4 [template = %.loc6_17.5 (constants.%.237)] +// CHECK:STDOUT: %.loc6_17.2: @F.%.loc6_17.5 (%.237) = splice_inst %.loc6_17.4 [template = %.loc6_17.6 (constants.%.f96)] +// CHECK:STDOUT: %.loc6_17.3: %i32 = splice_inst %.loc6_17.7 [template = %.loc6_17.8 (constants.%.6ec)] // CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %n: %i32 = wrapper_binding n, %.loc6_17.3 // CHECK:STDOUT: name_binding_decl { @@ -278,10 +278,10 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.cdf -// CHECK:STDOUT: %.loc6_17.4 => constants.%inst.splice_block.7b2 +// CHECK:STDOUT: %.loc6_17.4 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc6_17.5 => constants.%i32 // CHECK:STDOUT: %.loc6_17.6 => invalid -// CHECK:STDOUT: %.loc6_17.7 => constants.%inst.splice_block.5a9 +// CHECK:STDOUT: %.loc6_17.7 => constants.%inst.splice_block.426619.2 // CHECK:STDOUT: %.loc6_17.8 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: @@ -294,10 +294,10 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.08f -// CHECK:STDOUT: %.loc6_17.4 => constants.%inst.splice_block.eb8 +// CHECK:STDOUT: %.loc6_17.4 => constants.%inst.splice_block.426619.3 // CHECK:STDOUT: %.loc6_17.5 => constants.%i32 // CHECK:STDOUT: %.loc6_17.6 => invalid -// CHECK:STDOUT: %.loc6_17.7 => constants.%inst.splice_block.68a +// CHECK:STDOUT: %.loc6_17.7 => constants.%inst.splice_block.426619.4 // CHECK:STDOUT: %.loc6_17.8 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: @@ -315,37 +315,25 @@ fn G() { // CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete] // CHECK:STDOUT: %T.patt.3a0592.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template] // CHECK:STDOUT: %T.67db0b.1: type = symbolic_binding T, 0, template [template] -// CHECK:STDOUT: %pattern_type.51d1c4.1: type = pattern_type %T.67db0b.1 [template] -// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d1c4.1 = value_param_pattern [template] -// CHECK:STDOUT: %x.patt.260: %pattern_type.51d1c4.1 = wrapper_binding_pattern x, %x.param_patt.91d [template] -// CHECK:STDOUT: %.795f: Core.Form = init_form %i32 [concrete] +// CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T.67db0b.1 [template] +// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d = value_param_pattern [template] +// CHECK:STDOUT: %x.patt.260: %pattern_type.51d = wrapper_binding_pattern x, %x.param_patt.91d [template] +// CHECK:STDOUT: %.795: Core.Form = init_form %i32 [concrete] // CHECK:STDOUT: %return.param_patt.a9a: %pattern_type.6b6 = out_param_pattern [concrete] // CHECK:STDOUT: %return.patt.e1b: %pattern_type.6b6 = return_slot_pattern %return.param_patt.a9a, %i32 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.944: = require_complete_type %T.67db0b.1 [template] -// CHECK:STDOUT: %.525: type = type_of_inst @F.%.loc10_11.3 [template] -// CHECK:STDOUT: %.ba9: %.525 = splice_inst @F.%.loc10_11.3 [template] -// CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3aa489.1: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] -// CHECK:STDOUT: %Self.29426c.1: %ImplicitAs.type.3aa489.1 = symbolic_binding Self, 1 [symbolic] -// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.97ed63.1: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Dest, %Self.29426c.1) [symbolic] -// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.9453b4.1: %ImplicitAs.WithSelf.Convert.type.97ed63.1 = struct_value () [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.914: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] -// CHECK:STDOUT: %ImplicitAs.assoc_type.e23: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%i32) [concrete] -// CHECK:STDOUT: %assoc0.368: %ImplicitAs.assoc_type.e23 = assoc_entity element0, imports.%Core.import_ref.cb2 [concrete] -// CHECK:STDOUT: %.ba3: type = type_of_inst @F.%.loc10_17.7 [template] -// CHECK:STDOUT: %.095: %.ba3 = splice_inst @F.%.loc10_17.7 [template] -// CHECK:STDOUT: %.b85: type = type_of_inst @F.%.loc10_17.10 [template] -// CHECK:STDOUT: %.975: %.b85 = splice_inst @F.%.loc10_17.10 [template] -// CHECK:STDOUT: %.fc4: %i32 = splice_inst @F.%.loc10_17.13 [template] +// CHECK:STDOUT: %.8cb: type = type_of_inst @F.%.loc10_11.3 [template] +// CHECK:STDOUT: %.c23: %.8cb = splice_inst @F.%.loc10_11.3 [template] +// CHECK:STDOUT: %.28a: %i32 = splice_inst @F.%.loc10_17.2 [template] // CHECK:STDOUT: %D: type = class_type @D [concrete] // CHECK:STDOUT: %struct_type.base.085: type = struct_type {.base: %C} [concrete] // CHECK:STDOUT: %complete_type.756: = complete_type_witness %struct_type.base.085 [concrete] // CHECK:STDOUT: %pattern_type.d8d: type = pattern_type %D [concrete] // CHECK:STDOUT: %x.param_patt.23b: %pattern_type.d8d = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt.c51: %pattern_type.d8d = wrapper_binding_pattern x, %x.param_patt.23b [concrete] -// CHECK:STDOUT: %inst.splice_block.c9b: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.99f: ref %i32 = splice_block %.287 { // CHECK:STDOUT: %.24c: %D = specific_inst @F.%x.ref, @F(%D) // CHECK:STDOUT: %.ff4: ref %C = class_element_access %.24c, element0 @@ -353,63 +341,43 @@ fn G() { // CHECK:STDOUT: %.287: ref %i32 = class_element_access %.07e, element0 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] -// CHECK:STDOUT: %Int.67af24.2: type = class_type @Int, @Int(%To) [symbolic] -// CHECK:STDOUT: %facet_type.037: type = facet_type <@IntFitsIn, @IntFitsIn(%Int.67af24.2) & @AnyInt> [symbolic] -// CHECK:STDOUT: %From.6a4: %facet_type.037 = symbolic_binding From, 1 [symbolic] -// CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.type.7fa: type = fn_type @From.as_type.as.ImplicitAs.impl.Convert, @From.as_type.as.ImplicitAs.impl(%To, %From.6a4) [symbolic] -// CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.643: %From.as_type.as.ImplicitAs.impl.Convert.type.7fa = struct_value () [symbolic] -// CHECK:STDOUT: %facet_type.138: type = facet_type <@IntFitsIn, @IntFitsIn(%i32) & @AnyInt> [concrete] -// CHECK:STDOUT: %custom_witness: = custom_witness (), @IntFitsIn, @IntFitsIn(%i32) [concrete] -// CHECK:STDOUT: %Int.as.AnyInt.impl.AsInt.type.f15: type = fn_type @Int.as.AnyInt.impl.AsInt, @Int.as.AnyInt.impl(%N) [symbolic] -// CHECK:STDOUT: %Int.as.AnyInt.impl.AsInt.d10: %Int.as.AnyInt.impl.AsInt.type.f15 = struct_value () [symbolic] -// CHECK:STDOUT: %AnyInt.impl_witness.48c: = impl_witness imports.%AnyInt.impl_witness_table, @Int.as.AnyInt.impl(%int_32) [concrete] -// CHECK:STDOUT: %facet_value: %facet_type.138 = facet_value %i32, (%custom_witness, %AnyInt.impl_witness.48c) [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.1d8: = impl_witness imports.%ImplicitAs.impl_witness_table.992, @From.as_type.as.ImplicitAs.impl(%int_32, %facet_value) [concrete] -// CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.type.9d6: type = fn_type @From.as_type.as.ImplicitAs.impl.Convert, @From.as_type.as.ImplicitAs.impl(%int_32, %facet_value) [concrete] -// CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.84a: %From.as_type.as.ImplicitAs.impl.Convert.type.9d6 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.914 = facet_value %i32, (%ImplicitAs.impl_witness.1d8) [concrete] -// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.157: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] -// CHECK:STDOUT: %.3fd: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.157, %ImplicitAs.facet [concrete] -// CHECK:STDOUT: %inst.splice_block.2ae: = inst_value [concrete] { -// CHECK:STDOUT: %.2dc: = splice_block %bound_method.b08 { -// CHECK:STDOUT: %impl.elem0.6c4: %.3fd = impl_witness_access %ImplicitAs.impl_witness.1d8, element0 [concrete = %From.as_type.as.ImplicitAs.impl.Convert.84a] -// CHECK:STDOUT: %bound_method.b08: = bound_method %.99f, %impl.elem0.6c4 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %From.as_type.as.ImplicitAs.impl.Convert.84a, @From.as_type.as.ImplicitAs.impl.Convert(%int_32, %facet_value) [concrete] -// CHECK:STDOUT: %inst.splice_block.3b5: = inst_value [concrete] { -// CHECK:STDOUT: %.fe6: init %i32 = splice_block %From.as_type.as.ImplicitAs.impl.Convert.call { -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.6c4, @From.as_type.as.ImplicitAs.impl.Convert(%int_32, %facet_value) [concrete = %From.as_type.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.dab: = bound_method %.99f, %specific_fn +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.b51: = impl_witness imports.%Copy.impl_witness_table.8d2, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.3f6: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.4f6: %Int.as.Copy.impl.Op.type.3f6 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.b51) [concrete] +// CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] +// CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %.403: init %i32 = splice_block %Int.as.Copy.impl.Op.call { // CHECK:STDOUT: %.1ba: %i32 = acquire_value %.99f -// CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.dab(%.1ba) +// CHECK:STDOUT: %impl.elem0.882: %.737 = impl_witness_access %Copy.impl_witness.b51, element0 [concrete = %Int.as.Copy.impl.Op.4f6] +// CHECK:STDOUT: %bound_method.941: = bound_method %.1ba, %impl.elem0.882 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.882, @Int.as.Copy.impl.Op(%int_32) [concrete = %Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.9e0: = bound_method %.1ba, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.9e0(%.1ba) // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.specific_inst: = inst_value [concrete] { -// CHECK:STDOUT: %.ec7: init %i32 = specific_inst @F.%.loc10_17.5, @F(%D) -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.cb2: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type.97ed63.1) = import_ref Core//prelude/operators/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert.9453b4.1)] -// CHECK:STDOUT: %Core.import_ref.2a4: @From.as_type.as.ImplicitAs.impl.%From.as_type.as.ImplicitAs.impl.Convert.type (%From.as_type.as.ImplicitAs.impl.Convert.type.7fa) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @From.as_type.as.ImplicitAs.impl.%From.as_type.as.ImplicitAs.impl.Convert (constants.%From.as_type.as.ImplicitAs.impl.Convert.643)] -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.992 = impl_witness_table (%Core.import_ref.2a4), @From.as_type.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.47b: Core.IntLiteral = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.AnyInt.impl.%N (constants.%N)] -// CHECK:STDOUT: %Core.import_ref.49b: @Int.as.AnyInt.impl.%Int.as.AnyInt.impl.AsInt.type (%Int.as.AnyInt.impl.AsInt.type.f15) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.AnyInt.impl.%Int.as.AnyInt.impl.AsInt (constants.%Int.as.AnyInt.impl.AsInt.d10)] -// CHECK:STDOUT: %AnyInt.impl_witness_table = impl_witness_table (%Core.import_ref.47b, %Core.import_ref.49b), @Int.as.AnyInt.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)] +// CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt.loc9_16.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc9_16.2 (constants.%T.patt.3a0592.1)] -// CHECK:STDOUT: %x.param_patt.loc9_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc9_25.2 (constants.%x.param_patt.91d)] -// CHECK:STDOUT: %x.patt.loc9_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc9_25.1 [template = %x.patt.loc9_25.2 (constants.%x.patt.260)] +// CHECK:STDOUT: %x.param_patt.loc9_25.1: @F.%pattern_type (%pattern_type.51d) = value_param_pattern [template = %x.param_patt.loc9_25.2 (constants.%x.param_patt.91d)] +// CHECK:STDOUT: %x.patt.loc9_25.1: @F.%pattern_type (%pattern_type.51d) = wrapper_binding_pattern x, %x.param_patt.loc9_25.1 [template = %x.patt.loc9_25.2 (constants.%x.patt.260)] // CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete = constants.%return.param_patt.a9a] // CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete = constants.%return.patt.e1b] // CHECK:STDOUT: } { // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc9_33: Core.Form = init_form %i32 [concrete = constants.%.795f] +// CHECK:STDOUT: %.loc9_33: Core.Form = init_form %i32 [concrete = constants.%.795] // CHECK:STDOUT: %.loc9_18.1: type = splice_block %.loc9_18.2 [concrete = type] { // CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] // CHECK:STDOUT: %.loc9_18.2: type = type_literal type [concrete = type] @@ -426,45 +394,34 @@ fn G() { // CHECK:STDOUT: generic fn @F(%T.loc9_16.2: type) { // CHECK:STDOUT: %T.patt.loc9_16.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc9_16.2 (constants.%T.patt.3a0592.1)] // CHECK:STDOUT: %T.loc9_16.1: type = symbolic_binding T, 0, template [template = %T.loc9_16.1 (constants.%T.67db0b.1)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc9_16.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)] -// CHECK:STDOUT: %x.param_patt.loc9_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc9_25.2 (constants.%x.param_patt.91d)] -// CHECK:STDOUT: %x.patt.loc9_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc9_25.2 [template = %x.patt.loc9_25.2 (constants.%x.patt.260)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc9_16.1 [template = %pattern_type (constants.%pattern_type.51d)] +// CHECK:STDOUT: %x.param_patt.loc9_25.2: @F.%pattern_type (%pattern_type.51d) = value_param_pattern [template = %x.param_patt.loc9_25.2 (constants.%x.param_patt.91d)] +// CHECK:STDOUT: %x.patt.loc9_25.2: @F.%pattern_type (%pattern_type.51d) = wrapper_binding_pattern x, %x.param_patt.loc9_25.2 [template = %x.patt.loc9_25.2 (constants.%x.patt.260)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.loc9_16.1 [template = %require_complete (constants.%require_complete.944)] // CHECK:STDOUT: %.loc10_11.3: = compound_member_access_action %x.ref, %n.ref [template] -// CHECK:STDOUT: %.loc10_11.4: type = type_of_inst %.loc10_11.3 [template = %.loc10_11.4 (constants.%.525)] -// CHECK:STDOUT: %.loc10_11.5: @F.%.loc10_11.4 (%.525) = splice_inst %.loc10_11.3 [template = %.loc10_11.5 (constants.%.ba9)] -// CHECK:STDOUT: %.loc10_17.7: = compound_member_access_action %.loc10_11.2, constants.%assoc0.368 [template] -// CHECK:STDOUT: %.loc10_17.8: type = type_of_inst %.loc10_17.7 [template = %.loc10_17.8 (constants.%.ba3)] -// CHECK:STDOUT: %.loc10_17.9: @F.%.loc10_17.8 (%.ba3) = splice_inst %.loc10_17.7 [template = %.loc10_17.9 (constants.%.095)] -// CHECK:STDOUT: %.loc10_17.10: = call_action (%.loc10_17.2), true [template] -// CHECK:STDOUT: %.loc10_17.11: type = type_of_inst %.loc10_17.10 [template = %.loc10_17.11 (constants.%.b85)] -// CHECK:STDOUT: %.loc10_17.12: @F.%.loc10_17.11 (%.b85) = splice_inst %.loc10_17.10 [template = %.loc10_17.12 (constants.%.975)] -// CHECK:STDOUT: %.loc10_17.13: = convert_to_category_action %.loc10_17.5, element10 [template] -// CHECK:STDOUT: %.loc10_17.14: %i32 = splice_inst %.loc10_17.13 [template = %.loc10_17.14 (constants.%.fc4)] +// CHECK:STDOUT: %.loc10_11.4: type = type_of_inst %.loc10_11.3 [template = %.loc10_11.4 (constants.%.8cb)] +// CHECK:STDOUT: %.loc10_11.5: @F.%.loc10_11.4 (%.8cb) = splice_inst %.loc10_11.3 [template = %.loc10_11.5 (constants.%.c23)] +// CHECK:STDOUT: %.loc10_17.2: = convert_action %.loc10_11.2, constants.%i32, element10 [template] +// CHECK:STDOUT: %.loc10_17.3: %i32 = splice_inst %.loc10_17.2 [template = %.loc10_17.3 (constants.%.28a)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%T.loc9_16.1 (%T.67db0b.1)) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @F.%T.loc9_16.1 (%T.67db0b.1) = name_ref x, %x // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %n.ref: %C.elem = name_ref n, @C.%field_decl [concrete = @C.%field_decl] -// CHECK:STDOUT: %.loc10_11.1: type = type_of_inst %.loc10_11.3 [template = %.loc10_11.4 (constants.%.525)] -// CHECK:STDOUT: %.loc10_11.2: @F.%.loc10_11.4 (%.525) = splice_inst %.loc10_11.3 [template = %.loc10_11.5 (constants.%.ba9)] -// CHECK:STDOUT: %.loc10_17.1: type = type_of_inst %.loc10_17.7 [template = %.loc10_17.8 (constants.%.ba3)] -// CHECK:STDOUT: %.loc10_17.2: @F.%.loc10_17.8 (%.ba3) = splice_inst %.loc10_17.7 [template = %.loc10_17.9 (constants.%.095)] -// CHECK:STDOUT: %.loc10_17.3: type = type_of_inst %.loc10_17.10 [template = %.loc10_17.11 (constants.%.b85)] -// CHECK:STDOUT: %.loc10_17.4: @F.%.loc10_17.11 (%.b85) = splice_inst %.loc10_17.10 [template = %.loc10_17.12 (constants.%.975)] -// CHECK:STDOUT: %.loc10_17.5: %i32 = converted %.loc10_11.2, %.loc10_17.4 [template = %.loc10_17.12 (constants.%.975)] -// CHECK:STDOUT: %.loc10_17.6: %i32 = splice_inst %.loc10_17.13 [template = %.loc10_17.14 (constants.%.fc4)] -// CHECK:STDOUT: return %.loc10_17.6 +// CHECK:STDOUT: %.loc10_11.1: type = type_of_inst %.loc10_11.3 [template = %.loc10_11.4 (constants.%.8cb)] +// CHECK:STDOUT: %.loc10_11.2: @F.%.loc10_11.4 (%.8cb) = splice_inst %.loc10_11.3 [template = %.loc10_11.5 (constants.%.c23)] +// CHECK:STDOUT: %.loc10_17.1: %i32 = splice_inst %.loc10_17.2 [template = %.loc10_17.3 (constants.%.28a)] +// CHECK:STDOUT: return %.loc10_17.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.67db0b.1) { // CHECK:STDOUT: %T.patt.loc9_16.2 => constants.%T.patt.3a0592.1 // CHECK:STDOUT: %T.loc9_16.1 => constants.%T.67db0b.1 -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d1c4.1 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d // CHECK:STDOUT: %x.param_patt.loc9_25.2 => constants.%x.param_patt.91d // CHECK:STDOUT: %x.patt.loc9_25.2 => constants.%x.patt.260 // CHECK:STDOUT: } @@ -478,16 +435,10 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.756 -// CHECK:STDOUT: %.loc10_11.3 => constants.%inst.splice_block.c9b +// CHECK:STDOUT: %.loc10_11.3 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc10_11.4 => constants.%i32 // CHECK:STDOUT: %.loc10_11.5 => invalid -// CHECK:STDOUT: %.loc10_17.7 => constants.%inst.splice_block.2ae -// CHECK:STDOUT: %.loc10_17.8 => -// CHECK:STDOUT: %.loc10_17.9 => invalid -// CHECK:STDOUT: %.loc10_17.10 => constants.%inst.splice_block.3b5 -// CHECK:STDOUT: %.loc10_17.11 => constants.%i32 -// CHECK:STDOUT: %.loc10_17.12 => invalid -// CHECK:STDOUT: %.loc10_17.13 => constants.%inst.specific_inst -// CHECK:STDOUT: %.loc10_17.14 => invalid +// CHECK:STDOUT: %.loc10_17.2 => constants.%inst.splice_block.426619.2 +// CHECK:STDOUT: %.loc10_17.3 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/template/member_out_of_line.carbon b/toolchain/check/testdata/generic/template/member_out_of_line.carbon index ac0899262ba4..7a0b546d0944 100644 --- a/toolchain/check/testdata/generic/template/member_out_of_line.carbon +++ b/toolchain/check/testdata/generic/template/member_out_of_line.carbon @@ -32,7 +32,7 @@ fn Class(template T: type).F(n: T.U) -> T.U { return n; } -// CHECK:STDERR: fail_todo_basic.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `>` [FunctionRedeclReturnTypeDiffers] +// CHECK:STDERR: fail_todo_basic.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `>` [FunctionRedeclReturnTypeDiffers] // CHECK:STDERR: fn Class(template T: type).G(self) -> T.U { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_basic.carbon:[[@LINE-18]]:3: note: previously declared with return type `T` [FunctionRedeclReturnTypePrevious] @@ -55,84 +55,67 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [concrete] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [concrete] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [template] -// CHECK:STDOUT: %pattern_type.51d1c4.1: type = pattern_type %T [template] -// CHECK:STDOUT: %n.param_patt.fb2: %pattern_type.51d1c4.1 = value_param_pattern [template] -// CHECK:STDOUT: %n.patt.955: %pattern_type.51d1c4.1 = wrapper_binding_pattern n, %n.param_patt.fb2 [template] -// CHECK:STDOUT: %.184347.1: Core.Form = init_form %T [template] -// CHECK:STDOUT: %return.param_patt.41d2d9.1: %pattern_type.51d1c4.1 = out_param_pattern [template] -// CHECK:STDOUT: %return.patt.b39: %pattern_type.51d1c4.1 = return_slot_pattern %return.param_patt.41d2d9.1, %T [template] +// CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [template] +// CHECK:STDOUT: %n.param_patt.fb2: %pattern_type.51d = value_param_pattern [template] +// CHECK:STDOUT: %n.patt.955: %pattern_type.51d = wrapper_binding_pattern n, %n.param_patt.fb2 [template] +// CHECK:STDOUT: %.184: Core.Form = init_form %T [template] +// CHECK:STDOUT: %return.param_patt.41d: %pattern_type.51d = out_param_pattern [template] +// CHECK:STDOUT: %return.patt.b39: %pattern_type.51d = return_slot_pattern %return.param_patt.41d, %T [template] // CHECK:STDOUT: %Class.F.type.9829b4.1: type = fn_type @Class.F.loc6, @Class(%T) [template] // CHECK:STDOUT: %Class.F.c6358f.1: %Class.F.type.9829b4.1 = struct_value () [template] // CHECK:STDOUT: %pattern_type.36e: type = pattern_type %Class [template] -// CHECK:STDOUT: %self.param_patt.f93: %pattern_type.36e = value_param_pattern [template] -// CHECK:STDOUT: %self.patt.1dd: %pattern_type.36e = wrapper_binding_pattern self, %self.param_patt.f93 [template] +// CHECK:STDOUT: %self.param_patt: %pattern_type.36e = value_param_pattern [template] +// CHECK:STDOUT: %self.patt: %pattern_type.36e = wrapper_binding_pattern self, %self.param_patt [template] // CHECK:STDOUT: %Class.G.type.ea69e8.1: type = fn_type @Class.G.loc7, @Class(%T) [template] // CHECK:STDOUT: %Class.G.5aff6a.1: %Class.G.type.ea69e8.1 = struct_value () [template] // CHECK:STDOUT: %require_complete.944: = require_complete_type %T [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %T} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template] -// CHECK:STDOUT: %.96c438.1: type = type_of_inst @Class.F.loc18.%.loc18_34.1 [template] -// CHECK:STDOUT: %.8220de.1: %.96c438.1 = splice_inst @Class.F.loc18.%.loc18_34.1 [template] -// CHECK:STDOUT: %.c0c9e0.1: type = splice_inst @Class.F.loc18.%.loc18_34.4 [template] -// CHECK:STDOUT: %pattern_type.9646b3.1: type = pattern_type %.c0c9e0.1 [template] -// CHECK:STDOUT: %n.param_patt.58d: %pattern_type.9646b3.1 = value_param_pattern [template] -// CHECK:STDOUT: %n.patt.1bd: %pattern_type.9646b3.1 = wrapper_binding_pattern n, %n.param_patt.58d [template] -// CHECK:STDOUT: %.96c438.2: type = type_of_inst @Class.F.loc18.%.loc18_42.1 [template] -// CHECK:STDOUT: %.8220de.2: %.96c438.2 = splice_inst @Class.F.loc18.%.loc18_42.1 [template] -// CHECK:STDOUT: %.c0c9e0.2: type = splice_inst @Class.F.loc18.%.loc18_42.4 [template] -// CHECK:STDOUT: %.cfae01.1: Core.Form = init_form %.c0c9e0.2 [template] -// CHECK:STDOUT: %pattern_type.9646b3.2: type = pattern_type %.c0c9e0.2 [template] -// CHECK:STDOUT: %return.param_patt.6e70c7.1: %pattern_type.9646b3.2 = out_param_pattern [template] -// CHECK:STDOUT: %return.patt.60d394.1: %pattern_type.9646b3.2 = return_slot_pattern %return.param_patt.6e70c7.1, %.c0c9e0.2 [template] -// CHECK:STDOUT: %.3d9: = access_member_action %T, U [template] -// CHECK:STDOUT: %.cf6: type = type_of_inst %.3d9 [template] -// CHECK:STDOUT: %.2db: %.cf6 = splice_inst %.3d9 [template] -// CHECK:STDOUT: %.c0f: = convert_to_value_action %.2db, type [template] -// CHECK:STDOUT: %.2b1: type = splice_inst %.c0f [template] -// CHECK:STDOUT: %pattern_type.731: type = pattern_type %.2b1 [template] -// CHECK:STDOUT: %n.param_patt.b5f: %pattern_type.731 = value_param_pattern [template] -// CHECK:STDOUT: %n.patt.164: %pattern_type.731 = wrapper_binding_pattern n, %n.param_patt.b5f [template] -// CHECK:STDOUT: %.a5c: Core.Form = init_form %.2b1 [template] -// CHECK:STDOUT: %return.param_patt.4cd: %pattern_type.731 = out_param_pattern [template] -// CHECK:STDOUT: %return.patt.a02: %pattern_type.731 = return_slot_pattern %return.param_patt.4cd, %.2b1 [template] +// CHECK:STDOUT: %.eff391.1: type = type_of_inst @Class.F.loc18.%.loc18_34.1 [template] +// CHECK:STDOUT: %.b66113.1: %.eff391.1 = splice_inst @Class.F.loc18.%.loc18_34.1 [template] +// CHECK:STDOUT: %.5372ba.1: type = splice_inst @Class.F.loc18.%.loc18_34.4 [template] +// CHECK:STDOUT: %pattern_type.fcb8f3.1: type = pattern_type %.5372ba.1 [template] +// CHECK:STDOUT: %n.param_patt.110b44.1: %pattern_type.fcb8f3.1 = value_param_pattern [template] +// CHECK:STDOUT: %n.patt.9e3e22.1: %pattern_type.fcb8f3.1 = wrapper_binding_pattern n, %n.param_patt.110b44.1 [template] +// CHECK:STDOUT: %.eff391.2: type = type_of_inst @Class.F.loc18.%.loc18_42.1 [template] +// CHECK:STDOUT: %.b66113.2: %.eff391.2 = splice_inst @Class.F.loc18.%.loc18_42.1 [template] +// CHECK:STDOUT: %.5372ba.2: type = splice_inst @Class.F.loc18.%.loc18_42.4 [template] +// CHECK:STDOUT: %.cd79f1.1: Core.Form = init_form %.5372ba.2 [template] +// CHECK:STDOUT: %pattern_type.fcb8f3.2: type = pattern_type %.5372ba.2 [template] +// CHECK:STDOUT: %return.param_patt.2e9ac5.1: %pattern_type.fcb8f3.2 = out_param_pattern [template] +// CHECK:STDOUT: %return.patt.7fc6a1.1: %pattern_type.fcb8f3.2 = return_slot_pattern %return.param_patt.2e9ac5.1, %.5372ba.2 [template] +// CHECK:STDOUT: %.9af: = access_member_action %T, U [template] +// CHECK:STDOUT: %.eff391.3: type = type_of_inst %.9af [template] +// CHECK:STDOUT: %.b66113.3: %.eff391.3 = splice_inst %.9af [template] +// CHECK:STDOUT: %.c8c: = convert_to_value_action %.b66113.3, type [template] +// CHECK:STDOUT: %.5372ba.3: type = splice_inst %.c8c [template] +// CHECK:STDOUT: %pattern_type.fcb8f3.3: type = pattern_type %.5372ba.3 [template] +// CHECK:STDOUT: %n.param_patt.110b44.2: %pattern_type.fcb8f3.3 = value_param_pattern [template] +// CHECK:STDOUT: %n.patt.9e3e22.2: %pattern_type.fcb8f3.3 = wrapper_binding_pattern n, %n.param_patt.110b44.2 [template] +// CHECK:STDOUT: %.cd79f1.2: Core.Form = init_form %.5372ba.3 [template] +// CHECK:STDOUT: %return.param_patt.2e9ac5.2: %pattern_type.fcb8f3.3 = out_param_pattern [template] +// CHECK:STDOUT: %return.patt.7fc6a1.2: %pattern_type.fcb8f3.3 = return_slot_pattern %return.param_patt.2e9ac5.2, %.5372ba.3 [template] // CHECK:STDOUT: %Class.F.type.9829b4.2: type = fn_type @Class.F.loc18, @Class(%T) [template] // CHECK:STDOUT: %Class.F.c6358f.2: %Class.F.type.9829b4.2 = struct_value () [template] -// CHECK:STDOUT: %require_complete.67aa49.1: = require_complete_type %.c0c9e0.1 [template] -// CHECK:STDOUT: %require_complete.67aa49.2: = require_complete_type %.c0c9e0.2 [template] -// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] -// CHECK:STDOUT: %.d5a14b.1: type = type_of_inst @Class.F.loc18.%.loc19_11.11 [template] -// CHECK:STDOUT: %.13a60a.1: %.d5a14b.1 = splice_inst @Class.F.loc18.%.loc19_11.11 [template] -// CHECK:STDOUT: %.818a0b.1: type = type_of_inst @Class.F.loc18.%.loc19_11.14 [template] -// CHECK:STDOUT: %.3f02f6.1: %.818a0b.1 = splice_inst @Class.F.loc18.%.loc19_11.14 [template] -// CHECK:STDOUT: %.e73: type = type_of_inst @Class.F.loc18.%.loc19_11.17 [template] -// CHECK:STDOUT: %.442: %.e73 = splice_inst @Class.F.loc18.%.loc19_11.17 [template] -// CHECK:STDOUT: %.94c: type = type_of_inst @Class.F.loc18.%.loc19_11.20 [template] -// CHECK:STDOUT: %.776: %.94c = splice_inst @Class.F.loc18.%.loc19_11.20 [template] -// CHECK:STDOUT: %.0cb: %.c0c9e0.2 = splice_inst @Class.F.loc18.%.loc19_11.23 [template] -// CHECK:STDOUT: %.96c438.3: type = type_of_inst @Class.G.loc29.%.loc29_40.1 [template] -// CHECK:STDOUT: %.8220de.3: %.96c438.3 = splice_inst @Class.G.loc29.%.loc29_40.1 [template] -// CHECK:STDOUT: %.c0c9e0.3: type = splice_inst @Class.G.loc29.%.loc29_40.4 [template] -// CHECK:STDOUT: %.cfae01.2: Core.Form = init_form %.c0c9e0.3 [template] -// CHECK:STDOUT: %pattern_type.9646b3.3: type = pattern_type %.c0c9e0.3 [template] -// CHECK:STDOUT: %return.param_patt.6e70c7.2: %pattern_type.9646b3.3 = out_param_pattern [template] -// CHECK:STDOUT: %return.patt.60d394.2: %pattern_type.9646b3.3 = return_slot_pattern %return.param_patt.6e70c7.2, %.c0c9e0.3 [template] +// CHECK:STDOUT: %require_complete.cb0614.1: = require_complete_type %.5372ba.1 [template] +// CHECK:STDOUT: %require_complete.cb0614.2: = require_complete_type %.5372ba.2 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.5d6323.1: %.5372ba.2 = splice_inst @Class.F.loc18.%tuple.elem0 [template] +// CHECK:STDOUT: %.eff391.4: type = type_of_inst @Class.G.loc29.%.loc29_40.1 [template] +// CHECK:STDOUT: %.b66113.4: %.eff391.4 = splice_inst @Class.G.loc29.%.loc29_40.1 [template] +// CHECK:STDOUT: %.5372ba.4: type = splice_inst @Class.G.loc29.%.loc29_40.4 [template] +// CHECK:STDOUT: %.cd79f1.3: Core.Form = init_form %.5372ba.4 [template] +// CHECK:STDOUT: %pattern_type.fcb8f3.4: type = pattern_type %.5372ba.4 [template] +// CHECK:STDOUT: %return.param_patt.2e9ac5.3: %pattern_type.fcb8f3.4 = out_param_pattern [template] +// CHECK:STDOUT: %return.patt.7fc6a1.3: %pattern_type.fcb8f3.4 = return_slot_pattern %return.param_patt.2e9ac5.3, %.5372ba.4 [template] // CHECK:STDOUT: %Class.G.type.ea69e8.2: type = fn_type @Class.G.loc29, @Class(%T) [template] // CHECK:STDOUT: %Class.G.5aff6a.2: %Class.G.type.ea69e8.2 = struct_value () [template] // CHECK:STDOUT: %require_complete.4d9: = require_complete_type %Class [template] -// CHECK:STDOUT: %require_complete.67aa49.3: = require_complete_type %.c0c9e0.3 [template] -// CHECK:STDOUT: %.dd9: type = type_of_inst @Class.G.loc29.%.loc30_14.3 [template] -// CHECK:STDOUT: %.732: %.dd9 = splice_inst @Class.G.loc29.%.loc30_14.3 [template] -// CHECK:STDOUT: %.d5a14b.2: type = type_of_inst @Class.G.loc29.%.loc30_16.11 [template] -// CHECK:STDOUT: %.13a60a.2: %.d5a14b.2 = splice_inst @Class.G.loc29.%.loc30_16.11 [template] -// CHECK:STDOUT: %.818a0b.2: type = type_of_inst @Class.G.loc29.%.loc30_16.14 [template] -// CHECK:STDOUT: %.3f02f6.2: %.818a0b.2 = splice_inst @Class.G.loc29.%.loc30_16.14 [template] -// CHECK:STDOUT: %.9f3: type = type_of_inst @Class.G.loc29.%.loc30_16.17 [template] -// CHECK:STDOUT: %.fbe: %.9f3 = splice_inst @Class.G.loc29.%.loc30_16.17 [template] -// CHECK:STDOUT: %.8fa: type = type_of_inst @Class.G.loc29.%.loc30_16.20 [template] -// CHECK:STDOUT: %.d64: %.8fa = splice_inst @Class.G.loc29.%.loc30_16.20 [template] -// CHECK:STDOUT: %.8a4: %.c0c9e0.3 = splice_inst @Class.G.loc29.%.loc30_16.23 [template] +// CHECK:STDOUT: %require_complete.cb0614.3: = require_complete_type %.5372ba.4 [template] +// CHECK:STDOUT: %.237: type = type_of_inst @Class.G.loc29.%.loc30_14.3 [template] +// CHECK:STDOUT: %.f96: %.237 = splice_inst @Class.G.loc29.%.loc30_14.3 [template] +// CHECK:STDOUT: %.5d6323.2: %.5372ba.4 = splice_inst @Class.G.loc29.%tuple.elem0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -146,10 +129,10 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: %T.loc5_23.2: type = symbolic_binding T, 0, template [template = %T.loc5_23.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.F.decl: %Class.F.type.9829b4.2 = fn_decl @Class.F.loc18 [template = constants.%Class.F.c6358f.2] { -// CHECK:STDOUT: %n.param_patt.loc18_31.1: @Class.F.loc18.%pattern_type.loc18_31 (%pattern_type.9646b3.1) = value_param_pattern [template = %n.param_patt.loc18_31.2 (constants.%n.param_patt.58d)] -// CHECK:STDOUT: %n.patt.loc18_31.1: @Class.F.loc18.%pattern_type.loc18_31 (%pattern_type.9646b3.1) = wrapper_binding_pattern n, %n.param_patt.loc18_31.1 [template = %n.patt.loc18_31.2 (constants.%n.patt.1bd)] -// CHECK:STDOUT: %return.param_patt.loc18_42.1: @Class.F.loc18.%pattern_type.loc18_42 (%pattern_type.9646b3.2) = out_param_pattern [template = %return.param_patt.loc18_42.2 (constants.%return.param_patt.6e70c7.1)] -// CHECK:STDOUT: %return.patt.loc18_38.1: @Class.F.loc18.%pattern_type.loc18_42 (%pattern_type.9646b3.2) = return_slot_pattern %return.param_patt.loc18_42.1, %.loc18_42.9 [template = %return.patt.loc18_38.2 (constants.%return.patt.60d394.1)] +// CHECK:STDOUT: %n.param_patt.loc18_31.1: @Class.F.loc18.%pattern_type.loc18_31 (%pattern_type.fcb8f3.1) = value_param_pattern [template = %n.param_patt.loc18_31.2 (constants.%n.param_patt.110b44.1)] +// CHECK:STDOUT: %n.patt.loc18_31.1: @Class.F.loc18.%pattern_type.loc18_31 (%pattern_type.fcb8f3.1) = wrapper_binding_pattern n, %n.param_patt.loc18_31.1 [template = %n.patt.loc18_31.2 (constants.%n.patt.9e3e22.1)] +// CHECK:STDOUT: %return.param_patt.loc18_42.1: @Class.F.loc18.%pattern_type.loc18_42 (%pattern_type.fcb8f3.2) = out_param_pattern [template = %return.param_patt.loc18_42.2 (constants.%return.param_patt.2e9ac5.1)] +// CHECK:STDOUT: %return.patt.loc18_38.1: @Class.F.loc18.%pattern_type.loc18_42 (%pattern_type.fcb8f3.2) = return_slot_pattern %return.param_patt.loc18_42.1, %.loc18_42.9 [template = %return.patt.loc18_38.2 (constants.%return.patt.7fc6a1.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc18_22.1: type = splice_block %.loc18_22.2 [concrete = type] { // CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] @@ -157,26 +140,26 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc18_20: type = symbolic_binding T, 0, template [template = @Class.%T.loc5_23.1 (constants.%T)] // CHECK:STDOUT: %T.ref.loc18_41: type = name_ref T, %T.loc18_20 [template = %T.loc18_33 (constants.%T)] -// CHECK:STDOUT: %.loc18_42.7: type = type_of_inst %.loc18_42.1 [template = %.loc18_42.2 (constants.%.96c438.2)] -// CHECK:STDOUT: %.loc18_42.8: @Class.F.loc18.%.loc18_42.2 (%.96c438.2) = splice_inst %.loc18_42.1 [template = %.loc18_42.3 (constants.%.8220de.2)] -// CHECK:STDOUT: %.loc18_42.9: type = splice_inst %.loc18_42.4 [template = %.loc18_42.5 (constants.%.c0c9e0.2)] -// CHECK:STDOUT: %.loc18_42.10: Core.Form = init_form %.loc18_42.9 [template = %.loc18_42.6 (constants.%.cfae01.1)] -// CHECK:STDOUT: %n.param: @Class.F.loc18.%.loc18_34.5 (%.c0c9e0.1) = value_param call_param0 -// CHECK:STDOUT: %.loc18_34.6: type = splice_block %.loc18_34.9 [template = %.loc18_34.5 (constants.%.c0c9e0.1)] { +// CHECK:STDOUT: %.loc18_42.7: type = type_of_inst %.loc18_42.1 [template = %.loc18_42.2 (constants.%.eff391.2)] +// CHECK:STDOUT: %.loc18_42.8: @Class.F.loc18.%.loc18_42.2 (%.eff391.2) = splice_inst %.loc18_42.1 [template = %.loc18_42.3 (constants.%.b66113.2)] +// CHECK:STDOUT: %.loc18_42.9: type = splice_inst %.loc18_42.4 [template = %.loc18_42.5 (constants.%.5372ba.2)] +// CHECK:STDOUT: %.loc18_42.10: Core.Form = init_form %.loc18_42.9 [template = %.loc18_42.6 (constants.%.cd79f1.1)] +// CHECK:STDOUT: %n.param: @Class.F.loc18.%.loc18_34.5 (%.5372ba.1) = value_param call_param0 +// CHECK:STDOUT: %.loc18_34.6: type = splice_block %.loc18_34.9 [template = %.loc18_34.5 (constants.%.5372ba.1)] { // CHECK:STDOUT: %T.ref.loc18_33: type = name_ref T, %T.loc18_20 [template = %T.loc18_33 (constants.%T)] -// CHECK:STDOUT: %.loc18_34.7: type = type_of_inst %.loc18_34.1 [template = %.loc18_34.2 (constants.%.96c438.1)] -// CHECK:STDOUT: %.loc18_34.8: @Class.F.loc18.%.loc18_34.2 (%.96c438.1) = splice_inst %.loc18_34.1 [template = %.loc18_34.3 (constants.%.8220de.1)] -// CHECK:STDOUT: %.loc18_34.9: type = splice_inst %.loc18_34.4 [template = %.loc18_34.5 (constants.%.c0c9e0.1)] +// CHECK:STDOUT: %.loc18_34.7: type = type_of_inst %.loc18_34.1 [template = %.loc18_34.2 (constants.%.eff391.1)] +// CHECK:STDOUT: %.loc18_34.8: @Class.F.loc18.%.loc18_34.2 (%.eff391.1) = splice_inst %.loc18_34.1 [template = %.loc18_34.3 (constants.%.b66113.1)] +// CHECK:STDOUT: %.loc18_34.9: type = splice_inst %.loc18_34.4 [template = %.loc18_34.5 (constants.%.5372ba.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %n: @Class.F.loc18.%.loc18_34.5 (%.c0c9e0.1) = wrapper_binding n, %n.param -// CHECK:STDOUT: %return.param: ref @Class.F.loc18.%.loc18_42.5 (%.c0c9e0.2) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Class.F.loc18.%.loc18_42.5 (%.c0c9e0.2) = return_slot %return.param +// CHECK:STDOUT: %n: @Class.F.loc18.%.loc18_34.5 (%.5372ba.1) = wrapper_binding n, %n.param +// CHECK:STDOUT: %return.param: ref @Class.F.loc18.%.loc18_42.5 (%.5372ba.2) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Class.F.loc18.%.loc18_42.5 (%.5372ba.2) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Class.G.decl: %Class.G.type.ea69e8.2 = fn_decl @Class.G.loc29 [template = constants.%Class.G.5aff6a.2] { -// CHECK:STDOUT: %self.param_patt.loc29_30.1: @Class.G.loc29.%pattern_type.loc29_30 (%pattern_type.36e) = value_param_pattern [template = %self.param_patt.loc29_30.2 (constants.%self.param_patt.f93)] -// CHECK:STDOUT: %self.patt.loc29_30.1: @Class.G.loc29.%pattern_type.loc29_30 (%pattern_type.36e) = wrapper_binding_pattern self, %self.param_patt.loc29_30.1 [template = %self.patt.loc29_30.2 (constants.%self.patt.1dd)] -// CHECK:STDOUT: %return.param_patt.loc29_40.1: @Class.G.loc29.%pattern_type.loc29_40 (%pattern_type.9646b3.3) = out_param_pattern [template = %return.param_patt.loc29_40.2 (constants.%return.param_patt.6e70c7.2)] -// CHECK:STDOUT: %return.patt.loc29_36.1: @Class.G.loc29.%pattern_type.loc29_40 (%pattern_type.9646b3.3) = return_slot_pattern %return.param_patt.loc29_40.1, %.loc29_40.9 [template = %return.patt.loc29_36.2 (constants.%return.patt.60d394.2)] +// CHECK:STDOUT: %self.param_patt.loc29_30.1: @Class.G.loc29.%pattern_type.loc29_30 (%pattern_type.36e) = value_param_pattern [template = %self.param_patt.loc29_30.2 (constants.%self.param_patt)] +// CHECK:STDOUT: %self.patt.loc29_30.1: @Class.G.loc29.%pattern_type.loc29_30 (%pattern_type.36e) = wrapper_binding_pattern self, %self.param_patt.loc29_30.1 [template = %self.patt.loc29_30.2 (constants.%self.patt)] +// CHECK:STDOUT: %return.param_patt.loc29_40.1: @Class.G.loc29.%pattern_type.loc29_40 (%pattern_type.fcb8f3.4) = out_param_pattern [template = %return.param_patt.loc29_40.2 (constants.%return.param_patt.2e9ac5.3)] +// CHECK:STDOUT: %return.patt.loc29_36.1: @Class.G.loc29.%pattern_type.loc29_40 (%pattern_type.fcb8f3.4) = return_slot_pattern %return.param_patt.loc29_40.1, %.loc29_40.9 [template = %return.patt.loc29_36.2 (constants.%return.patt.7fc6a1.3)] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc29_22.1: type = splice_block %.loc29_22.2 [concrete = type] { // CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] @@ -184,18 +167,18 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc29_20: type = symbolic_binding T, 0, template [template = @Class.%T.loc5_23.1 (constants.%T)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc29_20 [template = %T.loc29_30 (constants.%T)] -// CHECK:STDOUT: %.loc29_40.7: type = type_of_inst %.loc29_40.1 [template = %.loc29_40.2 (constants.%.96c438.3)] -// CHECK:STDOUT: %.loc29_40.8: @Class.G.loc29.%.loc29_40.2 (%.96c438.3) = splice_inst %.loc29_40.1 [template = %.loc29_40.3 (constants.%.8220de.3)] -// CHECK:STDOUT: %.loc29_40.9: type = splice_inst %.loc29_40.4 [template = %.loc29_40.5 (constants.%.c0c9e0.3)] -// CHECK:STDOUT: %.loc29_40.10: Core.Form = init_form %.loc29_40.9 [template = %.loc29_40.6 (constants.%.cfae01.2)] +// CHECK:STDOUT: %.loc29_40.7: type = type_of_inst %.loc29_40.1 [template = %.loc29_40.2 (constants.%.eff391.4)] +// CHECK:STDOUT: %.loc29_40.8: @Class.G.loc29.%.loc29_40.2 (%.eff391.4) = splice_inst %.loc29_40.1 [template = %.loc29_40.3 (constants.%.b66113.4)] +// CHECK:STDOUT: %.loc29_40.9: type = splice_inst %.loc29_40.4 [template = %.loc29_40.5 (constants.%.5372ba.4)] +// CHECK:STDOUT: %.loc29_40.10: Core.Form = init_form %.loc29_40.9 [template = %.loc29_40.6 (constants.%.cd79f1.3)] // CHECK:STDOUT: %self.param: @Class.G.loc29.%Class (%Class) = value_param call_param0 // CHECK:STDOUT: %.loc29_30.1: type = splice_block %Self.ref [template = %Class (constants.%Class)] { // CHECK:STDOUT: %.loc29_30.2: type = specific_constant constants.%Class, @Class(constants.%T) [template = %Class (constants.%Class)] // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc29_30.2 [template = %Class (constants.%Class)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Class.G.loc29.%Class (%Class) = wrapper_binding self, %self.param -// CHECK:STDOUT: %return.param: ref @Class.G.loc29.%.loc29_40.5 (%.c0c9e0.3) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Class.G.loc29.%.loc29_40.5 (%.c0c9e0.3) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @Class.G.loc29.%.loc29_40.5 (%.5372ba.4) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Class.G.loc29.%.loc29_40.5 (%.5372ba.4) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -216,13 +199,13 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Class.F.decl: @Class.%Class.F.type (%Class.F.type.9829b4.1) = fn_decl @Class.F.loc6 [template = @Class.%Class.F (constants.%Class.F.c6358f.1)] { -// CHECK:STDOUT: %n.param_patt.loc6_9.1: @Class.F.loc6.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %n.param_patt.loc6_9.2 (constants.%n.param_patt.fb2)] -// CHECK:STDOUT: %n.patt.loc6_9.1: @Class.F.loc6.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern n, %n.param_patt.loc6_9.1 [template = %n.patt.loc6_9.2 (constants.%n.patt.955)] -// CHECK:STDOUT: %return.param_patt.loc6_17.1: @Class.F.loc6.%pattern_type (%pattern_type.51d1c4.1) = out_param_pattern [template = %return.param_patt.loc6_17.2 (constants.%return.param_patt.41d2d9.1)] -// CHECK:STDOUT: %return.patt.loc6_14.1: @Class.F.loc6.%pattern_type (%pattern_type.51d1c4.1) = return_slot_pattern %return.param_patt.loc6_17.1, %T.ref.loc6_17 [template = %return.patt.loc6_14.2 (constants.%return.patt.b39)] +// CHECK:STDOUT: %n.param_patt.loc6_9.1: @Class.F.loc6.%pattern_type (%pattern_type.51d) = value_param_pattern [template = %n.param_patt.loc6_9.2 (constants.%n.param_patt.fb2)] +// CHECK:STDOUT: %n.patt.loc6_9.1: @Class.F.loc6.%pattern_type (%pattern_type.51d) = wrapper_binding_pattern n, %n.param_patt.loc6_9.1 [template = %n.patt.loc6_9.2 (constants.%n.patt.955)] +// CHECK:STDOUT: %return.param_patt.loc6_17.1: @Class.F.loc6.%pattern_type (%pattern_type.51d) = out_param_pattern [template = %return.param_patt.loc6_17.2 (constants.%return.param_patt.41d)] +// CHECK:STDOUT: %return.patt.loc6_14.1: @Class.F.loc6.%pattern_type (%pattern_type.51d) = return_slot_pattern %return.param_patt.loc6_17.1, %T.ref.loc6_17 [template = %return.patt.loc6_14.2 (constants.%return.patt.b39)] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref.loc6_17: type = name_ref T, @Class.%T.loc5_23.2 [template = %T (constants.%T)] -// CHECK:STDOUT: %.loc6_17.2: Core.Form = init_form %T.ref.loc6_17 [template = %.loc6_17.1 (constants.%.184347.1)] +// CHECK:STDOUT: %.loc6_17.2: Core.Form = init_form %T.ref.loc6_17 [template = %.loc6_17.1 (constants.%.184)] // CHECK:STDOUT: %n.param: @Class.F.loc6.%T (%T) = value_param call_param0 // CHECK:STDOUT: %T.ref.loc6_11: type = name_ref T, @Class.%T.loc5_23.2 [template = %T (constants.%T)] // CHECK:STDOUT: %n: @Class.F.loc6.%T (%T) = wrapper_binding n, %n.param @@ -230,13 +213,13 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: %return: ref @Class.F.loc6.%T (%T) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Class.G.decl: @Class.%Class.G.type (%Class.G.type.ea69e8.1) = fn_decl @Class.G.loc7 [template = @Class.%Class.G (constants.%Class.G.5aff6a.1)] { -// CHECK:STDOUT: %self.param_patt.loc7_8.1: @Class.G.loc7.%pattern_type.loc7_8 (%pattern_type.36e) = value_param_pattern [template = %self.param_patt.loc7_8.2 (constants.%self.param_patt.f93)] -// CHECK:STDOUT: %self.patt.loc7_8.1: @Class.G.loc7.%pattern_type.loc7_8 (%pattern_type.36e) = wrapper_binding_pattern self, %self.param_patt.loc7_8.1 [template = %self.patt.loc7_8.2 (constants.%self.patt.1dd)] -// CHECK:STDOUT: %return.param_patt.loc7_17.1: @Class.G.loc7.%pattern_type.loc7_17 (%pattern_type.51d1c4.1) = out_param_pattern [template = %return.param_patt.loc7_17.2 (constants.%return.param_patt.41d2d9.1)] -// CHECK:STDOUT: %return.patt.loc7_14.1: @Class.G.loc7.%pattern_type.loc7_17 (%pattern_type.51d1c4.1) = return_slot_pattern %return.param_patt.loc7_17.1, %T.ref [template = %return.patt.loc7_14.2 (constants.%return.patt.b39)] +// CHECK:STDOUT: %self.param_patt.loc7_8.1: @Class.G.loc7.%pattern_type.loc7_8 (%pattern_type.36e) = value_param_pattern [template = %self.param_patt.loc7_8.2 (constants.%self.param_patt)] +// CHECK:STDOUT: %self.patt.loc7_8.1: @Class.G.loc7.%pattern_type.loc7_8 (%pattern_type.36e) = wrapper_binding_pattern self, %self.param_patt.loc7_8.1 [template = %self.patt.loc7_8.2 (constants.%self.patt)] +// CHECK:STDOUT: %return.param_patt.loc7_17.1: @Class.G.loc7.%pattern_type.loc7_17 (%pattern_type.51d) = out_param_pattern [template = %return.param_patt.loc7_17.2 (constants.%return.param_patt.41d)] +// CHECK:STDOUT: %return.patt.loc7_14.1: @Class.G.loc7.%pattern_type.loc7_17 (%pattern_type.51d) = return_slot_pattern %return.param_patt.loc7_17.1, %T.ref [template = %return.patt.loc7_14.2 (constants.%return.patt.b39)] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc5_23.2 [template = %T (constants.%T)] -// CHECK:STDOUT: %.loc7_17.2: Core.Form = init_form %T.ref [template = %.loc7_17.1 (constants.%.184347.1)] +// CHECK:STDOUT: %.loc7_17.2: Core.Form = init_form %T.ref [template = %.loc7_17.1 (constants.%.184)] // CHECK:STDOUT: %self.param: @Class.G.loc7.%Class (%Class) = value_param call_param0 // CHECK:STDOUT: %.loc7_8.1: type = splice_block %Self.ref [template = %Class (constants.%Class)] { // CHECK:STDOUT: %.loc7_8.2: type = specific_constant constants.%Class, @Class(constants.%T) [template = %Class (constants.%Class)] @@ -263,12 +246,12 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Class.F.loc6(@Class.%T.loc5_23.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0, template [template = %T (constants.%T)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %T [template = %pattern_type (constants.%pattern_type.51d1c4.1)] -// CHECK:STDOUT: %n.param_patt.loc6_9.2: @Class.F.loc6.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %n.param_patt.loc6_9.2 (constants.%n.param_patt.fb2)] -// CHECK:STDOUT: %n.patt.loc6_9.2: @Class.F.loc6.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern n, %n.param_patt.loc6_9.2 [template = %n.patt.loc6_9.2 (constants.%n.patt.955)] -// CHECK:STDOUT: %.loc6_17.1: Core.Form = init_form %T [template = %.loc6_17.1 (constants.%.184347.1)] -// CHECK:STDOUT: %return.param_patt.loc6_17.2: @Class.F.loc6.%pattern_type (%pattern_type.51d1c4.1) = out_param_pattern [template = %return.param_patt.loc6_17.2 (constants.%return.param_patt.41d2d9.1)] -// CHECK:STDOUT: %return.patt.loc6_14.2: @Class.F.loc6.%pattern_type (%pattern_type.51d1c4.1) = return_slot_pattern %return.param_patt.loc6_17.2, %T [template = %return.patt.loc6_14.2 (constants.%return.patt.b39)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %T [template = %pattern_type (constants.%pattern_type.51d)] +// CHECK:STDOUT: %n.param_patt.loc6_9.2: @Class.F.loc6.%pattern_type (%pattern_type.51d) = value_param_pattern [template = %n.param_patt.loc6_9.2 (constants.%n.param_patt.fb2)] +// CHECK:STDOUT: %n.patt.loc6_9.2: @Class.F.loc6.%pattern_type (%pattern_type.51d) = wrapper_binding_pattern n, %n.param_patt.loc6_9.2 [template = %n.patt.loc6_9.2 (constants.%n.patt.955)] +// CHECK:STDOUT: %.loc6_17.1: Core.Form = init_form %T [template = %.loc6_17.1 (constants.%.184)] +// CHECK:STDOUT: %return.param_patt.loc6_17.2: @Class.F.loc6.%pattern_type (%pattern_type.51d) = out_param_pattern [template = %return.param_patt.loc6_17.2 (constants.%return.param_patt.41d)] +// CHECK:STDOUT: %return.patt.loc6_14.2: @Class.F.loc6.%pattern_type (%pattern_type.51d) = return_slot_pattern %return.param_patt.loc6_17.2, %T [template = %return.patt.loc6_14.2 (constants.%return.patt.b39)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%n.param: @Class.F.loc6.%T (%T)) -> out %return.param: @Class.F.loc6.%T (%T); // CHECK:STDOUT: } @@ -277,12 +260,12 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: %T: type = symbolic_binding T, 0, template [template = %T (constants.%T)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [template = %Class (constants.%Class)] // CHECK:STDOUT: %pattern_type.loc7_8: type = pattern_type %Class [template = %pattern_type.loc7_8 (constants.%pattern_type.36e)] -// CHECK:STDOUT: %self.param_patt.loc7_8.2: @Class.G.loc7.%pattern_type.loc7_8 (%pattern_type.36e) = value_param_pattern [template = %self.param_patt.loc7_8.2 (constants.%self.param_patt.f93)] -// CHECK:STDOUT: %self.patt.loc7_8.2: @Class.G.loc7.%pattern_type.loc7_8 (%pattern_type.36e) = wrapper_binding_pattern self, %self.param_patt.loc7_8.2 [template = %self.patt.loc7_8.2 (constants.%self.patt.1dd)] -// CHECK:STDOUT: %.loc7_17.1: Core.Form = init_form %T [template = %.loc7_17.1 (constants.%.184347.1)] -// CHECK:STDOUT: %pattern_type.loc7_17: type = pattern_type %T [template = %pattern_type.loc7_17 (constants.%pattern_type.51d1c4.1)] -// CHECK:STDOUT: %return.param_patt.loc7_17.2: @Class.G.loc7.%pattern_type.loc7_17 (%pattern_type.51d1c4.1) = out_param_pattern [template = %return.param_patt.loc7_17.2 (constants.%return.param_patt.41d2d9.1)] -// CHECK:STDOUT: %return.patt.loc7_14.2: @Class.G.loc7.%pattern_type.loc7_17 (%pattern_type.51d1c4.1) = return_slot_pattern %return.param_patt.loc7_17.2, %T [template = %return.patt.loc7_14.2 (constants.%return.patt.b39)] +// CHECK:STDOUT: %self.param_patt.loc7_8.2: @Class.G.loc7.%pattern_type.loc7_8 (%pattern_type.36e) = value_param_pattern [template = %self.param_patt.loc7_8.2 (constants.%self.param_patt)] +// CHECK:STDOUT: %self.patt.loc7_8.2: @Class.G.loc7.%pattern_type.loc7_8 (%pattern_type.36e) = wrapper_binding_pattern self, %self.param_patt.loc7_8.2 [template = %self.patt.loc7_8.2 (constants.%self.patt)] +// CHECK:STDOUT: %.loc7_17.1: Core.Form = init_form %T [template = %.loc7_17.1 (constants.%.184)] +// CHECK:STDOUT: %pattern_type.loc7_17: type = pattern_type %T [template = %pattern_type.loc7_17 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %return.param_patt.loc7_17.2: @Class.G.loc7.%pattern_type.loc7_17 (%pattern_type.51d) = out_param_pattern [template = %return.param_patt.loc7_17.2 (constants.%return.param_patt.41d)] +// CHECK:STDOUT: %return.patt.loc7_14.2: @Class.G.loc7.%pattern_type.loc7_17 (%pattern_type.51d) = return_slot_pattern %return.param_patt.loc7_17.2, %T [template = %return.patt.loc7_14.2 (constants.%return.patt.b39)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @Class.G.loc7.%Class (%Class)) -> out %return.param: @Class.G.loc7.%T (%T); // CHECK:STDOUT: } @@ -290,55 +273,35 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: generic fn @Class.F.loc18(%T.loc18_20: type) { // CHECK:STDOUT: %T.loc18_33: type = symbolic_binding T, 0, template [template = %T.loc18_33 (constants.%T)] // CHECK:STDOUT: %.loc18_34.1: = access_member_action %T.ref.loc18_33, U [template] -// CHECK:STDOUT: %.loc18_34.2: type = type_of_inst %.loc18_34.1 [template = %.loc18_34.2 (constants.%.96c438.1)] -// CHECK:STDOUT: %.loc18_34.3: @Class.F.loc18.%.loc18_34.2 (%.96c438.1) = splice_inst %.loc18_34.1 [template = %.loc18_34.3 (constants.%.8220de.1)] +// CHECK:STDOUT: %.loc18_34.2: type = type_of_inst %.loc18_34.1 [template = %.loc18_34.2 (constants.%.eff391.1)] +// CHECK:STDOUT: %.loc18_34.3: @Class.F.loc18.%.loc18_34.2 (%.eff391.1) = splice_inst %.loc18_34.1 [template = %.loc18_34.3 (constants.%.b66113.1)] // CHECK:STDOUT: %.loc18_34.4: = convert_to_value_action %.loc18_34.8, type [template] -// CHECK:STDOUT: %.loc18_34.5: type = splice_inst %.loc18_34.4 [template = %.loc18_34.5 (constants.%.c0c9e0.1)] -// CHECK:STDOUT: %pattern_type.loc18_31: type = pattern_type %.loc18_34.5 [template = %pattern_type.loc18_31 (constants.%pattern_type.9646b3.1)] -// CHECK:STDOUT: %n.param_patt.loc18_31.2: @Class.F.loc18.%pattern_type.loc18_31 (%pattern_type.9646b3.1) = value_param_pattern [template = %n.param_patt.loc18_31.2 (constants.%n.param_patt.58d)] -// CHECK:STDOUT: %n.patt.loc18_31.2: @Class.F.loc18.%pattern_type.loc18_31 (%pattern_type.9646b3.1) = wrapper_binding_pattern n, %n.param_patt.loc18_31.2 [template = %n.patt.loc18_31.2 (constants.%n.patt.1bd)] +// CHECK:STDOUT: %.loc18_34.5: type = splice_inst %.loc18_34.4 [template = %.loc18_34.5 (constants.%.5372ba.1)] +// CHECK:STDOUT: %pattern_type.loc18_31: type = pattern_type %.loc18_34.5 [template = %pattern_type.loc18_31 (constants.%pattern_type.fcb8f3.1)] +// CHECK:STDOUT: %n.param_patt.loc18_31.2: @Class.F.loc18.%pattern_type.loc18_31 (%pattern_type.fcb8f3.1) = value_param_pattern [template = %n.param_patt.loc18_31.2 (constants.%n.param_patt.110b44.1)] +// CHECK:STDOUT: %n.patt.loc18_31.2: @Class.F.loc18.%pattern_type.loc18_31 (%pattern_type.fcb8f3.1) = wrapper_binding_pattern n, %n.param_patt.loc18_31.2 [template = %n.patt.loc18_31.2 (constants.%n.patt.9e3e22.1)] // CHECK:STDOUT: %.loc18_42.1: = access_member_action %T.ref.loc18_41, U [template] -// CHECK:STDOUT: %.loc18_42.2: type = type_of_inst %.loc18_42.1 [template = %.loc18_42.2 (constants.%.96c438.2)] -// CHECK:STDOUT: %.loc18_42.3: @Class.F.loc18.%.loc18_42.2 (%.96c438.2) = splice_inst %.loc18_42.1 [template = %.loc18_42.3 (constants.%.8220de.2)] +// CHECK:STDOUT: %.loc18_42.2: type = type_of_inst %.loc18_42.1 [template = %.loc18_42.2 (constants.%.eff391.2)] +// CHECK:STDOUT: %.loc18_42.3: @Class.F.loc18.%.loc18_42.2 (%.eff391.2) = splice_inst %.loc18_42.1 [template = %.loc18_42.3 (constants.%.b66113.2)] // CHECK:STDOUT: %.loc18_42.4: = convert_to_value_action %.loc18_42.8, type [template] -// CHECK:STDOUT: %.loc18_42.5: type = splice_inst %.loc18_42.4 [template = %.loc18_42.5 (constants.%.c0c9e0.2)] -// CHECK:STDOUT: %.loc18_42.6: Core.Form = init_form %.loc18_42.5 [template = %.loc18_42.6 (constants.%.cfae01.1)] -// CHECK:STDOUT: %pattern_type.loc18_42: type = pattern_type %.loc18_42.5 [template = %pattern_type.loc18_42 (constants.%pattern_type.9646b3.2)] -// CHECK:STDOUT: %return.param_patt.loc18_42.2: @Class.F.loc18.%pattern_type.loc18_42 (%pattern_type.9646b3.2) = out_param_pattern [template = %return.param_patt.loc18_42.2 (constants.%return.param_patt.6e70c7.1)] -// CHECK:STDOUT: %return.patt.loc18_38.2: @Class.F.loc18.%pattern_type.loc18_42 (%pattern_type.9646b3.2) = return_slot_pattern %return.param_patt.loc18_42.2, %.loc18_42.5 [template = %return.patt.loc18_38.2 (constants.%return.patt.60d394.1)] +// CHECK:STDOUT: %.loc18_42.5: type = splice_inst %.loc18_42.4 [template = %.loc18_42.5 (constants.%.5372ba.2)] +// CHECK:STDOUT: %.loc18_42.6: Core.Form = init_form %.loc18_42.5 [template = %.loc18_42.6 (constants.%.cd79f1.1)] +// CHECK:STDOUT: %pattern_type.loc18_42: type = pattern_type %.loc18_42.5 [template = %pattern_type.loc18_42 (constants.%pattern_type.fcb8f3.2)] +// CHECK:STDOUT: %return.param_patt.loc18_42.2: @Class.F.loc18.%pattern_type.loc18_42 (%pattern_type.fcb8f3.2) = out_param_pattern [template = %return.param_patt.loc18_42.2 (constants.%return.param_patt.2e9ac5.1)] +// CHECK:STDOUT: %return.patt.loc18_38.2: @Class.F.loc18.%pattern_type.loc18_42 (%pattern_type.fcb8f3.2) = return_slot_pattern %return.param_patt.loc18_42.2, %.loc18_42.5 [template = %return.patt.loc18_38.2 (constants.%return.patt.7fc6a1.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc18_31: = require_complete_type %.loc18_34.5 [template = %require_complete.loc18_31 (constants.%require_complete.67aa49.1)] -// CHECK:STDOUT: %require_complete.loc18_38: = require_complete_type %.loc18_42.5 [template = %require_complete.loc18_38 (constants.%require_complete.67aa49.2)] -// CHECK:STDOUT: %.loc19_11.11: = call_action (constants.%ImplicitAs.generic, constants.%.c0c9e0.2), false [template] -// CHECK:STDOUT: %.loc19_11.12: type = type_of_inst %.loc19_11.11 [template = %.loc19_11.12 (constants.%.d5a14b.1)] -// CHECK:STDOUT: %.loc19_11.13: @Class.F.loc18.%.loc19_11.12 (%.d5a14b.1) = splice_inst %.loc19_11.11 [template = %.loc19_11.13 (constants.%.13a60a.1)] -// CHECK:STDOUT: %.loc19_11.14: = access_member_action %.loc19_11.2, Convert [template] -// CHECK:STDOUT: %.loc19_11.15: type = type_of_inst %.loc19_11.14 [template = %.loc19_11.15 (constants.%.818a0b.1)] -// CHECK:STDOUT: %.loc19_11.16: @Class.F.loc18.%.loc19_11.15 (%.818a0b.1) = splice_inst %.loc19_11.14 [template = %.loc19_11.16 (constants.%.3f02f6.1)] -// CHECK:STDOUT: %.loc19_11.17: = compound_member_access_action %n.ref, %.loc19_11.4 [template] -// CHECK:STDOUT: %.loc19_11.18: type = type_of_inst %.loc19_11.17 [template = %.loc19_11.18 (constants.%.e73)] -// CHECK:STDOUT: %.loc19_11.19: @Class.F.loc18.%.loc19_11.18 (%.e73) = splice_inst %.loc19_11.17 [template = %.loc19_11.19 (constants.%.442)] -// CHECK:STDOUT: %.loc19_11.20: = call_action (%.loc19_11.6), true [template] -// CHECK:STDOUT: %.loc19_11.21: type = type_of_inst %.loc19_11.20 [template = %.loc19_11.21 (constants.%.94c)] -// CHECK:STDOUT: %.loc19_11.22: @Class.F.loc18.%.loc19_11.21 (%.94c) = splice_inst %.loc19_11.20 [template = %.loc19_11.22 (constants.%.776)] -// CHECK:STDOUT: %.loc19_11.23: = convert_to_category_action %.loc19_11.9, element10 [template] -// CHECK:STDOUT: %.loc19_11.24: @Class.F.loc18.%.loc18_42.5 (%.c0c9e0.2) = splice_inst %.loc19_11.23 [template = %.loc19_11.24 (constants.%.0cb)] +// CHECK:STDOUT: %require_complete.loc18_31: = require_complete_type %.loc18_34.5 [template = %require_complete.loc18_31 (constants.%require_complete.cb0614.1)] +// CHECK:STDOUT: %require_complete.loc18_38: = require_complete_type %.loc18_42.5 [template = %require_complete.loc18_38 (constants.%require_complete.cb0614.2)] +// CHECK:STDOUT: %.loc19_11.2: %tuple.type = initialize_action %n.ref, %.loc18_42.5, %return.param, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc19_11.2, element0 [template] +// CHECK:STDOUT: %.loc19_11.3: @Class.F.loc18.%.loc18_42.5 (%.5372ba.2) = splice_inst %tuple.elem0 [template = %.loc19_11.3 (constants.%.5d6323.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%n.param: @Class.F.loc18.%.loc18_34.5 (%.c0c9e0.1)) -> out %return.param: @Class.F.loc18.%.loc18_42.5 (%.c0c9e0.2) { +// CHECK:STDOUT: fn(%n.param: @Class.F.loc18.%.loc18_34.5 (%.5372ba.1)) -> out %return.param: @Class.F.loc18.%.loc18_42.5 (%.5372ba.2) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: @Class.F.loc18.%.loc18_34.5 (%.c0c9e0.1) = name_ref n, %n -// CHECK:STDOUT: %.loc19_11.1: type = type_of_inst %.loc19_11.11 [template = %.loc19_11.12 (constants.%.d5a14b.1)] -// CHECK:STDOUT: %.loc19_11.2: @Class.F.loc18.%.loc19_11.12 (%.d5a14b.1) = splice_inst %.loc19_11.11 [template = %.loc19_11.13 (constants.%.13a60a.1)] -// CHECK:STDOUT: %.loc19_11.3: type = type_of_inst %.loc19_11.14 [template = %.loc19_11.15 (constants.%.818a0b.1)] -// CHECK:STDOUT: %.loc19_11.4: @Class.F.loc18.%.loc19_11.15 (%.818a0b.1) = splice_inst %.loc19_11.14 [template = %.loc19_11.16 (constants.%.3f02f6.1)] -// CHECK:STDOUT: %.loc19_11.5: type = type_of_inst %.loc19_11.17 [template = %.loc19_11.18 (constants.%.e73)] -// CHECK:STDOUT: %.loc19_11.6: @Class.F.loc18.%.loc19_11.18 (%.e73) = splice_inst %.loc19_11.17 [template = %.loc19_11.19 (constants.%.442)] -// CHECK:STDOUT: %.loc19_11.7: type = type_of_inst %.loc19_11.20 [template = %.loc19_11.21 (constants.%.94c)] -// CHECK:STDOUT: %.loc19_11.8: @Class.F.loc18.%.loc19_11.21 (%.94c) = splice_inst %.loc19_11.20 [template = %.loc19_11.22 (constants.%.776)] -// CHECK:STDOUT: %.loc19_11.9: @Class.F.loc18.%.loc18_42.5 (%.c0c9e0.2) = converted %n.ref, %.loc19_11.8 [template = %.loc19_11.22 (constants.%.776)] -// CHECK:STDOUT: %.loc19_11.10: @Class.F.loc18.%.loc18_42.5 (%.c0c9e0.2) = splice_inst %.loc19_11.23 [template = %.loc19_11.24 (constants.%.0cb)] -// CHECK:STDOUT: return %.loc19_11.10 to %return.param +// CHECK:STDOUT: %n.ref: @Class.F.loc18.%.loc18_34.5 (%.5372ba.1) = name_ref n, %n +// CHECK:STDOUT: %.loc19_11.1: @Class.F.loc18.%.loc18_42.5 (%.5372ba.2) = splice_inst %tuple.elem0 [template = %.loc19_11.3 (constants.%.5d6323.1)] +// CHECK:STDOUT: return %.loc19_11.1 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -346,55 +309,35 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: %T.loc29_30: type = symbolic_binding T, 0, template [template = %T.loc29_30 (constants.%T)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc29_30) [template = %Class (constants.%Class)] // CHECK:STDOUT: %pattern_type.loc29_30: type = pattern_type %Class [template = %pattern_type.loc29_30 (constants.%pattern_type.36e)] -// CHECK:STDOUT: %self.param_patt.loc29_30.2: @Class.G.loc29.%pattern_type.loc29_30 (%pattern_type.36e) = value_param_pattern [template = %self.param_patt.loc29_30.2 (constants.%self.param_patt.f93)] -// CHECK:STDOUT: %self.patt.loc29_30.2: @Class.G.loc29.%pattern_type.loc29_30 (%pattern_type.36e) = wrapper_binding_pattern self, %self.param_patt.loc29_30.2 [template = %self.patt.loc29_30.2 (constants.%self.patt.1dd)] +// CHECK:STDOUT: %self.param_patt.loc29_30.2: @Class.G.loc29.%pattern_type.loc29_30 (%pattern_type.36e) = value_param_pattern [template = %self.param_patt.loc29_30.2 (constants.%self.param_patt)] +// CHECK:STDOUT: %self.patt.loc29_30.2: @Class.G.loc29.%pattern_type.loc29_30 (%pattern_type.36e) = wrapper_binding_pattern self, %self.param_patt.loc29_30.2 [template = %self.patt.loc29_30.2 (constants.%self.patt)] // CHECK:STDOUT: %.loc29_40.1: = access_member_action %T.ref, U [template] -// CHECK:STDOUT: %.loc29_40.2: type = type_of_inst %.loc29_40.1 [template = %.loc29_40.2 (constants.%.96c438.3)] -// CHECK:STDOUT: %.loc29_40.3: @Class.G.loc29.%.loc29_40.2 (%.96c438.3) = splice_inst %.loc29_40.1 [template = %.loc29_40.3 (constants.%.8220de.3)] +// CHECK:STDOUT: %.loc29_40.2: type = type_of_inst %.loc29_40.1 [template = %.loc29_40.2 (constants.%.eff391.4)] +// CHECK:STDOUT: %.loc29_40.3: @Class.G.loc29.%.loc29_40.2 (%.eff391.4) = splice_inst %.loc29_40.1 [template = %.loc29_40.3 (constants.%.b66113.4)] // CHECK:STDOUT: %.loc29_40.4: = convert_to_value_action %.loc29_40.8, type [template] -// CHECK:STDOUT: %.loc29_40.5: type = splice_inst %.loc29_40.4 [template = %.loc29_40.5 (constants.%.c0c9e0.3)] -// CHECK:STDOUT: %.loc29_40.6: Core.Form = init_form %.loc29_40.5 [template = %.loc29_40.6 (constants.%.cfae01.2)] -// CHECK:STDOUT: %pattern_type.loc29_40: type = pattern_type %.loc29_40.5 [template = %pattern_type.loc29_40 (constants.%pattern_type.9646b3.3)] -// CHECK:STDOUT: %return.param_patt.loc29_40.2: @Class.G.loc29.%pattern_type.loc29_40 (%pattern_type.9646b3.3) = out_param_pattern [template = %return.param_patt.loc29_40.2 (constants.%return.param_patt.6e70c7.2)] -// CHECK:STDOUT: %return.patt.loc29_36.2: @Class.G.loc29.%pattern_type.loc29_40 (%pattern_type.9646b3.3) = return_slot_pattern %return.param_patt.loc29_40.2, %.loc29_40.5 [template = %return.patt.loc29_36.2 (constants.%return.patt.60d394.2)] +// CHECK:STDOUT: %.loc29_40.5: type = splice_inst %.loc29_40.4 [template = %.loc29_40.5 (constants.%.5372ba.4)] +// CHECK:STDOUT: %.loc29_40.6: Core.Form = init_form %.loc29_40.5 [template = %.loc29_40.6 (constants.%.cd79f1.3)] +// CHECK:STDOUT: %pattern_type.loc29_40: type = pattern_type %.loc29_40.5 [template = %pattern_type.loc29_40 (constants.%pattern_type.fcb8f3.4)] +// CHECK:STDOUT: %return.param_patt.loc29_40.2: @Class.G.loc29.%pattern_type.loc29_40 (%pattern_type.fcb8f3.4) = out_param_pattern [template = %return.param_patt.loc29_40.2 (constants.%return.param_patt.2e9ac5.3)] +// CHECK:STDOUT: %return.patt.loc29_36.2: @Class.G.loc29.%pattern_type.loc29_40 (%pattern_type.fcb8f3.4) = return_slot_pattern %return.param_patt.loc29_40.2, %.loc29_40.5 [template = %return.patt.loc29_36.2 (constants.%return.patt.7fc6a1.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc29_30: = require_complete_type %Class [template = %require_complete.loc29_30 (constants.%require_complete.4d9)] -// CHECK:STDOUT: %require_complete.loc29_36: = require_complete_type %.loc29_40.5 [template = %require_complete.loc29_36 (constants.%require_complete.67aa49.3)] +// CHECK:STDOUT: %require_complete.loc29_36: = require_complete_type %.loc29_40.5 [template = %require_complete.loc29_36 (constants.%require_complete.cb0614.3)] // CHECK:STDOUT: %.loc30_14.3: = access_member_action %self.ref, n [template] -// CHECK:STDOUT: %.loc30_14.4: type = type_of_inst %.loc30_14.3 [template = %.loc30_14.4 (constants.%.dd9)] -// CHECK:STDOUT: %.loc30_14.5: @Class.G.loc29.%.loc30_14.4 (%.dd9) = splice_inst %.loc30_14.3 [template = %.loc30_14.5 (constants.%.732)] -// CHECK:STDOUT: %.loc30_16.11: = call_action (constants.%ImplicitAs.generic, constants.%.c0c9e0.3), false [template] -// CHECK:STDOUT: %.loc30_16.12: type = type_of_inst %.loc30_16.11 [template = %.loc30_16.12 (constants.%.d5a14b.2)] -// CHECK:STDOUT: %.loc30_16.13: @Class.G.loc29.%.loc30_16.12 (%.d5a14b.2) = splice_inst %.loc30_16.11 [template = %.loc30_16.13 (constants.%.13a60a.2)] -// CHECK:STDOUT: %.loc30_16.14: = access_member_action %.loc30_16.2, Convert [template] -// CHECK:STDOUT: %.loc30_16.15: type = type_of_inst %.loc30_16.14 [template = %.loc30_16.15 (constants.%.818a0b.2)] -// CHECK:STDOUT: %.loc30_16.16: @Class.G.loc29.%.loc30_16.15 (%.818a0b.2) = splice_inst %.loc30_16.14 [template = %.loc30_16.16 (constants.%.3f02f6.2)] -// CHECK:STDOUT: %.loc30_16.17: = compound_member_access_action %.loc30_14.2, %.loc30_16.4 [template] -// CHECK:STDOUT: %.loc30_16.18: type = type_of_inst %.loc30_16.17 [template = %.loc30_16.18 (constants.%.9f3)] -// CHECK:STDOUT: %.loc30_16.19: @Class.G.loc29.%.loc30_16.18 (%.9f3) = splice_inst %.loc30_16.17 [template = %.loc30_16.19 (constants.%.fbe)] -// CHECK:STDOUT: %.loc30_16.20: = call_action (%.loc30_16.6), true [template] -// CHECK:STDOUT: %.loc30_16.21: type = type_of_inst %.loc30_16.20 [template = %.loc30_16.21 (constants.%.8fa)] -// CHECK:STDOUT: %.loc30_16.22: @Class.G.loc29.%.loc30_16.21 (%.8fa) = splice_inst %.loc30_16.20 [template = %.loc30_16.22 (constants.%.d64)] -// CHECK:STDOUT: %.loc30_16.23: = convert_to_category_action %.loc30_16.9, element10 [template] -// CHECK:STDOUT: %.loc30_16.24: @Class.G.loc29.%.loc29_40.5 (%.c0c9e0.3) = splice_inst %.loc30_16.23 [template = %.loc30_16.24 (constants.%.8a4)] +// CHECK:STDOUT: %.loc30_14.4: type = type_of_inst %.loc30_14.3 [template = %.loc30_14.4 (constants.%.237)] +// CHECK:STDOUT: %.loc30_14.5: @Class.G.loc29.%.loc30_14.4 (%.237) = splice_inst %.loc30_14.3 [template = %.loc30_14.5 (constants.%.f96)] +// CHECK:STDOUT: %.loc30_16.2: %tuple.type = initialize_action %.loc30_14.2, %.loc29_40.5, %return.param, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc30_16.2, element0 [template] +// CHECK:STDOUT: %.loc30_16.3: @Class.G.loc29.%.loc29_40.5 (%.5372ba.4) = splice_inst %tuple.elem0 [template = %.loc30_16.3 (constants.%.5d6323.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Class.G.loc29.%Class (%Class)) -> out %return.param: @Class.G.loc29.%.loc29_40.5 (%.c0c9e0.3) { +// CHECK:STDOUT: fn(%self.param: @Class.G.loc29.%Class (%Class)) -> out %return.param: @Class.G.loc29.%.loc29_40.5 (%.5372ba.4) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @Class.G.loc29.%Class (%Class) = name_ref self, %self -// CHECK:STDOUT: %.loc30_14.1: type = type_of_inst %.loc30_14.3 [template = %.loc30_14.4 (constants.%.dd9)] -// CHECK:STDOUT: %.loc30_14.2: @Class.G.loc29.%.loc30_14.4 (%.dd9) = splice_inst %.loc30_14.3 [template = %.loc30_14.5 (constants.%.732)] -// CHECK:STDOUT: %.loc30_16.1: type = type_of_inst %.loc30_16.11 [template = %.loc30_16.12 (constants.%.d5a14b.2)] -// CHECK:STDOUT: %.loc30_16.2: @Class.G.loc29.%.loc30_16.12 (%.d5a14b.2) = splice_inst %.loc30_16.11 [template = %.loc30_16.13 (constants.%.13a60a.2)] -// CHECK:STDOUT: %.loc30_16.3: type = type_of_inst %.loc30_16.14 [template = %.loc30_16.15 (constants.%.818a0b.2)] -// CHECK:STDOUT: %.loc30_16.4: @Class.G.loc29.%.loc30_16.15 (%.818a0b.2) = splice_inst %.loc30_16.14 [template = %.loc30_16.16 (constants.%.3f02f6.2)] -// CHECK:STDOUT: %.loc30_16.5: type = type_of_inst %.loc30_16.17 [template = %.loc30_16.18 (constants.%.9f3)] -// CHECK:STDOUT: %.loc30_16.6: @Class.G.loc29.%.loc30_16.18 (%.9f3) = splice_inst %.loc30_16.17 [template = %.loc30_16.19 (constants.%.fbe)] -// CHECK:STDOUT: %.loc30_16.7: type = type_of_inst %.loc30_16.20 [template = %.loc30_16.21 (constants.%.8fa)] -// CHECK:STDOUT: %.loc30_16.8: @Class.G.loc29.%.loc30_16.21 (%.8fa) = splice_inst %.loc30_16.20 [template = %.loc30_16.22 (constants.%.d64)] -// CHECK:STDOUT: %.loc30_16.9: @Class.G.loc29.%.loc29_40.5 (%.c0c9e0.3) = converted %.loc30_14.2, %.loc30_16.8 [template = %.loc30_16.22 (constants.%.d64)] -// CHECK:STDOUT: %.loc30_16.10: @Class.G.loc29.%.loc29_40.5 (%.c0c9e0.3) = splice_inst %.loc30_16.23 [template = %.loc30_16.24 (constants.%.8a4)] -// CHECK:STDOUT: return %.loc30_16.10 to %return.param +// CHECK:STDOUT: %.loc30_14.1: type = type_of_inst %.loc30_14.3 [template = %.loc30_14.4 (constants.%.237)] +// CHECK:STDOUT: %.loc30_14.2: @Class.G.loc29.%.loc30_14.4 (%.237) = splice_inst %.loc30_14.3 [template = %.loc30_14.5 (constants.%.f96)] +// CHECK:STDOUT: %.loc30_16.1: @Class.G.loc29.%.loc29_40.5 (%.5372ba.4) = splice_inst %tuple.elem0 [template = %.loc30_16.3 (constants.%.5d6323.2)] +// CHECK:STDOUT: return %.loc30_16.1 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -416,11 +359,11 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class.F.loc6(constants.%T) { // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d1c4.1 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d // CHECK:STDOUT: %n.param_patt.loc6_9.2 => constants.%n.param_patt.fb2 // CHECK:STDOUT: %n.patt.loc6_9.2 => constants.%n.patt.955 -// CHECK:STDOUT: %.loc6_17.1 => constants.%.184347.1 -// CHECK:STDOUT: %return.param_patt.loc6_17.2 => constants.%return.param_patt.41d2d9.1 +// CHECK:STDOUT: %.loc6_17.1 => constants.%.184 +// CHECK:STDOUT: %return.param_patt.loc6_17.2 => constants.%return.param_patt.41d // CHECK:STDOUT: %return.patt.loc6_14.2 => constants.%return.patt.b39 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -428,49 +371,49 @@ fn Class(template T: type).G(self) -> T.U { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: %pattern_type.loc7_8 => constants.%pattern_type.36e -// CHECK:STDOUT: %self.param_patt.loc7_8.2 => constants.%self.param_patt.f93 -// CHECK:STDOUT: %self.patt.loc7_8.2 => constants.%self.patt.1dd -// CHECK:STDOUT: %.loc7_17.1 => constants.%.184347.1 -// CHECK:STDOUT: %pattern_type.loc7_17 => constants.%pattern_type.51d1c4.1 -// CHECK:STDOUT: %return.param_patt.loc7_17.2 => constants.%return.param_patt.41d2d9.1 +// CHECK:STDOUT: %self.param_patt.loc7_8.2 => constants.%self.param_patt +// CHECK:STDOUT: %self.patt.loc7_8.2 => constants.%self.patt +// CHECK:STDOUT: %.loc7_17.1 => constants.%.184 +// CHECK:STDOUT: %pattern_type.loc7_17 => constants.%pattern_type.51d +// CHECK:STDOUT: %return.param_patt.loc7_17.2 => constants.%return.param_patt.41d // CHECK:STDOUT: %return.patt.loc7_14.2 => constants.%return.patt.b39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class.F.loc18(constants.%T) { // CHECK:STDOUT: %T.loc18_33 => constants.%T -// CHECK:STDOUT: %.loc18_34.1 => constants.%.3d9 -// CHECK:STDOUT: %.loc18_34.2 => constants.%.cf6 -// CHECK:STDOUT: %.loc18_34.3 => constants.%.2db -// CHECK:STDOUT: %.loc18_34.4 => constants.%.c0f -// CHECK:STDOUT: %.loc18_34.5 => constants.%.2b1 -// CHECK:STDOUT: %pattern_type.loc18_31 => constants.%pattern_type.731 -// CHECK:STDOUT: %n.param_patt.loc18_31.2 => constants.%n.param_patt.b5f -// CHECK:STDOUT: %n.patt.loc18_31.2 => constants.%n.patt.164 -// CHECK:STDOUT: %.loc18_42.1 => constants.%.3d9 -// CHECK:STDOUT: %.loc18_42.2 => constants.%.cf6 -// CHECK:STDOUT: %.loc18_42.3 => constants.%.2db -// CHECK:STDOUT: %.loc18_42.4 => constants.%.c0f -// CHECK:STDOUT: %.loc18_42.5 => constants.%.2b1 -// CHECK:STDOUT: %.loc18_42.6 => constants.%.a5c -// CHECK:STDOUT: %pattern_type.loc18_42 => constants.%pattern_type.731 -// CHECK:STDOUT: %return.param_patt.loc18_42.2 => constants.%return.param_patt.4cd -// CHECK:STDOUT: %return.patt.loc18_38.2 => constants.%return.patt.a02 +// CHECK:STDOUT: %.loc18_34.1 => constants.%.9af +// CHECK:STDOUT: %.loc18_34.2 => constants.%.eff391.3 +// CHECK:STDOUT: %.loc18_34.3 => constants.%.b66113.3 +// CHECK:STDOUT: %.loc18_34.4 => constants.%.c8c +// CHECK:STDOUT: %.loc18_34.5 => constants.%.5372ba.3 +// CHECK:STDOUT: %pattern_type.loc18_31 => constants.%pattern_type.fcb8f3.3 +// CHECK:STDOUT: %n.param_patt.loc18_31.2 => constants.%n.param_patt.110b44.2 +// CHECK:STDOUT: %n.patt.loc18_31.2 => constants.%n.patt.9e3e22.2 +// CHECK:STDOUT: %.loc18_42.1 => constants.%.9af +// CHECK:STDOUT: %.loc18_42.2 => constants.%.eff391.3 +// CHECK:STDOUT: %.loc18_42.3 => constants.%.b66113.3 +// CHECK:STDOUT: %.loc18_42.4 => constants.%.c8c +// CHECK:STDOUT: %.loc18_42.5 => constants.%.5372ba.3 +// CHECK:STDOUT: %.loc18_42.6 => constants.%.cd79f1.2 +// CHECK:STDOUT: %pattern_type.loc18_42 => constants.%pattern_type.fcb8f3.3 +// CHECK:STDOUT: %return.param_patt.loc18_42.2 => constants.%return.param_patt.2e9ac5.2 +// CHECK:STDOUT: %return.patt.loc18_38.2 => constants.%return.patt.7fc6a1.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class.G.loc29(constants.%T) { // CHECK:STDOUT: %T.loc29_30 => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: %pattern_type.loc29_30 => constants.%pattern_type.36e -// CHECK:STDOUT: %self.param_patt.loc29_30.2 => constants.%self.param_patt.f93 -// CHECK:STDOUT: %self.patt.loc29_30.2 => constants.%self.patt.1dd -// CHECK:STDOUT: %.loc29_40.1 => constants.%.3d9 -// CHECK:STDOUT: %.loc29_40.2 => constants.%.cf6 -// CHECK:STDOUT: %.loc29_40.3 => constants.%.2db -// CHECK:STDOUT: %.loc29_40.4 => constants.%.c0f -// CHECK:STDOUT: %.loc29_40.5 => constants.%.2b1 -// CHECK:STDOUT: %.loc29_40.6 => constants.%.a5c -// CHECK:STDOUT: %pattern_type.loc29_40 => constants.%pattern_type.731 -// CHECK:STDOUT: %return.param_patt.loc29_40.2 => constants.%return.param_patt.4cd -// CHECK:STDOUT: %return.patt.loc29_36.2 => constants.%return.patt.a02 +// CHECK:STDOUT: %self.param_patt.loc29_30.2 => constants.%self.param_patt +// CHECK:STDOUT: %self.patt.loc29_30.2 => constants.%self.patt +// CHECK:STDOUT: %.loc29_40.1 => constants.%.9af +// CHECK:STDOUT: %.loc29_40.2 => constants.%.eff391.3 +// CHECK:STDOUT: %.loc29_40.3 => constants.%.b66113.3 +// CHECK:STDOUT: %.loc29_40.4 => constants.%.c8c +// CHECK:STDOUT: %.loc29_40.5 => constants.%.5372ba.3 +// CHECK:STDOUT: %.loc29_40.6 => constants.%.cd79f1.2 +// CHECK:STDOUT: %pattern_type.loc29_40 => constants.%pattern_type.fcb8f3.3 +// CHECK:STDOUT: %return.param_patt.loc29_40.2 => constants.%return.param_patt.2e9ac5.2 +// CHECK:STDOUT: %return.patt.loc29_36.2 => constants.%return.patt.7fc6a1.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/template/operator.carbon b/toolchain/check/testdata/generic/template/operator.carbon index f442bf5ba65e..5e316c1db60f 100644 --- a/toolchain/check/testdata/generic/template/operator.carbon +++ b/toolchain/check/testdata/generic/template/operator.carbon @@ -96,91 +96,53 @@ fn G() { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.944: = require_complete_type %T.67db0b.1 [template] -// CHECK:STDOUT: %.bc7: type = type_of_inst @F.%.loc9_4.4 [template] -// CHECK:STDOUT: %.ec2: %.bc7 = splice_inst @F.%.loc9_4.4 [template] +// CHECK:STDOUT: %.939: type = type_of_inst @F.%.loc9_4.4 [template] +// CHECK:STDOUT: %.fa5: %.939 = splice_inst @F.%.loc9_4.4 [template] // CHECK:STDOUT: %int_456.010: Core.IntLiteral = int_value 456 [concrete] -// CHECK:STDOUT: %require_complete.03f: = require_complete_type %.bc7 [template] -// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] -// CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3aa489.1: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] -// CHECK:STDOUT: %Self.29426c.1: %ImplicitAs.type.3aa489.1 = symbolic_binding Self, 1 [symbolic] -// CHECK:STDOUT: %ImplicitAs.assoc_type.fccd30.1: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.97ed63.1: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Dest, %Self.29426c.1) [symbolic] -// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.9453b4.1: %ImplicitAs.WithSelf.Convert.type.97ed63.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.7b0: type = type_of_inst @F.%.loc9_7.11 [template] -// CHECK:STDOUT: %.8e6: %.7b0 = splice_inst @F.%.loc9_7.11 [template] -// CHECK:STDOUT: %.4fc: type = type_of_inst @F.%.loc9_7.14 [template] -// CHECK:STDOUT: %.9f7: %.4fc = splice_inst @F.%.loc9_7.14 [template] -// CHECK:STDOUT: %.deb: type = type_of_inst @F.%.loc9_7.17 [template] -// CHECK:STDOUT: %.ed6: %.deb = splice_inst @F.%.loc9_7.17 [template] -// CHECK:STDOUT: %.769: type = type_of_inst @F.%.loc9_7.20 [template] -// CHECK:STDOUT: %.51e: %.769 = splice_inst @F.%.loc9_7.20 [template] -// CHECK:STDOUT: %.cbd: %.bc7 = splice_inst @F.%.loc9_7.23 [template] -// CHECK:STDOUT: %.740: %.bc7 = splice_inst @F.%.loc9_4.7 [template] +// CHECK:STDOUT: %require_complete.906: = require_complete_type %.939 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.6a7: %.939 = splice_inst @F.%tuple.elem0 [template] +// CHECK:STDOUT: %.cba: %.939 = splice_inst @F.%.loc9_4.7 [template] // CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] -// CHECK:STDOUT: %ImplicitAs.type.914edc.1: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] -// CHECK:STDOUT: %ImplicitAs.assoc_type.e23: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%i32) [concrete] -// CHECK:STDOUT: %assoc0.368: %ImplicitAs.assoc_type.e23 = assoc_entity element0, imports.%Core.import_ref.cb2 [concrete] -// CHECK:STDOUT: %assoc0.0ac: %ImplicitAs.assoc_type.fccd30.1 = assoc_entity element0, imports.%Core.import_ref.f9d [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.914: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl.0e9(%To) [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.845: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74 = struct_value () [symbolic] // CHECK:STDOUT: %ImplicitAs.impl_witness.a2a: = impl_witness imports.%ImplicitAs.impl_witness_table.1aa, @Core.IntLiteral.as.ImplicitAs.impl.0e9(%int_32) [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.2ba: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl.0e9(%int_32) [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.2ba = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.914edc.1 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.a2a) [concrete] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.914 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.a2a) [concrete] // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8eb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] // CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8eb, %ImplicitAs.facet [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.57149a.1: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %t.param_patt.df1: %pattern_type.98b = ref_param_pattern [concrete] // CHECK:STDOUT: %t.patt.e50: %pattern_type.98b = wrapper_binding_pattern t, %t.param_patt.df1 [concrete] -// CHECK:STDOUT: %inst.splice_block.f32: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.d44: ref %i32 = splice_block %.3d2 { // CHECK:STDOUT: %.b6d: ref %C = specific_inst @F.%t.ref, @F(%C) // CHECK:STDOUT: %x.ref: %C.elem = name_ref x, @C.%field_decl [concrete = @C.%field_decl] // CHECK:STDOUT: %.3d2: ref %i32 = class_element_access %.b6d, element0 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.facet_type: = inst_value [concrete] { -// CHECK:STDOUT: %ImplicitAs.type.914edc.2: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete = %ImplicitAs.type.914edc.1] -// CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.f55: = inst_value [concrete] { -// CHECK:STDOUT: %.a54: %ImplicitAs.assoc_type.e23 = splice_block %Convert.ref [concrete = %assoc0.368] { -// CHECK:STDOUT: %.88d: %ImplicitAs.assoc_type.e23 = specific_constant imports.%Core.import_ref.484, @ImplicitAs.WithSelf(%i32, %Self.29426c.1) [concrete = %assoc0.368] -// CHECK:STDOUT: %Convert.ref: %ImplicitAs.assoc_type.e23 = name_ref Convert, %.88d [concrete = %assoc0.368] -// CHECK:STDOUT: } -// CHECK:STDOUT: } // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.efc: = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] -// CHECK:STDOUT: %inst.splice_block.3b1: = inst_value [concrete] { -// CHECK:STDOUT: %.895: = splice_block %bound_method.6bb [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.efc] { +// CHECK:STDOUT: %bound_method.c5c: = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_456.8dd: %i32 = int_value 456 [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { +// CHECK:STDOUT: %.339: init %i32 = splice_block %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = %int_456.8dd] { // CHECK:STDOUT: %impl.elem0.0e6: %.b7a = impl_witness_access %ImplicitAs.impl_witness.a2a, element0 [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39] // CHECK:STDOUT: %bound_method.6bb: = bound_method %int_456.010, %impl.elem0.0e6 [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.efc] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.0e6, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete = %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.4506: = bound_method %int_456.010, %specific_fn [concrete = %bound_method.c5c] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.4506(%int_456.010) [concrete = %int_456.8dd] // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %bound_method.c5c699.1: = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.57149a.1 [concrete] -// CHECK:STDOUT: %int_456.8dd: %i32 = int_value 456 [concrete] -// CHECK:STDOUT: %inst.splice_block.e9c: = inst_value [concrete] { -// CHECK:STDOUT: %.367: init %i32 = splice_block %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = %int_456.8dd] { -// CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.c5c699.2: = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.57149a.2 [concrete = %bound_method.c5c699.1] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.c5c699.2(%int_456.010) [concrete = %int_456.8dd] -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.b29: = inst_value [concrete] { -// CHECK:STDOUT: %.c5c: init %i32 = splice_block %Int.as.Copy.impl.Op.call [concrete = %int_456.8dd] { -// CHECK:STDOUT: -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.5c8: = inst_value [concrete] { +// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%inst.splice_block.426619.2) [concrete] +// CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { // CHECK:STDOUT: %.30b: ref %i32 = splice_block %.d44 {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.484: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.fccd30.1) = import_ref Core//prelude/operators/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%assoc0 (constants.%assoc0.0ac)] -// CHECK:STDOUT: %Core.import_ref.cb2: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type.97ed63.1) = import_ref Core//prelude/operators/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert.9453b4.1)] -// CHECK:STDOUT: %Core.import_ref.f9d = import_ref Core//prelude/operators/as, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.0e9.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.0e9.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl.0e9 [concrete] // CHECK:STDOUT: } @@ -212,44 +174,24 @@ fn G() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc8: = require_complete_type %T.loc8_16.1 [template = %require_complete.loc8 (constants.%require_complete.944)] // CHECK:STDOUT: %.loc9_4.4: = access_member_action %t.ref, x [template] -// CHECK:STDOUT: %.loc9_4.5: type = type_of_inst %.loc9_4.4 [template = %.loc9_4.5 (constants.%.bc7)] -// CHECK:STDOUT: %.loc9_4.6: @F.%.loc9_4.5 (%.bc7) = splice_inst %.loc9_4.4 [template = %.loc9_4.6 (constants.%.ec2)] -// CHECK:STDOUT: %require_complete.loc9: = require_complete_type %.loc9_4.5 [template = %require_complete.loc9 (constants.%require_complete.03f)] -// CHECK:STDOUT: %.loc9_7.11: = call_action (constants.%ImplicitAs.generic, %.loc9_4.5), false [template] -// CHECK:STDOUT: %.loc9_7.12: type = type_of_inst %.loc9_7.11 [template = %.loc9_7.12 (constants.%.7b0)] -// CHECK:STDOUT: %.loc9_7.13: @F.%.loc9_7.12 (%.7b0) = splice_inst %.loc9_7.11 [template = %.loc9_7.13 (constants.%.8e6)] -// CHECK:STDOUT: %.loc9_7.14: = access_member_action %.loc9_7.2, Convert [template] -// CHECK:STDOUT: %.loc9_7.15: type = type_of_inst %.loc9_7.14 [template = %.loc9_7.15 (constants.%.4fc)] -// CHECK:STDOUT: %.loc9_7.16: @F.%.loc9_7.15 (%.4fc) = splice_inst %.loc9_7.14 [template = %.loc9_7.16 (constants.%.9f7)] -// CHECK:STDOUT: %.loc9_7.17: = compound_member_access_action %int_456, %.loc9_7.4 [template] -// CHECK:STDOUT: %.loc9_7.18: type = type_of_inst %.loc9_7.17 [template = %.loc9_7.18 (constants.%.deb)] -// CHECK:STDOUT: %.loc9_7.19: @F.%.loc9_7.18 (%.deb) = splice_inst %.loc9_7.17 [template = %.loc9_7.19 (constants.%.ed6)] -// CHECK:STDOUT: %.loc9_7.20: = call_action (%.loc9_7.6), true [template] -// CHECK:STDOUT: %.loc9_7.21: type = type_of_inst %.loc9_7.20 [template = %.loc9_7.21 (constants.%.769)] -// CHECK:STDOUT: %.loc9_7.22: @F.%.loc9_7.21 (%.769) = splice_inst %.loc9_7.20 [template = %.loc9_7.22 (constants.%.51e)] -// CHECK:STDOUT: %.loc9_7.23: = convert_to_category_action %.loc9_7.9, element10 [template] -// CHECK:STDOUT: %.loc9_7.24: @F.%.loc9_4.5 (%.bc7) = splice_inst %.loc9_7.23 [template = %.loc9_7.24 (constants.%.cbd)] +// CHECK:STDOUT: %.loc9_4.5: type = type_of_inst %.loc9_4.4 [template = %.loc9_4.5 (constants.%.939)] +// CHECK:STDOUT: %.loc9_4.6: @F.%.loc9_4.5 (%.939) = splice_inst %.loc9_4.4 [template = %.loc9_4.6 (constants.%.fa5)] +// CHECK:STDOUT: %require_complete.loc9: = require_complete_type %.loc9_4.5 [template = %require_complete.loc9 (constants.%require_complete.906)] +// CHECK:STDOUT: %.loc9_7.2: %tuple.type = initialize_action %int_456, %.loc9_4.5, %.loc9_4.2, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc9_7.2, element0 [template] +// CHECK:STDOUT: %.loc9_7.3: @F.%.loc9_4.5 (%.939) = splice_inst %tuple.elem0 [template = %.loc9_7.3 (constants.%.6a7)] // CHECK:STDOUT: %.loc9_4.7: = convert_to_category_action %.loc9_4.2, element9 [template] -// CHECK:STDOUT: %.loc9_4.8: @F.%.loc9_4.5 (%.bc7) = splice_inst %.loc9_4.7 [template = %.loc9_4.8 (constants.%.740)] +// CHECK:STDOUT: %.loc9_4.8: @F.%.loc9_4.5 (%.939) = splice_inst %.loc9_4.7 [template = %.loc9_4.8 (constants.%.cba)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: ref @F.%T.loc8_16.1 (%T.67db0b.1)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %t.ref: ref @F.%T.loc8_16.1 (%T.67db0b.1) = name_ref t, %t -// CHECK:STDOUT: %.loc9_4.1: type = type_of_inst %.loc9_4.4 [template = %.loc9_4.5 (constants.%.bc7)] -// CHECK:STDOUT: %.loc9_4.2: @F.%.loc9_4.5 (%.bc7) = splice_inst %.loc9_4.4 [template = %.loc9_4.6 (constants.%.ec2)] +// CHECK:STDOUT: %.loc9_4.1: type = type_of_inst %.loc9_4.4 [template = %.loc9_4.5 (constants.%.939)] +// CHECK:STDOUT: %.loc9_4.2: @F.%.loc9_4.5 (%.939) = splice_inst %.loc9_4.4 [template = %.loc9_4.6 (constants.%.fa5)] // CHECK:STDOUT: %int_456: Core.IntLiteral = int_value 456 [concrete = constants.%int_456.010] -// CHECK:STDOUT: %.loc9_7.1: type = type_of_inst %.loc9_7.11 [template = %.loc9_7.12 (constants.%.7b0)] -// CHECK:STDOUT: %.loc9_7.2: @F.%.loc9_7.12 (%.7b0) = splice_inst %.loc9_7.11 [template = %.loc9_7.13 (constants.%.8e6)] -// CHECK:STDOUT: %.loc9_7.3: type = type_of_inst %.loc9_7.14 [template = %.loc9_7.15 (constants.%.4fc)] -// CHECK:STDOUT: %.loc9_7.4: @F.%.loc9_7.15 (%.4fc) = splice_inst %.loc9_7.14 [template = %.loc9_7.16 (constants.%.9f7)] -// CHECK:STDOUT: %.loc9_7.5: type = type_of_inst %.loc9_7.17 [template = %.loc9_7.18 (constants.%.deb)] -// CHECK:STDOUT: %.loc9_7.6: @F.%.loc9_7.18 (%.deb) = splice_inst %.loc9_7.17 [template = %.loc9_7.19 (constants.%.ed6)] -// CHECK:STDOUT: %.loc9_7.7: type = type_of_inst %.loc9_7.20 [template = %.loc9_7.21 (constants.%.769)] -// CHECK:STDOUT: %.loc9_7.8: @F.%.loc9_7.21 (%.769) = splice_inst %.loc9_7.20 [template = %.loc9_7.22 (constants.%.51e)] -// CHECK:STDOUT: %.loc9_7.9: @F.%.loc9_4.5 (%.bc7) = converted %int_456, %.loc9_7.8 [template = %.loc9_7.22 (constants.%.51e)] -// CHECK:STDOUT: %.loc9_7.10: @F.%.loc9_4.5 (%.bc7) = splice_inst %.loc9_7.23 [template = %.loc9_7.24 (constants.%.cbd)] -// CHECK:STDOUT: assign %.loc9_4.2, %.loc9_7.10 -// CHECK:STDOUT: %.loc9_4.3: @F.%.loc9_4.5 (%.bc7) = splice_inst %.loc9_4.7 [template = %.loc9_4.8 (constants.%.740)] +// CHECK:STDOUT: %.loc9_7.1: @F.%.loc9_4.5 (%.939) = splice_inst %tuple.elem0 [template = %.loc9_7.3 (constants.%.6a7)] +// CHECK:STDOUT: assign %.loc9_4.2, %.loc9_7.1 +// CHECK:STDOUT: %.loc9_4.3: @F.%.loc9_4.5 (%.939) = splice_inst %.loc9_4.7 [template = %.loc9_4.8 (constants.%.cba)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -271,25 +213,14 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc8 => constants.%complete_type.0c6 -// CHECK:STDOUT: %.loc9_4.4 => constants.%inst.splice_block.f32 +// CHECK:STDOUT: %.loc9_4.4 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc9_4.5 => constants.%i32 // CHECK:STDOUT: %.loc9_4.6 => invalid // CHECK:STDOUT: %require_complete.loc9 => constants.%complete_type.f8a -// CHECK:STDOUT: %.loc9_7.11 => constants.%inst.facet_type -// CHECK:STDOUT: %.loc9_7.12 => type -// CHECK:STDOUT: %.loc9_7.13 => constants.%ImplicitAs.type.914edc.1 -// CHECK:STDOUT: %.loc9_7.14 => constants.%inst.splice_block.f55 -// CHECK:STDOUT: %.loc9_7.15 => constants.%ImplicitAs.assoc_type.e23 -// CHECK:STDOUT: %.loc9_7.16 => constants.%assoc0.368 -// CHECK:STDOUT: %.loc9_7.17 => constants.%inst.splice_block.3b1 -// CHECK:STDOUT: %.loc9_7.18 => -// CHECK:STDOUT: %.loc9_7.19 => constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.efc -// CHECK:STDOUT: %.loc9_7.20 => constants.%inst.splice_block.e9c -// CHECK:STDOUT: %.loc9_7.21 => constants.%i32 -// CHECK:STDOUT: %.loc9_7.22 => constants.%int_456.8dd -// CHECK:STDOUT: %.loc9_7.23 => constants.%inst.splice_block.b29 -// CHECK:STDOUT: %.loc9_7.24 => constants.%int_456.8dd -// CHECK:STDOUT: %.loc9_4.7 => constants.%inst.splice_block.5c8 +// CHECK:STDOUT: %.loc9_7.2 => constants.%tuple +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block.426619.2 +// CHECK:STDOUT: %.loc9_7.3 => constants.%int_456.8dd +// CHECK:STDOUT: %.loc9_4.7 => constants.%inst.splice_block.426619.3 // CHECK:STDOUT: %.loc9_4.8 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/template/template_access_assoc_const.carbon b/toolchain/check/testdata/generic/template/template_access_assoc_const.carbon index 051b46621d7e..3e892e1fe866 100644 --- a/toolchain/check/testdata/generic/template/template_access_assoc_const.carbon +++ b/toolchain/check/testdata/generic/template/template_access_assoc_const.carbon @@ -34,23 +34,23 @@ interface I(template T: type, N: T.I1) { // CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete] // CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template] // CHECK:STDOUT: %T: type = symbolic_binding T, 0, template [template] -// CHECK:STDOUT: %.79c: type = type_of_inst @I.%.loc16_35.1 [template] -// CHECK:STDOUT: %.e63: %.79c = splice_inst @I.%.loc16_35.1 [template] -// CHECK:STDOUT: %.c96: type = splice_inst @I.%.loc16_35.4 [template] -// CHECK:STDOUT: %pattern_type.9f6: type = pattern_type %.c96 [template] -// CHECK:STDOUT: %N.patt.b37: %pattern_type.9f6 = symbolic_binding_pattern N, 1 [template] -// CHECK:STDOUT: %N: %.c96 = symbolic_binding N, 1 [template] -// CHECK:STDOUT: %.299: = access_member_action %T, I1 [template] -// CHECK:STDOUT: %.912: type = type_of_inst %.299 [template] -// CHECK:STDOUT: %.a7e: %.912 = splice_inst %.299 [template] -// CHECK:STDOUT: %.2f4: = convert_to_value_action %.a7e, type [template] -// CHECK:STDOUT: %.2ad: type = splice_inst %.2f4 [template] -// CHECK:STDOUT: %pattern_type.11c: type = pattern_type %.2ad [template] -// CHECK:STDOUT: %N.patt.0f4: %pattern_type.11c = symbolic_binding_pattern N, 1 [template] +// CHECK:STDOUT: %.c8bd56.1: type = type_of_inst @I.%.loc16_35.1 [template] +// CHECK:STDOUT: %.af5dbc.1: %.c8bd56.1 = splice_inst @I.%.loc16_35.1 [template] +// CHECK:STDOUT: %.5372ba.1: type = splice_inst @I.%.loc16_35.4 [template] +// CHECK:STDOUT: %pattern_type.fcb8f3.1: type = pattern_type %.5372ba.1 [template] +// CHECK:STDOUT: %N.patt.52ad3a.1: %pattern_type.fcb8f3.1 = symbolic_binding_pattern N, 1 [template] +// CHECK:STDOUT: %N: %.5372ba.1 = symbolic_binding N, 1 [template] +// CHECK:STDOUT: %.528: = access_member_action %T, I1 [template] +// CHECK:STDOUT: %.c8bd56.2: type = type_of_inst %.528 [template] +// CHECK:STDOUT: %.af5dbc.2: %.c8bd56.2 = splice_inst %.528 [template] +// CHECK:STDOUT: %.c8c: = convert_to_value_action %.af5dbc.2, type [template] +// CHECK:STDOUT: %.5372ba.2: type = splice_inst %.c8c [template] +// CHECK:STDOUT: %pattern_type.fcb8f3.2: type = pattern_type %.5372ba.2 [template] +// CHECK:STDOUT: %N.patt.52ad3a.2: %pattern_type.fcb8f3.2 = symbolic_binding_pattern N, 1 [template] // CHECK:STDOUT: %I.type.335: type = generic_interface_type @I [concrete] // CHECK:STDOUT: %I.generic: %I.type.335 = struct_value () [concrete] -// CHECK:STDOUT: %I.type.c6a: type = facet_type <@I, @I(%T, %N)> [template] -// CHECK:STDOUT: %Self: %I.type.c6a = symbolic_binding Self, 2 [template] +// CHECK:STDOUT: %I.type.32e: type = facet_type <@I, @I(%T, %N)> [template] +// CHECK:STDOUT: %Self: %I.type.32e = symbolic_binding Self, 2 [template] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I, @I(%T, %N) [template] // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%I1 [template] // CHECK:STDOUT: } @@ -58,42 +58,42 @@ interface I(template T: type, N: T.I1) { // CHECK:STDOUT: file { // CHECK:STDOUT: %I.decl: %I.type.335 = interface_decl @I [concrete = constants.%I.generic] { // CHECK:STDOUT: %T.patt.loc16_23.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc16_23.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc16_32.1: @I.%pattern_type (%pattern_type.9f6) = symbolic_binding_pattern N, 1 [template = %N.patt.loc16_32.2 (constants.%N.patt.b37)] +// CHECK:STDOUT: %N.patt.loc16_32.1: @I.%pattern_type (%pattern_type.fcb8f3.1) = symbolic_binding_pattern N, 1 [template = %N.patt.loc16_32.2 (constants.%N.patt.52ad3a.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc16_25.1: type = splice_block %.loc16_25.2 [concrete = type] { // CHECK:STDOUT: %.Self.frozen.loc16_23: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] // CHECK:STDOUT: %.loc16_25.2: type = type_literal type [concrete = type] // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc16_23.2: type = symbolic_binding T, 0, template [template = %T.loc16_23.1 (constants.%T)] -// CHECK:STDOUT: %.loc16_35.6: type = splice_block %.loc16_35.9 [template = %.loc16_35.5 (constants.%.c96)] { +// CHECK:STDOUT: %.loc16_35.6: type = splice_block %.loc16_35.9 [template = %.loc16_35.5 (constants.%.5372ba.1)] { // CHECK:STDOUT: %.Self.frozen.loc16_32: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc16_23.2 [template = %T.loc16_23.1 (constants.%T)] -// CHECK:STDOUT: %.loc16_35.7: type = type_of_inst %.loc16_35.1 [template = %.loc16_35.2 (constants.%.79c)] -// CHECK:STDOUT: %.loc16_35.8: @I.%.loc16_35.2 (%.79c) = splice_inst %.loc16_35.1 [template = %.loc16_35.3 (constants.%.e63)] -// CHECK:STDOUT: %.loc16_35.9: type = splice_inst %.loc16_35.4 [template = %.loc16_35.5 (constants.%.c96)] +// CHECK:STDOUT: %.loc16_35.7: type = type_of_inst %.loc16_35.1 [template = %.loc16_35.2 (constants.%.c8bd56.1)] +// CHECK:STDOUT: %.loc16_35.8: @I.%.loc16_35.2 (%.c8bd56.1) = splice_inst %.loc16_35.1 [template = %.loc16_35.3 (constants.%.af5dbc.1)] +// CHECK:STDOUT: %.loc16_35.9: type = splice_inst %.loc16_35.4 [template = %.loc16_35.5 (constants.%.5372ba.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc16_32.2: @I.%.loc16_35.5 (%.c96) = symbolic_binding N, 1 [template = %N.loc16_32.1 (constants.%N)] +// CHECK:STDOUT: %N.loc16_32.2: @I.%.loc16_35.5 (%.5372ba.1) = symbolic_binding N, 1 [template = %N.loc16_32.1 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @I(%T.loc16_23.2: type, %N.loc16_32.2: @I.%.loc16_35.5 (%.c96)) { +// CHECK:STDOUT: generic interface @I(%T.loc16_23.2: type, %N.loc16_32.2: @I.%.loc16_35.5 (%.5372ba.1)) { // CHECK:STDOUT: %T.patt.loc16_23.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc16_23.2 (constants.%T.patt)] // CHECK:STDOUT: %T.loc16_23.1: type = symbolic_binding T, 0, template [template = %T.loc16_23.1 (constants.%T)] // CHECK:STDOUT: %.loc16_35.1: = access_member_action %T.ref, I1 [template] -// CHECK:STDOUT: %.loc16_35.2: type = type_of_inst %.loc16_35.1 [template = %.loc16_35.2 (constants.%.79c)] -// CHECK:STDOUT: %.loc16_35.3: @I.%.loc16_35.2 (%.79c) = splice_inst %.loc16_35.1 [template = %.loc16_35.3 (constants.%.e63)] +// CHECK:STDOUT: %.loc16_35.2: type = type_of_inst %.loc16_35.1 [template = %.loc16_35.2 (constants.%.c8bd56.1)] +// CHECK:STDOUT: %.loc16_35.3: @I.%.loc16_35.2 (%.c8bd56.1) = splice_inst %.loc16_35.1 [template = %.loc16_35.3 (constants.%.af5dbc.1)] // CHECK:STDOUT: %.loc16_35.4: = convert_to_value_action %.loc16_35.8, type [template] -// CHECK:STDOUT: %.loc16_35.5: type = splice_inst %.loc16_35.4 [template = %.loc16_35.5 (constants.%.c96)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %.loc16_35.5 [template = %pattern_type (constants.%pattern_type.9f6)] -// CHECK:STDOUT: %N.patt.loc16_32.2: @I.%pattern_type (%pattern_type.9f6) = symbolic_binding_pattern N, 1 [template = %N.patt.loc16_32.2 (constants.%N.patt.b37)] -// CHECK:STDOUT: %N.loc16_32.1: @I.%.loc16_35.5 (%.c96) = symbolic_binding N, 1 [template = %N.loc16_32.1 (constants.%N)] +// CHECK:STDOUT: %.loc16_35.5: type = splice_inst %.loc16_35.4 [template = %.loc16_35.5 (constants.%.5372ba.1)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %.loc16_35.5 [template = %pattern_type (constants.%pattern_type.fcb8f3.1)] +// CHECK:STDOUT: %N.patt.loc16_32.2: @I.%pattern_type (%pattern_type.fcb8f3.1) = symbolic_binding_pattern N, 1 [template = %N.patt.loc16_32.2 (constants.%N.patt.52ad3a.1)] +// CHECK:STDOUT: %N.loc16_32.1: @I.%.loc16_35.5 (%.5372ba.1) = symbolic_binding N, 1 [template = %N.loc16_32.1 (constants.%N)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T.loc16_23.1, %N.loc16_32.1)> [template = %I.type (constants.%I.type.c6a)] -// CHECK:STDOUT: %Self.loc16_40.2: @I.%I.type (%I.type.c6a) = symbolic_binding Self, 2 [template = %Self.loc16_40.2 (constants.%Self)] +// CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T.loc16_23.1, %N.loc16_32.1)> [template = %I.type (constants.%I.type.32e)] +// CHECK:STDOUT: %Self.loc16_40.2: @I.%I.type (%I.type.32e) = symbolic_binding Self, 2 [template = %Self.loc16_40.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.loc16_40.1: @I.%I.type (%I.type.c6a) = symbolic_binding Self, 2 [template = %Self.loc16_40.2 (constants.%Self)] +// CHECK:STDOUT: %Self.loc16_40.1: @I.%I.type (%I.type.32e) = symbolic_binding Self, 2 [template = %Self.loc16_40.2 (constants.%Self)] // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete] // CHECK:STDOUT: // CHECK:STDOUT: !with Self: @@ -113,13 +113,13 @@ interface I(template T: type, N: T.I1) { // CHECK:STDOUT: specific @I(constants.%T, constants.%N) { // CHECK:STDOUT: %T.patt.loc16_23.2 => constants.%T.patt // CHECK:STDOUT: %T.loc16_23.1 => constants.%T -// CHECK:STDOUT: %.loc16_35.1 => constants.%.299 -// CHECK:STDOUT: %.loc16_35.2 => constants.%.912 -// CHECK:STDOUT: %.loc16_35.3 => constants.%.a7e -// CHECK:STDOUT: %.loc16_35.4 => constants.%.2f4 -// CHECK:STDOUT: %.loc16_35.5 => constants.%.2ad -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.11c -// CHECK:STDOUT: %N.patt.loc16_32.2 => constants.%N.patt.0f4 +// CHECK:STDOUT: %.loc16_35.1 => constants.%.528 +// CHECK:STDOUT: %.loc16_35.2 => constants.%.c8bd56.2 +// CHECK:STDOUT: %.loc16_35.3 => constants.%.af5dbc.2 +// CHECK:STDOUT: %.loc16_35.4 => constants.%.c8c +// CHECK:STDOUT: %.loc16_35.5 => constants.%.5372ba.2 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.fcb8f3.2 +// CHECK:STDOUT: %N.patt.loc16_32.2 => constants.%N.patt.52ad3a.2 // CHECK:STDOUT: %N.loc16_32.1 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/template/unimplemented.carbon b/toolchain/check/testdata/generic/template/unimplemented.carbon index 6a80cb2b66e1..17bfcbc41396 100644 --- a/toolchain/check/testdata/generic/template/unimplemented.carbon +++ b/toolchain/check/testdata/generic/template/unimplemented.carbon @@ -59,10 +59,10 @@ fn F(template c: C) { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.944: = require_complete_type %T [template] -// CHECK:STDOUT: %.7f2: type = type_of_inst @F.%.loc11_5.4 [template] -// CHECK:STDOUT: %.c64: %.7f2 = splice_inst @F.%.loc11_5.4 [template] -// CHECK:STDOUT: %require_complete.8cc: = require_complete_type %.7f2 [template] -// CHECK:STDOUT: %.0fe: %.7f2 = splice_inst @F.%.loc11_5.7 [template] +// CHECK:STDOUT: %.237: type = type_of_inst @F.%.loc11_5.4 [template] +// CHECK:STDOUT: %.f96: %.237 = splice_inst @F.%.loc11_5.4 [template] +// CHECK:STDOUT: %require_complete.b43: = require_complete_type %.237 [template] +// CHECK:STDOUT: %.fb1: %.237 = splice_inst @F.%.loc11_5.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -104,18 +104,18 @@ fn F(template c: C) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc6: = require_complete_type %T.loc6_16.1 [template = %require_complete.loc6 (constants.%require_complete.944)] // CHECK:STDOUT: %.loc11_5.4: = access_member_action %x.ref, n [template] -// CHECK:STDOUT: %.loc11_5.5: type = type_of_inst %.loc11_5.4 [template = %.loc11_5.5 (constants.%.7f2)] -// CHECK:STDOUT: %.loc11_5.6: @F.%.loc11_5.5 (%.7f2) = splice_inst %.loc11_5.4 [template = %.loc11_5.6 (constants.%.c64)] -// CHECK:STDOUT: %require_complete.loc11: = require_complete_type %.loc11_5.5 [template = %require_complete.loc11 (constants.%require_complete.8cc)] +// CHECK:STDOUT: %.loc11_5.5: type = type_of_inst %.loc11_5.4 [template = %.loc11_5.5 (constants.%.237)] +// CHECK:STDOUT: %.loc11_5.6: @F.%.loc11_5.5 (%.237) = splice_inst %.loc11_5.4 [template = %.loc11_5.6 (constants.%.f96)] +// CHECK:STDOUT: %require_complete.loc11: = require_complete_type %.loc11_5.5 [template = %require_complete.loc11 (constants.%require_complete.b43)] // CHECK:STDOUT: %.loc11_5.7: = convert_to_category_action %.loc11_5.2, element1 [template] -// CHECK:STDOUT: %.loc11_5.8: @F.%.loc11_5.5 (%.7f2) = splice_inst %.loc11_5.7 [template = %.loc11_5.8 (constants.%.0fe)] +// CHECK:STDOUT: %.loc11_5.8: @F.%.loc11_5.5 (%.237) = splice_inst %.loc11_5.7 [template = %.loc11_5.8 (constants.%.fb1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%T.loc6_16.1 (%T)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @F.%T.loc6_16.1 (%T) = name_ref x, %x -// CHECK:STDOUT: %.loc11_5.1: type = type_of_inst %.loc11_5.4 [template = %.loc11_5.5 (constants.%.7f2)] -// CHECK:STDOUT: %.loc11_5.2: @F.%.loc11_5.5 (%.7f2) = splice_inst %.loc11_5.4 [template = %.loc11_5.6 (constants.%.c64)] -// CHECK:STDOUT: %.loc11_5.3: @F.%.loc11_5.5 (%.7f2) = splice_inst %.loc11_5.7 [template = %.loc11_5.8 (constants.%.0fe)] +// CHECK:STDOUT: %.loc11_5.1: type = type_of_inst %.loc11_5.4 [template = %.loc11_5.5 (constants.%.237)] +// CHECK:STDOUT: %.loc11_5.2: @F.%.loc11_5.5 (%.237) = splice_inst %.loc11_5.4 [template = %.loc11_5.6 (constants.%.f96)] +// CHECK:STDOUT: %.loc11_5.3: @F.%.loc11_5.5 (%.237) = splice_inst %.loc11_5.7 [template = %.loc11_5.8 (constants.%.fb1)] // CHECK:STDOUT: %.loc11_3: ref = deref %.loc11_5.3 [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -147,10 +147,10 @@ fn F(template c: C) { // CHECK:STDOUT: %c: %C = symbolic_binding c, 0, template [template] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %.daf: type = type_of_inst @F.%.loc16_5.4 [template] -// CHECK:STDOUT: %.26f: %.daf = splice_inst @F.%.loc16_5.4 [template] -// CHECK:STDOUT: %require_complete.519: = require_complete_type %.daf [template] -// CHECK:STDOUT: %.2d8: %.daf = splice_inst @F.%.loc16_5.7 [template] +// CHECK:STDOUT: %.237: type = type_of_inst @F.%.loc16_5.4 [template] +// CHECK:STDOUT: %.f96: %.237 = splice_inst @F.%.loc16_5.4 [template] +// CHECK:STDOUT: %require_complete.b43: = require_complete_type %.237 [template] +// CHECK:STDOUT: %.fb1: %.237 = splice_inst @F.%.loc16_5.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -199,18 +199,18 @@ fn F(template c: C) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc16_5.4: = access_member_action %c.ref, n [template] -// CHECK:STDOUT: %.loc16_5.5: type = type_of_inst %.loc16_5.4 [template = %.loc16_5.5 (constants.%.daf)] -// CHECK:STDOUT: %.loc16_5.6: @F.%.loc16_5.5 (%.daf) = splice_inst %.loc16_5.4 [template = %.loc16_5.6 (constants.%.26f)] -// CHECK:STDOUT: %require_complete: = require_complete_type %.loc16_5.5 [template = %require_complete (constants.%require_complete.519)] +// CHECK:STDOUT: %.loc16_5.5: type = type_of_inst %.loc16_5.4 [template = %.loc16_5.5 (constants.%.237)] +// CHECK:STDOUT: %.loc16_5.6: @F.%.loc16_5.5 (%.237) = splice_inst %.loc16_5.4 [template = %.loc16_5.6 (constants.%.f96)] +// CHECK:STDOUT: %require_complete: = require_complete_type %.loc16_5.5 [template = %require_complete (constants.%require_complete.b43)] // CHECK:STDOUT: %.loc16_5.7: = convert_to_category_action %.loc16_5.2, element1 [template] -// CHECK:STDOUT: %.loc16_5.8: @F.%.loc16_5.5 (%.daf) = splice_inst %.loc16_5.7 [template = %.loc16_5.8 (constants.%.2d8)] +// CHECK:STDOUT: %.loc16_5.8: @F.%.loc16_5.5 (%.237) = splice_inst %.loc16_5.7 [template = %.loc16_5.8 (constants.%.fb1)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c.loc11_16.2 [template = %c.loc11_16.1 (constants.%c)] -// CHECK:STDOUT: %.loc16_5.1: type = type_of_inst %.loc16_5.4 [template = %.loc16_5.5 (constants.%.daf)] -// CHECK:STDOUT: %.loc16_5.2: @F.%.loc16_5.5 (%.daf) = splice_inst %.loc16_5.4 [template = %.loc16_5.6 (constants.%.26f)] -// CHECK:STDOUT: %.loc16_5.3: @F.%.loc16_5.5 (%.daf) = splice_inst %.loc16_5.7 [template = %.loc16_5.8 (constants.%.2d8)] +// CHECK:STDOUT: %.loc16_5.1: type = type_of_inst %.loc16_5.4 [template = %.loc16_5.5 (constants.%.237)] +// CHECK:STDOUT: %.loc16_5.2: @F.%.loc16_5.5 (%.237) = splice_inst %.loc16_5.4 [template = %.loc16_5.6 (constants.%.f96)] +// CHECK:STDOUT: %.loc16_5.3: @F.%.loc16_5.5 (%.237) = splice_inst %.loc16_5.7 [template = %.loc16_5.8 (constants.%.fb1)] // CHECK:STDOUT: %.loc16_3: ref = deref %.loc16_5.3 [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/class/import/template.carbon b/toolchain/check/testdata/interop/cpp/class/import/template.carbon index 4fd54af9578b..eabfad9f5591 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/template.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/template.carbon @@ -346,11 +346,11 @@ fn G() { // CHECK:STDOUT: %.a92: type = template_inst %T [template] // CHECK:STDOUT: %.32d: type = type_of_inst @B.%.loc12_17.4 [template] // CHECK:STDOUT: %.8af: %.32d = splice_inst @B.%.loc12_17.4 [template] -// CHECK:STDOUT: %.d15: type = splice_inst @B.%.loc12_17.7 [template] -// CHECK:STDOUT: %require_complete.f74: = require_complete_type %.d15 [template] -// CHECK:STDOUT: %B.elem.d56: type = unbound_element_type %B.60e, %.d15 [template] -// CHECK:STDOUT: %struct_type.a.a60: type = struct_type {.a: %.d15} [template] -// CHECK:STDOUT: %complete_type.082: = complete_type_witness %struct_type.a.a60 [template] +// CHECK:STDOUT: %.537: type = splice_inst @B.%.loc12_17.7 [template] +// CHECK:STDOUT: %require_complete.cb0: = require_complete_type %.537 [template] +// CHECK:STDOUT: %B.elem.301: type = unbound_element_type %B.60e, %.537 [template] +// CHECK:STDOUT: %struct_type.a.df5: type = struct_type {.a: %.537} [template] +// CHECK:STDOUT: %complete_type.e6d: = complete_type_witness %struct_type.a.df5 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %B.bd8: type = class_type @B, @B(%i32) [concrete] @@ -360,10 +360,10 @@ fn G() { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %A: type = class_type @A [concrete] -// CHECK:STDOUT: %inst.splice_block.72d: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.22e: type = splice_block imports.%A.decl [concrete = %A] {} // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.c26: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { // CHECK:STDOUT: %.4e4: type = splice_block %A [concrete = %A] {} // CHECK:STDOUT: } // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [concrete] @@ -434,24 +434,24 @@ fn G() { // CHECK:STDOUT: %.loc12_17.5: type = type_of_inst %.loc12_17.4 [template = %.loc12_17.5 (constants.%.32d)] // CHECK:STDOUT: %.loc12_17.6: @B.%.loc12_17.5 (%.32d) = splice_inst %.loc12_17.4 [template = %.loc12_17.6 (constants.%.8af)] // CHECK:STDOUT: %.loc12_17.7: = convert_to_value_action %.loc12_17.2, type [template] -// CHECK:STDOUT: %.loc12_17.8: type = splice_inst %.loc12_17.7 [template = %.loc12_17.8 (constants.%.d15)] -// CHECK:STDOUT: %require_complete: = require_complete_type %.loc12_17.8 [template = %require_complete (constants.%require_complete.f74)] +// CHECK:STDOUT: %.loc12_17.8: type = splice_inst %.loc12_17.7 [template = %.loc12_17.8 (constants.%.537)] +// CHECK:STDOUT: %require_complete: = require_complete_type %.loc12_17.8 [template = %require_complete (constants.%require_complete.cb0)] // CHECK:STDOUT: %B: type = class_type @B, @B(%T.loc11_10.1) [symbolic = %B (constants.%B.60e)] -// CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %.loc12_17.8 [template = %B.elem (constants.%B.elem.d56)] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: @B.%.loc12_17.8 (%.d15)} [template = %struct_type.a (constants.%struct_type.a.a60)] -// CHECK:STDOUT: %complete_type.loc13_1.2: = complete_type_witness %struct_type.a [template = %complete_type.loc13_1.2 (constants.%complete_type.082)] +// CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %.loc12_17.8 [template = %B.elem (constants.%B.elem.301)] +// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: @B.%.loc12_17.8 (%.537)} [template = %struct_type.a (constants.%struct_type.a.df5)] +// CHECK:STDOUT: %complete_type.loc13_1.2: = complete_type_witness %struct_type.a [template = %complete_type.loc13_1.2 (constants.%complete_type.e6d)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %field_decl: @B.%B.elem (%B.elem.d56) = field_decl a, element0, %.loc12_17.3 in [concrete] { +// CHECK:STDOUT: %field_decl: @B.%B.elem (%B.elem.301) = field_decl a, element0, %.loc12_17.3 in [concrete] { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%A.template [concrete = constants.%A.template] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_10.2 [symbolic = %T.loc11_10.1 (constants.%T)] // CHECK:STDOUT: %.loc12_16.1: type = template_inst %T.ref [template = %.loc12_16.2 (constants.%.a92)] // CHECK:STDOUT: %.loc12_17.1: type = type_of_inst %.loc12_17.4 [template = %.loc12_17.5 (constants.%.32d)] // CHECK:STDOUT: %.loc12_17.2: @B.%.loc12_17.5 (%.32d) = splice_inst %.loc12_17.4 [template = %.loc12_17.6 (constants.%.8af)] -// CHECK:STDOUT: %.loc12_17.3: type = splice_inst %.loc12_17.7 [template = %.loc12_17.8 (constants.%.d15)] +// CHECK:STDOUT: %.loc12_17.3: type = splice_inst %.loc12_17.7 [template = %.loc12_17.8 (constants.%.537)] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type.loc13_1.1: = complete_type_witness constants.%struct_type.a.a60 [template = %complete_type.loc13_1.2 (constants.%complete_type.082)] +// CHECK:STDOUT: %complete_type.loc13_1.1: = complete_type_witness constants.%struct_type.a.df5 [template = %complete_type.loc13_1.2 (constants.%complete_type.e6d)] // CHECK:STDOUT: complete_type_witness = %complete_type.loc13_1.1 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -490,10 +490,10 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc12_16.2 => constants.%i32 -// CHECK:STDOUT: %.loc12_17.4 => constants.%inst.splice_block.72d +// CHECK:STDOUT: %.loc12_17.4 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc12_17.5 => type // CHECK:STDOUT: %.loc12_17.6 => constants.%A -// CHECK:STDOUT: %.loc12_17.7 => constants.%inst.splice_block.c26 +// CHECK:STDOUT: %.loc12_17.7 => constants.%inst.splice_block.426619.2 // CHECK:STDOUT: %.loc12_17.8 => constants.%A // CHECK:STDOUT: %require_complete => constants.%complete_type.ece // CHECK:STDOUT: %B => constants.%B.bd8 @@ -518,34 +518,34 @@ fn G() { // CHECK:STDOUT: %.a92: type = template_inst %T [template] // CHECK:STDOUT: %.32dd98.1: type = type_of_inst @F.%.loc10_24.5 [template] // CHECK:STDOUT: %.8af9c5.1: %.32dd98.1 = splice_inst @F.%.loc10_24.5 [template] -// CHECK:STDOUT: %.d15: type = splice_inst @F.%.loc10_24.8 [template] -// CHECK:STDOUT: %require_complete.f74: = require_complete_type %.d15 [template] -// CHECK:STDOUT: %pattern_type.3c1: type = pattern_type %.d15 [template] -// CHECK:STDOUT: %a.patt.100: %pattern_type.3c1 = value_binding_pattern a [template] +// CHECK:STDOUT: %.537: type = splice_inst @F.%.loc10_24.8 [template] +// CHECK:STDOUT: %require_complete.cb0: = require_complete_type %.537 [template] +// CHECK:STDOUT: %pattern_type.fcb: type = pattern_type %.537 [template] +// CHECK:STDOUT: %a.patt.d9b: %pattern_type.fcb = value_binding_pattern a [template] // CHECK:STDOUT: %.32dd98.2: type = type_of_inst @F.%.loc10_35.3 [template] // CHECK:STDOUT: %.8af9c5.2: %.32dd98.2 = splice_inst @F.%.loc10_35.3 [template] -// CHECK:STDOUT: %.e8f: type = type_of_inst @F.%.loc10_36.3 [template] -// CHECK:STDOUT: %.c84: %.e8f = splice_inst @F.%.loc10_36.3 [template] -// CHECK:STDOUT: %.08a: type = type_of_inst @F.%.loc10_39.4 [template] -// CHECK:STDOUT: %.47d: %.08a = splice_inst @F.%.loc10_39.4 [template] -// CHECK:STDOUT: %.74a: %.d15 = splice_inst @F.%.loc10_39.7 [template] +// CHECK:STDOUT: %.fdd: type = type_of_inst @F.%.loc10_36.3 [template] +// CHECK:STDOUT: %.598: %.fdd = splice_inst @F.%.loc10_36.3 [template] +// CHECK:STDOUT: %.e81: type = type_of_inst @F.%.loc10_39.4 [template] +// CHECK:STDOUT: %.949: %.e81 = splice_inst @F.%.loc10_39.4 [template] +// CHECK:STDOUT: %.739: %.537 = splice_inst @F.%.loc10_39.7 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%i32) [concrete] // CHECK:STDOUT: %A: type = class_type @A [concrete] -// CHECK:STDOUT: %inst.splice_block.72dff3.1: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.22ed96.1: type = splice_block imports.%A.decl [concrete = %A] {} // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.c26: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { // CHECK:STDOUT: %.4e4: type = splice_block %A [concrete = %A] {} // CHECK:STDOUT: } // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.b78: type = pattern_type %A [concrete] // CHECK:STDOUT: %a.patt.117: %pattern_type.b78 = value_binding_pattern a [concrete] -// CHECK:STDOUT: %inst.splice_block.72dff3.2: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { // CHECK:STDOUT: %.22ed96.2: type = splice_block imports.%A.decl [concrete = %A] {} // CHECK:STDOUT: } // CHECK:STDOUT: %A.A.cpp_overload_set.type: type = cpp_overload_set_type @A.A.cpp_overload_set [concrete] @@ -556,7 +556,7 @@ fn G() { // CHECK:STDOUT: %ptr.303: type = ptr_type %A [concrete] // CHECK:STDOUT: %A__carbon_thunk.type: type = fn_type @A__carbon_thunk [concrete] // CHECK:STDOUT: %A__carbon_thunk: %A__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %inst.splice_block.76c: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.4: = inst_value [concrete] { // CHECK:STDOUT: %.78f: init %A = splice_block %.38d { // CHECK:STDOUT: %.3a8: ref %A = temporary_storage // CHECK:STDOUT: %addr: %ptr.303 = addr_of %.3a8 @@ -564,7 +564,7 @@ fn G() { // CHECK:STDOUT: %.38d: init %A to %.3a8 = mark_in_place_init %A__carbon_thunk.call // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.b90: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.5: = inst_value [concrete] { // CHECK:STDOUT: %.114: %A = splice_block %.f4b { // CHECK:STDOUT: %.146: ref %A = temporary %.3a8, %.78f // CHECK:STDOUT: %.f4b: %A = acquire_value %.146 @@ -610,21 +610,21 @@ fn G() { // CHECK:STDOUT: %.loc10_24.6: type = type_of_inst %.loc10_24.5 [template = %.loc10_24.6 (constants.%.32dd98.1)] // CHECK:STDOUT: %.loc10_24.7: @F.%.loc10_24.6 (%.32dd98.1) = splice_inst %.loc10_24.5 [template = %.loc10_24.7 (constants.%.8af9c5.1)] // CHECK:STDOUT: %.loc10_24.8: = convert_to_value_action %.loc10_24.3, type [template] -// CHECK:STDOUT: %.loc10_24.9: type = splice_inst %.loc10_24.8 [template = %.loc10_24.9 (constants.%.d15)] -// CHECK:STDOUT: %require_complete: = require_complete_type %.loc10_24.9 [template = %require_complete (constants.%require_complete.f74)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %.loc10_24.9 [template = %pattern_type (constants.%pattern_type.3c1)] -// CHECK:STDOUT: %a.patt.loc10_15.2: @F.%pattern_type (%pattern_type.3c1) = value_binding_pattern a [template = %a.patt.loc10_15.2 (constants.%a.patt.100)] +// CHECK:STDOUT: %.loc10_24.9: type = splice_inst %.loc10_24.8 [template = %.loc10_24.9 (constants.%.537)] +// CHECK:STDOUT: %require_complete: = require_complete_type %.loc10_24.9 [template = %require_complete (constants.%require_complete.cb0)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %.loc10_24.9 [template = %pattern_type (constants.%pattern_type.fcb)] +// CHECK:STDOUT: %a.patt.loc10_15.2: @F.%pattern_type (%pattern_type.fcb) = value_binding_pattern a [template = %a.patt.loc10_15.2 (constants.%a.patt.d9b)] // CHECK:STDOUT: %.loc10_35.3: = call_action (%A.ref.loc10_31, %.loc10_34), false [template] // CHECK:STDOUT: %.loc10_35.4: type = type_of_inst %.loc10_35.3 [template = %.loc10_35.4 (constants.%.32dd98.2)] // CHECK:STDOUT: %.loc10_35.5: @F.%.loc10_35.4 (%.32dd98.2) = splice_inst %.loc10_35.3 [template = %.loc10_35.5 (constants.%.8af9c5.2)] // CHECK:STDOUT: %.loc10_36.3: = access_member_action %.loc10_35.2, A [template] -// CHECK:STDOUT: %.loc10_36.4: type = type_of_inst %.loc10_36.3 [template = %.loc10_36.4 (constants.%.e8f)] -// CHECK:STDOUT: %.loc10_36.5: @F.%.loc10_36.4 (%.e8f) = splice_inst %.loc10_36.3 [template = %.loc10_36.5 (constants.%.c84)] +// CHECK:STDOUT: %.loc10_36.4: type = type_of_inst %.loc10_36.3 [template = %.loc10_36.4 (constants.%.fdd)] +// CHECK:STDOUT: %.loc10_36.5: @F.%.loc10_36.4 (%.fdd) = splice_inst %.loc10_36.3 [template = %.loc10_36.5 (constants.%.598)] // CHECK:STDOUT: %.loc10_39.4: = call_action (%.loc10_36.2), false [template] -// CHECK:STDOUT: %.loc10_39.5: type = type_of_inst %.loc10_39.4 [template = %.loc10_39.5 (constants.%.08a)] -// CHECK:STDOUT: %.loc10_39.6: @F.%.loc10_39.5 (%.08a) = splice_inst %.loc10_39.4 [template = %.loc10_39.6 (constants.%.47d)] +// CHECK:STDOUT: %.loc10_39.5: type = type_of_inst %.loc10_39.4 [template = %.loc10_39.5 (constants.%.e81)] +// CHECK:STDOUT: %.loc10_39.6: @F.%.loc10_39.5 (%.e81) = splice_inst %.loc10_39.4 [template = %.loc10_39.6 (constants.%.949)] // CHECK:STDOUT: %.loc10_39.7: = convert_to_value_action %.loc10_39.2, %.loc10_24.9 [template] -// CHECK:STDOUT: %.loc10_39.8: @F.%.loc10_24.9 (%.d15) = splice_inst %.loc10_39.7 [template = %.loc10_39.8 (constants.%.74a)] +// CHECK:STDOUT: %.loc10_39.8: @F.%.loc10_24.9 (%.537) = splice_inst %.loc10_39.7 [template = %.loc10_39.8 (constants.%.739)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -634,23 +634,23 @@ fn G() { // CHECK:STDOUT: %.loc10_34: type = template_inst %T.ref.loc10_34 [template = %.loc10_23.2 (constants.%.a92)] // CHECK:STDOUT: %.loc10_35.1: type = type_of_inst %.loc10_35.3 [template = %.loc10_35.4 (constants.%.32dd98.2)] // CHECK:STDOUT: %.loc10_35.2: @F.%.loc10_35.4 (%.32dd98.2) = splice_inst %.loc10_35.3 [template = %.loc10_35.5 (constants.%.8af9c5.2)] -// CHECK:STDOUT: %.loc10_36.1: type = type_of_inst %.loc10_36.3 [template = %.loc10_36.4 (constants.%.e8f)] -// CHECK:STDOUT: %.loc10_36.2: @F.%.loc10_36.4 (%.e8f) = splice_inst %.loc10_36.3 [template = %.loc10_36.5 (constants.%.c84)] -// CHECK:STDOUT: %.loc10_39.1: type = type_of_inst %.loc10_39.4 [template = %.loc10_39.5 (constants.%.08a)] -// CHECK:STDOUT: %.loc10_39.2: @F.%.loc10_39.5 (%.08a) = splice_inst %.loc10_39.4 [template = %.loc10_39.6 (constants.%.47d)] -// CHECK:STDOUT: %.loc10_39.3: @F.%.loc10_24.9 (%.d15) = splice_inst %.loc10_39.7 [template = %.loc10_39.8 (constants.%.74a)] -// CHECK:STDOUT: %.loc10_24.1: type = splice_block %.loc10_24.4 [template = %.loc10_24.9 (constants.%.d15)] { +// CHECK:STDOUT: %.loc10_36.1: type = type_of_inst %.loc10_36.3 [template = %.loc10_36.4 (constants.%.fdd)] +// CHECK:STDOUT: %.loc10_36.2: @F.%.loc10_36.4 (%.fdd) = splice_inst %.loc10_36.3 [template = %.loc10_36.5 (constants.%.598)] +// CHECK:STDOUT: %.loc10_39.1: type = type_of_inst %.loc10_39.4 [template = %.loc10_39.5 (constants.%.e81)] +// CHECK:STDOUT: %.loc10_39.2: @F.%.loc10_39.5 (%.e81) = splice_inst %.loc10_39.4 [template = %.loc10_39.6 (constants.%.949)] +// CHECK:STDOUT: %.loc10_39.3: @F.%.loc10_24.9 (%.537) = splice_inst %.loc10_39.7 [template = %.loc10_39.8 (constants.%.739)] +// CHECK:STDOUT: %.loc10_24.1: type = splice_block %.loc10_24.4 [template = %.loc10_24.9 (constants.%.537)] { // CHECK:STDOUT: %Cpp.ref.loc10_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %A.ref.loc10_20: %A.type = name_ref A, imports.%A.template [concrete = constants.%A.template] // CHECK:STDOUT: %T.ref.loc10_23: type = name_ref T, %T.loc9_15.2 [symbolic = %T.loc9_15.1 (constants.%T)] // CHECK:STDOUT: %.loc10_23.1: type = template_inst %T.ref.loc10_23 [template = %.loc10_23.2 (constants.%.a92)] // CHECK:STDOUT: %.loc10_24.2: type = type_of_inst %.loc10_24.5 [template = %.loc10_24.6 (constants.%.32dd98.1)] // CHECK:STDOUT: %.loc10_24.3: @F.%.loc10_24.6 (%.32dd98.1) = splice_inst %.loc10_24.5 [template = %.loc10_24.7 (constants.%.8af9c5.1)] -// CHECK:STDOUT: %.loc10_24.4: type = splice_inst %.loc10_24.8 [template = %.loc10_24.9 (constants.%.d15)] +// CHECK:STDOUT: %.loc10_24.4: type = splice_inst %.loc10_24.8 [template = %.loc10_24.9 (constants.%.537)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%.loc10_24.9 (%.d15) = wrapper_binding a, %.loc10_39.3 +// CHECK:STDOUT: %a: @F.%.loc10_24.9 (%.537) = wrapper_binding a, %.loc10_39.3 // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %a.patt.loc10_15.1: @F.%pattern_type (%pattern_type.3c1) = value_binding_pattern a [template = %a.patt.loc10_15.2 (constants.%a.patt.100)] +// CHECK:STDOUT: %a.patt.loc10_15.1: @F.%pattern_type (%pattern_type.fcb) = value_binding_pattern a [template = %a.patt.loc10_15.2 (constants.%a.patt.d9b)] // CHECK:STDOUT: } // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -676,24 +676,24 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc10_23.2 => constants.%i32 -// CHECK:STDOUT: %.loc10_24.5 => constants.%inst.splice_block.72dff3.1 +// CHECK:STDOUT: %.loc10_24.5 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc10_24.6 => type // CHECK:STDOUT: %.loc10_24.7 => constants.%A -// CHECK:STDOUT: %.loc10_24.8 => constants.%inst.splice_block.c26 +// CHECK:STDOUT: %.loc10_24.8 => constants.%inst.splice_block.426619.2 // CHECK:STDOUT: %.loc10_24.9 => constants.%A // CHECK:STDOUT: %require_complete => constants.%complete_type.357 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b78 // CHECK:STDOUT: %a.patt.loc10_15.2 => constants.%a.patt.117 -// CHECK:STDOUT: %.loc10_35.3 => constants.%inst.splice_block.72dff3.2 +// CHECK:STDOUT: %.loc10_35.3 => constants.%inst.splice_block.426619.3 // CHECK:STDOUT: %.loc10_35.4 => type // CHECK:STDOUT: %.loc10_35.5 => constants.%A // CHECK:STDOUT: %.loc10_36.3 => constants.%inst.name_ref // CHECK:STDOUT: %.loc10_36.4 => constants.%A.A.cpp_overload_set.type // CHECK:STDOUT: %.loc10_36.5 => constants.%A.A.cpp_overload_set.value -// CHECK:STDOUT: %.loc10_39.4 => constants.%inst.splice_block.76c +// CHECK:STDOUT: %.loc10_39.4 => constants.%inst.splice_block.426619.4 // CHECK:STDOUT: %.loc10_39.5 => constants.%A // CHECK:STDOUT: %.loc10_39.6 => invalid -// CHECK:STDOUT: %.loc10_39.7 => constants.%inst.splice_block.b90 +// CHECK:STDOUT: %.loc10_39.7 => constants.%inst.splice_block.426619.5 // CHECK:STDOUT: %.loc10_39.8 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: @@ -713,45 +713,36 @@ fn G() { // CHECK:STDOUT: %.a92: type = template_inst %T [template] // CHECK:STDOUT: %.32dd98.1: type = type_of_inst @F.%.loc10_24.5 [template] // CHECK:STDOUT: %.8af9c5.1: %.32dd98.1 = splice_inst @F.%.loc10_24.5 [template] -// CHECK:STDOUT: %.d15: type = splice_inst @F.%.loc10_24.8 [template] -// CHECK:STDOUT: %require_complete.f74: = require_complete_type %.d15 [template] -// CHECK:STDOUT: %pattern_type.3c1: type = pattern_type %.d15 [template] -// CHECK:STDOUT: %a.patt.b2a: %pattern_type.3c1 = ref_binding_pattern a [template] -// CHECK:STDOUT: %a.var_patt.66a: %pattern_type.3c1 = var_pattern %a.patt.b2a [template] +// CHECK:STDOUT: %.537: type = splice_inst @F.%.loc10_24.8 [template] +// CHECK:STDOUT: %require_complete.cb0: = require_complete_type %.537 [template] +// CHECK:STDOUT: %pattern_type.fcb: type = pattern_type %.537 [template] +// CHECK:STDOUT: %a.patt.970: %pattern_type.fcb = ref_binding_pattern a [template] +// CHECK:STDOUT: %a.var_patt.98f: %pattern_type.fcb = var_pattern %a.patt.970 [template] // CHECK:STDOUT: %.32dd98.2: type = type_of_inst @F.%.loc10_35.3 [template] // CHECK:STDOUT: %.8af9c5.2: %.32dd98.2 = splice_inst @F.%.loc10_35.3 [template] -// CHECK:STDOUT: %.e8f: type = type_of_inst @F.%.loc10_36.3 [template] -// CHECK:STDOUT: %.c84: %.e8f = splice_inst @F.%.loc10_36.3 [template] -// CHECK:STDOUT: %.08a: type = type_of_inst @F.%.loc10_39.3 [template] -// CHECK:STDOUT: %.47d: %.08a = splice_inst @F.%.loc10_39.3 [template] -// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] -// CHECK:STDOUT: %.98306a.1: type = type_of_inst @F.%.loc10_3.15 [template] -// CHECK:STDOUT: %.21024f.1: %.98306a.1 = splice_inst @F.%.loc10_3.15 [template] -// CHECK:STDOUT: %.20fa30.1: type = type_of_inst @F.%.loc10_3.18 [template] -// CHECK:STDOUT: %.aae4fe.1: %.20fa30.1 = splice_inst @F.%.loc10_3.18 [template] -// CHECK:STDOUT: %.e2f: type = type_of_inst @F.%.loc10_3.21 [template] -// CHECK:STDOUT: %.8c6: %.e2f = splice_inst @F.%.loc10_3.21 [template] -// CHECK:STDOUT: %.4d4: type = type_of_inst @F.%.loc10_3.24 [template] -// CHECK:STDOUT: %.c8d: %.4d4 = splice_inst @F.%.loc10_3.24 [template] -// CHECK:STDOUT: %.972: %.d15 = splice_inst @F.%.loc10_3.27 [template] +// CHECK:STDOUT: %.fdd: type = type_of_inst @F.%.loc10_36.3 [template] +// CHECK:STDOUT: %.598: %.fdd = splice_inst @F.%.loc10_36.3 [template] +// CHECK:STDOUT: %.e81: type = type_of_inst @F.%.loc10_39.3 [template] +// CHECK:STDOUT: %.949: %.e81 = splice_inst @F.%.loc10_39.3 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.5d6: %.537 = splice_inst @F.%tuple.elem0 [template] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Self: %Destroy.type = symbolic_binding Self, 0 [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self) [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] // CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] -// CHECK:STDOUT: %.409: type = type_of_inst @F.%.loc10_3.29 [template] -// CHECK:STDOUT: %.9b8: %.409 = splice_inst @F.%.loc10_3.29 [template] -// CHECK:STDOUT: %.a75: type = type_of_inst @F.%.loc10_3.32 [template] -// CHECK:STDOUT: %.4ea: %.a75 = splice_inst @F.%.loc10_3.32 [template] +// CHECK:STDOUT: %.8cb: type = type_of_inst @F.%.loc10_3.8 [template] +// CHECK:STDOUT: %.c23: %.8cb = splice_inst @F.%.loc10_3.8 [template] +// CHECK:STDOUT: %.57c: type = type_of_inst @F.%.loc10_3.11 [template] +// CHECK:STDOUT: %.e63: %.57c = splice_inst @F.%.loc10_3.11 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %A: type = class_type @A [concrete] -// CHECK:STDOUT: %inst.splice_block.72dff3.1: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.22ed96.1: type = splice_block imports.%A.decl [concrete = %A] {} // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.c26: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { // CHECK:STDOUT: %.4e4: type = splice_block %A [concrete = %A] {} // CHECK:STDOUT: } // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] @@ -759,7 +750,7 @@ fn G() { // CHECK:STDOUT: %pattern_type.b78: type = pattern_type %A [concrete] // CHECK:STDOUT: %a.patt.198: %pattern_type.b78 = ref_binding_pattern a [concrete] // CHECK:STDOUT: %a.var_patt.47b: %pattern_type.b78 = var_pattern %a.patt.198 [concrete] -// CHECK:STDOUT: %inst.splice_block.72dff3.2: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { // CHECK:STDOUT: %.22ed96.2: type = splice_block imports.%A.decl [concrete = %A] {} // CHECK:STDOUT: } // CHECK:STDOUT: %A.A.cpp_overload_set.type: type = cpp_overload_set_type @A.A.cpp_overload_set [concrete] @@ -770,28 +761,18 @@ fn G() { // CHECK:STDOUT: %ptr.303: type = ptr_type %A [concrete] // CHECK:STDOUT: %A__carbon_thunk.type: type = fn_type @A__carbon_thunk [concrete] // CHECK:STDOUT: %A__carbon_thunk: %A__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %inst.splice_block.76c: = inst_value [concrete] { -// CHECK:STDOUT: %.78f: init %A = splice_block %.38d { -// CHECK:STDOUT: %.3a8: ref %A = temporary_storage -// CHECK:STDOUT: %addr: %ptr.303 = addr_of %.3a8 +// CHECK:STDOUT: %inst.splice_block.426619.4: = inst_value [concrete] { +// CHECK:STDOUT: %.723: init %A = splice_block %.904 { +// CHECK:STDOUT: %.b99e31.2: ref %A = specific_inst @F.%a.var, @F(%i32) +// CHECK:STDOUT: %addr: %ptr.303 = addr_of %.b99e31.2 // CHECK:STDOUT: %A__carbon_thunk.call: init %empty_tuple.type = call imports.%A__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.38d: init %A to %.3a8 = mark_in_place_init %A__carbon_thunk.call +// CHECK:STDOUT: %.904: init %A to %.b99e31.2 = mark_in_place_init %A__carbon_thunk.call // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %.7ad: = call_action (%ImplicitAs.generic, %.d15), false [template] -// CHECK:STDOUT: %.98306a.2: type = type_of_inst %.7ad [template] -// CHECK:STDOUT: %.21024f.2: %.98306a.2 = splice_inst %.7ad [template] -// CHECK:STDOUT: %.adc: = access_member_action %.21024f.2, Convert [template] -// CHECK:STDOUT: %.20fa30.2: type = type_of_inst %.adc [template] -// CHECK:STDOUT: %.aae4fe.2: %.20fa30.2 = splice_inst %.adc [template] -// CHECK:STDOUT: %.311: = compound_member_access_action %.78f, %.aae4fe.2 [template] -// CHECK:STDOUT: %.1be: type = type_of_inst %.311 [template] -// CHECK:STDOUT: %.3f6: %.1be = splice_inst %.311 [template] -// CHECK:STDOUT: %.787: = call_action (%.3f6), true [template] -// CHECK:STDOUT: %.67b: type = type_of_inst %.787 [template] -// CHECK:STDOUT: %.c3f: %.67b = splice_inst %.787 [template] -// CHECK:STDOUT: %.9d9: = convert_to_category_action %.c3f, element10 [template] -// CHECK:STDOUT: %.1a1: %A = splice_inst %.9d9 [template] +// CHECK:STDOUT: %inst.splice_block.426619.5: = inst_value [concrete] { +// CHECK:STDOUT: %.ab7: init %A = splice_block %.723 {} +// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%inst.splice_block.426619.5) [concrete] // CHECK:STDOUT: %self.param_patt.1f1: %pattern_type.b78 = ref_param_pattern [concrete] // CHECK:STDOUT: %self.patt.6db: %pattern_type.b78 = wrapper_binding_pattern self, %self.param_patt.1f1 [concrete] // CHECK:STDOUT: %A.cpp_destructor.type: type = fn_type @A.cpp_destructor [concrete] @@ -804,15 +785,15 @@ fn G() { // CHECK:STDOUT: %Destroy.facet.cd4: %Destroy.type = facet_value %A, (%custom_witness.842) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.2fb: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.cd4) [concrete] // CHECK:STDOUT: %.758: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.2fb, %Destroy.facet.cd4 [concrete] -// CHECK:STDOUT: %inst.splice_block.df2: = inst_value [concrete] { -// CHECK:STDOUT: %.6c0: = splice_block %bound_method { -// CHECK:STDOUT: %.30e: ref %A = specific_inst @F.%a.var, @F(%i32) +// CHECK:STDOUT: %inst.splice_block.426619.6: = inst_value [concrete] { +// CHECK:STDOUT: %.c39: = splice_block %bound_method { +// CHECK:STDOUT: %.b99e31.1: ref %A = specific_inst @F.%a.var, @F(%i32) // CHECK:STDOUT: %impl.elem2: %.758 = impl_witness_access %custom_witness.842, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3] -// CHECK:STDOUT: %bound_method: = bound_method %.30e, %impl.elem2 +// CHECK:STDOUT: %bound_method: = bound_method %.b99e31.1, %impl.elem2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %inst.call: = inst_value [concrete] { -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.6c0(%.30e) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.c39(%.b99e31.1) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -869,83 +850,63 @@ fn G() { // CHECK:STDOUT: %.loc10_24.6: type = type_of_inst %.loc10_24.5 [template = %.loc10_24.6 (constants.%.32dd98.1)] // CHECK:STDOUT: %.loc10_24.7: @F.%.loc10_24.6 (%.32dd98.1) = splice_inst %.loc10_24.5 [template = %.loc10_24.7 (constants.%.8af9c5.1)] // CHECK:STDOUT: %.loc10_24.8: = convert_to_value_action %.loc10_24.3, type [template] -// CHECK:STDOUT: %.loc10_24.9: type = splice_inst %.loc10_24.8 [template = %.loc10_24.9 (constants.%.d15)] -// CHECK:STDOUT: %require_complete: = require_complete_type %.loc10_24.9 [template = %require_complete (constants.%require_complete.f74)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %.loc10_24.9 [template = %pattern_type (constants.%pattern_type.3c1)] -// CHECK:STDOUT: %a.patt.loc10_15.2: @F.%pattern_type (%pattern_type.3c1) = ref_binding_pattern a [template = %a.patt.loc10_15.2 (constants.%a.patt.b2a)] -// CHECK:STDOUT: %a.var_patt.loc10_3.2: @F.%pattern_type (%pattern_type.3c1) = var_pattern %a.patt.loc10_15.2 [template = %a.var_patt.loc10_3.2 (constants.%a.var_patt.66a)] +// CHECK:STDOUT: %.loc10_24.9: type = splice_inst %.loc10_24.8 [template = %.loc10_24.9 (constants.%.537)] +// CHECK:STDOUT: %require_complete: = require_complete_type %.loc10_24.9 [template = %require_complete (constants.%require_complete.cb0)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %.loc10_24.9 [template = %pattern_type (constants.%pattern_type.fcb)] +// CHECK:STDOUT: %a.patt.loc10_15.2: @F.%pattern_type (%pattern_type.fcb) = ref_binding_pattern a [template = %a.patt.loc10_15.2 (constants.%a.patt.970)] +// CHECK:STDOUT: %a.var_patt.loc10_3.2: @F.%pattern_type (%pattern_type.fcb) = var_pattern %a.patt.loc10_15.2 [template = %a.var_patt.loc10_3.2 (constants.%a.var_patt.98f)] // CHECK:STDOUT: %.loc10_35.3: = call_action (%A.ref.loc10_31, %.loc10_34), false [template] // CHECK:STDOUT: %.loc10_35.4: type = type_of_inst %.loc10_35.3 [template = %.loc10_35.4 (constants.%.32dd98.2)] // CHECK:STDOUT: %.loc10_35.5: @F.%.loc10_35.4 (%.32dd98.2) = splice_inst %.loc10_35.3 [template = %.loc10_35.5 (constants.%.8af9c5.2)] // CHECK:STDOUT: %.loc10_36.3: = access_member_action %.loc10_35.2, A [template] -// CHECK:STDOUT: %.loc10_36.4: type = type_of_inst %.loc10_36.3 [template = %.loc10_36.4 (constants.%.e8f)] -// CHECK:STDOUT: %.loc10_36.5: @F.%.loc10_36.4 (%.e8f) = splice_inst %.loc10_36.3 [template = %.loc10_36.5 (constants.%.c84)] +// CHECK:STDOUT: %.loc10_36.4: type = type_of_inst %.loc10_36.3 [template = %.loc10_36.4 (constants.%.fdd)] +// CHECK:STDOUT: %.loc10_36.5: @F.%.loc10_36.4 (%.fdd) = splice_inst %.loc10_36.3 [template = %.loc10_36.5 (constants.%.598)] // CHECK:STDOUT: %.loc10_39.3: = call_action (%.loc10_36.2), false [template] -// CHECK:STDOUT: %.loc10_39.4: type = type_of_inst %.loc10_39.3 [template = %.loc10_39.4 (constants.%.08a)] -// CHECK:STDOUT: %.loc10_39.5: @F.%.loc10_39.4 (%.08a) = splice_inst %.loc10_39.3 [template = %.loc10_39.5 (constants.%.47d)] -// CHECK:STDOUT: %.loc10_3.15: = call_action (constants.%ImplicitAs.generic, constants.%.d15), false [template] -// CHECK:STDOUT: %.loc10_3.16: type = type_of_inst %.loc10_3.15 [template = %.loc10_3.16 (constants.%.98306a.1)] -// CHECK:STDOUT: %.loc10_3.17: @F.%.loc10_3.16 (%.98306a.1) = splice_inst %.loc10_3.15 [template = %.loc10_3.17 (constants.%.21024f.1)] -// CHECK:STDOUT: %.loc10_3.18: = access_member_action %.loc10_3.2, Convert [template] -// CHECK:STDOUT: %.loc10_3.19: type = type_of_inst %.loc10_3.18 [template = %.loc10_3.19 (constants.%.20fa30.1)] -// CHECK:STDOUT: %.loc10_3.20: @F.%.loc10_3.19 (%.20fa30.1) = splice_inst %.loc10_3.18 [template = %.loc10_3.20 (constants.%.aae4fe.1)] -// CHECK:STDOUT: %.loc10_3.21: = compound_member_access_action %.loc10_39.2, %.loc10_3.4 [template] -// CHECK:STDOUT: %.loc10_3.22: type = type_of_inst %.loc10_3.21 [template = %.loc10_3.22 (constants.%.e2f)] -// CHECK:STDOUT: %.loc10_3.23: @F.%.loc10_3.22 (%.e2f) = splice_inst %.loc10_3.21 [template = %.loc10_3.23 (constants.%.8c6)] -// CHECK:STDOUT: %.loc10_3.24: = call_action (%.loc10_3.6), true [template] -// CHECK:STDOUT: %.loc10_3.25: type = type_of_inst %.loc10_3.24 [template = %.loc10_3.25 (constants.%.4d4)] -// CHECK:STDOUT: %.loc10_3.26: @F.%.loc10_3.25 (%.4d4) = splice_inst %.loc10_3.24 [template = %.loc10_3.26 (constants.%.c8d)] -// CHECK:STDOUT: %.loc10_3.27: = convert_to_category_action %.loc10_3.9, element10 [template] -// CHECK:STDOUT: %.loc10_3.28: @F.%.loc10_24.9 (%.d15) = splice_inst %.loc10_3.27 [template = %.loc10_3.28 (constants.%.972)] -// CHECK:STDOUT: %.loc10_3.29: = compound_member_access_action %a.var, constants.%assoc2 [template] -// CHECK:STDOUT: %.loc10_3.30: type = type_of_inst %.loc10_3.29 [template = %.loc10_3.30 (constants.%.409)] -// CHECK:STDOUT: %.loc10_3.31: @F.%.loc10_3.30 (%.409) = splice_inst %.loc10_3.29 [template = %.loc10_3.31 (constants.%.9b8)] -// CHECK:STDOUT: %.loc10_3.32: = call_action (%.loc10_3.12), true [template] -// CHECK:STDOUT: %.loc10_3.33: type = type_of_inst %.loc10_3.32 [template = %.loc10_3.33 (constants.%.a75)] -// CHECK:STDOUT: %.loc10_3.34: @F.%.loc10_3.33 (%.a75) = splice_inst %.loc10_3.32 [template = %.loc10_3.34 (constants.%.4ea)] +// CHECK:STDOUT: %.loc10_39.4: type = type_of_inst %.loc10_39.3 [template = %.loc10_39.4 (constants.%.e81)] +// CHECK:STDOUT: %.loc10_39.5: @F.%.loc10_39.4 (%.e81) = splice_inst %.loc10_39.3 [template = %.loc10_39.5 (constants.%.949)] +// CHECK:STDOUT: %.loc10_3.6: %tuple.type = initialize_action %.loc10_39.2, %.loc10_24.9, %a.var, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc10_3.6, element0 [template] +// CHECK:STDOUT: %.loc10_3.7: @F.%.loc10_24.9 (%.537) = splice_inst %tuple.elem0 [template = %.loc10_3.7 (constants.%.5d6)] +// CHECK:STDOUT: %.loc10_3.8: = compound_member_access_action %a.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc10_3.9: type = type_of_inst %.loc10_3.8 [template = %.loc10_3.9 (constants.%.8cb)] +// CHECK:STDOUT: %.loc10_3.10: @F.%.loc10_3.9 (%.8cb) = splice_inst %.loc10_3.8 [template = %.loc10_3.10 (constants.%.c23)] +// CHECK:STDOUT: %.loc10_3.11: = call_action (%.loc10_3.3), true [template] +// CHECK:STDOUT: %.loc10_3.12: type = type_of_inst %.loc10_3.11 [template = %.loc10_3.12 (constants.%.57c)] +// CHECK:STDOUT: %.loc10_3.13: @F.%.loc10_3.12 (%.57c) = splice_inst %.loc10_3.11 [template = %.loc10_3.13 (constants.%.e63)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.var: ref @F.%.loc10_24.9 (%.d15) = var_storage %a.var_patt.loc10_3.1 +// CHECK:STDOUT: %a.var: ref @F.%.loc10_24.9 (%.537) = var_storage %a.var_patt.loc10_3.1 // CHECK:STDOUT: %Cpp.ref.loc10_28: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %A.ref.loc10_31: %A.type = name_ref A, imports.%A.template [concrete = constants.%A.template] // CHECK:STDOUT: %T.ref.loc10_34: type = name_ref T, %T.loc9_15.2 [symbolic = %T.loc9_15.1 (constants.%T)] // CHECK:STDOUT: %.loc10_34: type = template_inst %T.ref.loc10_34 [template = %.loc10_23.2 (constants.%.a92)] // CHECK:STDOUT: %.loc10_35.1: type = type_of_inst %.loc10_35.3 [template = %.loc10_35.4 (constants.%.32dd98.2)] // CHECK:STDOUT: %.loc10_35.2: @F.%.loc10_35.4 (%.32dd98.2) = splice_inst %.loc10_35.3 [template = %.loc10_35.5 (constants.%.8af9c5.2)] -// CHECK:STDOUT: %.loc10_36.1: type = type_of_inst %.loc10_36.3 [template = %.loc10_36.4 (constants.%.e8f)] -// CHECK:STDOUT: %.loc10_36.2: @F.%.loc10_36.4 (%.e8f) = splice_inst %.loc10_36.3 [template = %.loc10_36.5 (constants.%.c84)] -// CHECK:STDOUT: %.loc10_39.1: type = type_of_inst %.loc10_39.3 [template = %.loc10_39.4 (constants.%.08a)] -// CHECK:STDOUT: %.loc10_39.2: @F.%.loc10_39.4 (%.08a) = splice_inst %.loc10_39.3 [template = %.loc10_39.5 (constants.%.47d)] -// CHECK:STDOUT: %.loc10_3.1: type = type_of_inst %.loc10_3.15 [template = %.loc10_3.16 (constants.%.98306a.1)] -// CHECK:STDOUT: %.loc10_3.2: @F.%.loc10_3.16 (%.98306a.1) = splice_inst %.loc10_3.15 [template = %.loc10_3.17 (constants.%.21024f.1)] -// CHECK:STDOUT: %.loc10_3.3: type = type_of_inst %.loc10_3.18 [template = %.loc10_3.19 (constants.%.20fa30.1)] -// CHECK:STDOUT: %.loc10_3.4: @F.%.loc10_3.19 (%.20fa30.1) = splice_inst %.loc10_3.18 [template = %.loc10_3.20 (constants.%.aae4fe.1)] -// CHECK:STDOUT: %.loc10_3.5: type = type_of_inst %.loc10_3.21 [template = %.loc10_3.22 (constants.%.e2f)] -// CHECK:STDOUT: %.loc10_3.6: @F.%.loc10_3.22 (%.e2f) = splice_inst %.loc10_3.21 [template = %.loc10_3.23 (constants.%.8c6)] -// CHECK:STDOUT: %.loc10_3.7: type = type_of_inst %.loc10_3.24 [template = %.loc10_3.25 (constants.%.4d4)] -// CHECK:STDOUT: %.loc10_3.8: @F.%.loc10_3.25 (%.4d4) = splice_inst %.loc10_3.24 [template = %.loc10_3.26 (constants.%.c8d)] -// CHECK:STDOUT: %.loc10_3.9: @F.%.loc10_24.9 (%.d15) = converted %.loc10_39.2, %.loc10_3.8 [template = %.loc10_3.26 (constants.%.c8d)] -// CHECK:STDOUT: %.loc10_3.10: @F.%.loc10_24.9 (%.d15) = splice_inst %.loc10_3.27 [template = %.loc10_3.28 (constants.%.972)] -// CHECK:STDOUT: assign %a.var, %.loc10_3.10 -// CHECK:STDOUT: %.loc10_24.1: type = splice_block %.loc10_24.4 [template = %.loc10_24.9 (constants.%.d15)] { +// CHECK:STDOUT: %.loc10_36.1: type = type_of_inst %.loc10_36.3 [template = %.loc10_36.4 (constants.%.fdd)] +// CHECK:STDOUT: %.loc10_36.2: @F.%.loc10_36.4 (%.fdd) = splice_inst %.loc10_36.3 [template = %.loc10_36.5 (constants.%.598)] +// CHECK:STDOUT: %.loc10_39.1: type = type_of_inst %.loc10_39.3 [template = %.loc10_39.4 (constants.%.e81)] +// CHECK:STDOUT: %.loc10_39.2: @F.%.loc10_39.4 (%.e81) = splice_inst %.loc10_39.3 [template = %.loc10_39.5 (constants.%.949)] +// CHECK:STDOUT: %.loc10_3.1: @F.%.loc10_24.9 (%.537) = splice_inst %tuple.elem0 [template = %.loc10_3.7 (constants.%.5d6)] +// CHECK:STDOUT: assign %a.var, %.loc10_3.1 +// CHECK:STDOUT: %.loc10_24.1: type = splice_block %.loc10_24.4 [template = %.loc10_24.9 (constants.%.537)] { // CHECK:STDOUT: %Cpp.ref.loc10_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %A.ref.loc10_20: %A.type = name_ref A, imports.%A.template [concrete = constants.%A.template] // CHECK:STDOUT: %T.ref.loc10_23: type = name_ref T, %T.loc9_15.2 [symbolic = %T.loc9_15.1 (constants.%T)] // CHECK:STDOUT: %.loc10_23.1: type = template_inst %T.ref.loc10_23 [template = %.loc10_23.2 (constants.%.a92)] // CHECK:STDOUT: %.loc10_24.2: type = type_of_inst %.loc10_24.5 [template = %.loc10_24.6 (constants.%.32dd98.1)] // CHECK:STDOUT: %.loc10_24.3: @F.%.loc10_24.6 (%.32dd98.1) = splice_inst %.loc10_24.5 [template = %.loc10_24.7 (constants.%.8af9c5.1)] -// CHECK:STDOUT: %.loc10_24.4: type = splice_inst %.loc10_24.8 [template = %.loc10_24.9 (constants.%.d15)] +// CHECK:STDOUT: %.loc10_24.4: type = splice_inst %.loc10_24.8 [template = %.loc10_24.9 (constants.%.537)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: ref @F.%.loc10_24.9 (%.d15) = wrapper_binding a, %a.var +// CHECK:STDOUT: %a: ref @F.%.loc10_24.9 (%.537) = wrapper_binding a, %a.var // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %a.patt.loc10_15.1: @F.%pattern_type (%pattern_type.3c1) = ref_binding_pattern a [template = %a.patt.loc10_15.2 (constants.%a.patt.b2a)] -// CHECK:STDOUT: %a.var_patt.loc10_3.1: @F.%pattern_type (%pattern_type.3c1) = var_pattern %a.patt.loc10_15.1 [template = %a.var_patt.loc10_3.2 (constants.%a.var_patt.66a)] +// CHECK:STDOUT: %a.patt.loc10_15.1: @F.%pattern_type (%pattern_type.fcb) = ref_binding_pattern a [template = %a.patt.loc10_15.2 (constants.%a.patt.970)] +// CHECK:STDOUT: %a.var_patt.loc10_3.1: @F.%pattern_type (%pattern_type.fcb) = var_pattern %a.patt.loc10_15.1 [template = %a.var_patt.loc10_3.2 (constants.%a.var_patt.98f)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_3.11: type = type_of_inst %.loc10_3.29 [template = %.loc10_3.30 (constants.%.409)] -// CHECK:STDOUT: %.loc10_3.12: @F.%.loc10_3.30 (%.409) = splice_inst %.loc10_3.29 [template = %.loc10_3.31 (constants.%.9b8)] -// CHECK:STDOUT: %.loc10_3.13: type = type_of_inst %.loc10_3.32 [template = %.loc10_3.33 (constants.%.a75)] -// CHECK:STDOUT: %.loc10_3.14: @F.%.loc10_3.33 (%.a75) = splice_inst %.loc10_3.32 [template = %.loc10_3.34 (constants.%.4ea)] +// CHECK:STDOUT: %.loc10_3.2: type = type_of_inst %.loc10_3.8 [template = %.loc10_3.9 (constants.%.8cb)] +// CHECK:STDOUT: %.loc10_3.3: @F.%.loc10_3.9 (%.8cb) = splice_inst %.loc10_3.8 [template = %.loc10_3.10 (constants.%.c23)] +// CHECK:STDOUT: %.loc10_3.4: type = type_of_inst %.loc10_3.11 [template = %.loc10_3.12 (constants.%.57c)] +// CHECK:STDOUT: %.loc10_3.5: @F.%.loc10_3.12 (%.57c) = splice_inst %.loc10_3.11 [template = %.loc10_3.13 (constants.%.e63)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -970,43 +931,32 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc10_23.2 => constants.%i32 -// CHECK:STDOUT: %.loc10_24.5 => constants.%inst.splice_block.72dff3.1 +// CHECK:STDOUT: %.loc10_24.5 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc10_24.6 => type // CHECK:STDOUT: %.loc10_24.7 => constants.%A -// CHECK:STDOUT: %.loc10_24.8 => constants.%inst.splice_block.c26 +// CHECK:STDOUT: %.loc10_24.8 => constants.%inst.splice_block.426619.2 // CHECK:STDOUT: %.loc10_24.9 => constants.%A // CHECK:STDOUT: %require_complete => constants.%complete_type.357 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b78 // CHECK:STDOUT: %a.patt.loc10_15.2 => constants.%a.patt.198 // CHECK:STDOUT: %a.var_patt.loc10_3.2 => constants.%a.var_patt.47b -// CHECK:STDOUT: %.loc10_35.3 => constants.%inst.splice_block.72dff3.2 +// CHECK:STDOUT: %.loc10_35.3 => constants.%inst.splice_block.426619.3 // CHECK:STDOUT: %.loc10_35.4 => type // CHECK:STDOUT: %.loc10_35.5 => constants.%A // CHECK:STDOUT: %.loc10_36.3 => constants.%inst.name_ref // CHECK:STDOUT: %.loc10_36.4 => constants.%A.A.cpp_overload_set.type // CHECK:STDOUT: %.loc10_36.5 => constants.%A.A.cpp_overload_set.value -// CHECK:STDOUT: %.loc10_39.3 => constants.%inst.splice_block.76c +// CHECK:STDOUT: %.loc10_39.3 => constants.%inst.splice_block.426619.4 // CHECK:STDOUT: %.loc10_39.4 => constants.%A // CHECK:STDOUT: %.loc10_39.5 => invalid -// CHECK:STDOUT: %.loc10_3.15 => constants.%.7ad -// CHECK:STDOUT: %.loc10_3.16 => constants.%.98306a.2 -// CHECK:STDOUT: %.loc10_3.17 => constants.%.21024f.2 -// CHECK:STDOUT: %.loc10_3.18 => constants.%.adc -// CHECK:STDOUT: %.loc10_3.19 => constants.%.20fa30.2 -// CHECK:STDOUT: %.loc10_3.20 => constants.%.aae4fe.2 -// CHECK:STDOUT: %.loc10_3.21 => constants.%.311 -// CHECK:STDOUT: %.loc10_3.22 => constants.%.1be -// CHECK:STDOUT: %.loc10_3.23 => constants.%.3f6 -// CHECK:STDOUT: %.loc10_3.24 => constants.%.787 -// CHECK:STDOUT: %.loc10_3.25 => constants.%.67b -// CHECK:STDOUT: %.loc10_3.26 => constants.%.c3f -// CHECK:STDOUT: %.loc10_3.27 => constants.%.9d9 -// CHECK:STDOUT: %.loc10_3.28 => constants.%.1a1 -// CHECK:STDOUT: %.loc10_3.29 => constants.%inst.splice_block.df2 -// CHECK:STDOUT: %.loc10_3.30 => -// CHECK:STDOUT: %.loc10_3.31 => invalid -// CHECK:STDOUT: %.loc10_3.32 => constants.%inst.call -// CHECK:STDOUT: %.loc10_3.33 => constants.%empty_tuple.type -// CHECK:STDOUT: %.loc10_3.34 => invalid +// CHECK:STDOUT: %.loc10_3.6 => constants.%tuple +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block.426619.5 +// CHECK:STDOUT: %.loc10_3.7 => invalid +// CHECK:STDOUT: %.loc10_3.8 => constants.%inst.splice_block.426619.6 +// CHECK:STDOUT: %.loc10_3.9 => +// CHECK:STDOUT: %.loc10_3.10 => invalid +// CHECK:STDOUT: %.loc10_3.11 => constants.%inst.call +// CHECK:STDOUT: %.loc10_3.12 => constants.%empty_tuple.type +// CHECK:STDOUT: %.loc10_3.13 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/template/generic_call.carbon b/toolchain/check/testdata/interop/cpp/template/generic_call.carbon index e831271cf55a..eb751071d883 100644 --- a/toolchain/check/testdata/interop/cpp/template/generic_call.carbon +++ b/toolchain/check/testdata/interop/cpp/template/generic_call.carbon @@ -41,9 +41,9 @@ fn G() { // CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete] // CHECK:STDOUT: %T.patt.3a0: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.51d1c4.1: type = pattern_type %T.67d [symbolic] -// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d1c4.1 = value_param_pattern [symbolic] -// CHECK:STDOUT: %x.patt.260: %pattern_type.51d1c4.1 = wrapper_binding_pattern x, %x.param_patt.91d [symbolic] +// CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T.67d [symbolic] +// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d = value_param_pattern [symbolic] +// CHECK:STDOUT: %x.patt.260: %pattern_type.51d = wrapper_binding_pattern x, %x.param_patt.91d [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -53,11 +53,11 @@ fn G() { // CHECK:STDOUT: %.a92: type = template_inst %T.67d [template] // CHECK:STDOUT: %.d46: type = type_of_inst @F.%.loc8_24.5 [template] // CHECK:STDOUT: %.de1: %.d46 = splice_inst @F.%.loc8_24.5 [template] -// CHECK:STDOUT: %.5cd: type = splice_inst @F.%.loc8_24.8 [template] -// CHECK:STDOUT: %require_complete.363: = require_complete_type %.5cd [template] -// CHECK:STDOUT: %pattern_type.a1f: type = pattern_type %.5cd [template] -// CHECK:STDOUT: %v.patt.019: %pattern_type.a1f = ref_binding_pattern v [template] -// CHECK:STDOUT: %v.var_patt.d78: %pattern_type.a1f = var_pattern %v.patt.019 [template] +// CHECK:STDOUT: %.537: type = splice_inst @F.%.loc8_24.8 [template] +// CHECK:STDOUT: %require_complete.cb0: = require_complete_type %.537 [template] +// CHECK:STDOUT: %pattern_type.fcb: type = pattern_type %.537 [template] +// CHECK:STDOUT: %v.patt.126: %pattern_type.fcb = ref_binding_pattern v [template] +// CHECK:STDOUT: %v.var_patt.768: %pattern_type.fcb = var_pattern %v.patt.126 [template] // CHECK:STDOUT: %DefaultOrUnformed.type: type = facet_type <@DefaultOrUnformed> [concrete] // CHECK:STDOUT: %Self.935: %DefaultOrUnformed.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.8f1: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%Self.935) [symbolic] @@ -66,34 +66,25 @@ fn G() { // CHECK:STDOUT: %T.b09: %Default.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9: type = fn_type @T.as_type.as.DefaultOrUnformed.impl.Op, @T.as_type.as.DefaultOrUnformed.impl(%T.b09) [symbolic] // CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.cfe: %T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9 = struct_value () [symbolic] -// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness: = lookup_impl_witness %.5cd, @DefaultOrUnformed [template] -// CHECK:STDOUT: %.f4d: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%.5cd) [template] -// CHECK:STDOUT: %DefaultOrUnformed.facet.a1a: %DefaultOrUnformed.type = facet_value %.5cd, (%DefaultOrUnformed.lookup_impl_witness) [template] -// CHECK:STDOUT: %.c72: type = type_of_inst @F.%.loc8_25.7 [template] -// CHECK:STDOUT: %.0a6: %.c72 = splice_inst @F.%.loc8_25.7 [template] -// CHECK:STDOUT: %.463: type = type_of_inst @F.%.loc8_25.10 [template] -// CHECK:STDOUT: %.ba3: %.463 = splice_inst @F.%.loc8_25.10 [template] -// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] -// CHECK:STDOUT: %.585e1e.1: type = type_of_inst @F.%.loc8_3.15 [template] -// CHECK:STDOUT: %.b296a8.1: %.585e1e.1 = splice_inst @F.%.loc8_3.15 [template] -// CHECK:STDOUT: %.e218d7.1: type = type_of_inst @F.%.loc8_3.18 [template] -// CHECK:STDOUT: %.f58188.1: %.e218d7.1 = splice_inst @F.%.loc8_3.18 [template] -// CHECK:STDOUT: %.797: type = type_of_inst @F.%.loc8_3.21 [template] -// CHECK:STDOUT: %.664: %.797 = splice_inst @F.%.loc8_3.21 [template] -// CHECK:STDOUT: %.9f0: type = type_of_inst @F.%.loc8_3.24 [template] -// CHECK:STDOUT: %.0f3: %.9f0 = splice_inst @F.%.loc8_3.24 [template] -// CHECK:STDOUT: %.e77: %.5cd = splice_inst @F.%.loc8_3.27 [template] +// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness: = lookup_impl_witness %.537, @DefaultOrUnformed [template] +// CHECK:STDOUT: %.0681: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%.537) [template] +// CHECK:STDOUT: %DefaultOrUnformed.facet.67e: %DefaultOrUnformed.type = facet_value %.537, (%DefaultOrUnformed.lookup_impl_witness) [template] +// CHECK:STDOUT: %.77d: type = type_of_inst @F.%.loc8_25.7 [template] +// CHECK:STDOUT: %.984: %.77d = splice_inst @F.%.loc8_25.7 [template] +// CHECK:STDOUT: %.b48: type = type_of_inst @F.%.loc8_25.10 [template] +// CHECK:STDOUT: %.e18: %.b48 = splice_inst @F.%.loc8_25.10 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.5d6: %.537 = splice_inst @F.%tuple.elem0 [template] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] // CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] -// CHECK:STDOUT: %.f97: type = type_of_inst @F.%.loc8_3.29 [template] -// CHECK:STDOUT: %.f14: %.f97 = splice_inst @F.%.loc8_3.29 [template] -// CHECK:STDOUT: %.2c7: type = type_of_inst @F.%.loc8_3.32 [template] -// CHECK:STDOUT: %.96f: %.2c7 = splice_inst @F.%.loc8_3.32 [template] +// CHECK:STDOUT: %.8cb: type = type_of_inst @F.%.loc8_3.8 [template] +// CHECK:STDOUT: %.c23: %.8cb = splice_inst @F.%.loc8_3.8 [template] +// CHECK:STDOUT: %.57c: type = type_of_inst @F.%.loc8_3.11 [template] +// CHECK:STDOUT: %.e63: %.57c = splice_inst @F.%.loc8_3.11 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] @@ -101,10 +92,10 @@ fn G() { // CHECK:STDOUT: %x.param_patt.468: %pattern_type.fa7 = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt.af8: %pattern_type.fa7 = wrapper_binding_pattern x, %x.param_patt.468 [concrete] // CHECK:STDOUT: %S: type = class_type @S [concrete] -// CHECK:STDOUT: %inst.splice_block.5af: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.788: type = splice_block imports.%S.decl [concrete = %S] {} // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.c1e: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { // CHECK:STDOUT: %.895: type = splice_block %S [concrete = %S] {} // CHECK:STDOUT: } // CHECK:STDOUT: %pattern_type.981: type = pattern_type %S [concrete] @@ -121,37 +112,27 @@ fn G() { // CHECK:STDOUT: %DefaultOrUnformed.facet.ba3: %DefaultOrUnformed.type = facet_value %S, (%DefaultOrUnformed.impl_witness.1ff) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.483: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.ba3) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.assoc_type: type = assoc_entity_type @DefaultOrUnformed [concrete] -// CHECK:STDOUT: %assoc0.b81: %DefaultOrUnformed.assoc_type = assoc_entity element0, imports.%Core.import_ref.d14 [concrete] +// CHECK:STDOUT: %assoc0: %DefaultOrUnformed.assoc_type = assoc_entity element0, imports.%Core.import_ref.d14 [concrete] // CHECK:STDOUT: %.805: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.483, %DefaultOrUnformed.facet.ba3 [concrete] -// CHECK:STDOUT: %inst.splice_block.9d9: = inst_value [concrete] { +// CHECK:STDOUT: %inst.splice_block.426619.3: = inst_value [concrete] { // CHECK:STDOUT: %.64e: %.805 = splice_block %impl.elem0.9ae [concrete = %T.as_type.as.DefaultOrUnformed.impl.Op.83d] { // CHECK:STDOUT: %as_type: type = facet_access_type %DefaultOrUnformed.facet.ba3 [concrete = %S] // CHECK:STDOUT: %.bcb: type = converted %DefaultOrUnformed.facet.ba3, %as_type [concrete = %S] -// CHECK:STDOUT: %Op.ref: %DefaultOrUnformed.assoc_type = name_ref Op, imports.%Core.import_ref.6dc [concrete = %assoc0.b81] +// CHECK:STDOUT: %Op.ref: %DefaultOrUnformed.assoc_type = name_ref Op, imports.%Core.import_ref.6dc [concrete = %assoc0] // CHECK:STDOUT: %impl.elem0.9ae: %.805 = impl_witness_access %DefaultOrUnformed.impl_witness.1ff, element0 [concrete = %T.as_type.as.DefaultOrUnformed.impl.Op.83d] // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.7e5: = inst_value [concrete] { -// CHECK:STDOUT: %.cc7: init %S = splice_block %T.as_type.as.DefaultOrUnformed.impl.Op.call { +// CHECK:STDOUT: %inst.splice_block.426619.4: = inst_value [concrete] { +// CHECK:STDOUT: %.941: init %S = splice_block %T.as_type.as.DefaultOrUnformed.impl.Op.call { // CHECK:STDOUT: -// CHECK:STDOUT: %.746: ref %S = temporary_storage -// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call: init %S to %.746 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.e6b3f4.2() +// CHECK:STDOUT: %.46b016.2: ref %S = specific_inst @F.%v.var, @F(%X) +// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call: init %S to %.46b016.2 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.e6b3f4.2() // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %.352: = call_action (%ImplicitAs.generic, %.5cd), false [template] -// CHECK:STDOUT: %.585e1e.2: type = type_of_inst %.352 [template] -// CHECK:STDOUT: %.b296a8.2: %.585e1e.2 = splice_inst %.352 [template] -// CHECK:STDOUT: %.556: = access_member_action %.b296a8.2, Convert [template] -// CHECK:STDOUT: %.e218d7.2: type = type_of_inst %.556 [template] -// CHECK:STDOUT: %.f58188.2: %.e218d7.2 = splice_inst %.556 [template] -// CHECK:STDOUT: %.955: = compound_member_access_action %.cc7, %.f58188.2 [template] -// CHECK:STDOUT: %.5c9: type = type_of_inst %.955 [template] -// CHECK:STDOUT: %.2bf: %.5c9 = splice_inst %.955 [template] -// CHECK:STDOUT: %.9a4: = call_action (%.2bf), true [template] -// CHECK:STDOUT: %.94b: type = type_of_inst %.9a4 [template] -// CHECK:STDOUT: %.a03: %.94b = splice_inst %.9a4 [template] -// CHECK:STDOUT: %.169: = convert_to_category_action %.a03, element10 [template] -// CHECK:STDOUT: %.217: %S = splice_inst %.169 [template] +// CHECK:STDOUT: %inst.splice_block.426619.5: = inst_value [concrete] { +// CHECK:STDOUT: %.75f: init %S = splice_block %.941 {} +// CHECK:STDOUT: } +// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%inst.splice_block.426619.5) [concrete] // CHECK:STDOUT: %self.param_patt.471: %pattern_type.981 = ref_param_pattern [concrete] // CHECK:STDOUT: %self.patt.5f0: %pattern_type.981 = wrapper_binding_pattern self, %self.param_patt.471 [concrete] // CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete] @@ -166,16 +147,16 @@ fn G() { // CHECK:STDOUT: %Destroy.facet.edc: %Destroy.type = facet_value %S, (%custom_witness.1bfa2a.2) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.e44: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.edc) [concrete] // CHECK:STDOUT: %.bb1: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.e44, %Destroy.facet.edc [concrete] -// CHECK:STDOUT: %inst.splice_block.80a: = inst_value [concrete] { -// CHECK:STDOUT: %.c7f: = splice_block %bound_method { -// CHECK:STDOUT: %.e7d: ref %S = specific_inst @F.%v.var, @F(%X) +// CHECK:STDOUT: %inst.splice_block.426619.6: = inst_value [concrete] { +// CHECK:STDOUT: %.9a4: = splice_block %bound_method { +// CHECK:STDOUT: %.46b016.1: ref %S = specific_inst @F.%v.var, @F(%X) // CHECK:STDOUT: // CHECK:STDOUT: %impl.elem2: %.bb1 = impl_witness_access %custom_witness.1bfa2a.2, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.2] -// CHECK:STDOUT: %bound_method: = bound_method %.e7d, %impl.elem2 +// CHECK:STDOUT: %bound_method: = bound_method %.46b016.1, %impl.elem2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %inst.call: = inst_value [concrete] { -// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.c7f(%.e7d) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.9a4(%.46b016.1) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -186,7 +167,7 @@ fn G() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %S.template: %S.type = struct_value () [concrete = constants.%S.template] -// CHECK:STDOUT: %Core.import_ref.6dc: %DefaultOrUnformed.assoc_type = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc0.b81] +// CHECK:STDOUT: %Core.import_ref.6dc: %DefaultOrUnformed.assoc_type = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %Core.import_ref.c2f: @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op.type (%T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op (constants.%T.as_type.as.DefaultOrUnformed.impl.Op.cfe)] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] // CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] @@ -213,8 +194,8 @@ fn G() { // CHECK:STDOUT: file { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt.loc7_7.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_7.2 (constants.%T.patt.3a0)] -// CHECK:STDOUT: %x.param_patt.loc7_23.1: @F.%pattern_type.loc7 (%pattern_type.51d1c4.1) = value_param_pattern [symbolic = %x.param_patt.loc7_23.2 (constants.%x.param_patt.91d)] -// CHECK:STDOUT: %x.patt.loc7_23.1: @F.%pattern_type.loc7 (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc7_23.1 [symbolic = %x.patt.loc7_23.2 (constants.%x.patt.260)] +// CHECK:STDOUT: %x.param_patt.loc7_23.1: @F.%pattern_type.loc7 (%pattern_type.51d) = value_param_pattern [symbolic = %x.param_patt.loc7_23.2 (constants.%x.param_patt.91d)] +// CHECK:STDOUT: %x.patt.loc7_23.1: @F.%pattern_type.loc7 (%pattern_type.51d) = wrapper_binding_pattern x, %x.param_patt.loc7_23.1 [symbolic = %x.patt.loc7_23.2 (constants.%x.patt.260)] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc7_9.1: type = splice_block %.loc7_9.2 [concrete = type] { // CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] @@ -230,9 +211,9 @@ fn G() { // CHECK:STDOUT: generic fn @F(%T.loc7_7.2: type) { // CHECK:STDOUT: %T.patt.loc7_7.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_7.2 (constants.%T.patt.3a0)] // CHECK:STDOUT: %T.loc7_7.1: type = symbolic_binding T, 0 [symbolic = %T.loc7_7.1 (constants.%T.67d)] -// CHECK:STDOUT: %pattern_type.loc7: type = pattern_type %T.loc7_7.1 [symbolic = %pattern_type.loc7 (constants.%pattern_type.51d1c4.1)] -// CHECK:STDOUT: %x.param_patt.loc7_23.2: @F.%pattern_type.loc7 (%pattern_type.51d1c4.1) = value_param_pattern [symbolic = %x.param_patt.loc7_23.2 (constants.%x.param_patt.91d)] -// CHECK:STDOUT: %x.patt.loc7_23.2: @F.%pattern_type.loc7 (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc7_23.2 [symbolic = %x.patt.loc7_23.2 (constants.%x.patt.260)] +// CHECK:STDOUT: %pattern_type.loc7: type = pattern_type %T.loc7_7.1 [symbolic = %pattern_type.loc7 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %x.param_patt.loc7_23.2: @F.%pattern_type.loc7 (%pattern_type.51d) = value_param_pattern [symbolic = %x.param_patt.loc7_23.2 (constants.%x.param_patt.91d)] +// CHECK:STDOUT: %x.patt.loc7_23.2: @F.%pattern_type.loc7 (%pattern_type.51d) = wrapper_binding_pattern x, %x.param_patt.loc7_23.2 [symbolic = %x.patt.loc7_23.2 (constants.%x.patt.260)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc7: = require_complete_type %T.loc7_7.1 [symbolic = %require_complete.loc7 (constants.%require_complete.944)] @@ -241,79 +222,59 @@ fn G() { // CHECK:STDOUT: %.loc8_24.6: type = type_of_inst %.loc8_24.5 [template = %.loc8_24.6 (constants.%.d46)] // CHECK:STDOUT: %.loc8_24.7: @F.%.loc8_24.6 (%.d46) = splice_inst %.loc8_24.5 [template = %.loc8_24.7 (constants.%.de1)] // CHECK:STDOUT: %.loc8_24.8: = convert_to_value_action %.loc8_24.3, type [template] -// CHECK:STDOUT: %.loc8_24.9: type = splice_inst %.loc8_24.8 [template = %.loc8_24.9 (constants.%.5cd)] -// CHECK:STDOUT: %require_complete.loc8: = require_complete_type %.loc8_24.9 [template = %require_complete.loc8 (constants.%require_complete.363)] -// CHECK:STDOUT: %pattern_type.loc8: type = pattern_type %.loc8_24.9 [template = %pattern_type.loc8 (constants.%pattern_type.a1f)] -// CHECK:STDOUT: %v.patt.loc8_15.2: @F.%pattern_type.loc8 (%pattern_type.a1f) = ref_binding_pattern v [template = %v.patt.loc8_15.2 (constants.%v.patt.019)] -// CHECK:STDOUT: %v.var_patt.loc8_3.2: @F.%pattern_type.loc8 (%pattern_type.a1f) = var_pattern %v.patt.loc8_15.2 [template = %v.var_patt.loc8_3.2 (constants.%v.var_patt.d78)] -// CHECK:STDOUT: %.loc8_25.6: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%.loc8_24.9) [template = %.loc8_25.6 (constants.%.f4d)] +// CHECK:STDOUT: %.loc8_24.9: type = splice_inst %.loc8_24.8 [template = %.loc8_24.9 (constants.%.537)] +// CHECK:STDOUT: %require_complete.loc8: = require_complete_type %.loc8_24.9 [template = %require_complete.loc8 (constants.%require_complete.cb0)] +// CHECK:STDOUT: %pattern_type.loc8: type = pattern_type %.loc8_24.9 [template = %pattern_type.loc8 (constants.%pattern_type.fcb)] +// CHECK:STDOUT: %v.patt.loc8_15.2: @F.%pattern_type.loc8 (%pattern_type.fcb) = ref_binding_pattern v [template = %v.patt.loc8_15.2 (constants.%v.patt.126)] +// CHECK:STDOUT: %v.var_patt.loc8_3.2: @F.%pattern_type.loc8 (%pattern_type.fcb) = var_pattern %v.patt.loc8_15.2 [template = %v.var_patt.loc8_3.2 (constants.%v.var_patt.768)] +// CHECK:STDOUT: %.loc8_25.6: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%.loc8_24.9) [template = %.loc8_25.6 (constants.%.0681)] // CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness: = lookup_impl_witness %.loc8_24.9, @DefaultOrUnformed [template = %DefaultOrUnformed.lookup_impl_witness (constants.%DefaultOrUnformed.lookup_impl_witness)] -// CHECK:STDOUT: %DefaultOrUnformed.facet.loc8_25.2: %DefaultOrUnformed.type = facet_value %.loc8_24.9, (%DefaultOrUnformed.lookup_impl_witness) [template = %DefaultOrUnformed.facet.loc8_25.2 (constants.%DefaultOrUnformed.facet.a1a)] +// CHECK:STDOUT: %DefaultOrUnformed.facet.loc8_25.2: %DefaultOrUnformed.type = facet_value %.loc8_24.9, (%DefaultOrUnformed.lookup_impl_witness) [template = %DefaultOrUnformed.facet.loc8_25.2 (constants.%DefaultOrUnformed.facet.67e)] // CHECK:STDOUT: %.loc8_25.7: = access_member_action %.loc8_25.1, Op [template] -// CHECK:STDOUT: %.loc8_25.8: type = type_of_inst %.loc8_25.7 [template = %.loc8_25.8 (constants.%.c72)] -// CHECK:STDOUT: %.loc8_25.9: @F.%.loc8_25.8 (%.c72) = splice_inst %.loc8_25.7 [template = %.loc8_25.9 (constants.%.0a6)] +// CHECK:STDOUT: %.loc8_25.8: type = type_of_inst %.loc8_25.7 [template = %.loc8_25.8 (constants.%.77d)] +// CHECK:STDOUT: %.loc8_25.9: @F.%.loc8_25.8 (%.77d) = splice_inst %.loc8_25.7 [template = %.loc8_25.9 (constants.%.984)] // CHECK:STDOUT: %.loc8_25.10: = call_action (%.loc8_25.3), false [template] -// CHECK:STDOUT: %.loc8_25.11: type = type_of_inst %.loc8_25.10 [template = %.loc8_25.11 (constants.%.463)] -// CHECK:STDOUT: %.loc8_25.12: @F.%.loc8_25.11 (%.463) = splice_inst %.loc8_25.10 [template = %.loc8_25.12 (constants.%.ba3)] -// CHECK:STDOUT: %.loc8_3.15: = call_action (constants.%ImplicitAs.generic, constants.%.5cd), false [template] -// CHECK:STDOUT: %.loc8_3.16: type = type_of_inst %.loc8_3.15 [template = %.loc8_3.16 (constants.%.585e1e.1)] -// CHECK:STDOUT: %.loc8_3.17: @F.%.loc8_3.16 (%.585e1e.1) = splice_inst %.loc8_3.15 [template = %.loc8_3.17 (constants.%.b296a8.1)] -// CHECK:STDOUT: %.loc8_3.18: = access_member_action %.loc8_3.2, Convert [template] -// CHECK:STDOUT: %.loc8_3.19: type = type_of_inst %.loc8_3.18 [template = %.loc8_3.19 (constants.%.e218d7.1)] -// CHECK:STDOUT: %.loc8_3.20: @F.%.loc8_3.19 (%.e218d7.1) = splice_inst %.loc8_3.18 [template = %.loc8_3.20 (constants.%.f58188.1)] -// CHECK:STDOUT: %.loc8_3.21: = compound_member_access_action %.loc8_25.5, %.loc8_3.4 [template] -// CHECK:STDOUT: %.loc8_3.22: type = type_of_inst %.loc8_3.21 [template = %.loc8_3.22 (constants.%.797)] -// CHECK:STDOUT: %.loc8_3.23: @F.%.loc8_3.22 (%.797) = splice_inst %.loc8_3.21 [template = %.loc8_3.23 (constants.%.664)] -// CHECK:STDOUT: %.loc8_3.24: = call_action (%.loc8_3.6), true [template] -// CHECK:STDOUT: %.loc8_3.25: type = type_of_inst %.loc8_3.24 [template = %.loc8_3.25 (constants.%.9f0)] -// CHECK:STDOUT: %.loc8_3.26: @F.%.loc8_3.25 (%.9f0) = splice_inst %.loc8_3.24 [template = %.loc8_3.26 (constants.%.0f3)] -// CHECK:STDOUT: %.loc8_3.27: = convert_to_category_action %.loc8_3.9, element10 [template] -// CHECK:STDOUT: %.loc8_3.28: @F.%.loc8_24.9 (%.5cd) = splice_inst %.loc8_3.27 [template = %.loc8_3.28 (constants.%.e77)] -// CHECK:STDOUT: %.loc8_3.29: = compound_member_access_action %v.var, constants.%assoc2 [template] -// CHECK:STDOUT: %.loc8_3.30: type = type_of_inst %.loc8_3.29 [template = %.loc8_3.30 (constants.%.f97)] -// CHECK:STDOUT: %.loc8_3.31: @F.%.loc8_3.30 (%.f97) = splice_inst %.loc8_3.29 [template = %.loc8_3.31 (constants.%.f14)] -// CHECK:STDOUT: %.loc8_3.32: = call_action (%.loc8_3.12), true [template] -// CHECK:STDOUT: %.loc8_3.33: type = type_of_inst %.loc8_3.32 [template = %.loc8_3.33 (constants.%.2c7)] -// CHECK:STDOUT: %.loc8_3.34: @F.%.loc8_3.33 (%.2c7) = splice_inst %.loc8_3.32 [template = %.loc8_3.34 (constants.%.96f)] +// CHECK:STDOUT: %.loc8_25.11: type = type_of_inst %.loc8_25.10 [template = %.loc8_25.11 (constants.%.b48)] +// CHECK:STDOUT: %.loc8_25.12: @F.%.loc8_25.11 (%.b48) = splice_inst %.loc8_25.10 [template = %.loc8_25.12 (constants.%.e18)] +// CHECK:STDOUT: %.loc8_3.6: %tuple.type = initialize_action %.loc8_25.5, %.loc8_24.9, %v.var, false [template] +// CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc8_3.6, element0 [template] +// CHECK:STDOUT: %.loc8_3.7: @F.%.loc8_24.9 (%.537) = splice_inst %tuple.elem0 [template = %.loc8_3.7 (constants.%.5d6)] +// CHECK:STDOUT: %.loc8_3.8: = compound_member_access_action %v.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc8_3.9: type = type_of_inst %.loc8_3.8 [template = %.loc8_3.9 (constants.%.8cb)] +// CHECK:STDOUT: %.loc8_3.10: @F.%.loc8_3.9 (%.8cb) = splice_inst %.loc8_3.8 [template = %.loc8_3.10 (constants.%.c23)] +// CHECK:STDOUT: %.loc8_3.11: = call_action (%.loc8_3.3), true [template] +// CHECK:STDOUT: %.loc8_3.12: type = type_of_inst %.loc8_3.11 [template = %.loc8_3.12 (constants.%.57c)] +// CHECK:STDOUT: %.loc8_3.13: @F.%.loc8_3.12 (%.57c) = splice_inst %.loc8_3.11 [template = %.loc8_3.13 (constants.%.e63)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%T.loc7_7.1 (%T.67d)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %v.var: ref @F.%.loc8_24.9 (%.5cd) = var_storage %v.var_patt.loc8_3.1 -// CHECK:STDOUT: %DefaultOrUnformed.facet.loc8_25.1: %DefaultOrUnformed.type = facet_value constants.%.5cd, (constants.%DefaultOrUnformed.lookup_impl_witness) [template = %DefaultOrUnformed.facet.loc8_25.2 (constants.%DefaultOrUnformed.facet.a1a)] -// CHECK:STDOUT: %.loc8_25.1: %DefaultOrUnformed.type = converted constants.%.5cd, %DefaultOrUnformed.facet.loc8_25.1 [template = %DefaultOrUnformed.facet.loc8_25.2 (constants.%DefaultOrUnformed.facet.a1a)] -// CHECK:STDOUT: %.loc8_25.2: type = type_of_inst %.loc8_25.7 [template = %.loc8_25.8 (constants.%.c72)] -// CHECK:STDOUT: %.loc8_25.3: @F.%.loc8_25.8 (%.c72) = splice_inst %.loc8_25.7 [template = %.loc8_25.9 (constants.%.0a6)] -// CHECK:STDOUT: %.loc8_25.4: type = type_of_inst %.loc8_25.10 [template = %.loc8_25.11 (constants.%.463)] -// CHECK:STDOUT: %.loc8_25.5: @F.%.loc8_25.11 (%.463) = splice_inst %.loc8_25.10 [template = %.loc8_25.12 (constants.%.ba3)] -// CHECK:STDOUT: %.loc8_3.1: type = type_of_inst %.loc8_3.15 [template = %.loc8_3.16 (constants.%.585e1e.1)] -// CHECK:STDOUT: %.loc8_3.2: @F.%.loc8_3.16 (%.585e1e.1) = splice_inst %.loc8_3.15 [template = %.loc8_3.17 (constants.%.b296a8.1)] -// CHECK:STDOUT: %.loc8_3.3: type = type_of_inst %.loc8_3.18 [template = %.loc8_3.19 (constants.%.e218d7.1)] -// CHECK:STDOUT: %.loc8_3.4: @F.%.loc8_3.19 (%.e218d7.1) = splice_inst %.loc8_3.18 [template = %.loc8_3.20 (constants.%.f58188.1)] -// CHECK:STDOUT: %.loc8_3.5: type = type_of_inst %.loc8_3.21 [template = %.loc8_3.22 (constants.%.797)] -// CHECK:STDOUT: %.loc8_3.6: @F.%.loc8_3.22 (%.797) = splice_inst %.loc8_3.21 [template = %.loc8_3.23 (constants.%.664)] -// CHECK:STDOUT: %.loc8_3.7: type = type_of_inst %.loc8_3.24 [template = %.loc8_3.25 (constants.%.9f0)] -// CHECK:STDOUT: %.loc8_3.8: @F.%.loc8_3.25 (%.9f0) = splice_inst %.loc8_3.24 [template = %.loc8_3.26 (constants.%.0f3)] -// CHECK:STDOUT: %.loc8_3.9: @F.%.loc8_24.9 (%.5cd) = converted %.loc8_25.5, %.loc8_3.8 [template = %.loc8_3.26 (constants.%.0f3)] -// CHECK:STDOUT: %.loc8_3.10: @F.%.loc8_24.9 (%.5cd) = splice_inst %.loc8_3.27 [template = %.loc8_3.28 (constants.%.e77)] -// CHECK:STDOUT: assign %v.var, %.loc8_3.10 -// CHECK:STDOUT: %.loc8_24.1: type = splice_block %.loc8_24.4 [template = %.loc8_24.9 (constants.%.5cd)] { +// CHECK:STDOUT: %v.var: ref @F.%.loc8_24.9 (%.537) = var_storage %v.var_patt.loc8_3.1 +// CHECK:STDOUT: %DefaultOrUnformed.facet.loc8_25.1: %DefaultOrUnformed.type = facet_value constants.%.537, (constants.%DefaultOrUnformed.lookup_impl_witness) [template = %DefaultOrUnformed.facet.loc8_25.2 (constants.%DefaultOrUnformed.facet.67e)] +// CHECK:STDOUT: %.loc8_25.1: %DefaultOrUnformed.type = converted constants.%.537, %DefaultOrUnformed.facet.loc8_25.1 [template = %DefaultOrUnformed.facet.loc8_25.2 (constants.%DefaultOrUnformed.facet.67e)] +// CHECK:STDOUT: %.loc8_25.2: type = type_of_inst %.loc8_25.7 [template = %.loc8_25.8 (constants.%.77d)] +// CHECK:STDOUT: %.loc8_25.3: @F.%.loc8_25.8 (%.77d) = splice_inst %.loc8_25.7 [template = %.loc8_25.9 (constants.%.984)] +// CHECK:STDOUT: %.loc8_25.4: type = type_of_inst %.loc8_25.10 [template = %.loc8_25.11 (constants.%.b48)] +// CHECK:STDOUT: %.loc8_25.5: @F.%.loc8_25.11 (%.b48) = splice_inst %.loc8_25.10 [template = %.loc8_25.12 (constants.%.e18)] +// CHECK:STDOUT: %.loc8_3.1: @F.%.loc8_24.9 (%.537) = splice_inst %tuple.elem0 [template = %.loc8_3.7 (constants.%.5d6)] +// CHECK:STDOUT: assign %v.var, %.loc8_3.1 +// CHECK:STDOUT: %.loc8_24.1: type = splice_block %.loc8_24.4 [template = %.loc8_24.9 (constants.%.537)] { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %S.ref: %S.type = name_ref S, imports.%S.template [concrete = constants.%S.template] // CHECK:STDOUT: %T.ref.loc8: type = name_ref T, %T.loc7_7.2 [symbolic = %T.loc7_7.1 (constants.%T.67d)] // CHECK:STDOUT: %.loc8_23.1: type = template_inst %T.ref.loc8 [template = %.loc8_23.2 (constants.%.a92)] // CHECK:STDOUT: %.loc8_24.2: type = type_of_inst %.loc8_24.5 [template = %.loc8_24.6 (constants.%.d46)] // CHECK:STDOUT: %.loc8_24.3: @F.%.loc8_24.6 (%.d46) = splice_inst %.loc8_24.5 [template = %.loc8_24.7 (constants.%.de1)] -// CHECK:STDOUT: %.loc8_24.4: type = splice_inst %.loc8_24.8 [template = %.loc8_24.9 (constants.%.5cd)] +// CHECK:STDOUT: %.loc8_24.4: type = splice_inst %.loc8_24.8 [template = %.loc8_24.9 (constants.%.537)] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref @F.%.loc8_24.9 (%.5cd) = wrapper_binding v, %v.var +// CHECK:STDOUT: %v: ref @F.%.loc8_24.9 (%.537) = wrapper_binding v, %v.var // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt.loc8_15.1: @F.%pattern_type.loc8 (%pattern_type.a1f) = ref_binding_pattern v [template = %v.patt.loc8_15.2 (constants.%v.patt.019)] -// CHECK:STDOUT: %v.var_patt.loc8_3.1: @F.%pattern_type.loc8 (%pattern_type.a1f) = var_pattern %v.patt.loc8_15.1 [template = %v.var_patt.loc8_3.2 (constants.%v.var_patt.d78)] +// CHECK:STDOUT: %v.patt.loc8_15.1: @F.%pattern_type.loc8 (%pattern_type.fcb) = ref_binding_pattern v [template = %v.patt.loc8_15.2 (constants.%v.patt.126)] +// CHECK:STDOUT: %v.var_patt.loc8_3.1: @F.%pattern_type.loc8 (%pattern_type.fcb) = var_pattern %v.patt.loc8_15.1 [template = %v.var_patt.loc8_3.2 (constants.%v.var_patt.768)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_3.11: type = type_of_inst %.loc8_3.29 [template = %.loc8_3.30 (constants.%.f97)] -// CHECK:STDOUT: %.loc8_3.12: @F.%.loc8_3.30 (%.f97) = splice_inst %.loc8_3.29 [template = %.loc8_3.31 (constants.%.f14)] -// CHECK:STDOUT: %.loc8_3.13: type = type_of_inst %.loc8_3.32 [template = %.loc8_3.33 (constants.%.2c7)] -// CHECK:STDOUT: %.loc8_3.14: @F.%.loc8_3.33 (%.2c7) = splice_inst %.loc8_3.32 [template = %.loc8_3.34 (constants.%.96f)] +// CHECK:STDOUT: %.loc8_3.2: type = type_of_inst %.loc8_3.8 [template = %.loc8_3.9 (constants.%.8cb)] +// CHECK:STDOUT: %.loc8_3.3: @F.%.loc8_3.9 (%.8cb) = splice_inst %.loc8_3.8 [template = %.loc8_3.10 (constants.%.c23)] +// CHECK:STDOUT: %.loc8_3.4: type = type_of_inst %.loc8_3.11 [template = %.loc8_3.12 (constants.%.57c)] +// CHECK:STDOUT: %.loc8_3.5: @F.%.loc8_3.12 (%.57c) = splice_inst %.loc8_3.11 [template = %.loc8_3.13 (constants.%.e63)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -330,7 +291,7 @@ fn G() { // CHECK:STDOUT: specific @F(constants.%T.67d) { // CHECK:STDOUT: %T.patt.loc7_7.2 => constants.%T.patt.3a0 // CHECK:STDOUT: %T.loc7_7.1 => constants.%T.67d -// CHECK:STDOUT: %pattern_type.loc7 => constants.%pattern_type.51d1c4.1 +// CHECK:STDOUT: %pattern_type.loc7 => constants.%pattern_type.51d // CHECK:STDOUT: %x.param_patt.loc7_23.2 => constants.%x.param_patt.91d // CHECK:STDOUT: %x.patt.loc7_23.2 => constants.%x.patt.260 // CHECK:STDOUT: } @@ -345,10 +306,10 @@ fn G() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc7 => constants.%complete_type // CHECK:STDOUT: %.loc8_23.2 => constants.%X -// CHECK:STDOUT: %.loc8_24.5 => constants.%inst.splice_block.5af +// CHECK:STDOUT: %.loc8_24.5 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc8_24.6 => type // CHECK:STDOUT: %.loc8_24.7 => constants.%S -// CHECK:STDOUT: %.loc8_24.8 => constants.%inst.splice_block.c1e +// CHECK:STDOUT: %.loc8_24.8 => constants.%inst.splice_block.426619.2 // CHECK:STDOUT: %.loc8_24.9 => constants.%S // CHECK:STDOUT: %require_complete.loc8 => constants.%complete_type // CHECK:STDOUT: %pattern_type.loc8 => constants.%pattern_type.981 @@ -357,31 +318,20 @@ fn G() { // CHECK:STDOUT: %.loc8_25.6 => constants.%.e53 // CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness => constants.%DefaultOrUnformed.impl_witness.1ff // CHECK:STDOUT: %DefaultOrUnformed.facet.loc8_25.2 => constants.%DefaultOrUnformed.facet.ba3 -// CHECK:STDOUT: %.loc8_25.7 => constants.%inst.splice_block.9d9 +// CHECK:STDOUT: %.loc8_25.7 => constants.%inst.splice_block.426619.3 // CHECK:STDOUT: %.loc8_25.8 => constants.%.805 // CHECK:STDOUT: %.loc8_25.9 => constants.%T.as_type.as.DefaultOrUnformed.impl.Op.83d -// CHECK:STDOUT: %.loc8_25.10 => constants.%inst.splice_block.7e5 +// CHECK:STDOUT: %.loc8_25.10 => constants.%inst.splice_block.426619.4 // CHECK:STDOUT: %.loc8_25.11 => constants.%S // CHECK:STDOUT: %.loc8_25.12 => invalid -// CHECK:STDOUT: %.loc8_3.15 => constants.%.352 -// CHECK:STDOUT: %.loc8_3.16 => constants.%.585e1e.2 -// CHECK:STDOUT: %.loc8_3.17 => constants.%.b296a8.2 -// CHECK:STDOUT: %.loc8_3.18 => constants.%.556 -// CHECK:STDOUT: %.loc8_3.19 => constants.%.e218d7.2 -// CHECK:STDOUT: %.loc8_3.20 => constants.%.f58188.2 -// CHECK:STDOUT: %.loc8_3.21 => constants.%.955 -// CHECK:STDOUT: %.loc8_3.22 => constants.%.5c9 -// CHECK:STDOUT: %.loc8_3.23 => constants.%.2bf -// CHECK:STDOUT: %.loc8_3.24 => constants.%.9a4 -// CHECK:STDOUT: %.loc8_3.25 => constants.%.94b -// CHECK:STDOUT: %.loc8_3.26 => constants.%.a03 -// CHECK:STDOUT: %.loc8_3.27 => constants.%.169 -// CHECK:STDOUT: %.loc8_3.28 => constants.%.217 -// CHECK:STDOUT: %.loc8_3.29 => constants.%inst.splice_block.80a -// CHECK:STDOUT: %.loc8_3.30 => -// CHECK:STDOUT: %.loc8_3.31 => invalid -// CHECK:STDOUT: %.loc8_3.32 => constants.%inst.call -// CHECK:STDOUT: %.loc8_3.33 => constants.%empty_tuple.type -// CHECK:STDOUT: %.loc8_3.34 => invalid +// CHECK:STDOUT: %.loc8_3.6 => constants.%tuple +// CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block.426619.5 +// CHECK:STDOUT: %.loc8_3.7 => invalid +// CHECK:STDOUT: %.loc8_3.8 => constants.%inst.splice_block.426619.6 +// CHECK:STDOUT: %.loc8_3.9 => +// CHECK:STDOUT: %.loc8_3.10 => invalid +// CHECK:STDOUT: %.loc8_3.11 => constants.%inst.call +// CHECK:STDOUT: %.loc8_3.12 => constants.%empty_tuple.type +// CHECK:STDOUT: %.loc8_3.13 => invalid // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/template/convert.carbon b/toolchain/lower/testdata/template/convert.carbon new file mode 100644 index 000000000000..3244961820ad --- /dev/null +++ b/toolchain/lower/testdata/template/convert.carbon @@ -0,0 +1,1124 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/template/convert.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/template/convert.carbon + +// --- convert.carbon + +library "[[@TEST_NAME]]"; + +fn F[template T: type](x: T) -> i32 { + let n: i32 = x; + return n; +} + +fn Test1(n: i32) -> i32 { + return F(n); +} + +class C { + var n: i32; + impl as Core.ImplicitAs(i32) { + fn Convert(self) -> i32 { return self.n; } + } +} + +fn Test2(c: C) -> i32 { + return F(c); +} + +// --- initialize_dependent_target_from_literal.carbon + +library "[[@TEST_NAME]]"; + +fn F(template T: type) { + var unused w: T = 0; +} + +fn G() { + F(i32); +} + +// --- initialize_primitive.carbon + +library "[[@TEST_NAME]]"; + +fn F[template T: type](x: T) { + var unused w: i32 = x; +} + +fn G() { + F(0 as i32); +} + +// --- initialize_from_tuple.carbon + +library "[[@TEST_NAME]]"; + +class X {} +fn Make() -> X; + +fn F(template T: type) { + var unused w: T = (Make(), Make(), Make()); +} + +class Y {} + +impl (X, X, X) as Core.ImplicitAs(Y) { + fn Convert(unused self: (X, X, X)) -> Y { return {}; } +} + +fn G() { + F((X, X, X)); + + F(array(X, 3)); + + F(Y); +} + +// --- initialize_from_nested_literal.carbon + +library "[[@TEST_NAME]]"; + +class X {} +fn Make() -> X; + +//@dump-sem-ir-begin +fn F(template T: type) { + var unused w: T = ({.a = Make(), .b = Make()}, Make()); +} +//@dump-sem-ir-end + +class Y { + impl X as Core.ImplicitAs(Y) { + fn Convert(self: X) -> Y; + } +} + +class Z { + var a: X; + var b: Y; +} + +fn G() { + F(({.a: X, .b: X}, X)); + + F(({.a: Y, .b: Y}, Y)); + + F((Z, Y)); +} + +// --- as.carbon + +library "[[@TEST_NAME]]"; + +fn AsI32[template T: type](x: T) -> i32 { + return x as i32; +} + +fn Test1(n: i32) { + let _: i32 = AsI32(n); +} + +class C { + var n: i32; + impl as Core.As(i32) { + fn Convert(self) -> i32 { return self.n; } + } +} + +fn Test2(c: C) { + let _: i32 = AsI32(c); +} + +// --- as_type.carbon + +library "[[@TEST_NAME]]"; + +fn AsType[template T: type](x: T, template U: type) { + let _: U = x as U; +} + +fn Test1(n: i32) { + AsType(n, i32); +} + +class C { + var n: i32; + impl as Core.As(i32) { + fn Convert(self) -> i32 { return self.n; } + } +} + +fn Test2(c: C) { + AsType(c, i32); +} + +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'convert.carbon' +// CHECK:STDOUT: source_filename = "convert.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @_CTest1.Main(i32 %n) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.84588f41d61dafba(i32 %n), !dbg !32 +// CHECK:STDOUT: ret i32 %F.call, !dbg !33 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @"_CConvert.C.Main:ImplicitAs.84588f41d61dafba.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc16_42.1.n = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !40 +// CHECK:STDOUT: %.loc16_42.2 = load i32, ptr %.loc16_42.1.n, align 4, !dbg !40 +// CHECK:STDOUT: ret i32 %.loc16_42.2, !dbg !41 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @_CTest2.Main(ptr %c) #0 !dbg !43 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.9522ff908e97e267(ptr %c), !dbg !49 +// CHECK:STDOUT: ret i32 %F.call, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.84588f41d61dafba(i32 %x) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret i32 %x, !dbg !61 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.9522ff908e97e267(ptr %x) #0 !dbg !63 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call = call i32 @"_CConvert.C.Main:ImplicitAs.84588f41d61dafba.Core"(ptr %x), !dbg !68 +// CHECK:STDOUT: ret i32 %C.as.ImplicitAs.impl.Convert.call, !dbg !72 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!19} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !18 = !DIFile(filename: "convert.carbon", directory: "") +// CHECK:STDOUT: !19 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !18, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !21 = !{!20, !20} +// CHECK:STDOUT: !22 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{!20, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Test1", linkageName: "_CTest1.Main", scope: null, file: !18, line: 9, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !34) +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !26, type: !20) +// CHECK:STDOUT: !32 = !DILocation(line: 10, column: 10, scope: !26) +// CHECK:STDOUT: !33 = !DILocation(line: 10, column: 3, scope: !26) +// CHECK:STDOUT: !34 = !{!27} +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.C.Main:ImplicitAs.84588f41d61dafba.Core", scope: null, file: !18, line: 16, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !42) +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !23) +// CHECK:STDOUT: !40 = !DILocation(line: 16, column: 38, scope: !35) +// CHECK:STDOUT: !41 = !DILocation(line: 16, column: 31, scope: !35) +// CHECK:STDOUT: !42 = !{!36} +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Test2", linkageName: "_CTest2.Main", scope: null, file: !18, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !51) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !23) +// CHECK:STDOUT: !49 = !DILocation(line: 21, column: 10, scope: !43) +// CHECK:STDOUT: !50 = !DILocation(line: 21, column: 3, scope: !43) +// CHECK:STDOUT: !51 = !{!44} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.84588f41d61dafba", scope: null, file: !18, line: 4, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !62) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !20) +// CHECK:STDOUT: !61 = !DILocation(line: 6, column: 3, scope: !52) +// CHECK:STDOUT: !62 = !{!53} +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.9522ff908e97e267", scope: null, file: !18, line: 4, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !73) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !23) +// CHECK:STDOUT: !68 = !DILocation(line: 5, column: 16, scope: !63) +// CHECK:STDOUT: !72 = !DILocation(line: 6, column: 3, scope: !63) +// CHECK:STDOUT: !73 = !{!64} +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'initialize_dependent_target_from_literal.carbon' +// CHECK:STDOUT: source_filename = "initialize_dependent_target_from_literal.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !80 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CF.Main.84588f41d61dafba(), !dbg !81 +// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !87 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !93 +// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.84588f41d61dafba() #0 !dbg !95 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %w.var = alloca i32, align 4, !dbg !96 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %w.var), !dbg !96 +// CHECK:STDOUT: store i32 0, ptr %w.var, align 4, !dbg !96 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %w.var), !dbg !96 +// CHECK:STDOUT: ret void, !dbg !98 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!75} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !74 = !DIFile(filename: "initialize_dependent_target_from_literal.carbon", directory: "") +// CHECK:STDOUT: !75 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !74, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !76 = !{null} +// CHECK:STDOUT: !77 = !DISubroutineType(types: !76) +// CHECK:STDOUT: !78 = !{null, !20} +// CHECK:STDOUT: !79 = !DISubroutineType(types: !78) +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !74, line: 8, type: !77, spFlags: DISPFlagDefinition, unit: !75) +// CHECK:STDOUT: !81 = !DILocation(line: 9, column: 3, scope: !80) +// CHECK:STDOUT: !82 = !DILocation(line: 8, column: 1, scope: !80) +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !74, line: 5, type: !79, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !86) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !20) +// CHECK:STDOUT: !85 = !DILocation(line: 5, column: 3, scope: !83) +// CHECK:STDOUT: !86 = !{!84} +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !74, line: 5, type: !79, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !90) +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !20) +// CHECK:STDOUT: !89 = !DILocation(line: 5, column: 3, scope: !87) +// CHECK:STDOUT: !90 = !{!88} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !74, line: 5, type: !79, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !94) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !20) +// CHECK:STDOUT: !93 = !DILocation(line: 5, column: 3, scope: !91) +// CHECK:STDOUT: !94 = !{!92} +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.84588f41d61dafba", scope: null, file: !74, line: 4, type: !77, spFlags: DISPFlagDefinition, unit: !75) +// CHECK:STDOUT: !96 = !DILocation(line: 5, column: 3, scope: !95) +// CHECK:STDOUT: !98 = !DILocation(line: 4, column: 1, scope: !95) +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'initialize_primitive.carbon' +// CHECK:STDOUT: source_filename = "initialize_primitive.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !101 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !105 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !107 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !109 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !111 +// CHECK:STDOUT: ret void, !dbg !111 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !113 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CF.Main.84588f41d61dafba(i32 0), !dbg !114 +// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.84588f41d61dafba(i32 %x) #0 !dbg !116 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %w.var = alloca i32, align 4, !dbg !119 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %w.var), !dbg !119 +// CHECK:STDOUT: store i32 %x, ptr %w.var, align 4, !dbg !119 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %w.var), !dbg !119 +// CHECK:STDOUT: ret void, !dbg !122 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!100} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !76 = !{null} +// CHECK:STDOUT: !77 = !DISubroutineType(types: !76) +// CHECK:STDOUT: !78 = !{null, !20} +// CHECK:STDOUT: !79 = !DISubroutineType(types: !78) +// CHECK:STDOUT: !99 = !DIFile(filename: "initialize_primitive.carbon", directory: "") +// CHECK:STDOUT: !100 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !99, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !99, line: 5, type: !79, spFlags: DISPFlagDefinition, unit: !100, retainedNodes: !104) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !20) +// CHECK:STDOUT: !103 = !DILocation(line: 5, column: 3, scope: !101) +// CHECK:STDOUT: !104 = !{!102} +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !99, line: 5, type: !79, spFlags: DISPFlagDefinition, unit: !100, retainedNodes: !108) +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !20) +// CHECK:STDOUT: !107 = !DILocation(line: 5, column: 3, scope: !105) +// CHECK:STDOUT: !108 = !{!106} +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !99, line: 5, type: !79, spFlags: DISPFlagDefinition, unit: !100, retainedNodes: !112) +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !20) +// CHECK:STDOUT: !111 = !DILocation(line: 5, column: 3, scope: !109) +// CHECK:STDOUT: !112 = !{!110} +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !99, line: 8, type: !77, spFlags: DISPFlagDefinition, unit: !100) +// CHECK:STDOUT: !114 = !DILocation(line: 9, column: 3, scope: !113) +// CHECK:STDOUT: !115 = !DILocation(line: 8, column: 1, scope: !113) +// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.84588f41d61dafba", scope: null, file: !99, line: 4, type: !79, spFlags: DISPFlagDefinition, unit: !100, retainedNodes: !123) +// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !20) +// CHECK:STDOUT: !119 = !DILocation(line: 5, column: 3, scope: !116) +// CHECK:STDOUT: !122 = !DILocation(line: 4, column: 1, scope: !116) +// CHECK:STDOUT: !123 = !{!117} +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'initialize_from_tuple.carbon' +// CHECK:STDOUT: source_filename = "initialize_from_tuple.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: @Y.val.loc14_54 = internal constant {} zeroinitializer +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @_CMake.Main(ptr sret({})) +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @"_CConvert.92e03c783d6af646:ImplicitAs.be297cc7300419fe.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !132 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @Y.val.loc14_54, i64 0, i1 false), !dbg !137 +// CHECK:STDOUT: ret void, !dbg !137 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !139 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CF.Main.fb3d597a6b1c4ee1(), !dbg !140 +// CHECK:STDOUT: call void @_CF.Main.cd5dea75f888aed4(), !dbg !141 +// CHECK:STDOUT: call void @_CF.Main.be297cc7300419fe(), !dbg !142 +// CHECK:STDOUT: ret void, !dbg !143 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !144 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !146 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !148 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !150 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !152 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core"(ptr %self), !dbg !154 +// CHECK:STDOUT: ret void, !dbg !154 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.92e03c783d6af646:core.Destroy.Core"(ptr %self) #0 !dbg !156 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !158 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.92e03c783d6af646:core.Destroy.Core"(ptr %self) #0 !dbg !160 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.92e03c783d6af646:core.Destroy.Core"(ptr %self), !dbg !162 +// CHECK:STDOUT: ret void, !dbg !162 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4c02ca82d7b9fa3c:core.Destroy.Core"(ptr %self) #0 !dbg !164 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !166 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4c02ca82d7b9fa3c:core.Destroy.Core"(ptr %self) #0 !dbg !168 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.4c02ca82d7b9fa3c:core.Destroy.Core"(ptr %self), !dbg !170 +// CHECK:STDOUT: ret void, !dbg !170 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.12212b84320f2fd6:core.Destroy.Core"(ptr %self) #0 !dbg !172 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !174 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.12212b84320f2fd6:core.Destroy.Core"(ptr %self) #0 !dbg !176 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.12212b84320f2fd6:core.Destroy.Core"(ptr %self), !dbg !178 +// CHECK:STDOUT: ret void, !dbg !178 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.fb3d597a6b1c4ee1() #0 !dbg !180 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %w.var = alloca { {}, {}, {} }, align 1, !dbg !181 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %w.var), !dbg !181 +// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { {}, {}, {} }, ptr %w.var, i32 0, i32 0, !dbg !182 +// CHECK:STDOUT: call void @_CMake.Main(ptr %tuple.elem0.tuple.elem), !dbg !183 +// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { {}, {}, {} }, ptr %w.var, i32 0, i32 1, !dbg !182 +// CHECK:STDOUT: call void @_CMake.Main(ptr %tuple.elem1.tuple.elem), !dbg !184 +// CHECK:STDOUT: %tuple.elem2.tuple.elem = getelementptr inbounds nuw { {}, {}, {} }, ptr %w.var, i32 0, i32 2, !dbg !182 +// CHECK:STDOUT: call void @_CMake.Main(ptr %tuple.elem2.tuple.elem), !dbg !185 +// CHECK:STDOUT: call void @"_CSelfDestruct.92e03c783d6af646:core.Destroy.Core"(ptr %w.var), !dbg !181 +// CHECK:STDOUT: ret void, !dbg !187 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.cd5dea75f888aed4() #0 !dbg !188 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %w.var = alloca [3 x {}], align 1, !dbg !189 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %w.var), !dbg !189 +// CHECK:STDOUT: %.f75.array.index = getelementptr inbounds [3 x {}], ptr %w.var, i32 0, i64 0, !dbg !190 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.f75.array.index), !dbg !191 +// CHECK:STDOUT: %.efc.array.index = getelementptr inbounds [3 x {}], ptr %w.var, i32 0, i64 1, !dbg !190 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.efc.array.index), !dbg !192 +// CHECK:STDOUT: %.d3b.array.index = getelementptr inbounds [3 x {}], ptr %w.var, i32 0, i64 2, !dbg !190 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.d3b.array.index), !dbg !193 +// CHECK:STDOUT: call void @"_CSelfDestruct.4c02ca82d7b9fa3c:core.Destroy.Core"(ptr %w.var), !dbg !189 +// CHECK:STDOUT: ret void, !dbg !195 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.be297cc7300419fe() #0 !dbg !196 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %w.var = alloca {}, align 1, !dbg !197 +// CHECK:STDOUT: %.7a56fd.1.temp = alloca {}, align 1, !dbg !197 +// CHECK:STDOUT: %.7a56fd.2.temp = alloca {}, align 1, !dbg !197 +// CHECK:STDOUT: %.7a56fd.3.temp = alloca {}, align 1, !dbg !197 +// CHECK:STDOUT: %tuple.9aa = alloca { ptr, ptr, ptr }, align 8, !dbg !201 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %w.var), !dbg !197 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.7a56fd.1.temp), !dbg !197 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.7a56fd.1.temp), !dbg !198 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.7a56fd.2.temp), !dbg !197 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.7a56fd.2.temp), !dbg !199 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.7a56fd.3.temp), !dbg !197 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.7a56fd.3.temp), !dbg !200 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %tuple.9aa), !dbg !201 +// CHECK:STDOUT: %tuple.9aa1 = getelementptr inbounds nuw { ptr, ptr, ptr }, ptr %tuple.9aa, i32 0, i32 0, !dbg !201 +// CHECK:STDOUT: store ptr %.7a56fd.1.temp, ptr %tuple.9aa1, align 8, !dbg !201 +// CHECK:STDOUT: %tuple.9aa2 = getelementptr inbounds nuw { ptr, ptr, ptr }, ptr %tuple.9aa, i32 0, i32 1, !dbg !201 +// CHECK:STDOUT: store ptr %.7a56fd.2.temp, ptr %tuple.9aa2, align 8, !dbg !201 +// CHECK:STDOUT: %tuple.9aa3 = getelementptr inbounds nuw { ptr, ptr, ptr }, ptr %tuple.9aa, i32 0, i32 2, !dbg !201 +// CHECK:STDOUT: store ptr %.7a56fd.3.temp, ptr %tuple.9aa3, align 8, !dbg !201 +// CHECK:STDOUT: call void @"_CConvert.92e03c783d6af646:ImplicitAs.be297cc7300419fe.Core"(ptr %w.var, ptr %tuple.9aa), !dbg !197 +// CHECK:STDOUT: call void @"_CSelfDestruct.12212b84320f2fd6:core.Destroy.Core"(ptr %w.var), !dbg !197 +// CHECK:STDOUT: ret void, !dbg !203 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 6, 5, 4, 3, 2, 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!125} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !76 = !{null} +// CHECK:STDOUT: !77 = !DISubroutineType(types: !76) +// CHECK:STDOUT: !124 = !DIFile(filename: "initialize_from_tuple.carbon", directory: "") +// CHECK:STDOUT: !125 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !124, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !128 = !{!23, !23} +// CHECK:STDOUT: !129 = !DISubroutineType(types: !128) +// CHECK:STDOUT: !130 = !{null, !23} +// CHECK:STDOUT: !131 = !DISubroutineType(types: !130) +// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.92e03c783d6af646:ImplicitAs.be297cc7300419fe.Core", scope: null, file: !124, line: 14, type: !129, spFlags: DISPFlagDefinition, unit: !125, retainedNodes: !138) +// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !23) +// CHECK:STDOUT: !137 = !DILocation(line: 14, column: 45, scope: !132) +// CHECK:STDOUT: !138 = !{!133} +// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !124, line: 17, type: !77, spFlags: DISPFlagDefinition, unit: !125) +// CHECK:STDOUT: !140 = !DILocation(line: 18, column: 3, scope: !139) +// CHECK:STDOUT: !141 = !DILocation(line: 20, column: 3, scope: !139) +// CHECK:STDOUT: !142 = !DILocation(line: 22, column: 3, scope: !139) +// CHECK:STDOUT: !143 = !DILocation(line: 17, column: 1, scope: !139) +// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !124, line: 8, type: !131, spFlags: DISPFlagDefinition, unit: !125, retainedNodes: !147) +// CHECK:STDOUT: !145 = !DILocalVariable(arg: 1, scope: !144, type: !23) +// CHECK:STDOUT: !146 = !DILocation(line: 8, column: 3, scope: !144) +// CHECK:STDOUT: !147 = !{!145} +// CHECK:STDOUT: !148 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !124, line: 8, type: !131, spFlags: DISPFlagDefinition, unit: !125, retainedNodes: !151) +// CHECK:STDOUT: !149 = !DILocalVariable(arg: 1, scope: !148, type: !23) +// CHECK:STDOUT: !150 = !DILocation(line: 8, column: 3, scope: !148) +// CHECK:STDOUT: !151 = !{!149} +// CHECK:STDOUT: !152 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !124, line: 8, type: !131, spFlags: DISPFlagDefinition, unit: !125, retainedNodes: !155) +// CHECK:STDOUT: !153 = !DILocalVariable(arg: 1, scope: !152, type: !23) +// CHECK:STDOUT: !154 = !DILocation(line: 8, column: 3, scope: !152) +// CHECK:STDOUT: !155 = !{!153} +// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.92e03c783d6af646:core.Destroy.Core", scope: null, file: !124, line: 8, type: !131, spFlags: DISPFlagDefinition, unit: !125, retainedNodes: !159) +// CHECK:STDOUT: !157 = !DILocalVariable(arg: 1, scope: !156, type: !23) +// CHECK:STDOUT: !158 = !DILocation(line: 8, column: 3, scope: !156) +// CHECK:STDOUT: !159 = !{!157} +// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.92e03c783d6af646:core.Destroy.Core", scope: null, file: !124, line: 8, type: !131, spFlags: DISPFlagDefinition, unit: !125, retainedNodes: !163) +// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !23) +// CHECK:STDOUT: !162 = !DILocation(line: 8, column: 3, scope: !160) +// CHECK:STDOUT: !163 = !{!161} +// CHECK:STDOUT: !164 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4c02ca82d7b9fa3c:core.Destroy.Core", scope: null, file: !124, line: 8, type: !131, spFlags: DISPFlagDefinition, unit: !125, retainedNodes: !167) +// CHECK:STDOUT: !165 = !DILocalVariable(arg: 1, scope: !164, type: !23) +// CHECK:STDOUT: !166 = !DILocation(line: 8, column: 3, scope: !164) +// CHECK:STDOUT: !167 = !{!165} +// CHECK:STDOUT: !168 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4c02ca82d7b9fa3c:core.Destroy.Core", scope: null, file: !124, line: 8, type: !131, spFlags: DISPFlagDefinition, unit: !125, retainedNodes: !171) +// CHECK:STDOUT: !169 = !DILocalVariable(arg: 1, scope: !168, type: !23) +// CHECK:STDOUT: !170 = !DILocation(line: 8, column: 3, scope: !168) +// CHECK:STDOUT: !171 = !{!169} +// CHECK:STDOUT: !172 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.12212b84320f2fd6:core.Destroy.Core", scope: null, file: !124, line: 8, type: !131, spFlags: DISPFlagDefinition, unit: !125, retainedNodes: !175) +// CHECK:STDOUT: !173 = !DILocalVariable(arg: 1, scope: !172, type: !23) +// CHECK:STDOUT: !174 = !DILocation(line: 8, column: 3, scope: !172) +// CHECK:STDOUT: !175 = !{!173} +// CHECK:STDOUT: !176 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.12212b84320f2fd6:core.Destroy.Core", scope: null, file: !124, line: 8, type: !131, spFlags: DISPFlagDefinition, unit: !125, retainedNodes: !179) +// CHECK:STDOUT: !177 = !DILocalVariable(arg: 1, scope: !176, type: !23) +// CHECK:STDOUT: !178 = !DILocation(line: 8, column: 3, scope: !176) +// CHECK:STDOUT: !179 = !{!177} +// CHECK:STDOUT: !180 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.fb3d597a6b1c4ee1", scope: null, file: !124, line: 7, type: !77, spFlags: DISPFlagDefinition, unit: !125) +// CHECK:STDOUT: !181 = !DILocation(line: 8, column: 3, scope: !180) +// CHECK:STDOUT: !182 = !DILocation(line: 8, column: 21, scope: !180) +// CHECK:STDOUT: !183 = !DILocation(line: 8, column: 22, scope: !180) +// CHECK:STDOUT: !184 = !DILocation(line: 8, column: 30, scope: !180) +// CHECK:STDOUT: !185 = !DILocation(line: 8, column: 38, scope: !180) +// CHECK:STDOUT: !187 = !DILocation(line: 7, column: 1, scope: !180) +// CHECK:STDOUT: !188 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.cd5dea75f888aed4", scope: null, file: !124, line: 7, type: !77, spFlags: DISPFlagDefinition, unit: !125) +// CHECK:STDOUT: !189 = !DILocation(line: 8, column: 3, scope: !188) +// CHECK:STDOUT: !190 = !DILocation(line: 8, column: 21, scope: !188) +// CHECK:STDOUT: !191 = !DILocation(line: 8, column: 22, scope: !188) +// CHECK:STDOUT: !192 = !DILocation(line: 8, column: 30, scope: !188) +// CHECK:STDOUT: !193 = !DILocation(line: 8, column: 38, scope: !188) +// CHECK:STDOUT: !195 = !DILocation(line: 7, column: 1, scope: !188) +// CHECK:STDOUT: !196 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.be297cc7300419fe", scope: null, file: !124, line: 7, type: !77, spFlags: DISPFlagDefinition, unit: !125) +// CHECK:STDOUT: !197 = !DILocation(line: 8, column: 3, scope: !196) +// CHECK:STDOUT: !198 = !DILocation(line: 8, column: 22, scope: !196) +// CHECK:STDOUT: !199 = !DILocation(line: 8, column: 30, scope: !196) +// CHECK:STDOUT: !200 = !DILocation(line: 8, column: 38, scope: !196) +// CHECK:STDOUT: !201 = !DILocation(line: 8, column: 21, scope: !196) +// CHECK:STDOUT: !203 = !DILocation(line: 7, column: 1, scope: !196) +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'initialize_from_nested_literal.carbon' +// CHECK:STDOUT: source_filename = "initialize_from_nested_literal.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @_CMake.Main(ptr sret({})) +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_CConvert.X.Main:ImplicitAs.be297cc7300419fe.Core"(ptr sret({}), ptr) +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !206 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CF.Main.75a9ebb2041c173b(), !dbg !207 +// CHECK:STDOUT: call void @_CF.Main.f5d9b693014ce43e(), !dbg !208 +// CHECK:STDOUT: call void @_CF.Main.84270bb113cb754b(), !dbg !209 +// CHECK:STDOUT: ret void, !dbg !210 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !211 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !213 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !215 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !217 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !219 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core"(ptr %self), !dbg !221 +// CHECK:STDOUT: ret void, !dbg !221 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f38e1c3ccdfe019b:core.Destroy.Core"(ptr %self) #0 !dbg !223 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !225 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f38e1c3ccdfe019b:core.Destroy.Core"(ptr %self) #0 !dbg !227 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f38e1c3ccdfe019b:core.Destroy.Core"(ptr %self), !dbg !229 +// CHECK:STDOUT: ret void, !dbg !229 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4c2c335412ec52fa:core.Destroy.Core"(ptr %self) #0 !dbg !231 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !233 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4c2c335412ec52fa:core.Destroy.Core"(ptr %self) #0 !dbg !235 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.4c2c335412ec52fa:core.Destroy.Core"(ptr %self), !dbg !237 +// CHECK:STDOUT: ret void, !dbg !237 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.12212b84320f2fd6:core.Destroy.Core"(ptr %self) #0 !dbg !239 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !241 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.12212b84320f2fd6:core.Destroy.Core"(ptr %self) #0 !dbg !243 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.12212b84320f2fd6:core.Destroy.Core"(ptr %self), !dbg !245 +// CHECK:STDOUT: ret void, !dbg !245 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0950f8aecfaebf0b:core.Destroy.Core"(ptr %self) #0 !dbg !247 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !249 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0950f8aecfaebf0b:core.Destroy.Core"(ptr %self) #0 !dbg !251 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0950f8aecfaebf0b:core.Destroy.Core"(ptr %self), !dbg !253 +// CHECK:STDOUT: ret void, !dbg !253 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.2f43e328c637647f:core.Destroy.Core"(ptr %self) #0 !dbg !255 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !257 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.2f43e328c637647f:core.Destroy.Core"(ptr %self) #0 !dbg !259 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.2f43e328c637647f:core.Destroy.Core"(ptr %self), !dbg !261 +// CHECK:STDOUT: ret void, !dbg !261 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.2970be6ba4c2615c:core.Destroy.Core"(ptr %self) #0 !dbg !263 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !265 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.2970be6ba4c2615c:core.Destroy.Core"(ptr %self) #0 !dbg !267 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.2970be6ba4c2615c:core.Destroy.Core"(ptr %self), !dbg !269 +// CHECK:STDOUT: ret void, !dbg !269 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self) #0 !dbg !271 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !273 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self) #0 !dbg !275 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self), !dbg !277 +// CHECK:STDOUT: ret void, !dbg !277 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.bb4067704e9a198c:core.Destroy.Core"(ptr %self) #0 !dbg !279 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !281 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bb4067704e9a198c:core.Destroy.Core"(ptr %self) #0 !dbg !283 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.bb4067704e9a198c:core.Destroy.Core"(ptr %self), !dbg !285 +// CHECK:STDOUT: ret void, !dbg !285 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.75a9ebb2041c173b() #0 !dbg !287 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %w.var = alloca { { {}, {} }, {} }, align 1, !dbg !288 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %w.var), !dbg !288 +// CHECK:STDOUT: %tuple.elem0.a28.tuple.elem = getelementptr inbounds nuw { { {}, {} }, {} }, ptr %w.var, i32 0, i32 0, !dbg !290 +// CHECK:STDOUT: %.d62.a = getelementptr inbounds nuw { {}, {} }, ptr %tuple.elem0.a28.tuple.elem, i32 0, i32 0, !dbg !289 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.d62.a), !dbg !291 +// CHECK:STDOUT: %.162.b = getelementptr inbounds nuw { {}, {} }, ptr %tuple.elem0.a28.tuple.elem, i32 0, i32 1, !dbg !289 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.162.b), !dbg !292 +// CHECK:STDOUT: %tuple.elem1.79b.tuple.elem = getelementptr inbounds nuw { { {}, {} }, {} }, ptr %w.var, i32 0, i32 1, !dbg !290 +// CHECK:STDOUT: call void @_CMake.Main(ptr %tuple.elem1.79b.tuple.elem), !dbg !293 +// CHECK:STDOUT: call void @"_CSelfDestruct.4c2c335412ec52fa:core.Destroy.Core"(ptr %w.var), !dbg !288 +// CHECK:STDOUT: ret void, !dbg !295 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.f5d9b693014ce43e() #0 !dbg !296 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %w.var = alloca { { {}, {} }, {} }, align 1, !dbg !297 +// CHECK:STDOUT: %.7a56fd.1.temp = alloca {}, align 1, !dbg !297 +// CHECK:STDOUT: %.7a56fd.2.temp = alloca {}, align 1, !dbg !297 +// CHECK:STDOUT: %.7a56fd.3.temp = alloca {}, align 1, !dbg !297 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %w.var), !dbg !297 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.7a56fd.1.temp), !dbg !297 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.7a56fd.1.temp), !dbg !298 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.7a56fd.2.temp), !dbg !297 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.7a56fd.2.temp), !dbg !299 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.7a56fd.3.temp), !dbg !297 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.7a56fd.3.temp), !dbg !301 +// CHECK:STDOUT: %tuple.elem0.25a.tuple.elem = getelementptr inbounds nuw { { {}, {} }, {} }, ptr %w.var, i32 0, i32 0, !dbg !302 +// CHECK:STDOUT: %.e68.a = getelementptr inbounds nuw { {}, {} }, ptr %tuple.elem0.25a.tuple.elem, i32 0, i32 0, !dbg !300 +// CHECK:STDOUT: call void @"_CConvert.X.Main:ImplicitAs.be297cc7300419fe.Core"(ptr %.e68.a, ptr %.7a56fd.1.temp), !dbg !300 +// CHECK:STDOUT: %.9f2.b = getelementptr inbounds nuw { {}, {} }, ptr %tuple.elem0.25a.tuple.elem, i32 0, i32 1, !dbg !300 +// CHECK:STDOUT: call void @"_CConvert.X.Main:ImplicitAs.be297cc7300419fe.Core"(ptr %.9f2.b, ptr %.7a56fd.2.temp), !dbg !300 +// CHECK:STDOUT: %tuple.elem1.0e1.tuple.elem = getelementptr inbounds nuw { { {}, {} }, {} }, ptr %w.var, i32 0, i32 1, !dbg !302 +// CHECK:STDOUT: call void @"_CConvert.X.Main:ImplicitAs.be297cc7300419fe.Core"(ptr %tuple.elem1.0e1.tuple.elem, ptr %.7a56fd.3.temp), !dbg !302 +// CHECK:STDOUT: call void @"_CSelfDestruct.2f43e328c637647f:core.Destroy.Core"(ptr %w.var), !dbg !297 +// CHECK:STDOUT: ret void, !dbg !304 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.84270bb113cb754b() #0 !dbg !305 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %w.var = alloca { { {}, {} }, {} }, align 1, !dbg !306 +// CHECK:STDOUT: %.7a56fd.4.temp = alloca {}, align 1, !dbg !306 +// CHECK:STDOUT: %.7a56fd.5.temp = alloca {}, align 1, !dbg !306 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %w.var), !dbg !306 +// CHECK:STDOUT: %tuple.elem0.d0d.tuple.elem = getelementptr inbounds nuw { { {}, {} }, {} }, ptr %w.var, i32 0, i32 0, !dbg !308 +// CHECK:STDOUT: %.b76.a = getelementptr inbounds nuw { {}, {} }, ptr %tuple.elem0.d0d.tuple.elem, i32 0, i32 0, !dbg !307 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.b76.a), !dbg !309 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.7a56fd.4.temp), !dbg !306 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.7a56fd.4.temp), !dbg !310 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.7a56fd.5.temp), !dbg !306 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.7a56fd.5.temp), !dbg !311 +// CHECK:STDOUT: %.25e.b = getelementptr inbounds nuw { {}, {} }, ptr %tuple.elem0.d0d.tuple.elem, i32 0, i32 1, !dbg !307 +// CHECK:STDOUT: call void @"_CConvert.X.Main:ImplicitAs.be297cc7300419fe.Core"(ptr %.25e.b, ptr %.7a56fd.4.temp), !dbg !307 +// CHECK:STDOUT: %tuple.elem1.c76.tuple.elem = getelementptr inbounds nuw { { {}, {} }, {} }, ptr %w.var, i32 0, i32 1, !dbg !308 +// CHECK:STDOUT: call void @"_CConvert.X.Main:ImplicitAs.be297cc7300419fe.Core"(ptr %tuple.elem1.c76.tuple.elem, ptr %.7a56fd.5.temp), !dbg !308 +// CHECK:STDOUT: call void @"_CSelfDestruct.bb4067704e9a198c:core.Destroy.Core"(ptr %w.var), !dbg !306 +// CHECK:STDOUT: ret void, !dbg !313 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 7, 6, 5, 4, 3, 2, 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!205} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !76 = !{null} +// CHECK:STDOUT: !77 = !DISubroutineType(types: !76) +// CHECK:STDOUT: !130 = !{null, !23} +// CHECK:STDOUT: !131 = !DISubroutineType(types: !130) +// CHECK:STDOUT: !204 = !DIFile(filename: "initialize_from_nested_literal.carbon", directory: "") +// CHECK:STDOUT: !205 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !204, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !206 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !204, line: 24, type: !77, spFlags: DISPFlagDefinition, unit: !205) +// CHECK:STDOUT: !207 = !DILocation(line: 25, column: 3, scope: !206) +// CHECK:STDOUT: !208 = !DILocation(line: 27, column: 3, scope: !206) +// CHECK:STDOUT: !209 = !DILocation(line: 29, column: 3, scope: !206) +// CHECK:STDOUT: !210 = !DILocation(line: 24, column: 1, scope: !206) +// CHECK:STDOUT: !211 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !214) +// CHECK:STDOUT: !212 = !DILocalVariable(arg: 1, scope: !211, type: !23) +// CHECK:STDOUT: !213 = !DILocation(line: 9, column: 3, scope: !211) +// CHECK:STDOUT: !214 = !{!212} +// CHECK:STDOUT: !215 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !218) +// CHECK:STDOUT: !216 = !DILocalVariable(arg: 1, scope: !215, type: !23) +// CHECK:STDOUT: !217 = !DILocation(line: 9, column: 3, scope: !215) +// CHECK:STDOUT: !218 = !{!216} +// CHECK:STDOUT: !219 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !222) +// CHECK:STDOUT: !220 = !DILocalVariable(arg: 1, scope: !219, type: !23) +// CHECK:STDOUT: !221 = !DILocation(line: 9, column: 3, scope: !219) +// CHECK:STDOUT: !222 = !{!220} +// CHECK:STDOUT: !223 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f38e1c3ccdfe019b:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !226) +// CHECK:STDOUT: !224 = !DILocalVariable(arg: 1, scope: !223, type: !23) +// CHECK:STDOUT: !225 = !DILocation(line: 9, column: 3, scope: !223) +// CHECK:STDOUT: !226 = !{!224} +// CHECK:STDOUT: !227 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f38e1c3ccdfe019b:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !230) +// CHECK:STDOUT: !228 = !DILocalVariable(arg: 1, scope: !227, type: !23) +// CHECK:STDOUT: !229 = !DILocation(line: 9, column: 3, scope: !227) +// CHECK:STDOUT: !230 = !{!228} +// CHECK:STDOUT: !231 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4c2c335412ec52fa:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !234) +// CHECK:STDOUT: !232 = !DILocalVariable(arg: 1, scope: !231, type: !23) +// CHECK:STDOUT: !233 = !DILocation(line: 9, column: 3, scope: !231) +// CHECK:STDOUT: !234 = !{!232} +// CHECK:STDOUT: !235 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4c2c335412ec52fa:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !238) +// CHECK:STDOUT: !236 = !DILocalVariable(arg: 1, scope: !235, type: !23) +// CHECK:STDOUT: !237 = !DILocation(line: 9, column: 3, scope: !235) +// CHECK:STDOUT: !238 = !{!236} +// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.12212b84320f2fd6:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !242) +// CHECK:STDOUT: !240 = !DILocalVariable(arg: 1, scope: !239, type: !23) +// CHECK:STDOUT: !241 = !DILocation(line: 9, column: 3, scope: !239) +// CHECK:STDOUT: !242 = !{!240} +// CHECK:STDOUT: !243 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.12212b84320f2fd6:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !246) +// CHECK:STDOUT: !244 = !DILocalVariable(arg: 1, scope: !243, type: !23) +// CHECK:STDOUT: !245 = !DILocation(line: 9, column: 3, scope: !243) +// CHECK:STDOUT: !246 = !{!244} +// CHECK:STDOUT: !247 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0950f8aecfaebf0b:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !250) +// CHECK:STDOUT: !248 = !DILocalVariable(arg: 1, scope: !247, type: !23) +// CHECK:STDOUT: !249 = !DILocation(line: 9, column: 3, scope: !247) +// CHECK:STDOUT: !250 = !{!248} +// CHECK:STDOUT: !251 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0950f8aecfaebf0b:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !254) +// CHECK:STDOUT: !252 = !DILocalVariable(arg: 1, scope: !251, type: !23) +// CHECK:STDOUT: !253 = !DILocation(line: 9, column: 3, scope: !251) +// CHECK:STDOUT: !254 = !{!252} +// CHECK:STDOUT: !255 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.2f43e328c637647f:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !258) +// CHECK:STDOUT: !256 = !DILocalVariable(arg: 1, scope: !255, type: !23) +// CHECK:STDOUT: !257 = !DILocation(line: 9, column: 3, scope: !255) +// CHECK:STDOUT: !258 = !{!256} +// CHECK:STDOUT: !259 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.2f43e328c637647f:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !262) +// CHECK:STDOUT: !260 = !DILocalVariable(arg: 1, scope: !259, type: !23) +// CHECK:STDOUT: !261 = !DILocation(line: 9, column: 3, scope: !259) +// CHECK:STDOUT: !262 = !{!260} +// CHECK:STDOUT: !263 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.2970be6ba4c2615c:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !266) +// CHECK:STDOUT: !264 = !DILocalVariable(arg: 1, scope: !263, type: !23) +// CHECK:STDOUT: !265 = !DILocation(line: 9, column: 3, scope: !263) +// CHECK:STDOUT: !266 = !{!264} +// CHECK:STDOUT: !267 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.2970be6ba4c2615c:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !270) +// CHECK:STDOUT: !268 = !DILocalVariable(arg: 1, scope: !267, type: !23) +// CHECK:STDOUT: !269 = !DILocation(line: 9, column: 3, scope: !267) +// CHECK:STDOUT: !270 = !{!268} +// CHECK:STDOUT: !271 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.680f7fa3ef86df7a:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !274) +// CHECK:STDOUT: !272 = !DILocalVariable(arg: 1, scope: !271, type: !23) +// CHECK:STDOUT: !273 = !DILocation(line: 9, column: 3, scope: !271) +// CHECK:STDOUT: !274 = !{!272} +// CHECK:STDOUT: !275 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.680f7fa3ef86df7a:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !278) +// CHECK:STDOUT: !276 = !DILocalVariable(arg: 1, scope: !275, type: !23) +// CHECK:STDOUT: !277 = !DILocation(line: 9, column: 3, scope: !275) +// CHECK:STDOUT: !278 = !{!276} +// CHECK:STDOUT: !279 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.bb4067704e9a198c:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !282) +// CHECK:STDOUT: !280 = !DILocalVariable(arg: 1, scope: !279, type: !23) +// CHECK:STDOUT: !281 = !DILocation(line: 9, column: 3, scope: !279) +// CHECK:STDOUT: !282 = !{!280} +// CHECK:STDOUT: !283 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bb4067704e9a198c:core.Destroy.Core", scope: null, file: !204, line: 9, type: !131, spFlags: DISPFlagDefinition, unit: !205, retainedNodes: !286) +// CHECK:STDOUT: !284 = !DILocalVariable(arg: 1, scope: !283, type: !23) +// CHECK:STDOUT: !285 = !DILocation(line: 9, column: 3, scope: !283) +// CHECK:STDOUT: !286 = !{!284} +// CHECK:STDOUT: !287 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.75a9ebb2041c173b", scope: null, file: !204, line: 8, type: !77, spFlags: DISPFlagDefinition, unit: !205) +// CHECK:STDOUT: !288 = !DILocation(line: 9, column: 3, scope: !287) +// CHECK:STDOUT: !289 = !DILocation(line: 9, column: 22, scope: !287) +// CHECK:STDOUT: !290 = !DILocation(line: 9, column: 21, scope: !287) +// CHECK:STDOUT: !291 = !DILocation(line: 9, column: 28, scope: !287) +// CHECK:STDOUT: !292 = !DILocation(line: 9, column: 41, scope: !287) +// CHECK:STDOUT: !293 = !DILocation(line: 9, column: 50, scope: !287) +// CHECK:STDOUT: !295 = !DILocation(line: 8, column: 1, scope: !287) +// CHECK:STDOUT: !296 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.f5d9b693014ce43e", scope: null, file: !204, line: 8, type: !77, spFlags: DISPFlagDefinition, unit: !205) +// CHECK:STDOUT: !297 = !DILocation(line: 9, column: 3, scope: !296) +// CHECK:STDOUT: !298 = !DILocation(line: 9, column: 28, scope: !296) +// CHECK:STDOUT: !299 = !DILocation(line: 9, column: 41, scope: !296) +// CHECK:STDOUT: !300 = !DILocation(line: 9, column: 22, scope: !296) +// CHECK:STDOUT: !301 = !DILocation(line: 9, column: 50, scope: !296) +// CHECK:STDOUT: !302 = !DILocation(line: 9, column: 21, scope: !296) +// CHECK:STDOUT: !304 = !DILocation(line: 8, column: 1, scope: !296) +// CHECK:STDOUT: !305 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.84270bb113cb754b", scope: null, file: !204, line: 8, type: !77, spFlags: DISPFlagDefinition, unit: !205) +// CHECK:STDOUT: !306 = !DILocation(line: 9, column: 3, scope: !305) +// CHECK:STDOUT: !307 = !DILocation(line: 9, column: 22, scope: !305) +// CHECK:STDOUT: !308 = !DILocation(line: 9, column: 21, scope: !305) +// CHECK:STDOUT: !309 = !DILocation(line: 9, column: 28, scope: !305) +// CHECK:STDOUT: !310 = !DILocation(line: 9, column: 41, scope: !305) +// CHECK:STDOUT: !311 = !DILocation(line: 9, column: 50, scope: !305) +// CHECK:STDOUT: !313 = !DILocation(line: 8, column: 1, scope: !305) +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'as.carbon' +// CHECK:STDOUT: source_filename = "as.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CTest1.Main(i32 %n) #0 !dbg !316 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %AsI32.call = call i32 @_CAsI32.Main.84588f41d61dafba(i32 %n), !dbg !320 +// CHECK:STDOUT: ret void, !dbg !323 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @"_CConvert.C.Main:As.84588f41d61dafba.Core"(ptr %self) #0 !dbg !325 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc15_42.1.n = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !330 +// CHECK:STDOUT: %.loc15_42.2 = load i32, ptr %.loc15_42.1.n, align 4, !dbg !330 +// CHECK:STDOUT: ret i32 %.loc15_42.2, !dbg !331 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CTest2.Main(ptr %c) #0 !dbg !333 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %AsI32.call = call i32 @_CAsI32.Main.9522ff908e97e267(ptr %c), !dbg !337 +// CHECK:STDOUT: ret void, !dbg !340 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CAsI32.Main.84588f41d61dafba(i32 %x) #0 !dbg !342 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret i32 %x, !dbg !348 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CAsI32.Main.9522ff908e97e267(ptr %x) #0 !dbg !350 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %C.as.As.impl.Convert.call = call i32 @"_CConvert.C.Main:As.84588f41d61dafba.Core"(ptr %x), !dbg !355 +// CHECK:STDOUT: ret i32 %C.as.As.impl.Convert.call, !dbg !356 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!315} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !21 = !{!20, !20} +// CHECK:STDOUT: !22 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{!20, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !78 = !{null, !20} +// CHECK:STDOUT: !79 = !DISubroutineType(types: !78) +// CHECK:STDOUT: !130 = !{null, !23} +// CHECK:STDOUT: !131 = !DISubroutineType(types: !130) +// CHECK:STDOUT: !314 = !DIFile(filename: "as.carbon", directory: "") +// CHECK:STDOUT: !315 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !314, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !316 = distinct !DISubprogram(name: "Test1", linkageName: "_CTest1.Main", scope: null, file: !314, line: 8, type: !79, spFlags: DISPFlagDefinition, unit: !315, retainedNodes: !324) +// CHECK:STDOUT: !317 = !DILocalVariable(arg: 1, scope: !316, type: !20) +// CHECK:STDOUT: !320 = !DILocation(line: 9, column: 16, scope: !316) +// CHECK:STDOUT: !323 = !DILocation(line: 8, column: 1, scope: !316) +// CHECK:STDOUT: !324 = !{!317} +// CHECK:STDOUT: !325 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.C.Main:As.84588f41d61dafba.Core", scope: null, file: !314, line: 15, type: !25, spFlags: DISPFlagDefinition, unit: !315, retainedNodes: !332) +// CHECK:STDOUT: !326 = !DILocalVariable(arg: 1, scope: !325, type: !23) +// CHECK:STDOUT: !330 = !DILocation(line: 15, column: 38, scope: !325) +// CHECK:STDOUT: !331 = !DILocation(line: 15, column: 31, scope: !325) +// CHECK:STDOUT: !332 = !{!326} +// CHECK:STDOUT: !333 = distinct !DISubprogram(name: "Test2", linkageName: "_CTest2.Main", scope: null, file: !314, line: 19, type: !131, spFlags: DISPFlagDefinition, unit: !315, retainedNodes: !341) +// CHECK:STDOUT: !334 = !DILocalVariable(arg: 1, scope: !333, type: !23) +// CHECK:STDOUT: !337 = !DILocation(line: 20, column: 16, scope: !333) +// CHECK:STDOUT: !340 = !DILocation(line: 19, column: 1, scope: !333) +// CHECK:STDOUT: !341 = !{!334} +// CHECK:STDOUT: !342 = distinct !DISubprogram(name: "AsI32", linkageName: "_CAsI32.Main.84588f41d61dafba", scope: null, file: !314, line: 4, type: !22, spFlags: DISPFlagDefinition, unit: !315, retainedNodes: !349) +// CHECK:STDOUT: !343 = !DILocalVariable(arg: 1, scope: !342, type: !20) +// CHECK:STDOUT: !348 = !DILocation(line: 5, column: 3, scope: !342) +// CHECK:STDOUT: !349 = !{!343} +// CHECK:STDOUT: !350 = distinct !DISubprogram(name: "AsI32", linkageName: "_CAsI32.Main.9522ff908e97e267", scope: null, file: !314, line: 4, type: !25, spFlags: DISPFlagDefinition, unit: !315, retainedNodes: !357) +// CHECK:STDOUT: !351 = !DILocalVariable(arg: 1, scope: !350, type: !23) +// CHECK:STDOUT: !355 = !DILocation(line: 5, column: 10, scope: !350) +// CHECK:STDOUT: !356 = !DILocation(line: 5, column: 3, scope: !350) +// CHECK:STDOUT: !357 = !{!351} +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'as_type.carbon' +// CHECK:STDOUT: source_filename = "as_type.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CTest1.Main(i32 %n) #0 !dbg !360 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CAsType.Main.8122a03446648385(i32 %n), !dbg !364 +// CHECK:STDOUT: ret void, !dbg !365 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @"_CConvert.C.Main:As.84588f41d61dafba.Core"(ptr %self) #0 !dbg !367 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc15_42.1.n = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !372 +// CHECK:STDOUT: %.loc15_42.2 = load i32, ptr %.loc15_42.1.n, align 4, !dbg !372 +// CHECK:STDOUT: ret i32 %.loc15_42.2, !dbg !373 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CTest2.Main(ptr %c) #0 !dbg !375 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CAsType.Main.3280a9d16838b780(ptr %c), !dbg !379 +// CHECK:STDOUT: ret void, !dbg !380 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CAsType.Main.8122a03446648385(i32 %x) #0 !dbg !382 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !388 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CAsType.Main.3280a9d16838b780(ptr %x) #0 !dbg !390 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %C.as.As.impl.Convert.call = call i32 @"_CConvert.C.Main:As.84588f41d61dafba.Core"(ptr %x), !dbg !393 +// CHECK:STDOUT: ret void, !dbg !396 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!359} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{!20, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !78 = !{null, !20} +// CHECK:STDOUT: !79 = !DISubroutineType(types: !78) +// CHECK:STDOUT: !130 = !{null, !23} +// CHECK:STDOUT: !131 = !DISubroutineType(types: !130) +// CHECK:STDOUT: !358 = !DIFile(filename: "as_type.carbon", directory: "") +// CHECK:STDOUT: !359 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !358, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !360 = distinct !DISubprogram(name: "Test1", linkageName: "_CTest1.Main", scope: null, file: !358, line: 8, type: !79, spFlags: DISPFlagDefinition, unit: !359, retainedNodes: !366) +// CHECK:STDOUT: !361 = !DILocalVariable(arg: 1, scope: !360, type: !20) +// CHECK:STDOUT: !364 = !DILocation(line: 9, column: 3, scope: !360) +// CHECK:STDOUT: !365 = !DILocation(line: 8, column: 1, scope: !360) +// CHECK:STDOUT: !366 = !{!361} +// CHECK:STDOUT: !367 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.C.Main:As.84588f41d61dafba.Core", scope: null, file: !358, line: 15, type: !25, spFlags: DISPFlagDefinition, unit: !359, retainedNodes: !374) +// CHECK:STDOUT: !368 = !DILocalVariable(arg: 1, scope: !367, type: !23) +// CHECK:STDOUT: !372 = !DILocation(line: 15, column: 38, scope: !367) +// CHECK:STDOUT: !373 = !DILocation(line: 15, column: 31, scope: !367) +// CHECK:STDOUT: !374 = !{!368} +// CHECK:STDOUT: !375 = distinct !DISubprogram(name: "Test2", linkageName: "_CTest2.Main", scope: null, file: !358, line: 19, type: !131, spFlags: DISPFlagDefinition, unit: !359, retainedNodes: !381) +// CHECK:STDOUT: !376 = !DILocalVariable(arg: 1, scope: !375, type: !23) +// CHECK:STDOUT: !379 = !DILocation(line: 20, column: 3, scope: !375) +// CHECK:STDOUT: !380 = !DILocation(line: 19, column: 1, scope: !375) +// CHECK:STDOUT: !381 = !{!376} +// CHECK:STDOUT: !382 = distinct !DISubprogram(name: "AsType", linkageName: "_CAsType.Main.8122a03446648385", scope: null, file: !358, line: 4, type: !79, spFlags: DISPFlagDefinition, unit: !359, retainedNodes: !389) +// CHECK:STDOUT: !383 = !DILocalVariable(arg: 1, scope: !382, type: !20) +// CHECK:STDOUT: !388 = !DILocation(line: 4, column: 1, scope: !382) +// CHECK:STDOUT: !389 = !{!383} +// CHECK:STDOUT: !390 = distinct !DISubprogram(name: "AsType", linkageName: "_CAsType.Main.3280a9d16838b780", scope: null, file: !358, line: 4, type: !131, spFlags: DISPFlagDefinition, unit: !359, retainedNodes: !397) +// CHECK:STDOUT: !391 = !DILocalVariable(arg: 1, scope: !390, type: !23) +// CHECK:STDOUT: !393 = !DILocation(line: 5, column: 14, scope: !390) +// CHECK:STDOUT: !396 = !DILocation(line: 4, column: 1, scope: !390) +// CHECK:STDOUT: !397 = !{!391} +// CHECK:STDOUT: diff --git a/toolchain/lower/testdata/template/merging.carbon b/toolchain/lower/testdata/template/merging.carbon index 38d6c67ca92f..e814f2c48de4 100644 --- a/toolchain/lower/testdata/template/merging.carbon +++ b/toolchain/lower/testdata/template/merging.carbon @@ -461,9 +461,9 @@ fn CallCallF(a: A, b: B) { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.d01354a0ad5f3687(ptr %x, ptr %y) #0 !dbg !157 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.9745c1.4.temp = alloca {}, align 1, !dbg !164 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.4.temp), !dbg !164 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.4.temp, ptr %y), !dbg !164 +// CHECK:STDOUT: %.9745c1.4.temp = alloca {}, align 1, !dbg !163 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.4.temp), !dbg !163 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.4.temp, ptr %y), !dbg !163 // CHECK:STDOUT: call void @_CF.Main(ptr %x, ptr %.9745c1.4.temp), !dbg !164 // CHECK:STDOUT: ret void, !dbg !165 // CHECK:STDOUT: } @@ -471,9 +471,9 @@ fn CallCallF(a: A, b: B) { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.37b67b83fe9ed3dd(ptr %x, ptr %y) #0 !dbg !167 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.9745c1.3.temp = alloca {}, align 1, !dbg !174 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.3.temp), !dbg !174 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.3.temp, ptr %x), !dbg !174 +// CHECK:STDOUT: %.9745c1.3.temp = alloca {}, align 1, !dbg !172 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.3.temp), !dbg !172 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.3.temp, ptr %x), !dbg !172 // CHECK:STDOUT: call void @_CF.Main(ptr %.9745c1.3.temp, ptr %y), !dbg !174 // CHECK:STDOUT: ret void, !dbg !175 // CHECK:STDOUT: } @@ -481,12 +481,12 @@ fn CallCallF(a: A, b: B) { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.7096323a0fb88cc3(ptr %x, ptr %y) #0 !dbg !177 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.9745c1.1.temp = alloca {}, align 1, !dbg !184 -// CHECK:STDOUT: %.9745c1.2.temp = alloca {}, align 1, !dbg !184 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.1.temp), !dbg !184 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.1.temp, ptr %x), !dbg !184 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.2.temp), !dbg !184 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.2.temp, ptr %y), !dbg !184 +// CHECK:STDOUT: %.9745c1.1.temp = alloca {}, align 1, !dbg !182 +// CHECK:STDOUT: %.9745c1.2.temp = alloca {}, align 1, !dbg !183 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.1.temp), !dbg !182 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.1.temp, ptr %x), !dbg !182 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.2.temp), !dbg !183 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.2.temp, ptr %y), !dbg !183 // CHECK:STDOUT: call void @_CF.Main(ptr %.9745c1.1.temp, ptr %.9745c1.2.temp), !dbg !184 // CHECK:STDOUT: ret void, !dbg !185 // CHECK:STDOUT: } @@ -534,18 +534,22 @@ fn CallCallF(a: A, b: B) { // CHECK:STDOUT: !157 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.d01354a0ad5f3687", scope: null, file: !117, line: 12, type: !120, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !166) // CHECK:STDOUT: !158 = !DILocalVariable(arg: 1, scope: !157, type: !24) // CHECK:STDOUT: !159 = !DILocalVariable(arg: 2, scope: !157, type: !24) +// CHECK:STDOUT: !163 = !DILocation(line: 13, column: 8, scope: !157) // CHECK:STDOUT: !164 = !DILocation(line: 13, column: 3, scope: !157) // CHECK:STDOUT: !165 = !DILocation(line: 12, column: 1, scope: !157) // CHECK:STDOUT: !166 = !{!158, !159} // CHECK:STDOUT: !167 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.37b67b83fe9ed3dd", scope: null, file: !117, line: 12, type: !120, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !176) // CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !24) // CHECK:STDOUT: !169 = !DILocalVariable(arg: 2, scope: !167, type: !24) +// CHECK:STDOUT: !172 = !DILocation(line: 13, column: 5, scope: !167) // CHECK:STDOUT: !174 = !DILocation(line: 13, column: 3, scope: !167) // CHECK:STDOUT: !175 = !DILocation(line: 12, column: 1, scope: !167) // CHECK:STDOUT: !176 = !{!168, !169} // CHECK:STDOUT: !177 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.7096323a0fb88cc3", scope: null, file: !117, line: 12, type: !120, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !186) // CHECK:STDOUT: !178 = !DILocalVariable(arg: 1, scope: !177, type: !24) // CHECK:STDOUT: !179 = !DILocalVariable(arg: 2, scope: !177, type: !24) +// CHECK:STDOUT: !182 = !DILocation(line: 13, column: 5, scope: !177) +// CHECK:STDOUT: !183 = !DILocation(line: 13, column: 8, scope: !177) // CHECK:STDOUT: !184 = !DILocation(line: 13, column: 3, scope: !177) // CHECK:STDOUT: !185 = !DILocation(line: 12, column: 1, scope: !177) // CHECK:STDOUT: !186 = !{!178, !179} diff --git a/toolchain/lower/testdata/template/operator.carbon b/toolchain/lower/testdata/template/operator.carbon index 2018ca35729a..8a125d258e86 100644 --- a/toolchain/lower/testdata/template/operator.carbon +++ b/toolchain/lower/testdata/template/operator.carbon @@ -52,19 +52,7 @@ fn CallPolynomial(n: i32) -> i32 { return Polynomial(n); } // CHECK:STDOUT: define linkonce_odr i32 @_CNegate.Main.84588f41d61dafba(i32 %a) #0 !dbg !18 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %Int.as.Negate.impl.Op.call = sub i32 0, %a, !dbg !24 -// CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.call = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %Int.as.Negate.impl.Op.call), !dbg !25 -// CHECK:STDOUT: ret i32 %From.as_type.as.ImplicitAs.impl.Convert.call, !dbg !25 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !28 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !33 -// CHECK:STDOUT: ret i32 %1, !dbg !35 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !37 { -// CHECK:STDOUT: ret i32 %self, !dbg !43 +// CHECK:STDOUT: ret i32 %Int.as.Negate.impl.Op.call, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -89,121 +77,75 @@ fn CallPolynomial(n: i32) -> i32 { return Polynomial(n); } // CHECK:STDOUT: !24 = !DILocation(line: 4, column: 10, scope: !18) // CHECK:STDOUT: !25 = !DILocation(line: 4, column: 3, scope: !18) // CHECK:STDOUT: !26 = !{!19} -// CHECK:STDOUT: !27 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !27, line: 64, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !36) -// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !6) -// CHECK:STDOUT: !33 = !DILocation(line: 66, column: 17, scope: !28) -// CHECK:STDOUT: !35 = !DILocation(line: 66, column: 5, scope: !28) -// CHECK:STDOUT: !36 = !{!29} -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !27, line: 59, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !44) -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !6) -// CHECK:STDOUT: !43 = !DILocation(line: 59, column: 28, scope: !37) -// CHECK:STDOUT: !44 = !{!38} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'binary.carbon' // CHECK:STDOUT: source_filename = "binary.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CCallAdd.Main(i32 %a, i32 %b) #0 !dbg !49 { +// CHECK:STDOUT: define i32 @_CCallAdd.Main(i32 %a, i32 %b) #0 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Add.call = call i32 @_CAdd.Main.84588f41d61dafba(i32 %a, i32 %b), !dbg !58 -// CHECK:STDOUT: ret i32 %Add.call, !dbg !59 +// CHECK:STDOUT: %Add.call = call i32 @_CAdd.Main.84588f41d61dafba(i32 %a, i32 %b), !dbg !40 +// CHECK:STDOUT: ret i32 %Add.call, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CAdd.Main.84588f41d61dafba(i32 %a, i32 %b) #0 !dbg !61 { +// CHECK:STDOUT: define linkonce_odr i32 @_CAdd.Main.84588f41d61dafba(i32 %a, i32 %b) #0 !dbg !43 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %a, %b, !dbg !68 -// CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.call = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %Int.as.AddWith.impl.Op.call), !dbg !70 -// CHECK:STDOUT: ret i32 %From.as_type.as.ImplicitAs.impl.Convert.call, !dbg !70 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !72 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !77 -// CHECK:STDOUT: ret i32 %1, !dbg !79 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !81 { -// CHECK:STDOUT: ret i32 %self, !dbg !87 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %a, %b, !dbg !50 +// CHECK:STDOUT: ret i32 %Int.as.AddWith.impl.Op.call, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!46} +// CHECK:STDOUT: !llvm.dbg.cu = !{!28} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !7 = !{!6, !6} -// CHECK:STDOUT: !8 = !DISubroutineType(types: !7) -// CHECK:STDOUT: !27 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !45 = !DIFile(filename: "binary.carbon", directory: "") -// CHECK:STDOUT: !46 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !45, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !47 = !{!6, !6, !6} -// CHECK:STDOUT: !48 = !DISubroutineType(types: !47) -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "CallAdd", linkageName: "_CCallAdd.Main", scope: null, file: !45, line: 7, type: !48, spFlags: DISPFlagDefinition, unit: !46, retainedNodes: !60) -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !6) -// CHECK:STDOUT: !51 = !DILocalVariable(arg: 2, scope: !49, type: !6) -// CHECK:STDOUT: !58 = !DILocation(line: 7, column: 44, scope: !49) -// CHECK:STDOUT: !59 = !DILocation(line: 7, column: 37, scope: !49) -// CHECK:STDOUT: !60 = !{!50, !51} -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Add", linkageName: "_CAdd.Main.84588f41d61dafba", scope: null, file: !45, line: 3, type: !48, spFlags: DISPFlagDefinition, unit: !46, retainedNodes: !71) -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !6) -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 2, scope: !61, type: !6) -// CHECK:STDOUT: !68 = !DILocation(line: 4, column: 10, scope: !61) -// CHECK:STDOUT: !70 = !DILocation(line: 4, column: 3, scope: !61) -// CHECK:STDOUT: !71 = !{!62, !63} -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !27, line: 64, type: !8, spFlags: DISPFlagDefinition, unit: !46, retainedNodes: !80) -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !6) -// CHECK:STDOUT: !77 = !DILocation(line: 66, column: 17, scope: !72) -// CHECK:STDOUT: !79 = !DILocation(line: 66, column: 5, scope: !72) -// CHECK:STDOUT: !80 = !{!73} -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !27, line: 59, type: !8, spFlags: DISPFlagDefinition, unit: !46, retainedNodes: !88) -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !6) -// CHECK:STDOUT: !87 = !DILocation(line: 59, column: 28, scope: !81) -// CHECK:STDOUT: !88 = !{!82} +// CHECK:STDOUT: !27 = !DIFile(filename: "binary.carbon", directory: "") +// CHECK:STDOUT: !28 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !27, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !29 = !{!6, !6, !6} +// CHECK:STDOUT: !30 = !DISubroutineType(types: !29) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "CallAdd", linkageName: "_CCallAdd.Main", scope: null, file: !27, line: 7, type: !30, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !42) +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !6) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 2, scope: !31, type: !6) +// CHECK:STDOUT: !40 = !DILocation(line: 7, column: 44, scope: !31) +// CHECK:STDOUT: !41 = !DILocation(line: 7, column: 37, scope: !31) +// CHECK:STDOUT: !42 = !{!32, !33} +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Add", linkageName: "_CAdd.Main.84588f41d61dafba", scope: null, file: !27, line: 3, type: !30, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !53) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !6) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 2, scope: !43, type: !6) +// CHECK:STDOUT: !50 = !DILocation(line: 4, column: 10, scope: !43) +// CHECK:STDOUT: !52 = !DILocation(line: 4, column: 3, scope: !43) +// CHECK:STDOUT: !53 = !{!44, !45} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'chained.carbon' // CHECK:STDOUT: source_filename = "chained.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CCallPolynomial.Main(i32 %n) #0 !dbg !91 { +// CHECK:STDOUT: define i32 @_CCallPolynomial.Main(i32 %n) #0 !dbg !56 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Polynomial.call = call i32 @_CPolynomial.Main.84588f41d61dafba(i32 %n), !dbg !97 -// CHECK:STDOUT: ret i32 %Polynomial.call, !dbg !98 +// CHECK:STDOUT: %Polynomial.call = call i32 @_CPolynomial.Main.84588f41d61dafba(i32 %n), !dbg !62 +// CHECK:STDOUT: ret i32 %Polynomial.call, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CPolynomial.Main.84588f41d61dafba(i32 %n) #0 !dbg !100 { +// CHECK:STDOUT: define linkonce_odr i32 @_CPolynomial.Main.84588f41d61dafba(i32 %n) #0 !dbg !65 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %T.as_type.as.MulWith.impl.Op.call.83a = mul i32 3, %n, !dbg !106 -// CHECK:STDOUT: %Int.as.MulWith.impl.Op.call = mul i32 %T.as_type.as.MulWith.impl.Op.call.83a, %n, !dbg !106 -// CHECK:STDOUT: %T.as_type.as.MulWith.impl.Op.call.958 = mul i32 5, %n, !dbg !109 -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %Int.as.MulWith.impl.Op.call, %T.as_type.as.MulWith.impl.Op.call.958, !dbg !106 -// CHECK:STDOUT: %Int.as.SubWith.impl.Op.call = sub i32 %Int.as.AddWith.impl.Op.call, 2, !dbg !106 -// CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.call = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %Int.as.SubWith.impl.Op.call), !dbg !110 -// CHECK:STDOUT: ret i32 %From.as_type.as.ImplicitAs.impl.Convert.call, !dbg !110 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !112 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !117 -// CHECK:STDOUT: ret i32 %1, !dbg !119 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !121 { -// CHECK:STDOUT: ret i32 %self, !dbg !127 +// CHECK:STDOUT: %T.as_type.as.MulWith.impl.Op.call.83a = mul i32 3, %n, !dbg !71 +// CHECK:STDOUT: %Int.as.MulWith.impl.Op.call = mul i32 %T.as_type.as.MulWith.impl.Op.call.83a, %n, !dbg !71 +// CHECK:STDOUT: %T.as_type.as.MulWith.impl.Op.call.958 = mul i32 5, %n, !dbg !74 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %Int.as.MulWith.impl.Op.call, %T.as_type.as.MulWith.impl.Op.call.958, !dbg !71 +// CHECK:STDOUT: %Int.as.SubWith.impl.Op.call = sub i32 %Int.as.AddWith.impl.Op.call, 2, !dbg !71 +// CHECK:STDOUT: ret i32 %Int.as.SubWith.impl.Op.call, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!90} +// CHECK:STDOUT: !llvm.dbg.cu = !{!55} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -211,27 +153,17 @@ fn CallPolynomial(n: i32) -> i32 { return Polynomial(n); } // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !7 = !{!6, !6} // CHECK:STDOUT: !8 = !DISubroutineType(types: !7) -// CHECK:STDOUT: !27 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !89 = !DIFile(filename: "chained.carbon", directory: "") -// CHECK:STDOUT: !90 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !89, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "CallPolynomial", linkageName: "_CCallPolynomial.Main", scope: null, file: !89, line: 7, type: !8, spFlags: DISPFlagDefinition, unit: !90, retainedNodes: !99) -// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !6) -// CHECK:STDOUT: !97 = !DILocation(line: 7, column: 43, scope: !91) -// CHECK:STDOUT: !98 = !DILocation(line: 7, column: 36, scope: !91) -// CHECK:STDOUT: !99 = !{!92} -// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "Polynomial", linkageName: "_CPolynomial.Main.84588f41d61dafba", scope: null, file: !89, line: 3, type: !8, spFlags: DISPFlagDefinition, unit: !90, retainedNodes: !111) -// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !6) -// CHECK:STDOUT: !106 = !DILocation(line: 4, column: 10, scope: !100) -// CHECK:STDOUT: !109 = !DILocation(line: 4, column: 22, scope: !100) -// CHECK:STDOUT: !110 = !DILocation(line: 4, column: 3, scope: !100) -// CHECK:STDOUT: !111 = !{!101} -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !27, line: 64, type: !8, spFlags: DISPFlagDefinition, unit: !90, retainedNodes: !120) -// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !6) -// CHECK:STDOUT: !117 = !DILocation(line: 66, column: 17, scope: !112) -// CHECK:STDOUT: !119 = !DILocation(line: 66, column: 5, scope: !112) -// CHECK:STDOUT: !120 = !{!113} -// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !27, line: 59, type: !8, spFlags: DISPFlagDefinition, unit: !90, retainedNodes: !128) -// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !6) -// CHECK:STDOUT: !127 = !DILocation(line: 59, column: 28, scope: !121) -// CHECK:STDOUT: !128 = !{!122} +// CHECK:STDOUT: !54 = !DIFile(filename: "chained.carbon", directory: "") +// CHECK:STDOUT: !55 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !54, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "CallPolynomial", linkageName: "_CCallPolynomial.Main", scope: null, file: !54, line: 7, type: !8, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !64) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !6) +// CHECK:STDOUT: !62 = !DILocation(line: 7, column: 43, scope: !56) +// CHECK:STDOUT: !63 = !DILocation(line: 7, column: 36, scope: !56) +// CHECK:STDOUT: !64 = !{!57} +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Polynomial", linkageName: "_CPolynomial.Main.84588f41d61dafba", scope: null, file: !54, line: 3, type: !8, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !76) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !6) +// CHECK:STDOUT: !71 = !DILocation(line: 4, column: 10, scope: !65) +// CHECK:STDOUT: !74 = !DILocation(line: 4, column: 22, scope: !65) +// CHECK:STDOUT: !75 = !DILocation(line: 4, column: 3, scope: !65) +// CHECK:STDOUT: !76 = !{!66} // CHECK:STDOUT: diff --git a/toolchain/sem_ir/expr_info.cpp b/toolchain/sem_ir/expr_info.cpp index 4bf9b4cc4f9b..2fbc4e1b05b9 100644 --- a/toolchain/sem_ir/expr_info.cpp +++ b/toolchain/sem_ir/expr_info.cpp @@ -130,7 +130,10 @@ static auto GetExprCategoryImpl(const File* ir, InstId inst_id, return action_category->category; } } else { - CARBON_FATAL("Inst doesn't have action category: {0}", action); + // TODO: Do we need a way to specify a non-dependent category here? + // Perhaps for the first element of a MultiInstAction we should use + // the ActionExprCategory on the inst. + return ExprCategory::Dependent; } } else if constexpr (std::same_as) { if (!inst.value_id.has_value()) { diff --git a/toolchain/sem_ir/id_kind.h b/toolchain/sem_ir/id_kind.h index 2f2079573893..c640ff49f815 100644 --- a/toolchain/sem_ir/id_kind.h +++ b/toolchain/sem_ir/id_kind.h @@ -35,6 +35,7 @@ using IdKind = TypeEnum< BundleId, BundleId, BundleId, + BundleId, CallParamIndex, CharId, ClangDeclId, diff --git a/toolchain/sem_ir/ids.h b/toolchain/sem_ir/ids.h index f844e9b960a0..e19b65c70aa8 100644 --- a/toolchain/sem_ir/ids.h +++ b/toolchain/sem_ir/ids.h @@ -529,7 +529,7 @@ struct BoolValue : public IdBase { static constexpr auto From(bool b) -> BoolValue { return b ? True : False; } // Returns the `bool` corresponding to this `BoolValue`. - constexpr auto ToBool() -> bool { + constexpr auto ToBool() const -> bool { CARBON_CHECK(*this == False || *this == True, "Invalid bool value {0}", index); return *this != False; diff --git a/toolchain/sem_ir/inst_categories.h b/toolchain/sem_ir/inst_categories.h index f957088d0b5f..667d2593ed5c 100644 --- a/toolchain/sem_ir/inst_categories.h +++ b/toolchain/sem_ir/inst_categories.h @@ -204,6 +204,24 @@ struct AnyBranch { AnyRawId arg1; }; +// clang-format off +#define AnyCompoundLiteral_CARBON_INST_CATEGORY(X, Sep) \ + X(::Carbon::SemIR::StructLiteral) Sep() \ + X(::Carbon::SemIR::TupleLiteral) +// clang-format on + +#define AnyCompoundLiteral_CARBON_KIND_ANY_EXPAND \ + CARBON_INST_CATEGORY_ANY_EXPAND(AnyCompoundLiteral) + +// Common representation for `StructLiteral` and `TupleLiteral`. +struct AnyCompoundLiteral { + using CategoryInfo = CARBON_INST_CATEGORY_INFO(AnyCompoundLiteral); + + InstKind kind; + TypeId type_id; + InstBlockId elements_id; +}; + // clang-format off #define AnyFormParamAction_CARBON_INST_CATEGORY(X, Sep) \ X(::Carbon::SemIR::FormParamPatternAction) Sep() \ diff --git a/toolchain/sem_ir/inst_fingerprinter.cpp b/toolchain/sem_ir/inst_fingerprinter.cpp index ff6dba6df04e..8e29fed878d7 100644 --- a/toolchain/sem_ir/inst_fingerprinter.cpp +++ b/toolchain/sem_ir/inst_fingerprinter.cpp @@ -474,6 +474,21 @@ struct Worklist { AddEntity(sem_ir->interfaces().Get(interface_id)); } + auto Add(MetaInstId /*meta_inst_id*/) -> void { + // TODO: Add some mechanism to fingerprint the target instruction. We allow + // "cycles" via `MetaInstId`, so we can't profile it here, and `MetaInstId` + // refers to the identity of the instruction, not merely its abstract value, + // so profiling it recursively wouldn't be correct either. + } + + auto Add(MetaInstBlockId meta_inst_block_id) -> void { + if (!meta_inst_block_id.has_value()) { + AddInvalid(); + return; + } + AddBlock(sem_ir->inst_blocks().Get(meta_inst_block_id)); + } + auto Add(NamedConstraintId named_constraint_id) -> void { AddEntity(sem_ir->named_constraints().Get(named_constraint_id)); } diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index fe7dc5e38b03..f92315f0f73d 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -99,6 +99,7 @@ CARBON_SEM_IR_INST_KIND(ImportRefLoaded) CARBON_SEM_IR_INST_KIND(ImportRefUnloaded) CARBON_SEM_IR_INST_KIND(InPlaceInit) CARBON_SEM_IR_INST_KIND(InitForm) +CARBON_SEM_IR_INST_KIND(InitializeAction) CARBON_SEM_IR_INST_KIND(InlineCppDecl) CARBON_SEM_IR_INST_KIND(InstType) CARBON_SEM_IR_INST_KIND(InstValue) diff --git a/toolchain/sem_ir/inst_kind.h b/toolchain/sem_ir/inst_kind.h index cfac912e0c3d..43e244d0b7a5 100644 --- a/toolchain/sem_ir/inst_kind.h +++ b/toolchain/sem_ir/inst_kind.h @@ -184,11 +184,17 @@ enum class InstConstantKind : int8_t { // operands, but never a concrete constant inst. TemplateOnly, // This instruction is a metaprogramming or template instantiation action that - // generates an instruction. Like `SymbolicOnly`, it may be a symbolic - // constant inst depending on its operands, but never a concrete constant - // inst. The instruction may or may not have a concrete constant value that is - // a generated instruction. Constant evaluation support for types with this - // constant kind is provided automatically, by calling `PerformDelayedAction`. + // generates and returns a tuple containing one or more instruction values. + // Like `SymbolicOnly`, it may be a symbolic constant inst depending on its + // operands, but never a concrete constant inst. The instruction may or may + // not have a concrete constant value that is a tuple of generated + // instructions. Constant evaluation support for types with this constant kind + // is provided automatically, by calling `PerformDelayedAction`. + MultiInstAction, + // This instruction is a metaprogramming or template instantiation action that + // generates and returns an instruction value. Like `MultiInstAction`, but + // optimized for the common case where the result is only a single + // instruction, in order to avoid creating an unnecessary 1-tuple. InstAction, // This instruction's operands determine whether it has a constant value, // whether it is a constant inst, and/or whether it results in a compile-time @@ -327,6 +333,12 @@ class InstKind : public CARBON_ENUM_BASE(InstKind) { return definition_info(*this).constant_kind; } + // Returns whether this instruction kind is an action instruction. + auto is_action() const -> bool { + return constant_kind() == InstConstantKind::InstAction || + constant_kind() == InstConstantKind::MultiInstAction; + } + // Returns whether we need an `InstId` referring to the instruction to // constant evaluate this instruction. If this is set to `true`, then: // @@ -443,6 +455,12 @@ class InstKind::Definition : public InstKind { return info_.constant_kind; } + // Returns whether this instruction kind is an action instruction. + constexpr auto is_action() const -> bool { + return constant_kind() == InstConstantKind::InstAction || + constant_kind() == InstConstantKind::MultiInstAction; + } + // Returns whether constant evaluation of this instruction needs an InstId. constexpr auto constant_needs_inst_id() const -> InstConstantNeedsInstIdKind { return info_.constant_needs_inst_id; diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index f4f314e7a8d2..a2ca03c875a8 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -1256,6 +1256,33 @@ struct InitForm { TypeInstId type_component_inst_id; }; +// An action that performs initialization of a given target. +struct InitializeAction { + static constexpr auto Kind = InstKind::InitializeAction.Define( + {.ir_name = "initialize_action", + .expr_category = ActionExprCategory(ExprCategory::Dependent), + .constant_kind = InstConstantKind::MultiInstAction, + .action_needs_specific_id = true, + .is_lowered = false}); + + struct Target { + // The target type for the initialization. + TypeInstId target_type_inst_id; + // The storage for the initialization. + MetaInstId storage_id; + // Whether this is required to be an in-place initialization. + BoolValue in_place; + }; + + // A tuple of InstTypes: one for the finished initialization expression, then + // one for each of the storage arguments in the source expression. + TypeId type_id; + // The source initializing expression. + MetaInstId init_id; + // Information about the target of the initialization. + BundleId target_id; +}; + // Consumes the repr-initializing expression `src_id` and forms an in-place // initializing expression that initializes the storage at `dest_id`, by // performing a final copy from source to destination for types whose