diff --git a/toolchain/check/BUILD b/toolchain/check/BUILD index c5f27f799e25..d2ba70df6951 100644 --- a/toolchain/check/BUILD +++ b/toolchain/check/BUILD @@ -32,6 +32,7 @@ cc_library( "modifiers.cpp", "name_component.cpp", "operator.cpp", + "pattern_match.cpp", "return.cpp", "subst.cpp", ], @@ -57,6 +58,7 @@ cc_library( "name_component.h", "operator.h", "param_and_arg_refs_stack.h", + "pattern_match.h", "pending_block.h", "return.h", "subst.h", diff --git a/toolchain/check/call.cpp b/toolchain/check/call.cpp index f2180cc50589..e86e22299bf6 100644 --- a/toolchain/check/call.cpp +++ b/toolchain/check/call.cpp @@ -61,8 +61,8 @@ static auto ResolveCalleeInCall(Context& context, SemIR::LocId loc_id, if (entity_generic_id.is_valid()) { specific_id = DeduceGenericCallArguments( context, loc_id, entity_generic_id, enclosing_specific_id, - callee_info.implicit_param_refs_id, callee_info.param_refs_id, self_id, - arg_ids); + callee_info.implicit_param_patterns_id, callee_info.param_patterns_id, + self_id, arg_ids); if (!specific_id.is_valid()) { return std::nullopt; } diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index ca2ce6a93c3e..82c4f82a2774 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -921,6 +921,7 @@ class TypeCompleter { -> SemIR::ValueRepr { switch (builtin.builtin_inst_kind) { case SemIR::BuiltinInstKind::TypeType: + case SemIR::BuiltinInstKind::AutoType: case SemIR::BuiltinInstKind::Error: case SemIR::BuiltinInstKind::Invalid: case SemIR::BuiltinInstKind::BoolType: diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 5e90ef7da750..feebea99e645 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -13,6 +13,7 @@ #include "toolchain/base/kind_switch.h" #include "toolchain/check/context.h" #include "toolchain/check/operator.h" +#include "toolchain/check/pattern_match.h" #include "toolchain/sem_ir/copy_on_write_block.h" #include "toolchain/sem_ir/file.h" #include "toolchain/sem_ir/generic.h" @@ -1138,9 +1139,8 @@ CARBON_DIAGNOSTIC(InCallToFunction, Note, "calling function declared here"); static auto ConvertSelf(Context& context, SemIR::LocId call_loc_id, SemIRLoc callee_loc, SemIR::SpecificId callee_specific_id, - std::optional addr_pattern, - SemIR::InstId self_param_id, SemIR::Param self_param, - SemIR::InstId self_id) -> SemIR::InstId { + SemIR::InstId self_param_id, SemIR::InstId self_id) + -> SemIR::InstId { if (!self_id.is_valid()) { CARBON_DIAGNOSTIC(MissingObjectInMethodCall, Error, "missing object argument in method call"); @@ -1151,6 +1151,7 @@ static auto ConvertSelf(Context& context, SemIR::LocId call_loc_id, return SemIR::InstId::BuiltinError; } + bool addr_pattern = context.insts().Is(self_param_id); DiagnosticAnnotationScope annotate_diagnostics( &context.emitter(), [&](auto& builder) { CARBON_DIAGNOSTIC( @@ -1162,34 +1163,11 @@ static auto ConvertSelf(Context& context, SemIR::LocId call_loc_id, : llvm::StringLiteral("self")); }); - // For `addr self`, take the address of the object argument. - auto self_or_addr_id = self_id; - if (addr_pattern) { - self_or_addr_id = ConvertToValueOrRefExpr(context, self_or_addr_id); - auto self = context.insts().Get(self_or_addr_id); - switch (SemIR::GetExprCategory(context.sem_ir(), self_id)) { - case SemIR::ExprCategory::Error: - case SemIR::ExprCategory::DurableRef: - case SemIR::ExprCategory::EphemeralRef: - break; - default: - CARBON_DIAGNOSTIC(AddrSelfIsNonRef, Error, - "`addr self` method cannot be invoked on a value"); - context.emitter().Emit(TokenOnly(call_loc_id), AddrSelfIsNonRef); - return SemIR::InstId::BuiltinError; - } - auto loc_id = context.insts().GetLocId(self_or_addr_id); - self_or_addr_id = context.AddInst( - loc_id, {.type_id = context.GetPointerType(self.type_id()), - .lvalue_id = self_or_addr_id}); - } - - return ConvertToValueOfType( - context, call_loc_id, self_or_addr_id, - SemIR::GetTypeInSpecific(context.sem_ir(), callee_specific_id, - self_param.type_id)); + return CallerPatternMatch(context, callee_specific_id, self_param_id, + self_id); } +// TODO: consider moving this to pattern_match.h auto ConvertCallArgs(Context& context, SemIR::LocId call_loc_id, SemIR::InstId self_id, llvm::ArrayRef arg_refs, @@ -1197,34 +1175,34 @@ auto ConvertCallArgs(Context& context, SemIR::LocId call_loc_id, const CalleeParamsInfo& callee, SemIR::SpecificId callee_specific_id) -> SemIR::InstBlockId { - auto implicit_param_refs = - context.inst_blocks().GetOrEmpty(callee.implicit_param_refs_id); - auto param_refs = context.inst_blocks().GetOrEmpty(callee.param_refs_id); + auto implicit_param_patterns = + context.inst_blocks().GetOrEmpty(callee.implicit_param_patterns_id); + auto param_patterns = + context.inst_blocks().GetOrEmpty(callee.param_patterns_id); // The caller should have ensured this callee has the right arity. - CARBON_CHECK(arg_refs.size() == param_refs.size()); + CARBON_CHECK(arg_refs.size() == param_patterns.size()); // Start building a block to hold the converted arguments. llvm::SmallVector args; - args.reserve(implicit_param_refs.size() + param_refs.size() + + args.reserve(implicit_param_patterns.size() + param_patterns.size() + return_storage_id.is_valid()); // Check implicit parameters. - for (auto implicit_param_id : implicit_param_refs) { - auto addr_pattern = - context.insts().TryGetAs(implicit_param_id); - auto param_info = SemIR::Function::GetParamFromParamRefId( + for (auto implicit_param_id : implicit_param_patterns) { + auto param_pattern_info = SemIR::Function::GetParamPatternInfoFromPatternId( context.sem_ir(), implicit_param_id); - if (param_info.GetNameId(context.sem_ir()) == SemIR::NameId::SelfValue) { - auto converted_self_id = ConvertSelf( - context, call_loc_id, callee.callee_loc, callee_specific_id, - addr_pattern, param_info.inst_id, param_info.inst, self_id); + if (param_pattern_info.GetNameId(context.sem_ir()) == + SemIR::NameId::SelfValue) { + auto converted_self_id = + ConvertSelf(context, call_loc_id, callee.callee_loc, + callee_specific_id, implicit_param_id, self_id); if (converted_self_id == SemIR::InstId::BuiltinError) { return SemIR::InstBlockId::Invalid; } args.push_back(converted_self_id); } else { - CARBON_CHECK(!param_info.inst.runtime_index.is_valid(), + CARBON_CHECK(!param_pattern_info.inst.runtime_index.is_valid(), "Unexpected implicit parameter passed at runtime"); } } @@ -1240,31 +1218,25 @@ auto ConvertCallArgs(Context& context, SemIR::LocId call_loc_id, }); // Check type conversions per-element. - for (auto [i, arg_id, param_ref_id] : llvm::enumerate(arg_refs, param_refs)) { + for (auto [i, arg_id, param_pattern_id] : + llvm::enumerate(arg_refs, param_patterns)) { diag_param_index = i; - // TODO: In general we need to perform pattern matching here to find the - // argument corresponding to each parameter. - auto param_info = - SemIR::Function::GetParamFromParamRefId(context.sem_ir(), param_ref_id); - if (!param_info.inst.runtime_index.is_valid()) { + auto runtime_index = SemIR::Function::GetParamPatternInfoFromPatternId( + context.sem_ir(), param_pattern_id) + .inst.runtime_index; + if (!runtime_index.is_valid()) { // Not a runtime parameter: we don't pass an argument. continue; } - auto param_type_id = SemIR::GetTypeInSpecific( - context.sem_ir(), callee_specific_id, - context.insts().Get(param_info.inst_id).type_id()); - // TODO: Convert to the proper expression category. For now, we assume - // parameters are all `let` bindings. - auto converted_arg_id = - ConvertToValueOfType(context, call_loc_id, arg_id, param_type_id); + auto converted_arg_id = CallerPatternMatch(context, callee_specific_id, + param_pattern_id, arg_id); if (converted_arg_id == SemIR::InstId::BuiltinError) { return SemIR::InstBlockId::Invalid; } - CARBON_CHECK(static_cast(args.size()) == - param_info.inst.runtime_index.index, + CARBON_CHECK(static_cast(args.size()) == runtime_index.index, "Parameters not numbered in order."); args.push_back(converted_arg_id); } diff --git a/toolchain/check/convert.h b/toolchain/check/convert.h index 4dab30cd789e..cdadbb40bf36 100644 --- a/toolchain/check/convert.h +++ b/toolchain/check/convert.h @@ -97,14 +97,18 @@ struct CalleeParamsInfo { explicit CalleeParamsInfo(const SemIR::EntityWithParamsBase& callee) : callee_loc(callee.latest_decl_id()), implicit_param_refs_id(callee.implicit_param_refs_id), - param_refs_id(callee.param_refs_id) {} + implicit_param_patterns_id(callee.implicit_param_patterns_id), + param_refs_id(callee.param_refs_id), + param_patterns_id(callee.param_patterns_id) {} // The location of the callee to use in diagnostics. SemIRLoc callee_loc; // The implicit parameters of the callee. SemIR::InstBlockId implicit_param_refs_id; + SemIR::InstBlockId implicit_param_patterns_id; // The explicit parameters of the callee. SemIR::InstBlockId param_refs_id; + SemIR::InstBlockId param_patterns_id; }; // Implicitly converts a set of arguments to match the parameter types in a diff --git a/toolchain/check/decl_name_stack.cpp b/toolchain/check/decl_name_stack.cpp index 2d315a306cf3..f820734cc43d 100644 --- a/toolchain/check/decl_name_stack.cpp +++ b/toolchain/check/decl_name_stack.cpp @@ -377,9 +377,9 @@ auto DeclNameStack::ResolveAsScope(const NameContext& name_context, return InvalidResult; } - auto new_params = DeclParams(name.name_loc_id, name.first_param_node_id, - name.last_param_node_id, name.implicit_params_id, - name.params_id); + auto new_params = DeclParams( + name.name_loc_id, name.first_param_node_id, name.last_param_node_id, + name.implicit_param_patterns_id, name.param_patterns_id); // Find the scope corresponding to the resolved instruction. // TODO: When diagnosing qualifiers on names, print a diagnostic that talks diff --git a/toolchain/check/decl_name_stack.h b/toolchain/check/decl_name_stack.h index f0f8d8324521..239e6cc3be85 100644 --- a/toolchain/check/decl_name_stack.h +++ b/toolchain/check/decl_name_stack.h @@ -102,7 +102,9 @@ class DeclNameStack { .last_param_node_id = name.last_param_node_id, .pattern_block_id = name.pattern_block_id, .implicit_param_refs_id = name.implicit_params_id, + .implicit_param_patterns_id = name.implicit_param_patterns_id, .param_refs_id = name.params_id, + .param_patterns_id = name.param_patterns_id, .is_extern = is_extern, .extern_library_id = extern_library, .non_owning_decl_id = diff --git a/toolchain/check/deduce.cpp b/toolchain/check/deduce.cpp index e4035ba3c211..88c466505660 100644 --- a/toolchain/check/deduce.cpp +++ b/toolchain/check/deduce.cpp @@ -282,8 +282,16 @@ auto DeductionContext::Deduce() -> bool { CARBON_KIND_SWITCH(param_inst) { // Deducing a symbolic binding from an argument with a constant value // deduces the binding as having that constant value. - case CARBON_KIND(SemIR::BindSymbolicName bind): { - auto& entity_name = context().entity_names().Get(bind.entity_name_id); + case SemIR::InstKind::SymbolicBindingPattern: + case SemIR::InstKind::BindSymbolicName: { + auto entity_name_id = SemIR::EntityNameId::Invalid; + if (auto bind = param_inst.TryAs()) { + entity_name_id = bind->entity_name_id; + } else { + entity_name_id = + param_inst.As().entity_name_id; + } + auto& entity_name = context().entity_names().Get(entity_name_id); auto index = entity_name.bind_index; if (!index.is_valid() || index < first_deduced_index_) { break; diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index b43471baf7f1..1934d36b5b26 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1360,6 +1360,28 @@ static auto TryEvalInstInContext(EvalContext& eval_context, case SemIR::ValueAsRef::Kind: break; + case CARBON_KIND(SemIR::SymbolicBindingPattern bind): { + // TODO: disable constant evaluation of SymbolicBindingPattern once + // DeduceGenericCallArguments no longer needs implicit params to have + // constant values. + const auto& bind_name = + eval_context.entity_names().Get(bind.entity_name_id); + + // If we know which specific we're evaluating within and this is an + // argument of that specific, its constant value is the corresponding + // argument value. + if (auto value = + eval_context.GetCompileTimeBindValue(bind_name.bind_index); + value.is_valid()) { + return value; + } + + // The constant form of a symbolic binding is an idealized form of the + // original, with no equivalent value. + bind.entity_name_id = + eval_context.entity_names().MakeCanonical(bind.entity_name_id); + return MakeConstantResult(eval_context.context(), bind, Phase::Symbolic); + } case CARBON_KIND(SemIR::BindSymbolicName bind): { const auto& bind_name = eval_context.entity_names().Get(bind.entity_name_id); @@ -1394,6 +1416,9 @@ static auto TryEvalInstInContext(EvalContext& eval_context, case CARBON_KIND(SemIR::NameRef typed_inst): { return eval_context.GetConstantValue(typed_inst.value_id); } + case CARBON_KIND(SemIR::ParamPattern param_pattern): { + return eval_context.GetConstantValue(param_pattern.subpattern_id); + } case CARBON_KIND(SemIR::Converted typed_inst): { return eval_context.GetConstantValue(typed_inst.result_id); } @@ -1466,7 +1491,6 @@ static auto TryEvalInstInContext(EvalContext& eval_context, case SemIR::ReturnExpr::Kind: case SemIR::Return::Kind: case SemIR::StructLiteral::Kind: - case SemIR::SymbolicBindingPattern::Kind: case SemIR::TupleLiteral::Kind: case SemIR::VarStorage::Kind: break; diff --git a/toolchain/check/generic.cpp b/toolchain/check/generic.cpp index a91177ed8134..3ea396294526 100644 --- a/toolchain/check/generic.cpp +++ b/toolchain/check/generic.cpp @@ -108,6 +108,12 @@ class RebuildGenericConstantInEvalBlockCallbacks final return true; } + if (auto pattern = + context_.insts().TryGetAs(inst_id)) { + inst_id = Rebuild(inst_id, *pattern); + return true; + } + return false; } @@ -426,39 +432,28 @@ auto ResolveSpecificDefinition(Context& context, SemIR::SpecificId specific_id) return true; } -// Replace the parameter with an invalid instruction so that we don't try -// constructing a generic based on it. Note this is updating the param -// refs block, not the actual params block, so will not be directly -// reflected in SemIR output. -static auto ReplaceInstructionWithError(Context& context, - SemIR::InstId& inst_id) -> void { - inst_id = context.AddInstInNoBlock( - context.insts().GetLocId(inst_id), - {.type_id = SemIR::TypeId::Error, - .name_id = SemIR::NameId::Base, - .runtime_index = SemIR::RuntimeParamIndex::Invalid}); -} - -auto RequireGenericParamsOnType(Context& context, SemIR::InstBlockId block_id) - -> void { - if (!block_id.is_valid() || block_id == SemIR::InstBlockId::Empty) { +auto RequireGenericParamsOnType(Context& context, + SemIR::InstBlockId pattern_block_id) -> void { + if (!pattern_block_id.is_valid() || + pattern_block_id == SemIR::InstBlockId::Empty) { return; } - for (auto& inst_id : context.inst_blocks().Get(block_id)) { - auto param_info = - SemIR::Function::GetParamFromParamRefId(context.sem_ir(), inst_id); - if (param_info.GetNameId(context.sem_ir()) == SemIR::NameId::SelfValue) { + for (auto& inst_id : context.inst_blocks().Get(pattern_block_id)) { + auto name_id = SemIR::Function::GetParamPatternInfoFromPatternId( + context.sem_ir(), inst_id) + .GetNameId(context.sem_ir()); + if (name_id == SemIR::NameId::SelfValue) { CARBON_DIAGNOSTIC(SelfParameterNotAllowed, Error, "`self` parameter only allowed on functions"); context.emitter().Emit(inst_id, SelfParameterNotAllowed); - ReplaceInstructionWithError(context, inst_id); + inst_id = SemIR::InstId::BuiltinError; } else if (!context.constant_values().Get(inst_id).is_constant()) { CARBON_DIAGNOSTIC(GenericParamMustBeConstant, Error, "parameters of generic types must be constant"); context.emitter().Emit(inst_id, GenericParamMustBeConstant); - ReplaceInstructionWithError(context, inst_id); + inst_id = SemIR::InstId::BuiltinError; } } } @@ -479,7 +474,7 @@ auto RequireGenericOrSelfImplicitFunctionParams(Context& context, "implicit parameters of functions must be constant or `self`"); context.emitter().Emit(inst_id, ImplictParamMustBeConstant); - ReplaceInstructionWithError(context, inst_id); + inst_id = SemIR::InstId::BuiltinError; } } } diff --git a/toolchain/check/global_init.cpp b/toolchain/check/global_init.cpp index d0f28df9352b..564e9953e53d 100644 --- a/toolchain/check/global_init.cpp +++ b/toolchain/check/global_init.cpp @@ -42,7 +42,9 @@ auto GlobalInit::Finalize() -> void { .last_param_node_id = Parse::NodeId::Invalid, .pattern_block_id = SemIR::InstBlockId::Empty, .implicit_param_refs_id = SemIR::InstBlockId::Invalid, + .implicit_param_patterns_id = SemIR::InstBlockId::Invalid, .param_refs_id = SemIR::InstBlockId::Empty, + .param_patterns_id = SemIR::InstBlockId::Empty, .is_extern = false, .extern_library_id = SemIR::LibraryNameId::Invalid, .non_owning_decl_id = SemIR::InstId::Invalid, diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index 9c25bf4fd797..2253c094274a 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -171,26 +171,40 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, // in a function definition. We don't know which kind we have here. // TODO: A tuple pattern can appear in other places than function // parameters. - auto param_id = context.AddInst( + auto param_id = context.AddInstInNoBlock( name_node, {.type_id = cast_type_id, - .name_id = name_id, .runtime_index = SemIR::RuntimeParamIndex::Invalid}); - auto bind_id = context.AddInst(make_bind_name(cast_type_id, param_id)); - push_bind_name(bind_id); + auto bind_id = + context.AddInstInNoBlock(make_bind_name(cast_type_id, param_id)); + if (needs_compile_time_binding) { + context.scope_stack().PushCompileTimeBinding(bind_id); + } // TODO: Bindings should come into scope immediately in other contexts // too. context.AddNameToLookup(name_id, bind_id); auto entity_name_id = context.insts().GetAs(bind_id).entity_name_id; + auto pattern_inst_id = SemIR::InstId::Invalid; if (is_generic) { - context.AddPatternInst( - name_node, - {.type_id = cast_type_id, .entity_name_id = entity_name_id}); + pattern_inst_id = context.AddPatternInst( + name_node, {.type_id = cast_type_id, + .entity_name_id = entity_name_id, + .bind_name_id = bind_id}); } else { - context.AddPatternInst( - name_node, - {.type_id = cast_type_id, .entity_name_id = entity_name_id}); + pattern_inst_id = context.AddPatternInst( + name_node, {.type_id = cast_type_id, + .entity_name_id = entity_name_id, + .bind_name_id = bind_id}); } + auto param_pattern_id = context.AddPatternInst( + node_id, + { + .type_id = context.insts().Get(pattern_inst_id).type_id(), + .subpattern_id = pattern_inst_id, + .runtime_index = SemIR::RuntimeParamIndex::Invalid, + }); + context.node_stack().Push(node_id, param_pattern_id); + // TODO: use the pattern insts to generate the pattern-match insts // at the end of the full pattern, instead of eagerly generating them // here. @@ -253,21 +267,29 @@ auto HandleParseNode(Context& context, } auto HandleParseNode(Context& context, Parse::AddrId node_id) -> bool { - auto self_param_id = context.node_stack().PopPattern(); - if (auto self_param = - context.insts().TryGetAs(self_param_id); - self_param && - context.entity_names().Get(self_param->entity_name_id).name_id == - SemIR::NameId::SelfValue) { - // TODO: The type of an `addr_pattern` should probably be the non-pointer - // type, because that's the type that the pattern matches. - context.AddInstAndPush( - node_id, {.type_id = self_param->type_id, .inner_id = self_param_id}); + auto param_pattern_id = context.node_stack().PopPattern(); + if (SemIR::Function::GetParamPatternInfoFromPatternId(context.sem_ir(), + param_pattern_id) + .GetNameId(context.sem_ir()) == SemIR::NameId::SelfValue) { + auto pointer_type = context.types().TryGetAs( + context.insts().Get(param_pattern_id).type_id()); + if (pointer_type) { + auto addr_pattern_id = context.AddPatternInst( + node_id, + {.type_id = SemIR::TypeId::AutoType, .inner_id = param_pattern_id}); + context.node_stack().Push(node_id, addr_pattern_id); + } else { + CARBON_DIAGNOSTIC( + AddrOnNonPointerType, Error, + "`addr` can only be applied to a binding with a pointer type"); + context.emitter().Emit(node_id, AddrOnNonPointerType); + context.node_stack().Push(node_id, param_pattern_id); + } } else { CARBON_DIAGNOSTIC(AddrOnNonSelfParam, Error, "`addr` can only be applied to a `self` parameter"); context.emitter().Emit(TokenOnly(node_id), AddrOnNonSelfParam); - context.node_stack().Push(node_id, self_param_id); + context.node_stack().Push(node_id, param_pattern_id); } return true; } diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index 5defa16b87a4..8d4d63659476 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -219,8 +219,8 @@ static auto BuildClassDecl(Context& context, Parse::AnyClassDeclId node_id, .self_type_id = SemIR::TypeId::Invalid, .inheritance_kind = inheritance_kind}}; - RequireGenericParamsOnType(context, class_info.implicit_param_refs_id); - RequireGenericParamsOnType(context, class_info.param_refs_id); + RequireGenericParamsOnType(context, class_info.implicit_param_patterns_id); + RequireGenericParamsOnType(context, class_info.param_patterns_id); MergeOrAddName(context, node_id, name_context, class_decl_id, class_decl, class_info, is_definition, diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index 6cb3cec8ecc2..c6122b27eb75 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -75,19 +75,38 @@ static auto CheckFunctionSignature(Context& context, RequireGenericOrSelfImplicitFunctionParams( context, name_and_params.implicit_params_id); SemIR::RuntimeParamIndex next_index(0); - for (auto param_id : llvm::concat( - context.inst_blocks().GetOrEmpty(name_and_params.implicit_params_id), - context.inst_blocks().GetOrEmpty(name_and_params.params_id))) { - // Find the parameter in the pattern. - auto param_info = - SemIR::Function::GetParamFromParamRefId(context.sem_ir(), param_id); - // If this is a runtime parameter, number it. - if (param_info.bind_name && - param_info.bind_name->kind == SemIR::BindName::Kind) { - param_info.inst.runtime_index = next_index; - context.ReplaceInstBeforeConstantUse(param_info.inst_id, param_info.inst); - ++next_index.index; + for (auto [params_id, param_patterns_id] : + {std::pair{name_and_params.implicit_params_id, + name_and_params.implicit_param_patterns_id}, + std::pair{name_and_params.params_id, + name_and_params.param_patterns_id}}) { + for (auto [param_id, param_pattern_id] : + llvm::zip_equal(context.inst_blocks().GetOrEmpty(params_id), + context.inst_blocks().GetOrEmpty(param_patterns_id))) { + if (param_id == SemIR::InstId::BuiltinError || + param_pattern_id == SemIR::InstId::BuiltinError) { + continue; + } + auto param_info = + SemIR::Function::GetParamFromParamRefId(context.sem_ir(), param_id); + auto param_pattern_info = + SemIR::Function::GetParamPatternInfoFromPatternId(context.sem_ir(), + param_pattern_id); + + // If this is a runtime parameter, number it. + // TODO: move this logic to pattern_match.cpp, and remove this function + // (which is otherwise redundant). + if (param_info.bind_name && + param_info.bind_name->kind == SemIR::BindName::Kind) { + param_info.inst.runtime_index = next_index; + context.ReplaceInstBeforeConstantUse(param_info.inst_id, + param_info.inst); + param_pattern_info.inst.runtime_index = next_index; + context.ReplaceInstBeforeConstantUse(param_pattern_info.inst_id, + param_pattern_info.inst); + ++next_index.index; + } } } @@ -310,9 +329,9 @@ static auto BuildFunctionDecl(Context& context, if (SemIR::IsEntryPoint(context.sem_ir(), function_decl.function_id)) { auto return_type_id = function_info.GetDeclaredReturnType(context.sem_ir()); // TODO: Update this once valid signatures for the entry point are decided. - if (function_info.implicit_param_refs_id.is_valid() || - !function_info.param_refs_id.is_valid() || - !context.inst_blocks().Get(function_info.param_refs_id).empty() || + if (function_info.implicit_param_patterns_id.is_valid() || + !function_info.param_patterns_id.is_valid() || + !context.inst_blocks().Get(function_info.param_patterns_id).empty() || (return_type_id.is_valid() && return_type_id != context.GetBuiltinType(SemIR::BuiltinInstKind::IntType) && @@ -360,6 +379,9 @@ static auto HandleFunctionDefinitionAfterSignature( for (auto param_ref_id : llvm::concat( context.inst_blocks().GetOrEmpty(function.implicit_param_refs_id), context.inst_blocks().GetOrEmpty(function.param_refs_id))) { + if (param_ref_id == SemIR::InstId::BuiltinError) { + continue; + } auto param_info = SemIR::Function::GetParamFromParamRefId(context.sem_ir(), param_ref_id); @@ -477,12 +499,14 @@ static auto IsValidBuiltinDeclaration(Context& context, -> bool { // Form the list of parameter types for the declaration. llvm::SmallVector param_type_ids; - auto implicit_param_refs = - context.inst_blocks().GetOrEmpty(function.implicit_param_refs_id); - auto param_refs = context.inst_blocks().GetOrEmpty(function.param_refs_id); - param_type_ids.reserve(implicit_param_refs.size() + param_refs.size()); - for (auto param_id : - llvm::concat(implicit_param_refs, param_refs)) { + auto implicit_param_patterns = + context.inst_blocks().GetOrEmpty(function.implicit_param_patterns_id); + auto param_patterns = + context.inst_blocks().GetOrEmpty(function.param_patterns_id); + param_type_ids.reserve(implicit_param_patterns.size() + + param_patterns.size()); + for (auto param_id : llvm::concat( + implicit_param_patterns, param_patterns)) { // TODO: We also need to track whether the parameter is declared with // `var`. param_type_ids.push_back(context.insts().Get(param_id).type_id()); diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index 3655cce866e8..51788698e555 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -10,6 +10,7 @@ #include "toolchain/check/impl.h" #include "toolchain/check/merge.h" #include "toolchain/check/modifiers.h" +#include "toolchain/check/pattern_match.h" #include "toolchain/parse/typed_nodes.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/typed_insts.h" @@ -202,9 +203,17 @@ static auto ExtendImpl(Context& context, Parse::NodeId extend_node, static auto PopImplIntroducerAndParamsAsNameComponent( Context& context, Parse::AnyImplDeclId end_of_decl_node_id) -> NameComponent { - auto [implicit_params_loc_id, implicit_params_id] = + auto [implicit_params_loc_id, implicit_param_patterns_id] = context.node_stack().PopWithNodeIdIf(); + ParameterBlocks parameter_blocks{ + .implicit_params_id = SemIR::InstBlockId::Invalid, + .params_id = SemIR::InstBlockId::Invalid}; + if (implicit_param_patterns_id) { + parameter_blocks = CalleePatternMatch(context, *implicit_param_patterns_id, + SemIR::InstBlockId::Invalid); + } + Parse::NodeId first_param_node_id = context.node_stack().PopForSoloNodeId(); Parse::NodeId last_param_node_id = end_of_decl_node_id; @@ -215,10 +224,12 @@ static auto PopImplIntroducerAndParamsAsNameComponent( .first_param_node_id = first_param_node_id, .last_param_node_id = last_param_node_id, .implicit_params_loc_id = implicit_params_loc_id, - .implicit_params_id = - implicit_params_id.value_or(SemIR::InstBlockId::Invalid), + .implicit_params_id = parameter_blocks.implicit_params_id, + .implicit_param_patterns_id = + implicit_param_patterns_id.value_or(SemIR::InstBlockId::Invalid), .params_loc_id = Parse::NodeId::Invalid, .params_id = SemIR::InstBlockId::Invalid, + .param_patterns_id = SemIR::InstBlockId::Invalid, .pattern_block_id = context.pattern_block_stack().Pop(), }; } diff --git a/toolchain/check/handle_interface.cpp b/toolchain/check/handle_interface.cpp index c6260ced0823..26ad016f16b5 100644 --- a/toolchain/check/handle_interface.cpp +++ b/toolchain/check/handle_interface.cpp @@ -60,8 +60,9 @@ static auto BuildInterfaceDecl(Context& context, SemIR::Interface interface_info = {name_context.MakeEntityWithParamsBase( name, interface_decl_id, /*is_extern=*/false, SemIR::LibraryNameId::Invalid)}; - RequireGenericParamsOnType(context, interface_info.implicit_param_refs_id); - RequireGenericParamsOnType(context, interface_info.param_refs_id); + RequireGenericParamsOnType(context, + interface_info.implicit_param_patterns_id); + RequireGenericParamsOnType(context, interface_info.param_patterns_id); // Check whether this is a redeclaration. auto existing_id = context.decl_name_stack().LookupOrAddName( @@ -74,8 +75,9 @@ static auto BuildInterfaceDecl(Context& context, if (CheckRedeclParamsMatch( context, DeclParams(interface_decl_id, name.first_param_node_id, - name.last_param_node_id, name.implicit_params_id, - name.params_id), + name.last_param_node_id, + name.implicit_param_patterns_id, + name.param_patterns_id), DeclParams(existing_interface))) { // TODO: This should be refactored a little, particularly for // prev_import_ir_id. See similar logic for classes and functions, which diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 4dadc17170e2..8b2c8cacc5d5 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -682,16 +682,42 @@ class ImportRefResolver { // constant. auto bind_id = inst_id; auto bind_inst = import_ir_.insts().Get(bind_id); - if (auto addr = bind_inst.TryAs()) { - bind_id = addr->inner_id; - bind_inst = import_ir_.insts().Get(bind_id); - } if (bind_inst.Is()) { GetLocalConstantId(bind_id); } } } + // Adds unresolved constants for each parameter's type to work_stack_. + auto LoadLocalPatternConstantIds(SemIR::InstBlockId param_patterns_id) + -> void { + if (!param_patterns_id.is_valid() || + param_patterns_id == SemIR::InstBlockId::Empty) { + return; + } + + const auto& param_patterns = + import_ir_.inst_blocks().Get(param_patterns_id); + for (auto pattern_id : param_patterns) { + auto pattern_inst = import_ir_.insts().Get(pattern_id); + GetLocalConstantId(pattern_inst.type_id()); + if (auto addr = pattern_inst.TryAs()) { + pattern_id = addr->inner_id; + pattern_inst = import_ir_.insts().Get(pattern_id); + GetLocalConstantId(pattern_inst.type_id()); + } + pattern_id = import_ir_.insts() + .GetAs(pattern_id) + .subpattern_id; + pattern_inst = import_ir_.insts().Get(pattern_id); + // If the parameter is a symbolic binding, build the + // SymbolicBindingPattern constant. + if (pattern_inst.Is()) { + GetLocalConstantId(pattern_id); + } + } + } + // Returns a version of param_refs_id localized to the current IR. // // Must only be called after a call to GetLocalParamConstantIds(param_refs_id) @@ -718,78 +744,148 @@ class ImportRefResolver { // added `bool addr` and `InstId bind_inst_id` to its return `ParamInfo`. // TODO: Consider a different parameter handling to simplify import logic. auto inst = import_ir_.insts().Get(ref_id); - auto addr_inst = inst.TryAs(); auto bind_id = ref_id; auto param_id = ref_id; - if (addr_inst) { - bind_id = addr_inst->inner_id; - param_id = bind_id; - inst = import_ir_.insts().Get(bind_id); - } - - auto bind_inst = inst.TryAs(); - if (bind_inst) { - param_id = bind_inst->value_id; - inst = import_ir_.insts().Get(param_id); - } + auto bind_inst = inst.As(); + param_id = bind_inst.value_id; + inst = import_ir_.insts().Get(param_id); auto param_inst = inst.As(); // Rebuild the param instruction. - auto name_id = GetLocalNameId(param_inst.name_id); + auto entity_name = + import_ir_.entity_names().Get(bind_inst.entity_name_id); + auto name_id = GetLocalNameId(entity_name.name_id); auto type_id = context_.GetTypeIdForTypeConstant( GetLocalConstantIdChecked(param_inst.type_id)); auto new_param_id = context_.AddInstInNoBlock( AddImportIRInst(param_id), - {.type_id = type_id, - .name_id = name_id, - .runtime_index = param_inst.runtime_index}); - if (bind_inst) { - switch (bind_inst->kind) { - case SemIR::BindName::Kind: { - auto entity_name_id = context_.entity_names().Add( - {.name_id = name_id, - .parent_scope_id = SemIR::NameScopeId::Invalid, - .bind_index = SemIR::CompileTimeBindIndex::Invalid}); - new_param_id = context_.AddInstInNoBlock( - AddImportIRInst(bind_id), {.type_id = type_id, - .entity_name_id = entity_name_id, - .value_id = new_param_id}); - break; - } - case SemIR::BindSymbolicName::Kind: { - // We already imported a constant value for this symbolic binding. - // We can reuse most of it, but update the value to point to our - // specific parameter, and preserve the constant value. - auto new_bind_inst = - context_.insts().GetAs( - context_.constant_values().GetInstId( - GetLocalConstantIdChecked(bind_id))); - new_bind_inst.value_id = new_param_id; - new_param_id = context_.AddInstInNoBlock(AddImportIRInst(bind_id), - new_bind_inst); - context_.constant_values().Set(new_param_id, - GetLocalConstantIdChecked(bind_id)); - break; - } - default: { - CARBON_FATAL("Unexpected kind: {0}", bind_inst->kind); - } + {.type_id = type_id, .runtime_index = param_inst.runtime_index}); + switch (bind_inst.kind) { + case SemIR::BindName::Kind: { + auto entity_name_id = context_.entity_names().Add( + {.name_id = name_id, + .parent_scope_id = SemIR::NameScopeId::Invalid, + .bind_index = SemIR::CompileTimeBindIndex::Invalid}); + new_param_id = context_.AddInstInNoBlock( + AddImportIRInst(bind_id), {.type_id = type_id, + .entity_name_id = entity_name_id, + .value_id = new_param_id}); + break; + } + case SemIR::BindSymbolicName::Kind: { + // We already imported a constant value for this symbolic binding. + // We can reuse most of it, but update the value to point to our + // specific parameter, and preserve the constant value. + auto new_bind_inst = context_.insts().GetAs( + context_.constant_values().GetInstId( + GetLocalConstantIdChecked(bind_id))); + new_bind_inst.value_id = new_param_id; + new_param_id = context_.AddInstInNoBlock(AddImportIRInst(bind_id), + new_bind_inst); + context_.constant_values().Set(new_param_id, + GetLocalConstantIdChecked(bind_id)); + break; + } + default: { + CARBON_FATAL("Unexpected kind: {0}", bind_inst.kind); } - } - if (addr_inst) { - new_param_id = context_.AddInstInNoBlock( - context_.MakeImportedLocAndInst( - AddImportIRInst(ref_id), - {.type_id = type_id, .inner_id = new_param_id})); } new_param_refs.push_back(new_param_id); } return context_.inst_blocks().Add(new_param_refs); } + // Returns a version of param_patterns_id localized to the current IR. + // + // Must only be called after a call to + // LoadLocalPatternConstantIds(param_patterns_id) has completed without adding + // any new work to work_stack_. + auto GetLocalParamPatternsId(SemIR::InstBlockId param_patterns_id) + -> SemIR::InstBlockId { + if (!param_patterns_id.is_valid() || + param_patterns_id == SemIR::InstBlockId::Empty) { + return param_patterns_id; + } + const auto& param_patterns = + import_ir_.inst_blocks().Get(param_patterns_id); + llvm::SmallVector new_patterns; + for (auto param_id : param_patterns) { + // Figure out the pattern structure. This echoes + // Function::GetParamPatternInfoFromPatternId. + auto addr_pattern_id = param_id; + auto addr_inst = + import_ir_.insts().TryGetAs(addr_pattern_id); + auto param_pattern_id = addr_pattern_id; + if (addr_inst) { + param_pattern_id = addr_inst->inner_id; + } + + auto param_pattern = + import_ir_.insts().GetAs(param_pattern_id); + + auto binding_id = param_pattern.subpattern_id; + auto binding = + import_ir_.insts().GetAs(binding_id); + + // Rebuild the pattern. + auto entity_name = import_ir_.entity_names().Get(binding.entity_name_id); + auto name_id = GetLocalNameId(entity_name.name_id); + auto type_id = context_.GetTypeIdForTypeConstant( + GetLocalConstantIdChecked(binding.type_id)); + + auto new_param_id = SemIR::InstId::Invalid; + switch (binding.kind) { + case SemIR::BindingPattern::Kind: { + auto entity_name_id = context_.entity_names().Add( + {.name_id = name_id, + .parent_scope_id = SemIR::NameScopeId::Invalid, + .bind_index = SemIR::CompileTimeBindIndex::Invalid}); + new_param_id = context_.AddInstInNoBlock( + AddImportIRInst(binding_id), + {.type_id = type_id, + .entity_name_id = entity_name_id, + .bind_name_id = SemIR::InstId::Invalid}); + break; + } + case SemIR::SymbolicBindingPattern::Kind: { + // We already imported a constant value for this symbolic binding. + // We can reuse most of it, but update the value to point to our + // specific parameter, and preserve the constant value. + auto bind_const_id = GetLocalConstantIdChecked(binding_id); + auto new_binding_inst = + context_.insts().GetAs( + context_.constant_values().GetInstId(bind_const_id)); + new_param_id = context_.AddInstInNoBlock(AddImportIRInst(binding_id), + new_binding_inst); + context_.constant_values().Set(new_param_id, bind_const_id); + break; + } + default: { + CARBON_FATAL("Unexpected kind: ", binding.kind); + } + } + new_param_id = context_.AddInstInNoBlock( + context_.MakeImportedLocAndInst( + AddImportIRInst(param_pattern_id), + {.type_id = type_id, + .subpattern_id = new_param_id, + .runtime_index = param_pattern.runtime_index})); + if (addr_inst) { + type_id = context_.GetTypeIdForTypeConstant( + GetLocalConstantIdChecked(addr_inst->type_id)); + new_param_id = context_.AddInstInNoBlock( + context_.MakeImportedLocAndInst( + AddImportIRInst(addr_pattern_id), + {.type_id = type_id, .inner_id = new_param_id})); + } + new_patterns.push_back(new_param_id); + } + return context_.inst_blocks().Add(new_patterns); + } + // Translates a NameId from the import IR to a local NameId. auto GetLocalNameId(SemIR::NameId import_name_id) -> SemIR::NameId { if (auto ident_id = import_name_id.AsIdentifierId(); ident_id.is_valid()) { @@ -906,9 +1002,16 @@ class ImportRefResolver { .implicit_param_refs_id = import_base.implicit_param_refs_id.is_valid() ? SemIR::InstBlockId::Empty : SemIR::InstBlockId::Invalid, + .implicit_param_patterns_id = + import_base.implicit_param_patterns_id.is_valid() + ? SemIR::InstBlockId::Empty + : SemIR::InstBlockId::Invalid, .param_refs_id = import_base.param_refs_id.is_valid() ? SemIR::InstBlockId::Empty : SemIR::InstBlockId::Invalid, + .param_patterns_id = import_base.param_patterns_id.is_valid() + ? SemIR::InstBlockId::Empty + : SemIR::InstBlockId::Invalid, .is_extern = import_base.is_extern, .extern_library_id = extern_library_id, .non_owning_decl_id = import_base.non_owning_decl_id.is_valid() @@ -1090,6 +1193,9 @@ class ImportRefResolver { case CARBON_KIND(SemIR::PointerType inst): { return TryResolveTypedInst(inst); } + case CARBON_KIND(SemIR::SymbolicBindingPattern inst): { + return TryResolveTypedInst(inst); + } case CARBON_KIND(SemIR::StructType inst): { return TryResolveTypedInst(inst, inst_id); } @@ -1234,6 +1340,26 @@ class ImportRefResolver { .value_id = SemIR::InstId::Invalid}); } + auto TryResolveTypedInst(SemIR::SymbolicBindingPattern inst) + -> ResolveResult { + auto type_id = GetLocalConstantId(inst.type_id); + if (HasNewWork()) { + return Retry(); + } + + const auto& import_entity_name = + import_ir_.entity_names().Get(inst.entity_name_id); + auto name_id = GetLocalNameId(import_entity_name.name_id); + auto entity_name_id = context_.entity_names().Add( + {.name_id = name_id, + .parent_scope_id = SemIR::NameScopeId::Invalid, + .bind_index = import_entity_name.bind_index}); + return ResolveAs( + {.type_id = context_.GetTypeIdForTypeConstant(type_id), + .entity_name_id = entity_name_id, + .bind_name_id = SemIR::InstId::Invalid}); + } + // Makes an incomplete class. This is necessary even with classes with a // complete declaration, because things such as `Self` may refer back to the // type. @@ -1346,7 +1472,9 @@ class ImportRefResolver { // Load constants for the definition. auto parent_scope_id = GetLocalNameScopeId(import_class.parent_scope_id); LoadLocalParamConstantIds(import_class.implicit_param_refs_id); + LoadLocalPatternConstantIds(import_class.implicit_param_patterns_id); LoadLocalParamConstantIds(import_class.param_refs_id); + LoadLocalPatternConstantIds(import_class.param_patterns_id); auto generic_data = GetLocalGenericData(import_class.generic_id); auto self_const_id = GetLocalConstantId(import_class.self_type_id); auto complete_type_witness_id = @@ -1365,7 +1493,11 @@ class ImportRefResolver { new_class.parent_scope_id = parent_scope_id; new_class.implicit_param_refs_id = GetLocalParamRefsId(import_class.implicit_param_refs_id); + new_class.implicit_param_patterns_id = + GetLocalParamPatternsId(import_class.implicit_param_patterns_id); new_class.param_refs_id = GetLocalParamRefsId(import_class.param_refs_id); + new_class.param_patterns_id = + GetLocalParamPatternsId(import_class.param_patterns_id); SetGenericData(import_class.generic_id, new_class.generic_id, generic_data); new_class.self_type_id = context_.GetTypeIdForTypeConstant(self_const_id); @@ -1517,7 +1649,9 @@ class ImportRefResolver { } auto parent_scope_id = GetLocalNameScopeId(import_function.parent_scope_id); LoadLocalParamConstantIds(import_function.implicit_param_refs_id); + LoadLocalPatternConstantIds(import_function.implicit_param_patterns_id); LoadLocalParamConstantIds(import_function.param_refs_id); + LoadLocalPatternConstantIds(import_function.param_patterns_id); auto generic_data = GetLocalGenericData(import_function.generic_id); if (HasNewWork()) { @@ -1529,8 +1663,12 @@ class ImportRefResolver { new_function.parent_scope_id = parent_scope_id; new_function.implicit_param_refs_id = GetLocalParamRefsId(import_function.implicit_param_refs_id); + new_function.implicit_param_patterns_id = + GetLocalParamPatternsId(import_function.implicit_param_patterns_id); new_function.param_refs_id = GetLocalParamRefsId(import_function.param_refs_id); + new_function.param_patterns_id = + GetLocalParamPatternsId(import_function.param_patterns_id); SetGenericData(import_function.generic_id, new_function.generic_id, generic_data); @@ -1674,6 +1812,7 @@ class ImportRefResolver { // Load constants for the definition. auto parent_scope_id = GetLocalNameScopeId(import_impl.parent_scope_id); LoadLocalParamConstantIds(import_impl.implicit_param_refs_id); + LoadLocalPatternConstantIds(import_impl.implicit_param_patterns_id); auto generic_data = GetLocalGenericData(import_impl.generic_id); auto self_const_id = GetLocalConstantId( import_ir_.constant_values().Get(import_impl.self_id)); @@ -1688,6 +1827,8 @@ class ImportRefResolver { new_impl.parent_scope_id = parent_scope_id; new_impl.implicit_param_refs_id = GetLocalParamRefsId(import_impl.implicit_param_refs_id); + new_impl.implicit_param_patterns_id = + GetLocalParamPatternsId(import_impl.implicit_param_patterns_id); CARBON_CHECK(!import_impl.param_refs_id.is_valid() && !new_impl.param_refs_id.is_valid()); SetGenericData(import_impl.generic_id, new_impl.generic_id, generic_data); @@ -1837,7 +1978,9 @@ class ImportRefResolver { auto parent_scope_id = GetLocalNameScopeId(import_interface.parent_scope_id); LoadLocalParamConstantIds(import_interface.implicit_param_refs_id); + LoadLocalPatternConstantIds(import_interface.implicit_param_patterns_id); LoadLocalParamConstantIds(import_interface.param_refs_id); + LoadLocalPatternConstantIds(import_interface.param_patterns_id); auto generic_data = GetLocalGenericData(import_interface.generic_id); std::optional self_param_id; @@ -1853,8 +1996,12 @@ class ImportRefResolver { new_interface.parent_scope_id = parent_scope_id; new_interface.implicit_param_refs_id = GetLocalParamRefsId(import_interface.implicit_param_refs_id); + new_interface.implicit_param_patterns_id = + GetLocalParamPatternsId(import_interface.implicit_param_patterns_id); new_interface.param_refs_id = GetLocalParamRefsId(import_interface.param_refs_id); + new_interface.param_patterns_id = + GetLocalParamPatternsId(import_interface.param_patterns_id); SetGenericData(import_interface.generic_id, new_interface.generic_id, generic_data); diff --git a/toolchain/check/member_access.cpp b/toolchain/check/member_access.cpp index fe1ad78393a2..1710b6816479 100644 --- a/toolchain/check/member_access.cpp +++ b/toolchain/check/member_access.cpp @@ -89,11 +89,9 @@ static auto IsInstanceMethod(const SemIR::File& sem_ir, SemIR::FunctionId function_id) -> bool { const auto& function = sem_ir.functions().Get(function_id); for (auto param_id : - sem_ir.inst_blocks().GetOrEmpty(function.implicit_param_refs_id)) { - auto param_name_id = - SemIR::Function::GetParamFromParamRefId(sem_ir, param_id) - .GetNameId(sem_ir); - if (param_name_id == SemIR::NameId::SelfValue) { + sem_ir.inst_blocks().GetOrEmpty(function.implicit_param_patterns_id)) { + if (SemIR::Function::GetParamPatternInfoFromPatternId(sem_ir, param_id) + .GetNameId(sem_ir) == SemIR::NameId::SelfValue) { return true; } } diff --git a/toolchain/check/merge.cpp b/toolchain/check/merge.cpp index aa1498bc1223..e6c3ca188150 100644 --- a/toolchain/check/merge.cpp +++ b/toolchain/check/merge.cpp @@ -177,10 +177,11 @@ auto ReplacePrevInstForMerge(Context& context, SemIR::NameScopeId scope_id, // previously been diagnosed. static auto EntityHasParamError(Context& context, const DeclParams& info) -> bool { - for (auto param_refs_id : {info.implicit_param_refs_id, info.param_refs_id}) { - if (param_refs_id.is_valid() && - param_refs_id != SemIR::InstBlockId::Empty) { - for (auto param_id : context.inst_blocks().Get(param_refs_id)) { + for (auto param_patterns_id : + {info.implicit_param_patterns_id, info.param_patterns_id}) { + if (param_patterns_id.is_valid() && + param_patterns_id != SemIR::InstBlockId::Empty) { + for (auto param_id : context.inst_blocks().Get(param_patterns_id)) { if (context.insts().Get(param_id).type_id() == SemIR::TypeId::Error) { return true; } @@ -194,7 +195,7 @@ static auto EntityHasParamError(Context& context, const DeclParams& info) // to provide a diagnostic. static auto CheckRedeclParam( Context& context, llvm::StringLiteral param_diag_label, int32_t param_index, - SemIR::InstId new_param_ref_id, SemIR::InstId prev_param_ref_id, + SemIR::InstId new_param_pattern_id, SemIR::InstId prev_param_pattern_id, SemIR::SpecificId prev_specific_id, bool diagnose) -> bool { // TODO: Consider differentiating between type and name mistakes. For now, // taking the simpler approach because I also think we may want to refactor @@ -210,44 +211,48 @@ static auto CheckRedeclParam( "previous declaration's corresponding {0}parameter here", llvm::StringLiteral); context.emitter() - .Build(new_param_ref_id, RedeclParamDiffers, param_diag_label, + .Build(new_param_pattern_id, RedeclParamDiffers, param_diag_label, param_index + 1) - .Note(prev_param_ref_id, RedeclParamPrevious, param_diag_label) + .Note(prev_param_pattern_id, RedeclParamPrevious, param_diag_label) .Emit(); }; - auto new_param_ref = context.insts().Get(new_param_ref_id); - auto prev_param_ref = context.insts().Get(prev_param_ref_id); - if (new_param_ref.kind() != prev_param_ref.kind() || + auto new_param_pattern = context.insts().Get(new_param_pattern_id); + auto prev_param_pattern = context.insts().Get(prev_param_pattern_id); + if (new_param_pattern.kind() != prev_param_pattern.kind() || !context.types().AreEqualAcrossDeclarations( - new_param_ref.type_id(), + new_param_pattern.type_id(), SemIR::GetTypeInSpecific(context.sem_ir(), prev_specific_id, - prev_param_ref.type_id()))) { + prev_param_pattern.type_id()))) { emit_diagnostic(); return false; } - if (new_param_ref.Is()) { - new_param_ref = - context.insts().Get(new_param_ref.As().inner_id); - prev_param_ref = - context.insts().Get(prev_param_ref.As().inner_id); - if (new_param_ref.kind() != prev_param_ref.kind()) { + if (new_param_pattern.Is()) { + new_param_pattern = context.insts().Get( + new_param_pattern.As().inner_id); + prev_param_pattern = context.insts().Get( + prev_param_pattern.As().inner_id); + if (new_param_pattern.kind() != prev_param_pattern.kind()) { emit_diagnostic(); return false; } } - if (new_param_ref.Is()) { - new_param_ref = - context.insts().Get(new_param_ref.As().value_id); - prev_param_ref = - context.insts().Get(prev_param_ref.As().value_id); + new_param_pattern = context.insts().Get( + new_param_pattern.As().subpattern_id); + prev_param_pattern = context.insts().Get( + prev_param_pattern.As().subpattern_id); + if (new_param_pattern.kind() != prev_param_pattern.kind()) { + emit_diagnostic(); + return false; } - auto new_param = new_param_ref.As(); - auto prev_param = prev_param_ref.As(); - if (new_param.name_id != prev_param.name_id) { + auto new_entity_name = context.entity_names().Get( + new_param_pattern.As().entity_name_id); + auto prev_entity_name = context.entity_names().Get( + prev_param_pattern.As().entity_name_id); + if (new_entity_name.name_id != prev_entity_name.name_id) { emit_diagnostic(); return false; } @@ -257,19 +262,19 @@ static auto CheckRedeclParam( // Returns false if the param refs differ for a redeclaration. static auto CheckRedeclParams(Context& context, SemIRLoc new_decl_loc, - SemIR::InstBlockId new_param_refs_id, + SemIR::InstBlockId new_param_patterns_id, SemIRLoc prev_decl_loc, - SemIR::InstBlockId prev_param_refs_id, + SemIR::InstBlockId prev_param_patterns_id, llvm::StringLiteral param_diag_label, SemIR::SpecificId prev_specific_id, bool diagnose) -> bool { // This will often occur for empty params. - if (new_param_refs_id == prev_param_refs_id) { + if (new_param_patterns_id == prev_param_patterns_id) { return true; } // If exactly one of the parameter lists was present, they differ. - if (new_param_refs_id.is_valid() != prev_param_refs_id.is_valid()) { + if (new_param_patterns_id.is_valid() != prev_param_patterns_id.is_valid()) { if (!diagnose) { return false; } @@ -280,19 +285,23 @@ static auto CheckRedeclParams(Context& context, SemIRLoc new_decl_loc, "previously declared with{1} {0}parameter list", llvm::StringLiteral, llvm::StringLiteral); context.emitter() - .Build( - new_decl_loc, RedeclParamListDiffers, param_diag_label, - new_param_refs_id.is_valid() ? llvm::StringLiteral("") : "missing ") - .Note(prev_decl_loc, RedeclParamListPrevious, param_diag_label, - prev_param_refs_id.is_valid() ? llvm::StringLiteral("") : "out") + .Build(new_decl_loc, RedeclParamListDiffers, param_diag_label, + new_param_patterns_id.is_valid() ? llvm::StringLiteral("") + : "missing ") + .Note( + prev_decl_loc, RedeclParamListPrevious, param_diag_label, + prev_param_patterns_id.is_valid() ? llvm::StringLiteral("") : "out") .Emit(); return false; } - CARBON_CHECK(new_param_refs_id.is_valid() && prev_param_refs_id.is_valid()); - const auto new_param_ref_ids = context.inst_blocks().Get(new_param_refs_id); - const auto prev_param_ref_ids = context.inst_blocks().Get(prev_param_refs_id); - if (new_param_ref_ids.size() != prev_param_ref_ids.size()) { + CARBON_CHECK(new_param_patterns_id.is_valid() && + prev_param_patterns_id.is_valid()); + const auto new_param_pattern_ids = + context.inst_blocks().Get(new_param_patterns_id); + const auto prev_param_pattern_ids = + context.inst_blocks().Get(prev_param_patterns_id); + if (new_param_pattern_ids.size() != prev_param_pattern_ids.size()) { if (!diagnose) { return false; } @@ -305,16 +314,17 @@ static auto CheckRedeclParams(Context& context, SemIRLoc new_decl_loc, llvm::StringLiteral, int32_t); context.emitter() .Build(new_decl_loc, RedeclParamCountDiffers, param_diag_label, - new_param_ref_ids.size()) + new_param_pattern_ids.size()) .Note(prev_decl_loc, RedeclParamCountPrevious, param_diag_label, - prev_param_ref_ids.size()) + prev_param_pattern_ids.size()) .Emit(); return false; } - for (auto [index, new_param_ref_id, prev_param_ref_id] : - llvm::enumerate(new_param_ref_ids, prev_param_ref_ids)) { - if (!CheckRedeclParam(context, param_diag_label, index, new_param_ref_id, - prev_param_ref_id, prev_specific_id, diagnose)) { + for (auto [index, new_param_pattern_id, prev_param_pattern_id] : + llvm::enumerate(new_param_pattern_ids, prev_param_pattern_ids)) { + if (!CheckRedeclParam(context, param_diag_label, index, + new_param_pattern_id, prev_param_pattern_id, + prev_specific_id, diagnose)) { return false; } } @@ -401,13 +411,13 @@ auto CheckRedeclParamsMatch(Context& context, const DeclParams& new_entity, return false; } if (!CheckRedeclParams(context, new_entity.loc, - new_entity.implicit_param_refs_id, prev_entity.loc, - prev_entity.implicit_param_refs_id, "implicit ", + new_entity.implicit_param_patterns_id, prev_entity.loc, + prev_entity.implicit_param_patterns_id, "implicit ", prev_specific_id, diagnose)) { return false; } - if (!CheckRedeclParams(context, new_entity.loc, new_entity.param_refs_id, - prev_entity.loc, prev_entity.param_refs_id, "", + if (!CheckRedeclParams(context, new_entity.loc, new_entity.param_patterns_id, + prev_entity.loc, prev_entity.param_patterns_id, "", prev_specific_id, diagnose)) { return false; } diff --git a/toolchain/check/merge.h b/toolchain/check/merge.h index 011cca0aa523..a14bcc1f9ae0 100644 --- a/toolchain/check/merge.h +++ b/toolchain/check/merge.h @@ -62,18 +62,18 @@ struct DeclParams { : loc(base.latest_decl_id()), first_param_node_id(base.first_param_node_id), last_param_node_id(base.last_param_node_id), - implicit_param_refs_id(base.implicit_param_refs_id), - param_refs_id(base.param_refs_id) {} + implicit_param_patterns_id(base.implicit_param_patterns_id), + param_patterns_id(base.param_patterns_id) {} DeclParams(SemIRLoc loc, Parse::NodeId first_param_node_id, Parse::NodeId last_param_node_id, - SemIR::InstBlockId implicit_params_id, - SemIR::InstBlockId params_id) + SemIR::InstBlockId implicit_param_patterns_id, + SemIR::InstBlockId param_patterns_id) : loc(loc), first_param_node_id(first_param_node_id), last_param_node_id(last_param_node_id), - implicit_param_refs_id(implicit_params_id), - param_refs_id(params_id) {} + implicit_param_patterns_id(implicit_param_patterns_id), + param_patterns_id(param_patterns_id) {} // The location of the declaration of the entity. SemIRLoc loc; @@ -86,10 +86,10 @@ struct DeclParams { // The implicit parameters of the entity. Can be Invalid if there is no // implicit parameter list. - SemIR::InstBlockId implicit_param_refs_id; + SemIR::InstBlockId implicit_param_patterns_id; // The explicit parameters of the entity. Can be Invalid if there is no // explicit parameter list. - SemIR::InstBlockId param_refs_id; + SemIR::InstBlockId param_patterns_id; }; // Checks that the parameters in a redeclaration of an entity match the diff --git a/toolchain/check/name_component.cpp b/toolchain/check/name_component.cpp index 2e576a07082a..c5c04b4a8f63 100644 --- a/toolchain/check/name_component.cpp +++ b/toolchain/check/name_component.cpp @@ -5,6 +5,7 @@ #include "toolchain/check/name_component.h" #include "toolchain/check/context.h" +#include "toolchain/check/pattern_match.h" namespace Carbon::Check { @@ -13,20 +14,22 @@ auto PopNameComponent(Context& context) -> NameComponent { Parse::NodeId last_param_node_id = Parse::InvalidNodeId(); // Explicit params. - auto [params_loc_id, params_id] = + auto [params_loc_id, param_patterns_id] = context.node_stack().PopWithNodeIdIf(); - if (params_id) { + if (param_patterns_id) { first_param_node_id = context.node_stack() .PopForSoloNodeId(); last_param_node_id = params_loc_id; + } else { + param_patterns_id = SemIR::InstBlockId::Invalid; } // Implicit params. - auto [implicit_params_loc_id, implicit_params_id] = + auto [implicit_params_loc_id, implicit_param_patterns_id] = context.node_stack() .PopWithNodeIdIf(); - if (implicit_params_id) { + if (implicit_param_patterns_id) { // Implicit params always come before explicit params. first_param_node_id = context.node_stack() @@ -35,8 +38,13 @@ auto PopNameComponent(Context& context) -> NameComponent { if (last_param_node_id.is_valid()) { last_param_node_id = params_loc_id; } + } else { + implicit_param_patterns_id = SemIR::InstBlockId::Invalid; } + auto [implicit_params_id, params_id] = CalleePatternMatch( + context, *implicit_param_patterns_id, *param_patterns_id); + auto [name_loc_id, name_id] = context.node_stack().PopNameWithNodeId(); return { .name_loc_id = name_loc_id, @@ -44,10 +52,11 @@ auto PopNameComponent(Context& context) -> NameComponent { .first_param_node_id = first_param_node_id, .last_param_node_id = last_param_node_id, .implicit_params_loc_id = implicit_params_loc_id, - .implicit_params_id = - implicit_params_id.value_or(SemIR::InstBlockId::Invalid), + .implicit_params_id = implicit_params_id, + .implicit_param_patterns_id = *implicit_param_patterns_id, .params_loc_id = params_loc_id, - .params_id = params_id.value_or(SemIR::InstBlockId::Invalid), + .params_id = params_id, + .param_patterns_id = *param_patterns_id, .pattern_block_id = context.pattern_block_stack().Pop(), }; } diff --git a/toolchain/check/name_component.h b/toolchain/check/name_component.h index af2aaae39a2b..bcaa2d8e1a61 100644 --- a/toolchain/check/name_component.h +++ b/toolchain/check/name_component.h @@ -29,10 +29,12 @@ struct NameComponent { // The implicit parameter list. Parse::NodeId implicit_params_loc_id; SemIR::InstBlockId implicit_params_id; + SemIR::InstBlockId implicit_param_patterns_id; // The explicit parameter list. Parse::NodeId params_loc_id; SemIR::InstBlockId params_id; + SemIR::InstBlockId param_patterns_id; // The pattern block. SemIR::InstBlockId pattern_block_id; diff --git a/toolchain/check/pattern_match.cpp b/toolchain/check/pattern_match.cpp new file mode 100644 index 000000000000..70d61f6a75b0 --- /dev/null +++ b/toolchain/check/pattern_match.cpp @@ -0,0 +1,233 @@ +// 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 "toolchain/check/pattern_match.h" + +#include +#include + +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallVector.h" +#include "toolchain/base/kind_switch.h" +#include "toolchain/check/context.h" +#include "toolchain/check/convert.h" + +namespace Carbon::Check { +namespace { + +// Selects between the different kinds of pattern matching. +enum class MatchKind { + // Caller pattern matching occurs on the caller side of a function call, and + // is responsible for matching the argument expression against the portion + // of the pattern above the ParamPattern insts. + Caller, + + // Callee pattern matching occurs in the function decl block, and is + // responsible for matching the function's calling-convention parameters + // against the portion of the pattern below the ParamPattern insts. + Callee, + + // TODO: add enumerator for non-function-call pattern match +}; + +// The collected state of a pattern-matching operation. +class MatchContext { + public: + struct WorkItem { + SemIR::InstId pattern_id; + // Invalid when processing the callee side. + SemIR::InstId scrutinee_id; + }; + + // Constructs a MatchContext. If `callee_specific_id` is valid, this pattern + // match operation is part of implementing the signature of the given + // specific. + explicit MatchContext(MatchKind kind, SemIR::SpecificId callee_specific_id = + SemIR::SpecificId::Invalid) + : result_(SemIR::InstId::Invalid), + kind_(kind), + callee_specific_id_(callee_specific_id) {} + + // Returns whether there are any work items to process. + auto HasWork() const -> bool { + return !stack_.empty() && !result_.is_valid(); + } + + // Adds a work item to the stack. Cannot be called after Finish(). + auto AddWork(WorkItem work_item) -> void { + CARBON_CHECK(!result_.is_valid()); + stack_.push_back(work_item); + } + + // Returns the next work item to process. + auto NextWorkItem() -> WorkItem { return stack_.pop_back_val(); } + + // Sets the result of this pattern matching operation. Must not be called + // when there is still pending work, except to report an error. + auto Finish(SemIR::InstId result) -> void { + CARBON_CHECK(!HasWork() || result == SemIR::InstId::BuiltinError); + result_ = result; + } + + auto result() const -> SemIR::InstId { return result_; } + + auto kind() const -> MatchKind { return kind_; } + + auto callee_specific_id() const -> SemIR::SpecificId { + return callee_specific_id_; + } + + private: + llvm::SmallVector stack_; + + SemIR::InstId result_; + + MatchKind kind_; + + SemIR::SpecificId callee_specific_id_; +}; + +// Emits the pattern-match insts necessary to match the pattern inst +// `entry.pattern_id` against the scrutinee value `entry.scrutinee_id`, +// and adds to `match` any work necessary to traverse into its subpatterns. +// This behavior is contingent on the kind of match being performed, as +// indicated by `match.kind()`. For example, when performing a callee +// pattern match, this does not emit insts for patterns on the caller side. +// However, it still traverses into subpatterns if any of their descendants +// might emit insts. +// TODO: Require that `entry.scrutinee_id` is valid if and only if insts should +// be emitted, once we start emitting `Param` insts in the `ParamPattern` case. +auto EmitPatternMatch(Context& context, MatchContext& match, + MatchContext::WorkItem entry) -> void { + auto pattern = context.insts().GetWithLocId(entry.pattern_id); + CARBON_KIND_SWITCH(pattern.inst) { + case SemIR::BindingPattern::Kind: + case SemIR::SymbolicBindingPattern::Kind: { + CARBON_CHECK(match.kind() == MatchKind::Callee); + auto binding_pattern = pattern.inst.As(); + auto bind_name = context.insts().GetAs( + binding_pattern.bind_name_id); + // bind_name.value_id holds the corresponding `Param` inst. + // TODO: emit the `Param` inst as part of processing `ParamPattern`. + context.inst_block_stack().AddInstId(bind_name.value_id); + context.inst_block_stack().AddInstId(binding_pattern.bind_name_id); + match.Finish(binding_pattern.bind_name_id); + break; + } + case CARBON_KIND(SemIR::AddrPattern addr_pattern): { + if (match.kind() == MatchKind::Callee) { + // We're emitting pattern-match IR for the callee, but we're still on + // the caller side of the pattern, so we traverse without emitting any + // insts. + match.AddWork({.pattern_id = addr_pattern.inner_id, + .scrutinee_id = SemIR::InstId::Invalid}); + break; + } + CARBON_CHECK(entry.scrutinee_id.is_valid()); + auto scrutinee_ref_id = + ConvertToValueOrRefExpr(context, entry.scrutinee_id); + switch (SemIR::GetExprCategory(context.sem_ir(), scrutinee_ref_id)) { + case SemIR::ExprCategory::Error: + case SemIR::ExprCategory::DurableRef: + case SemIR::ExprCategory::EphemeralRef: + break; + default: + CARBON_DIAGNOSTIC(AddrSelfIsNonRef, Error, + "`addr self` method cannot be invoked on a value"); + context.emitter().Emit( + TokenOnly(context.insts().GetLocId(entry.scrutinee_id)), + AddrSelfIsNonRef); + match.Finish(SemIR::InstId::BuiltinError); + return; + } + auto scrutinee_ref = context.insts().Get(scrutinee_ref_id); + auto new_scrutinee = context.AddInst( + context.insts().GetLocId(scrutinee_ref_id), + {.type_id = context.GetPointerType(scrutinee_ref.type_id()), + .lvalue_id = scrutinee_ref_id}); + match.AddWork( + {.pattern_id = addr_pattern.inner_id, .scrutinee_id = new_scrutinee}); + break; + } + case CARBON_KIND(SemIR::ParamPattern param_pattern): { + switch (match.kind()) { + case MatchKind::Caller: { + CARBON_CHECK(entry.scrutinee_id.is_valid()); + match.Finish(ConvertToValueOfType( + context, context.insts().GetLocId(entry.scrutinee_id), + entry.scrutinee_id, + SemIR::GetTypeInSpecific(context.sem_ir(), + match.callee_specific_id(), + param_pattern.type_id))); + // Do not traverse farther, because the caller side of the pattern + // ends here. + break; + } + case MatchKind::Callee: { + match.AddWork({.pattern_id = param_pattern.subpattern_id, + .scrutinee_id = SemIR::InstId::Invalid}); + break; + } + } + break; + } + default: { + CARBON_FATAL("Inst kind not handled: {0}", pattern.inst.kind()); + } + } +} + +auto ProcessParameters(Context& context, + llvm::ArrayRef pattern_ids) + -> SemIR::InstBlockId { + std::vector inner_param_insts; + inner_param_insts.reserve(pattern_ids.size()); + for (SemIR::InstId inst_id : pattern_ids) { + MatchContext match(MatchKind::Callee); + match.AddWork( + {.pattern_id = inst_id, .scrutinee_id = SemIR::InstId::Invalid}); + while (match.HasWork()) { + EmitPatternMatch(context, match, match.NextWorkItem()); + } + // TODO: Should we break instead, if match.result_ is an error? + inner_param_insts.push_back(match.result()); + } + + return context.inst_blocks().Add(inner_param_insts); +} + +} // namespace + +auto CalleePatternMatch(Context& context, + SemIR::InstBlockId implicit_param_patterns_id, + SemIR::InstBlockId param_patterns_id) + -> ParameterBlocks { + auto params_id = SemIR::InstBlockId::Invalid; + auto implicit_params_id = SemIR::InstBlockId::Invalid; + + if (implicit_param_patterns_id.is_valid()) { + implicit_params_id = ProcessParameters( + context, context.inst_blocks().Get(implicit_param_patterns_id)); + } + + if (param_patterns_id.is_valid()) { + params_id = ProcessParameters(context, + context.inst_blocks().Get(param_patterns_id)); + } + + return {.implicit_params_id = implicit_params_id, .params_id = params_id}; +} + +auto CallerPatternMatch(Context& context, SemIR::SpecificId specific_id, + SemIR::InstId param, SemIR::InstId arg) + -> SemIR::InstId { + MatchContext match(MatchKind::Caller, specific_id); + match.AddWork({.pattern_id = param, .scrutinee_id = arg}); + while (match.HasWork()) { + EmitPatternMatch(context, match, match.NextWorkItem()); + } + return match.result(); +} + +} // namespace Carbon::Check diff --git a/toolchain/check/pattern_match.h b/toolchain/check/pattern_match.h new file mode 100644 index 000000000000..9c6b3833306c --- /dev/null +++ b/toolchain/check/pattern_match.h @@ -0,0 +1,54 @@ +// 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 + +#ifndef CARBON_TOOLCHAIN_CHECK_PATTERN_MATCH_H_ +#define CARBON_TOOLCHAIN_CHECK_PATTERN_MATCH_H_ + +#include "toolchain/check/context.h" +#include "toolchain/sem_ir/ids.h" + +namespace Carbon::Check { + +struct ParameterBlocks { + // The implicit parameter list. + SemIR::InstBlockId implicit_params_id; + + // The explicit parameter list. + SemIR::InstBlockId params_id; +}; + +// TODO: Find a better place for this overview, once it has stabilized. +// +// The signature pattern of a function call is matched partially by the caller +// and partially by the callee. `ParamPattern` insts mark the boundary +// between the two: pattern insts that are descendants of a `ParamPattern` +// are matched by the callee, and pattern insts that have a `ParamPattern` +// as a descendant are matched by the caller. +// +// "Calling convention arguments" are the values actually passed from caller to +// callee at the semantic IR level, and "calling convention parameters" are +// the corresponding semantic placeholders that they bind to. + +// Emits the pattern-match IR for the declaration of a function with the +// given implicit and explicit parameter patterns. This IR performs the callee +// side of pattern matching, starting at the `ParamPattern` insts, and matching +// them against the corresponding calling-convention parameters. +auto CalleePatternMatch(Context& context, + SemIR::InstBlockId implicit_param_patterns_id, + SemIR::InstBlockId param_patterns_id) + -> ParameterBlocks; + +// Emits the pattern-match IR for matching the given argument with the given +// parameter pattern, and returns the inst representing the resulting +// calling-convention argument. This IR performs the caller side of pattern +// matching that argument. +// +// TODO: restructure to have this handle the entire signature. +auto CallerPatternMatch(Context& context, SemIR::SpecificId specific_id, + SemIR::InstId param, SemIR::InstId arg) + -> SemIR::InstId; + +} // namespace Carbon::Check + +#endif // CARBON_TOOLCHAIN_CHECK_PATTERN_MATCH_H_ diff --git a/toolchain/check/subst.cpp b/toolchain/check/subst.cpp index ffa32d74a117..0c71bb5925c0 100644 --- a/toolchain/check/subst.cpp +++ b/toolchain/check/subst.cpp @@ -262,8 +262,15 @@ class SubstConstantCallbacks final : public SubstInstCallbacks { return true; } - auto bind = context_.insts().TryGetAs(inst_id); - if (!bind) { + auto entity_name_id = SemIR::EntityNameId::Invalid; + if (auto bind = + context_.insts().TryGetAs(inst_id)) { + entity_name_id = bind->entity_name_id; + } else if (auto bind = + context_.insts().TryGetAs( + inst_id)) { + entity_name_id = bind->entity_name_id; + } else { return false; } @@ -271,7 +278,7 @@ class SubstConstantCallbacks final : public SubstInstCallbacks { // TODO: Consider building a hash map for substitutions. We might have a // lot of them. for (auto [bind_index, replacement_id] : substitutions_) { - if (context_.entity_names().Get(bind->entity_name_id).bind_index == + if (context_.entity_names().Get(entity_name_id).bind_index == bind_index) { // This is the binding we're replacing. Perform substitution. inst_id = context_.constant_values().GetInstId(replacement_id); diff --git a/toolchain/check/testdata/alias/no_prelude/fail_params.carbon b/toolchain/check/testdata/alias/no_prelude/fail_params.carbon index 5225b7e108d7..35856017f2c1 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_params.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_params.carbon @@ -21,6 +21,7 @@ alias A(T:! type) = T*; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -28,10 +29,10 @@ alias A(T:! type) = T*; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] // CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T] // CHECK:STDOUT: %.loc18: type = ptr_type %T [symbolic = constants.%.1] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %param [symbolic = constants.%T] // CHECK:STDOUT: %A: = bind_alias A, [template = ] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index 403f3a80f5fc..a4eda1c2296d 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -58,7 +58,7 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -94,7 +94,7 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index e0d17eda7c8f..3bb21c374bc4 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -56,22 +56,24 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] // CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc11_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_32.loc11_27 [template = i32] // CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc11_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc11_8 +// CHECK:STDOUT: %param.loc11_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc11_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] @@ -93,7 +95,7 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a: i32, %b: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index bf4ea9516bbf..f997eb8d0529 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -51,16 +51,17 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11_14, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_22.1: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32] // CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_32.loc11_22, %.loc11_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] @@ -75,5 +76,5 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%n: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%n.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index 4f2b59473f31..20333a66b008 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -41,6 +41,7 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -68,12 +69,12 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -101,6 +102,7 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -125,19 +127,22 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -148,6 +153,7 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index 9088e63a542c..5b6b1aa2a69f 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -26,6 +26,7 @@ var a: [1; 1]; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -51,12 +52,12 @@ var a: [1; 1]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -78,6 +79,7 @@ var a: [1; 1]; // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -100,19 +102,22 @@ var a: [1; 1]; // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -123,6 +128,7 @@ var a: [1; 1]; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 795af1a67cb9..c7d1e3aab70d 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -59,6 +59,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -93,12 +94,12 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.11) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.15)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.11) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.15)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -161,6 +162,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -185,7 +187,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -225,14 +227,17 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -243,6 +248,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index b598188d1d7e..671799aea0a5 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -60,24 +60,26 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %arr.patt: %.3 = binding_pattern arr +// CHECK:STDOUT: %arr.param_patt: %.3 = param_pattern %arr.patt, runtime_param0 // CHECK:STDOUT: %i.patt: i32 = binding_pattern i +// CHECK:STDOUT: %i.param_patt: i32 = param_pattern %i.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32] // CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32.loc11_12, %.loc11_12.1 [template = i32] // CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.3] -// CHECK:STDOUT: %arr.param: %.3 = param arr, runtime_param0 -// CHECK:STDOUT: %arr: %.3 = bind_name arr, %arr.param // CHECK:STDOUT: %int.make_type_32.loc11_24: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_24.1: type = value_of_initializer %int.make_type_32.loc11_24 [template = i32] // CHECK:STDOUT: %.loc11_24.2: type = converted %int.make_type_32.loc11_24, %.loc11_24.1 [template = i32] -// CHECK:STDOUT: %i.param: i32 = param i, runtime_param1 -// CHECK:STDOUT: %i: i32 = bind_name i, %i.param // CHECK:STDOUT: %int.make_type_32.loc11_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_32.1: type = value_of_initializer %int.make_type_32.loc11_32 [template = i32] // CHECK:STDOUT: %.loc11_32.2: type = converted %int.make_type_32.loc11_32, %.loc11_32.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc11_6: %.3 = param runtime_param0 +// CHECK:STDOUT: %arr: %.3 = bind_name arr, %param.loc11_6 +// CHECK:STDOUT: %param.loc11_21: i32 = param runtime_param1 +// CHECK:STDOUT: %i: i32 = bind_name i, %param.loc11_21 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -89,7 +91,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%arr: %.3, %i: i32) -> i32 { +// CHECK:STDOUT: fn @F(%arr.param_patt: %.3, %i.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %arr.ref: %.3 = name_ref arr, %arr // CHECK:STDOUT: %i.ref: i32 = name_ref i, %i @@ -118,10 +120,10 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc16_20.10: ref i32 = array_index %.loc16_20.2, %.loc16_20.9 // CHECK:STDOUT: %.loc16_20.11: init i32 = initialize_from %.loc16_19 to %.loc16_20.10 [template = constants.%.2] // CHECK:STDOUT: %.loc16_20.12: init %.3 = array_init (%.loc16_20.5, %.loc16_20.8, %.loc16_20.11) to %.loc16_20.2 [template = constants.%array] -// CHECK:STDOUT: %.loc16_11.1: init %.3 = converted %.loc16_20.1, %.loc16_20.12 [template = constants.%array] -// CHECK:STDOUT: %.loc16_11.2: ref %.3 = temporary %.loc16_20.2, %.loc16_11.1 -// CHECK:STDOUT: %.loc16_11.3: %.3 = bind_value %.loc16_11.2 -// CHECK:STDOUT: %F.call: init i32 = call %F.ref(%.loc16_11.3, %.loc16_23) +// CHECK:STDOUT: %.loc16_20.13: init %.3 = converted %.loc16_20.1, %.loc16_20.12 [template = constants.%array] +// CHECK:STDOUT: %.loc16_20.14: ref %.3 = temporary %.loc16_20.2, %.loc16_20.13 +// CHECK:STDOUT: %.loc16_20.15: %.3 = bind_value %.loc16_20.14 +// CHECK:STDOUT: %F.call: init i32 = call %F.ref(%.loc16_20.15, %.loc16_23) // CHECK:STDOUT: %.loc16_25.1: i32 = value_of_initializer %F.call // CHECK:STDOUT: %.loc16_25.2: i32 = converted %F.call, %.loc16_25.1 // CHECK:STDOUT: return %.loc16_25.2 diff --git a/toolchain/check/testdata/array/generic_empty.carbon b/toolchain/check/testdata/array/generic_empty.carbon index fbda058c5865..b0314863007b 100644 --- a/toolchain/check/testdata/array/generic_empty.carbon +++ b/toolchain/check/testdata/array/generic_empty.carbon @@ -17,6 +17,7 @@ fn G(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] @@ -46,21 +47,23 @@ fn G(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_6.1, runtime_param [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%T.loc11_6.1: type) { // CHECK:STDOUT: %T.loc11_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc13_17.2: type = array_type constants.%.2, @G.%T.loc11_6.2 (%T) [symbolic = %.loc13_17.2 (constants.%.3)] // CHECK:STDOUT: %array: @G.%.loc13_17.2 (%.3) = tuple_value () [symbolic = %array (constants.%array)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc11_6.1: type) { +// CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %.loc13_16: i32 = int_literal 0 [template = constants.%.2] @@ -77,5 +80,6 @@ fn G(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T.loc11_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index fdf2bce54d62..0573281b78a4 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -549,6 +549,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %As.type.2: type = interface_type @As, @As(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @As(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -577,12 +578,12 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, inst+5, loaded [template = constants.%As] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+11, unloaded -// CHECK:STDOUT: %import_ref.4: @As.%.1 (%.8) = import_ref Core//prelude/operators/as, inst+29, loaded [symbolic = @As.%.2 (constants.%.12)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+22, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+22, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+22, unloaded +// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, inst+7, loaded [template = constants.%As] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+14, unloaded +// CHECK:STDOUT: %import_ref.4: @As.%.1 (%.8) = import_ref Core//prelude/operators/as, inst+33, loaded [symbolic = @As.%.2 (constants.%.12)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+26, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+26, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+26, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -602,6 +603,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: generic interface @As(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = interface_type @As, @As(%Dest) [symbolic = %As.type (constants.%As.type.2)] @@ -647,7 +649,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %As.type: type = interface_type @As, @As(%Dest) [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -667,14 +669,17 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@As.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -685,6 +690,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%B) { // CHECK:STDOUT: %Dest => constants.%B +// CHECK:STDOUT: %Dest.patt => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type => constants.%As.type.3 diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index a2ae2d734098..d8f49ca50174 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -31,6 +31,7 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %As.type.2: type = interface_type @As, @As(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @As(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -58,12 +59,12 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, inst+5, loaded [template = constants.%As] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+11, unloaded -// CHECK:STDOUT: %import_ref.4: @As.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+29, loaded [symbolic = @As.%.2 (constants.%.10)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+22, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+22, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+22, unloaded +// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, inst+7, loaded [template = constants.%As] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+14, unloaded +// CHECK:STDOUT: %import_ref.4: @As.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+33, loaded [symbolic = @As.%.2 (constants.%.10)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+26, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+26, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+26, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -84,6 +85,7 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: // CHECK:STDOUT: generic interface @As(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = interface_type @As, @As(%Dest) [symbolic = %As.type (constants.%As.type.2)] @@ -108,7 +110,7 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %As.type: type = interface_type @As, @As(%Dest) [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -133,14 +135,17 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@As.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -151,6 +156,7 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%.3) { // CHECK:STDOUT: %Dest => constants.%.3 +// CHECK:STDOUT: %Dest.patt => constants.%.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type => constants.%As.type.3 diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index a2d41de9704c..294dd87b9092 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -29,6 +29,7 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -56,12 +57,12 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -77,6 +78,7 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -101,7 +103,7 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -118,14 +120,17 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -136,6 +141,7 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/as/identity.carbon b/toolchain/check/testdata/as/identity.carbon index 1ec237edf72d..f541e6429e05 100644 --- a/toolchain/check/testdata/as/identity.carbon +++ b/toolchain/check/testdata/as/identity.carbon @@ -73,18 +73,20 @@ fn Initializing() { // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: %Value.decl: %Value.type = fn_decl @Value [template = constants.%Value] { // CHECK:STDOUT: %n.patt: %X = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %X = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref.loc17: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %n.param: %X = param n, runtime_param0 -// CHECK:STDOUT: %n: %X = bind_name n, %n.param +// CHECK:STDOUT: %param: %X = param runtime_param0 +// CHECK:STDOUT: %n: %X = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Reference.decl: %Reference.type = fn_decl @Reference [template = constants.%Reference] { // CHECK:STDOUT: %p.patt: %.5 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.5 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref.loc21: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %.loc21: type = ptr_type %X [template = constants.%.5] -// CHECK:STDOUT: %p.param: %.5 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.5 = bind_name p, %p.param +// CHECK:STDOUT: %param: %.5 = param runtime_param0 +// CHECK:STDOUT: %p: %.5 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {} { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] @@ -100,7 +102,7 @@ fn Initializing() { // CHECK:STDOUT: .Self = constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Value(%n: %X) { +// CHECK:STDOUT: fn @Value(%n.param_patt: %X) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %X.ref.loc18_10: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %n.ref: %X = name_ref n, %n @@ -109,7 +111,7 @@ fn Initializing() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Reference(%p: %.5) { +// CHECK:STDOUT: fn @Reference(%p.param_patt: %.5) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %X.ref.loc22_10: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %.loc22_11: type = ptr_type %X [template = constants.%.5] diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index cfa32a132c0a..6775e788d523 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -37,6 +37,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %As.type.2: type = interface_type @As, @As(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @As(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -78,12 +79,12 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, inst+5, loaded [template = constants.%As] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+11, unloaded -// CHECK:STDOUT: %import_ref.4: @As.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+29, loaded [symbolic = @As.%.2 (constants.%.15)] -// CHECK:STDOUT: %import_ref.5: @As.%Convert.type (%Convert.type.1) = import_ref Core//prelude/operators/as, inst+22, loaded [symbolic = @As.%Convert (constants.%Convert.1)] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+22, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+22, unloaded +// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, inst+7, loaded [template = constants.%As] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+14, unloaded +// CHECK:STDOUT: %import_ref.4: @As.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+33, loaded [symbolic = @As.%.2 (constants.%.15)] +// CHECK:STDOUT: %import_ref.5: @As.%Convert.type (%Convert.type.1) = import_ref Core//prelude/operators/as, inst+26, loaded [symbolic = @As.%Convert (constants.%Convert.1)] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+26, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+26, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -119,6 +120,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: // CHECK:STDOUT: generic interface @As(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = interface_type @As, @As(%Dest) [symbolic = %As.type (constants.%As.type.2)] @@ -139,14 +141,15 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %As.type { // CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] { // CHECK:STDOUT: %self.patt: i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: i32 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_20.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc16_20.2: type = converted %int.make_type_32, %.loc16_20.1 [template = i32] -// CHECK:STDOUT: %self.param: i32 = param self, runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %return: ref %X = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %self: i32 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15_24: = interface_witness (%Convert.decl) [template = constants.%.9] // CHECK:STDOUT: @@ -158,14 +161,15 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: impl @impl.2: %X.ref as %As.type { // CHECK:STDOUT: %Convert.decl: %Convert.type.4 = fn_decl @Convert.3 [template = constants.%Convert.4] { // CHECK:STDOUT: %self.patt: %X = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %X = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %self.param: %X = param self, runtime_param0 -// CHECK:STDOUT: %self: %X = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_28.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc20_28.2: type = converted %int.make_type_32, %.loc20_28.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %X = param runtime_param0 +// CHECK:STDOUT: %self: %X = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19_24: = interface_witness (%Convert.decl) [template = constants.%.13] // CHECK:STDOUT: @@ -193,10 +197,10 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %As.type: type = interface_type @As, @As(%Dest) [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[%self: i32]() -> %return: %X { +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: i32]() -> %return: %X { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: i32 = name_ref self, %self // CHECK:STDOUT: %.loc16_51.1: %.3 = struct_literal (%self.ref) @@ -207,7 +211,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: return %.loc16_52 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.3[%self: %X]() -> i32 { +// CHECK:STDOUT: fn @Convert.3[%self.param_patt: %X]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %X = name_ref self, %self // CHECK:STDOUT: %n.ref: %.2 = name_ref n, @X.%.loc12_8 [template = @X.%.loc12_8] @@ -251,14 +255,17 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@As.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { @@ -269,6 +276,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%X) { // CHECK:STDOUT: %Dest => constants.%X +// CHECK:STDOUT: %Dest.patt => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type => constants.%As.type.3 @@ -287,6 +295,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: // CHECK:STDOUT: specific @As(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type => constants.%As.type.4 diff --git a/toolchain/check/testdata/basics/builtin_insts.carbon b/toolchain/check/testdata/basics/builtin_insts.carbon index 72082629142c..57e3ac4876f5 100644 --- a/toolchain/check/testdata/basics/builtin_insts.carbon +++ b/toolchain/check/testdata/basics/builtin_insts.carbon @@ -31,6 +31,7 @@ // CHECK:STDOUT: insts: // CHECK:STDOUT: instTypeType: {kind: BuiltinInst, arg0: TypeType, type: typeTypeType} // CHECK:STDOUT: instError: {kind: BuiltinInst, arg0: Error, type: typeError} +// CHECK:STDOUT: instAutoType: {kind: BuiltinInst, arg0: AutoType, type: typeTypeType} // CHECK:STDOUT: instBoolType: {kind: BuiltinInst, arg0: BoolType, type: typeTypeType} // CHECK:STDOUT: instIntType: {kind: BuiltinInst, arg0: IntType, type: typeTypeType} // CHECK:STDOUT: instFloatType: {kind: BuiltinInst, arg0: FloatType, type: typeTypeType} @@ -43,6 +44,7 @@ // CHECK:STDOUT: constant_values: // CHECK:STDOUT: instTypeType: templateConstant(instTypeType) // CHECK:STDOUT: instError: templateConstant(instError) +// CHECK:STDOUT: instAutoType: templateConstant(instAutoType) // CHECK:STDOUT: instBoolType: templateConstant(instBoolType) // CHECK:STDOUT: instIntType: templateConstant(instIntType) // CHECK:STDOUT: instFloatType: templateConstant(instFloatType) diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index efc3bc262fa8..97aa97467f3f 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -42,7 +42,7 @@ var test_type: type = i32; // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -71,7 +71,7 @@ var test_type: type = i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/basics/fail_bad_run_2.carbon b/toolchain/check/testdata/basics/fail_bad_run_2.carbon index e48cf27a40e6..85bc027b8a98 100644 --- a/toolchain/check/testdata/basics/fail_bad_run_2.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run_2.carbon @@ -46,18 +46,19 @@ fn Run(n: i32) {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32, %.loc14_11.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Run(%n: i32) { +// CHECK:STDOUT: fn @Run(%n.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon index 20a874536f59..d588723825dd 100644 --- a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon +++ b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon @@ -26,6 +26,7 @@ var x: type = 42; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -51,12 +52,12 @@ var x: type = 42; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -71,6 +72,7 @@ var x: type = 42; // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -93,7 +95,7 @@ var x: type = 42; // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -109,14 +111,17 @@ var x: type = 42; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -127,6 +132,7 @@ var x: type = 42; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index 97635c93c684..6c5975d53073 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -62,7 +62,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -96,7 +96,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon index c303f2064eb9..e2bce1cba65a 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon @@ -36,7 +36,7 @@ fn B() { // CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+1}} // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [block4]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [block5]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} @@ -68,9 +68,10 @@ fn B() { // CHECK:STDOUT: 0: inst+1 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: block4: -// CHECK:STDOUT: 0: inst+5 +// CHECK:STDOUT: block4: {} // CHECK:STDOUT: block5: +// CHECK:STDOUT: 0: inst+5 +// CHECK:STDOUT: block6: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+1 // CHECK:STDOUT: ... @@ -110,7 +111,7 @@ fn B() { // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope1, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [block4]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [block5]} // CHECK:STDOUT: function1: {name: name1, parent_scope: name_scope1} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} @@ -162,12 +163,14 @@ fn B() { // CHECK:STDOUT: 0: inst+2 // CHECK:STDOUT: 1: inst+8 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: block4: +// CHECK:STDOUT: block4: {} +// CHECK:STDOUT: block5: // CHECK:STDOUT: 0: inst+7 // CHECK:STDOUT: 1: inst+12 // CHECK:STDOUT: 2: inst+13 // CHECK:STDOUT: 3: inst+14 -// CHECK:STDOUT: block5: +// CHECK:STDOUT: block6: {} +// CHECK:STDOUT: block7: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+1 // CHECK:STDOUT: 2: inst+3 diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon b/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon index e616c9bffae6..bbe6c67e11f6 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon @@ -36,7 +36,7 @@ fn B() { // CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+1}} // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [block4]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [block5]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} @@ -68,9 +68,10 @@ fn B() { // CHECK:STDOUT: 0: inst+1 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: block4: -// CHECK:STDOUT: 0: inst+5 +// CHECK:STDOUT: block4: {} // CHECK:STDOUT: block5: +// CHECK:STDOUT: 0: inst+5 +// CHECK:STDOUT: block6: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+1 // CHECK:STDOUT: ... @@ -89,7 +90,7 @@ fn B() { // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope1, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [block4]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [block5]} // CHECK:STDOUT: function1: {name: name1, parent_scope: name_scope1} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} @@ -141,12 +142,14 @@ fn B() { // CHECK:STDOUT: 0: inst+2 // CHECK:STDOUT: 1: inst+8 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: block4: +// CHECK:STDOUT: block4: {} +// CHECK:STDOUT: block5: // CHECK:STDOUT: 0: inst+7 // CHECK:STDOUT: 1: inst+12 // CHECK:STDOUT: 2: inst+13 // CHECK:STDOUT: 3: inst+14 -// CHECK:STDOUT: block5: +// CHECK:STDOUT: block6: {} +// CHECK:STDOUT: block7: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+1 // CHECK:STDOUT: 2: inst+3 diff --git a/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon index f13315ed159e..556633a197b4 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon @@ -23,11 +23,11 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: ir0: {decl_id: inst, is_export: false} // CHECK:STDOUT: import_ir_insts: {} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+15}} +// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+16}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_storage: inst+14, body: [block8]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_storage: inst+15, body: [block9]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} @@ -35,10 +35,10 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: typeTypeType: {kind: copy, type: typeTypeType} // CHECK:STDOUT: typeError: {kind: copy, type: typeError} // CHECK:STDOUT: 'type(instNamespaceType)': {kind: copy, type: type(instNamespaceType)} -// CHECK:STDOUT: 'type(inst+16)': {kind: none, type: type(inst+1)} +// CHECK:STDOUT: 'type(inst+17)': {kind: none, type: type(inst+1)} // CHECK:STDOUT: 'type(inst+1)': {kind: none, type: type(inst+1)} -// CHECK:STDOUT: 'type(inst+9)': {kind: pointer, type: type(inst+18)} -// CHECK:STDOUT: 'type(inst+18)': {kind: copy, type: type(inst+18)} +// CHECK:STDOUT: 'type(inst+10)': {kind: pointer, type: type(inst+19)} +// CHECK:STDOUT: 'type(inst+19)': {kind: copy, type: type(inst+19)} // CHECK:STDOUT: type_blocks: // CHECK:STDOUT: type_block0: {} // CHECK:STDOUT: type_block1: @@ -49,107 +49,111 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: 'inst+1': {kind: TupleType, arg0: type_block0, type: typeTypeType} // CHECK:STDOUT: 'inst+2': {kind: TupleLiteral, arg0: empty, type: type(inst+1)} // CHECK:STDOUT: 'inst+3': {kind: Converted, arg0: inst+2, arg1: inst+1, type: typeTypeType} -// CHECK:STDOUT: 'inst+4': {kind: Param, arg0: name1, arg1: runtime_param0, type: type(inst+1)} +// CHECK:STDOUT: 'inst+4': {kind: Param, arg0: runtime_param0, type: type(inst+1)} // CHECK:STDOUT: 'inst+5': {kind: BindName, arg0: entity_name0, arg1: inst+4, type: type(inst+1)} -// CHECK:STDOUT: 'inst+6': {kind: BindingPattern, arg0: entity_name0, type: type(inst+1)} -// CHECK:STDOUT: 'inst+7': {kind: TupleLiteral, arg0: empty, type: type(inst+1)} +// CHECK:STDOUT: 'inst+6': {kind: BindingPattern, arg0: entity_name0, arg1: inst+5, type: type(inst+1)} +// CHECK:STDOUT: 'inst+7': {kind: ParamPattern, arg0: inst+6, arg1: runtime_param0, type: type(inst+1)} // CHECK:STDOUT: 'inst+8': {kind: TupleLiteral, arg0: empty, type: type(inst+1)} -// CHECK:STDOUT: 'inst+9': {kind: TupleType, arg0: type_block1, type: typeTypeType} -// CHECK:STDOUT: 'inst+10': {kind: TupleLiteral, arg0: block5, type: type(inst+9)} -// CHECK:STDOUT: 'inst+11': {kind: Converted, arg0: inst+7, arg1: inst+1, type: typeTypeType} +// CHECK:STDOUT: 'inst+9': {kind: TupleLiteral, arg0: empty, type: type(inst+1)} +// CHECK:STDOUT: 'inst+10': {kind: TupleType, arg0: type_block1, type: typeTypeType} +// CHECK:STDOUT: 'inst+11': {kind: TupleLiteral, arg0: block5, type: type(inst+10)} // CHECK:STDOUT: 'inst+12': {kind: Converted, arg0: inst+8, arg1: inst+1, type: typeTypeType} -// CHECK:STDOUT: 'inst+13': {kind: Converted, arg0: inst+10, arg1: inst+9, type: typeTypeType} -// CHECK:STDOUT: 'inst+14': {kind: VarStorage, arg0: nameReturnSlot, type: type(inst+9)} -// CHECK:STDOUT: 'inst+15': {kind: FunctionDecl, arg0: function0, arg1: block7, type: type(inst+16)} -// CHECK:STDOUT: 'inst+16': {kind: FunctionType, arg0: function0, arg1: specific, type: typeTypeType} -// CHECK:STDOUT: 'inst+17': {kind: StructValue, arg0: empty, type: type(inst+16)} -// CHECK:STDOUT: 'inst+18': {kind: PointerType, arg0: type(inst+9), type: typeTypeType} -// CHECK:STDOUT: 'inst+19': {kind: NameRef, arg0: name1, arg1: inst+5, type: type(inst+1)} -// CHECK:STDOUT: 'inst+20': {kind: TupleLiteral, arg0: empty, type: type(inst+1)} -// CHECK:STDOUT: 'inst+21': {kind: TupleLiteral, arg0: block9, type: type(inst+9)} -// CHECK:STDOUT: 'inst+22': {kind: TupleAccess, arg0: inst+14, arg1: element0, type: type(inst+1)} -// CHECK:STDOUT: 'inst+23': {kind: TupleInit, arg0: block10, arg1: inst+22, type: type(inst+1)} -// CHECK:STDOUT: 'inst+24': {kind: TupleValue, arg0: empty, type: type(inst+1)} -// CHECK:STDOUT: 'inst+25': {kind: Converted, arg0: inst+19, arg1: inst+23, type: type(inst+1)} -// CHECK:STDOUT: 'inst+26': {kind: TupleAccess, arg0: inst+14, arg1: element1, type: type(inst+1)} -// CHECK:STDOUT: 'inst+27': {kind: TupleInit, arg0: empty, arg1: inst+26, type: type(inst+1)} -// CHECK:STDOUT: 'inst+28': {kind: Converted, arg0: inst+20, arg1: inst+27, type: type(inst+1)} -// CHECK:STDOUT: 'inst+29': {kind: TupleInit, arg0: block11, arg1: inst+14, type: type(inst+9)} -// CHECK:STDOUT: 'inst+30': {kind: TupleValue, arg0: block12, type: type(inst+9)} -// CHECK:STDOUT: 'inst+31': {kind: Converted, arg0: inst+21, arg1: inst+29, type: type(inst+9)} -// CHECK:STDOUT: 'inst+32': {kind: ReturnExpr, arg0: inst+31, arg1: inst+14} +// CHECK:STDOUT: 'inst+13': {kind: Converted, arg0: inst+9, arg1: inst+1, type: typeTypeType} +// CHECK:STDOUT: 'inst+14': {kind: Converted, arg0: inst+11, arg1: inst+10, type: typeTypeType} +// CHECK:STDOUT: 'inst+15': {kind: VarStorage, arg0: nameReturnSlot, type: type(inst+10)} +// CHECK:STDOUT: 'inst+16': {kind: FunctionDecl, arg0: function0, arg1: block8, type: type(inst+17)} +// CHECK:STDOUT: 'inst+17': {kind: FunctionType, arg0: function0, arg1: specific, type: typeTypeType} +// CHECK:STDOUT: 'inst+18': {kind: StructValue, arg0: empty, type: type(inst+17)} +// CHECK:STDOUT: 'inst+19': {kind: PointerType, arg0: type(inst+10), type: typeTypeType} +// CHECK:STDOUT: 'inst+20': {kind: NameRef, arg0: name1, arg1: inst+5, type: type(inst+1)} +// CHECK:STDOUT: 'inst+21': {kind: TupleLiteral, arg0: empty, type: type(inst+1)} +// CHECK:STDOUT: 'inst+22': {kind: TupleLiteral, arg0: block10, type: type(inst+10)} +// CHECK:STDOUT: 'inst+23': {kind: TupleAccess, arg0: inst+15, arg1: element0, type: type(inst+1)} +// CHECK:STDOUT: 'inst+24': {kind: TupleInit, arg0: block11, arg1: inst+23, type: type(inst+1)} +// CHECK:STDOUT: 'inst+25': {kind: TupleValue, arg0: empty, type: type(inst+1)} +// CHECK:STDOUT: 'inst+26': {kind: Converted, arg0: inst+20, arg1: inst+24, type: type(inst+1)} +// CHECK:STDOUT: 'inst+27': {kind: TupleAccess, arg0: inst+15, arg1: element1, type: type(inst+1)} +// CHECK:STDOUT: 'inst+28': {kind: TupleInit, arg0: empty, arg1: inst+27, type: type(inst+1)} +// CHECK:STDOUT: 'inst+29': {kind: Converted, arg0: inst+21, arg1: inst+28, type: type(inst+1)} +// CHECK:STDOUT: 'inst+30': {kind: TupleInit, arg0: block12, arg1: inst+15, type: type(inst+10)} +// CHECK:STDOUT: 'inst+31': {kind: TupleValue, arg0: block13, type: type(inst+10)} +// CHECK:STDOUT: 'inst+32': {kind: Converted, arg0: inst+22, arg1: inst+30, type: type(inst+10)} +// CHECK:STDOUT: 'inst+33': {kind: ReturnExpr, arg0: inst+32, arg1: inst+15} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: 'inst+0': templateConstant(inst+0) // CHECK:STDOUT: 'inst+1': templateConstant(inst+1) // CHECK:STDOUT: 'inst+3': templateConstant(inst+1) -// CHECK:STDOUT: 'inst+9': templateConstant(inst+9) -// CHECK:STDOUT: 'inst+11': templateConstant(inst+1) +// CHECK:STDOUT: 'inst+10': templateConstant(inst+10) // CHECK:STDOUT: 'inst+12': templateConstant(inst+1) -// CHECK:STDOUT: 'inst+13': templateConstant(inst+9) -// CHECK:STDOUT: 'inst+15': templateConstant(inst+17) -// CHECK:STDOUT: 'inst+16': templateConstant(inst+16) +// CHECK:STDOUT: 'inst+13': templateConstant(inst+1) +// CHECK:STDOUT: 'inst+14': templateConstant(inst+10) +// CHECK:STDOUT: 'inst+16': templateConstant(inst+18) // CHECK:STDOUT: 'inst+17': templateConstant(inst+17) // CHECK:STDOUT: 'inst+18': templateConstant(inst+18) -// CHECK:STDOUT: 'inst+23': templateConstant(inst+24) -// CHECK:STDOUT: 'inst+24': templateConstant(inst+24) -// CHECK:STDOUT: 'inst+25': templateConstant(inst+24) -// CHECK:STDOUT: 'inst+27': templateConstant(inst+24) -// CHECK:STDOUT: 'inst+28': templateConstant(inst+24) -// CHECK:STDOUT: 'inst+29': templateConstant(inst+30) -// CHECK:STDOUT: 'inst+30': templateConstant(inst+30) -// CHECK:STDOUT: 'inst+31': templateConstant(inst+30) +// CHECK:STDOUT: 'inst+19': templateConstant(inst+19) +// CHECK:STDOUT: 'inst+24': templateConstant(inst+25) +// CHECK:STDOUT: 'inst+25': templateConstant(inst+25) +// CHECK:STDOUT: 'inst+26': templateConstant(inst+25) +// CHECK:STDOUT: 'inst+28': templateConstant(inst+25) +// CHECK:STDOUT: 'inst+29': templateConstant(inst+25) +// CHECK:STDOUT: 'inst+30': templateConstant(inst+31) +// CHECK:STDOUT: 'inst+31': templateConstant(inst+31) +// CHECK:STDOUT: 'inst+32': templateConstant(inst+31) // CHECK:STDOUT: symbolic_constants: {} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+15 +// CHECK:STDOUT: 0: inst+16 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: block4: -// CHECK:STDOUT: 0: inst+5 -// CHECK:STDOUT: block5: // CHECK:STDOUT: 0: inst+7 -// CHECK:STDOUT: 1: inst+8 +// CHECK:STDOUT: block5: +// CHECK:STDOUT: 0: inst+8 +// CHECK:STDOUT: 1: inst+9 // CHECK:STDOUT: block6: -// CHECK:STDOUT: 0: inst+6 +// CHECK:STDOUT: 0: inst+5 // CHECK:STDOUT: block7: +// CHECK:STDOUT: 0: inst+6 +// CHECK:STDOUT: 1: inst+7 +// CHECK:STDOUT: block8: // CHECK:STDOUT: 0: inst+2 // CHECK:STDOUT: 1: inst+3 -// CHECK:STDOUT: 2: inst+4 -// CHECK:STDOUT: 3: inst+5 -// CHECK:STDOUT: 4: inst+7 -// CHECK:STDOUT: 5: inst+8 -// CHECK:STDOUT: 6: inst+10 -// CHECK:STDOUT: 7: inst+11 -// CHECK:STDOUT: 8: inst+12 -// CHECK:STDOUT: 9: inst+13 -// CHECK:STDOUT: 10: inst+14 -// CHECK:STDOUT: block8: -// CHECK:STDOUT: 0: inst+19 -// CHECK:STDOUT: 1: inst+20 -// CHECK:STDOUT: 2: inst+21 -// CHECK:STDOUT: 3: inst+22 -// CHECK:STDOUT: 4: inst+23 -// CHECK:STDOUT: 5: inst+25 -// CHECK:STDOUT: 6: inst+26 -// CHECK:STDOUT: 7: inst+27 -// CHECK:STDOUT: 8: inst+28 -// CHECK:STDOUT: 9: inst+29 -// CHECK:STDOUT: 10: inst+31 -// CHECK:STDOUT: 11: inst+32 +// CHECK:STDOUT: 2: inst+8 +// CHECK:STDOUT: 3: inst+9 +// CHECK:STDOUT: 4: inst+11 +// CHECK:STDOUT: 5: inst+12 +// CHECK:STDOUT: 6: inst+13 +// CHECK:STDOUT: 7: inst+14 +// CHECK:STDOUT: 8: inst+15 +// CHECK:STDOUT: 9: inst+4 +// CHECK:STDOUT: 10: inst+5 // CHECK:STDOUT: block9: -// CHECK:STDOUT: 0: inst+19 -// CHECK:STDOUT: 1: inst+20 -// CHECK:STDOUT: block10: {} -// CHECK:STDOUT: block11: -// CHECK:STDOUT: 0: inst+25 -// CHECK:STDOUT: 1: inst+28 +// CHECK:STDOUT: 0: inst+20 +// CHECK:STDOUT: 1: inst+21 +// CHECK:STDOUT: 2: inst+22 +// CHECK:STDOUT: 3: inst+23 +// CHECK:STDOUT: 4: inst+24 +// CHECK:STDOUT: 5: inst+26 +// CHECK:STDOUT: 6: inst+27 +// CHECK:STDOUT: 7: inst+28 +// CHECK:STDOUT: 8: inst+29 +// CHECK:STDOUT: 9: inst+30 +// CHECK:STDOUT: 10: inst+32 +// CHECK:STDOUT: 11: inst+33 +// CHECK:STDOUT: block10: +// CHECK:STDOUT: 0: inst+20 +// CHECK:STDOUT: 1: inst+21 +// CHECK:STDOUT: block11: {} // CHECK:STDOUT: block12: -// CHECK:STDOUT: 0: inst+24 -// CHECK:STDOUT: 1: inst+24 +// CHECK:STDOUT: 0: inst+26 +// CHECK:STDOUT: 1: inst+29 // CHECK:STDOUT: block13: +// CHECK:STDOUT: 0: inst+25 +// CHECK:STDOUT: 1: inst+25 +// CHECK:STDOUT: block14: // CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+15 +// CHECK:STDOUT: 1: inst+16 // CHECK:STDOUT: ... // CHECK:STDOUT: // CHECK:STDOUT: --- raw_and_textual_ir.carbon @@ -170,11 +174,10 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %n.patt: %.1 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %.1 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc15_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc15_12.2: type = converted %.loc15_12.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %n.param: %.1 = param n, runtime_param0 -// CHECK:STDOUT: %n: %.1 = bind_name n, %n.param // CHECK:STDOUT: %.loc15_20: %.1 = tuple_literal () // CHECK:STDOUT: %.loc15_24: %.1 = tuple_literal () // CHECK:STDOUT: %.loc15_25.1: %.2 = tuple_literal (%.loc15_20, %.loc15_24) @@ -182,10 +185,12 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: %.loc15_25.3: type = converted %.loc15_24, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc15_25.4: type = converted %.loc15_25.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %return: ref %.2 = var +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %n: %.1 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%n: %.1) -> %return: %.2 { +// CHECK:STDOUT: fn @Foo(%n.param_patt: %.1) -> %return: %.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %.1 = name_ref n, %n // CHECK:STDOUT: %.loc16_15.1: %.1 = tuple_literal () diff --git a/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon b/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon index 31a51bf21598..2c2418a54452 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon @@ -44,52 +44,55 @@ fn C(r#if: ()) -> () { // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %n.patt: %.1 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %.1 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc15_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc15_10.2: type = converted %.loc15_10.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %n.param: %.1 = param n, runtime_param0 -// CHECK:STDOUT: %n: %.1 = bind_name n, %n.param // CHECK:STDOUT: %.loc15_17.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc15_17.2: type = converted %.loc15_17.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %return: ref %.1 = var +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %n: %.1 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %n.patt: %.1 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %.1 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc19_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc19_12.2: type = converted %.loc19_12.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %n.param: %.1 = param n, runtime_param0 -// CHECK:STDOUT: %n: %.1 = bind_name n, %n.param // CHECK:STDOUT: %.loc19_19.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc19_19.2: type = converted %.loc19_19.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %return: ref %.1 = var +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %n: %.1 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %if.patt: %.1 = binding_pattern r#if +// CHECK:STDOUT: %if.param_patt: %.1 = param_pattern %if.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc23_13.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc23_13.2: type = converted %.loc23_13.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %if.param: %.1 = param r#if, runtime_param0 -// CHECK:STDOUT: %if: %.1 = bind_name r#if, %if.param // CHECK:STDOUT: %.loc23_20.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc23_20.2: type = converted %.loc23_20.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %return: ref %.1 = var +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %if: %.1 = bind_name r#if, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A(%n: %.1) -> %.1 { +// CHECK:STDOUT: fn @A(%n.param_patt: %.1) -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %.1 = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%n: %.1) -> %.1 { +// CHECK:STDOUT: fn @B(%n.param_patt: %.1) -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %.1 = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%if: %.1) -> %.1 { +// CHECK:STDOUT: fn @C(%if.param_patt: %.1) -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %if.ref: %.1 = name_ref r#if, %if // CHECK:STDOUT: return %if.ref diff --git a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon index 0fbd20ff2e92..f9dd806f310b 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon @@ -23,159 +23,177 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: ir0: {decl_id: inst, is_export: false} // CHECK:STDOUT: import_ir_insts: {} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+18}} +// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+21}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope, index: comp_time_bind0} // CHECK:STDOUT: entity_name1: {name: name2, parent_scope: name_scope, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_storage: inst+17, body: [block13]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_storage: inst+20, body: [block15]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: -// CHECK:STDOUT: generic0: {decl: inst+18, bindings: block9} +// CHECK:STDOUT: generic0: {decl: inst+21, bindings: block11} // CHECK:STDOUT: specifics: -// CHECK:STDOUT: specific0: {generic: generic0, args: block11} +// CHECK:STDOUT: specific0: {generic: generic0, args: block13} // CHECK:STDOUT: types: // CHECK:STDOUT: typeTypeType: {kind: copy, type: typeTypeType} // CHECK:STDOUT: typeError: {kind: copy, type: typeError} // CHECK:STDOUT: 'type(instNamespaceType)': {kind: copy, type: type(instNamespaceType)} -// CHECK:STDOUT: 'type(inst+21)': {kind: none, type: type(inst+10)} -// CHECK:STDOUT: 'type(inst+10)': {kind: none, type: type(inst+10)} +// CHECK:STDOUT: 'type(inst+25)': {kind: none, type: type(inst+13)} +// CHECK:STDOUT: 'type(inst+13)': {kind: none, type: type(inst+13)} // CHECK:STDOUT: 'type(symbolicConstant0)': {kind: copy, type: type(symbolicConstant0)} -// CHECK:STDOUT: 'type(symbolicConstant1)': {kind: pointer, type: type(symbolicConstant4)} -// CHECK:STDOUT: 'type(symbolicConstant4)': {kind: copy, type: type(symbolicConstant4)} -// CHECK:STDOUT: 'type(symbolicConstant2)': {kind: copy, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'type(symbolicConstant3)': {kind: pointer, type: type(symbolicConstant4)} +// CHECK:STDOUT: 'type(symbolicConstant2)': {kind: pointer, type: type(symbolicConstant6)} +// CHECK:STDOUT: 'type(symbolicConstant6)': {kind: copy, type: type(symbolicConstant6)} +// CHECK:STDOUT: 'type(symbolicConstant3)': {kind: copy, type: type(symbolicConstant3)} +// CHECK:STDOUT: 'type(symbolicConstant5)': {kind: pointer, type: type(symbolicConstant6)} // CHECK:STDOUT: type_blocks: // CHECK:STDOUT: type_block0: {} // CHECK:STDOUT: type_block1: // CHECK:STDOUT: 0: typeTypeType -// CHECK:STDOUT: 1: type(inst+10) +// CHECK:STDOUT: 1: type(inst+13) // CHECK:STDOUT: type_block2: // CHECK:STDOUT: 0: type(symbolicConstant0) -// CHECK:STDOUT: 1: type(inst+10) +// CHECK:STDOUT: 1: type(inst+13) // CHECK:STDOUT: type_block3: -// CHECK:STDOUT: 0: type(symbolicConstant2) -// CHECK:STDOUT: 1: type(inst+10) +// CHECK:STDOUT: 0: type(symbolicConstant3) +// CHECK:STDOUT: 1: type(inst+13) // CHECK:STDOUT: insts: // CHECK:STDOUT: 'inst+0': {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(instNamespaceType)} -// CHECK:STDOUT: 'inst+1': {kind: Param, arg0: name1, arg1: runtime_param, type: typeTypeType} +// CHECK:STDOUT: 'inst+1': {kind: Param, arg0: runtime_param, type: typeTypeType} // CHECK:STDOUT: 'inst+2': {kind: BindSymbolicName, arg0: entity_name0, arg1: inst+1, type: typeTypeType} // CHECK:STDOUT: 'inst+3': {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: typeTypeType} -// CHECK:STDOUT: 'inst+4': {kind: SymbolicBindingPattern, arg0: entity_name0, type: typeTypeType} -// CHECK:STDOUT: 'inst+5': {kind: NameRef, arg0: name1, arg1: inst+2, type: typeTypeType} -// CHECK:STDOUT: 'inst+6': {kind: Param, arg0: name2, arg1: runtime_param0, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'inst+7': {kind: BindName, arg0: entity_name1, arg1: inst+6, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'inst+8': {kind: BindingPattern, arg0: entity_name1, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'inst+9': {kind: NameRef, arg0: name1, arg1: inst+2, type: typeTypeType} -// CHECK:STDOUT: 'inst+10': {kind: TupleType, arg0: type_block0, type: typeTypeType} -// CHECK:STDOUT: 'inst+11': {kind: TupleLiteral, arg0: empty, type: type(inst+10)} -// CHECK:STDOUT: 'inst+12': {kind: TupleType, arg0: type_block1, type: typeTypeType} -// CHECK:STDOUT: 'inst+13': {kind: TupleLiteral, arg0: block6, type: type(inst+12)} -// CHECK:STDOUT: 'inst+14': {kind: Converted, arg0: inst+11, arg1: inst+10, type: typeTypeType} -// CHECK:STDOUT: 'inst+15': {kind: TupleType, arg0: type_block2, type: typeTypeType} -// CHECK:STDOUT: 'inst+16': {kind: Converted, arg0: inst+13, arg1: inst+15, type: typeTypeType} -// CHECK:STDOUT: 'inst+17': {kind: VarStorage, arg0: nameReturnSlot, type: type(symbolicConstant3)} -// CHECK:STDOUT: 'inst+18': {kind: FunctionDecl, arg0: function0, arg1: block8, type: type(inst+21)} -// CHECK:STDOUT: 'inst+19': {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: typeTypeType} -// CHECK:STDOUT: 'inst+20': {kind: TupleType, arg0: type_block3, type: typeTypeType} -// CHECK:STDOUT: 'inst+21': {kind: FunctionType, arg0: function0, arg1: specific, type: typeTypeType} -// CHECK:STDOUT: 'inst+22': {kind: StructValue, arg0: empty, type: type(inst+21)} -// CHECK:STDOUT: 'inst+23': {kind: PointerType, arg0: type(symbolicConstant1), type: typeTypeType} -// CHECK:STDOUT: 'inst+24': {kind: NameRef, arg0: name2, arg1: inst+7, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'inst+25': {kind: TupleLiteral, arg0: empty, type: type(inst+10)} -// CHECK:STDOUT: 'inst+26': {kind: TupleLiteral, arg0: block14, type: type(symbolicConstant3)} -// CHECK:STDOUT: 'inst+27': {kind: TupleAccess, arg0: inst+17, arg1: element0, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'inst+28': {kind: InitializeFrom, arg0: inst+24, arg1: inst+27, type: type(symbolicConstant2)} -// CHECK:STDOUT: 'inst+29': {kind: TupleAccess, arg0: inst+17, arg1: element1, type: type(inst+10)} -// CHECK:STDOUT: 'inst+30': {kind: TupleInit, arg0: empty, arg1: inst+29, type: type(inst+10)} -// CHECK:STDOUT: 'inst+31': {kind: TupleValue, arg0: empty, type: type(inst+10)} -// CHECK:STDOUT: 'inst+32': {kind: Converted, arg0: inst+25, arg1: inst+30, type: type(inst+10)} -// CHECK:STDOUT: 'inst+33': {kind: TupleInit, arg0: block15, arg1: inst+17, type: type(symbolicConstant3)} -// CHECK:STDOUT: 'inst+34': {kind: Converted, arg0: inst+26, arg1: inst+33, type: type(symbolicConstant3)} -// CHECK:STDOUT: 'inst+35': {kind: ReturnExpr, arg0: inst+34, arg1: inst+17} +// CHECK:STDOUT: 'inst+4': {kind: SymbolicBindingPattern, arg0: entity_name0, arg1: inst+2, type: typeTypeType} +// CHECK:STDOUT: 'inst+5': {kind: SymbolicBindingPattern, arg0: entity_name0, arg1: inst+2, type: typeTypeType} +// CHECK:STDOUT: 'inst+6': {kind: ParamPattern, arg0: inst+4, arg1: runtime_param, type: typeTypeType} +// CHECK:STDOUT: 'inst+7': {kind: NameRef, arg0: name1, arg1: inst+2, type: typeTypeType} +// CHECK:STDOUT: 'inst+8': {kind: Param, arg0: runtime_param0, type: type(symbolicConstant3)} +// CHECK:STDOUT: 'inst+9': {kind: BindName, arg0: entity_name1, arg1: inst+8, type: type(symbolicConstant3)} +// CHECK:STDOUT: 'inst+10': {kind: BindingPattern, arg0: entity_name1, arg1: inst+9, type: type(symbolicConstant3)} +// CHECK:STDOUT: 'inst+11': {kind: ParamPattern, arg0: inst+10, arg1: runtime_param0, type: type(symbolicConstant3)} +// CHECK:STDOUT: 'inst+12': {kind: NameRef, arg0: name1, arg1: inst+2, type: typeTypeType} +// CHECK:STDOUT: 'inst+13': {kind: TupleType, arg0: type_block0, type: typeTypeType} +// CHECK:STDOUT: 'inst+14': {kind: TupleLiteral, arg0: empty, type: type(inst+13)} +// CHECK:STDOUT: 'inst+15': {kind: TupleType, arg0: type_block1, type: typeTypeType} +// CHECK:STDOUT: 'inst+16': {kind: TupleLiteral, arg0: block6, type: type(inst+15)} +// CHECK:STDOUT: 'inst+17': {kind: Converted, arg0: inst+14, arg1: inst+13, type: typeTypeType} +// CHECK:STDOUT: 'inst+18': {kind: TupleType, arg0: type_block2, type: typeTypeType} +// CHECK:STDOUT: 'inst+19': {kind: Converted, arg0: inst+16, arg1: inst+18, type: typeTypeType} +// CHECK:STDOUT: 'inst+20': {kind: VarStorage, arg0: nameReturnSlot, type: type(symbolicConstant5)} +// CHECK:STDOUT: 'inst+21': {kind: FunctionDecl, arg0: function0, arg1: block10, type: type(inst+25)} +// CHECK:STDOUT: 'inst+22': {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: typeTypeType} +// CHECK:STDOUT: 'inst+23': {kind: SymbolicBindingPattern, arg0: entity_name0, arg1: inst+2, type: typeTypeType} +// CHECK:STDOUT: 'inst+24': {kind: TupleType, arg0: type_block3, type: typeTypeType} +// CHECK:STDOUT: 'inst+25': {kind: FunctionType, arg0: function0, arg1: specific, type: typeTypeType} +// CHECK:STDOUT: 'inst+26': {kind: StructValue, arg0: empty, type: type(inst+25)} +// CHECK:STDOUT: 'inst+27': {kind: PointerType, arg0: type(symbolicConstant2), type: typeTypeType} +// CHECK:STDOUT: 'inst+28': {kind: NameRef, arg0: name2, arg1: inst+9, type: type(symbolicConstant3)} +// CHECK:STDOUT: 'inst+29': {kind: TupleLiteral, arg0: empty, type: type(inst+13)} +// CHECK:STDOUT: 'inst+30': {kind: TupleLiteral, arg0: block16, type: type(symbolicConstant5)} +// CHECK:STDOUT: 'inst+31': {kind: TupleAccess, arg0: inst+20, arg1: element0, type: type(symbolicConstant3)} +// CHECK:STDOUT: 'inst+32': {kind: InitializeFrom, arg0: inst+28, arg1: inst+31, type: type(symbolicConstant3)} +// CHECK:STDOUT: 'inst+33': {kind: TupleAccess, arg0: inst+20, arg1: element1, type: type(inst+13)} +// CHECK:STDOUT: 'inst+34': {kind: TupleInit, arg0: empty, arg1: inst+33, type: type(inst+13)} +// CHECK:STDOUT: 'inst+35': {kind: TupleValue, arg0: empty, type: type(inst+13)} +// CHECK:STDOUT: 'inst+36': {kind: Converted, arg0: inst+29, arg1: inst+34, type: type(inst+13)} +// CHECK:STDOUT: 'inst+37': {kind: TupleInit, arg0: block17, arg1: inst+20, type: type(symbolicConstant5)} +// CHECK:STDOUT: 'inst+38': {kind: Converted, arg0: inst+30, arg1: inst+37, type: type(symbolicConstant5)} +// CHECK:STDOUT: 'inst+39': {kind: ReturnExpr, arg0: inst+38, arg1: inst+20} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: 'inst+0': templateConstant(inst+0) -// CHECK:STDOUT: 'inst+2': symbolicConstant2 +// CHECK:STDOUT: 'inst+2': symbolicConstant3 // CHECK:STDOUT: 'inst+3': symbolicConstant0 -// CHECK:STDOUT: 'inst+5': symbolicConstant2 -// CHECK:STDOUT: 'inst+9': symbolicConstant2 -// CHECK:STDOUT: 'inst+10': templateConstant(inst+10) -// CHECK:STDOUT: 'inst+12': templateConstant(inst+12) -// CHECK:STDOUT: 'inst+14': templateConstant(inst+10) -// CHECK:STDOUT: 'inst+15': symbolicConstant1 -// CHECK:STDOUT: 'inst+16': symbolicConstant3 -// CHECK:STDOUT: 'inst+18': templateConstant(inst+22) -// CHECK:STDOUT: 'inst+19': symbolicConstant2 -// CHECK:STDOUT: 'inst+20': symbolicConstant3 -// CHECK:STDOUT: 'inst+21': templateConstant(inst+21) -// CHECK:STDOUT: 'inst+22': templateConstant(inst+22) +// CHECK:STDOUT: 'inst+4': symbolicConstant4 +// CHECK:STDOUT: 'inst+5': symbolicConstant1 +// CHECK:STDOUT: 'inst+6': symbolicConstant4 +// CHECK:STDOUT: 'inst+7': symbolicConstant3 +// CHECK:STDOUT: 'inst+12': symbolicConstant3 +// CHECK:STDOUT: 'inst+13': templateConstant(inst+13) +// CHECK:STDOUT: 'inst+15': templateConstant(inst+15) +// CHECK:STDOUT: 'inst+17': templateConstant(inst+13) +// CHECK:STDOUT: 'inst+18': symbolicConstant2 +// CHECK:STDOUT: 'inst+19': symbolicConstant5 +// CHECK:STDOUT: 'inst+21': templateConstant(inst+26) +// CHECK:STDOUT: 'inst+22': symbolicConstant3 // CHECK:STDOUT: 'inst+23': symbolicConstant4 -// CHECK:STDOUT: 'inst+30': templateConstant(inst+31) -// CHECK:STDOUT: 'inst+31': templateConstant(inst+31) -// CHECK:STDOUT: 'inst+32': templateConstant(inst+31) +// CHECK:STDOUT: 'inst+24': symbolicConstant5 +// CHECK:STDOUT: 'inst+25': templateConstant(inst+25) +// CHECK:STDOUT: 'inst+26': templateConstant(inst+26) +// CHECK:STDOUT: 'inst+27': symbolicConstant6 +// CHECK:STDOUT: 'inst+34': templateConstant(inst+35) +// CHECK:STDOUT: 'inst+35': templateConstant(inst+35) +// CHECK:STDOUT: 'inst+36': templateConstant(inst+35) // CHECK:STDOUT: symbolic_constants: // CHECK:STDOUT: symbolicConstant0: {inst: inst+3, generic: generic, index: genericInst} -// CHECK:STDOUT: symbolicConstant1: {inst: inst+15, generic: generic, index: genericInst} -// CHECK:STDOUT: symbolicConstant2: {inst: inst+3, generic: generic0, index: genericInstInDecl0} -// CHECK:STDOUT: symbolicConstant3: {inst: inst+15, generic: generic0, index: genericInstInDecl1} -// CHECK:STDOUT: symbolicConstant4: {inst: inst+23, generic: generic, index: genericInst} +// CHECK:STDOUT: symbolicConstant1: {inst: inst+5, generic: generic, index: genericInst} +// CHECK:STDOUT: symbolicConstant2: {inst: inst+18, generic: generic, index: genericInst} +// CHECK:STDOUT: symbolicConstant3: {inst: inst+3, generic: generic0, index: genericInstInDecl0} +// CHECK:STDOUT: symbolicConstant4: {inst: inst+5, generic: generic0, index: genericInstInDecl1} +// CHECK:STDOUT: symbolicConstant5: {inst: inst+18, generic: generic0, index: genericInstInDecl2} +// CHECK:STDOUT: symbolicConstant6: {inst: inst+27, generic: generic, index: genericInst} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+18 +// CHECK:STDOUT: 0: inst+21 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: block4: -// CHECK:STDOUT: 0: inst+2 +// CHECK:STDOUT: 0: inst+6 // CHECK:STDOUT: block5: -// CHECK:STDOUT: 0: inst+7 +// CHECK:STDOUT: 0: inst+11 // CHECK:STDOUT: block6: -// CHECK:STDOUT: 0: inst+9 -// CHECK:STDOUT: 1: inst+11 +// CHECK:STDOUT: 0: inst+12 +// CHECK:STDOUT: 1: inst+14 // CHECK:STDOUT: block7: -// CHECK:STDOUT: 0: inst+4 -// CHECK:STDOUT: 1: inst+8 -// CHECK:STDOUT: block8: -// CHECK:STDOUT: 0: inst+1 -// CHECK:STDOUT: 1: inst+2 -// CHECK:STDOUT: 2: inst+5 -// CHECK:STDOUT: 3: inst+6 -// CHECK:STDOUT: 4: inst+7 -// CHECK:STDOUT: 5: inst+9 -// CHECK:STDOUT: 6: inst+11 -// CHECK:STDOUT: 7: inst+13 -// CHECK:STDOUT: 8: inst+14 -// CHECK:STDOUT: 9: inst+16 -// CHECK:STDOUT: 10: inst+17 -// CHECK:STDOUT: block9: // CHECK:STDOUT: 0: inst+2 +// CHECK:STDOUT: block8: +// CHECK:STDOUT: 0: inst+9 +// CHECK:STDOUT: block9: +// CHECK:STDOUT: 0: inst+4 +// CHECK:STDOUT: 1: inst+6 +// CHECK:STDOUT: 2: inst+10 +// CHECK:STDOUT: 3: inst+11 // CHECK:STDOUT: block10: -// CHECK:STDOUT: 0: inst+19 -// CHECK:STDOUT: 1: inst+20 +// CHECK:STDOUT: 0: inst+7 +// CHECK:STDOUT: 1: inst+12 +// CHECK:STDOUT: 2: inst+14 +// CHECK:STDOUT: 3: inst+16 +// CHECK:STDOUT: 4: inst+17 +// CHECK:STDOUT: 5: inst+19 +// CHECK:STDOUT: 6: inst+20 +// CHECK:STDOUT: 7: inst+1 +// CHECK:STDOUT: 8: inst+2 +// CHECK:STDOUT: 9: inst+8 +// CHECK:STDOUT: 10: inst+9 // CHECK:STDOUT: block11: -// CHECK:STDOUT: 0: inst+3 +// CHECK:STDOUT: 0: inst+2 // CHECK:STDOUT: block12: -// CHECK:STDOUT: 0: inst+3 -// CHECK:STDOUT: 1: inst+15 +// CHECK:STDOUT: 0: inst+22 +// CHECK:STDOUT: 1: inst+23 +// CHECK:STDOUT: 2: inst+24 // CHECK:STDOUT: block13: -// CHECK:STDOUT: 0: inst+24 -// CHECK:STDOUT: 1: inst+25 -// CHECK:STDOUT: 2: inst+26 -// CHECK:STDOUT: 3: inst+27 -// CHECK:STDOUT: 4: inst+28 -// CHECK:STDOUT: 5: inst+29 -// CHECK:STDOUT: 6: inst+30 -// CHECK:STDOUT: 7: inst+32 -// CHECK:STDOUT: 8: inst+33 -// CHECK:STDOUT: 9: inst+34 -// CHECK:STDOUT: 10: inst+35 +// CHECK:STDOUT: 0: inst+3 // CHECK:STDOUT: block14: -// CHECK:STDOUT: 0: inst+24 -// CHECK:STDOUT: 1: inst+25 +// CHECK:STDOUT: 0: inst+3 +// CHECK:STDOUT: 1: inst+3 +// CHECK:STDOUT: 2: inst+18 // CHECK:STDOUT: block15: // CHECK:STDOUT: 0: inst+28 -// CHECK:STDOUT: 1: inst+32 +// CHECK:STDOUT: 1: inst+29 +// CHECK:STDOUT: 2: inst+30 +// CHECK:STDOUT: 3: inst+31 +// CHECK:STDOUT: 4: inst+32 +// CHECK:STDOUT: 5: inst+33 +// CHECK:STDOUT: 6: inst+34 +// CHECK:STDOUT: 7: inst+36 +// CHECK:STDOUT: 8: inst+37 +// CHECK:STDOUT: 9: inst+38 +// CHECK:STDOUT: 10: inst+39 // CHECK:STDOUT: block16: +// CHECK:STDOUT: 0: inst+28 +// CHECK:STDOUT: 1: inst+29 +// CHECK:STDOUT: block17: +// CHECK:STDOUT: 0: inst+32 +// CHECK:STDOUT: 1: inst+36 +// CHECK:STDOUT: block18: // CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+18 +// CHECK:STDOUT: 1: inst+21 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon b/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon index b4686b3353e4..38a6caa90148 100644 --- a/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon @@ -34,11 +34,10 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %n.patt: %.1 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %.1 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc15_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc15_12.2: type = converted %.loc15_12.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %n.param: %.1 = param n, runtime_param0 -// CHECK:STDOUT: %n: %.1 = bind_name n, %n.param // CHECK:STDOUT: %.loc15_20: %.1 = tuple_literal () // CHECK:STDOUT: %.loc15_24: %.1 = tuple_literal () // CHECK:STDOUT: %.loc15_25.1: %.2 = tuple_literal (%.loc15_20, %.loc15_24) @@ -46,10 +45,12 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: %.loc15_25.3: type = converted %.loc15_24, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc15_25.4: type = converted %.loc15_25.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %return: ref %.2 = var +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %n: %.1 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%n: %.1) -> %return: %.2 { +// CHECK:STDOUT: fn @Foo(%n.param_patt: %.1) -> %return: %.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %.1 = name_ref n, %n // CHECK:STDOUT: %.loc16_15.1: %.1 = tuple_literal () diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index b2024125294c..b78cca807eec 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -80,7 +80,7 @@ fn F() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -170,5 +170,5 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index 69c7c4cb6518..56f59c802583 100644 --- a/toolchain/check/testdata/basics/type_literals.carbon +++ b/toolchain/check/testdata/basics/type_literals.carbon @@ -137,7 +137,7 @@ var test_f128: f128; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref: %Int.type = import_ref Core//prelude/types, inst+16, loaded [template = constants.%Int] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -168,7 +168,7 @@ var test_f128: f128; // CHECK:STDOUT: %test_i64: ref %.7 = bind_name test_i64, %test_i64.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%size: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%size.param_patt: i32) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_iN_bad_width.carbon // CHECK:STDOUT: @@ -195,7 +195,7 @@ var test_f128: f128; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref: %Int.type = import_ref Core//prelude/types, inst+16, loaded [template = constants.%Int] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -236,7 +236,7 @@ var test_f128: f128; // CHECK:STDOUT: %test_i10000000000000000000: ref = bind_name test_i10000000000000000000, %test_i10000000000000000000.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%size: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%size.param_patt: i32) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: --- uN.carbon // CHECK:STDOUT: @@ -264,7 +264,7 @@ var test_f128: f128; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Core//prelude/types, inst+25, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Core//prelude/types, inst+27, loaded [template = constants.%UInt] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -295,7 +295,7 @@ var test_f128: f128; // CHECK:STDOUT: %test_u64: ref %.7 = bind_name test_u64, %test_u64.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%size: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @UInt(%size.param_patt: i32) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_uN_bad_width.carbon // CHECK:STDOUT: @@ -322,7 +322,7 @@ var test_f128: f128; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Core//prelude/types, inst+25, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Core//prelude/types, inst+27, loaded [template = constants.%UInt] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -363,7 +363,7 @@ var test_f128: f128; // CHECK:STDOUT: %test_u10000000000000000000: ref = bind_name test_u10000000000000000000, %test_u10000000000000000000.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%size: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @UInt(%size.param_patt: i32) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_fN_bad_width.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/add.carbon b/toolchain/check/testdata/builtins/float/add.carbon index ba8260339a03..b442088e9f29 100644 --- a/toolchain/check/testdata/builtins/float/add.carbon +++ b/toolchain/check/testdata/builtins/float/add.carbon @@ -78,7 +78,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -91,47 +91,51 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] // CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %float.make_type.loc2_11 [template = f64] // CHECK:STDOUT: %.loc2_11.3: type = converted %float.make_type.loc2_11, %.loc2_11.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc2_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%.loc2_19.1) [template = f64] // CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %float.make_type.loc2_19 [template = f64] // CHECK:STDOUT: %.loc2_19.3: type = converted %float.make_type.loc2_19, %.loc2_19.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc2_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_27: init type = call constants.%Float(%.loc2_27.1) [template = f64] // CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %float.make_type.loc2_27 [template = f64] // CHECK:STDOUT: %.loc2_27.3: type = converted %float.make_type.loc2_27, %.loc2_27.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc2_8: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc4_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%.loc4_19.1) [template = f64] // CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %float.make_type.loc4_19 [template = f64] // CHECK:STDOUT: %.loc4_19.3: type = converted %float.make_type.loc4_19, %.loc4_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc4_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%.loc4_27.1) [template = f64] // CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %float.make_type.loc4_27 [template = f64] // CHECK:STDOUT: %.loc4_27.3: type = converted %float.make_type.loc4_27, %.loc4_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc4_35.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%.loc4_35.1) [template = f64] // CHECK:STDOUT: %.loc4_35.2: type = value_of_initializer %float.make_type.loc4_35 [template = f64] // CHECK:STDOUT: %.loc4_35.3: type = converted %float.make_type.loc4_35, %.loc4_35.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc4_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc4_16 +// CHECK:STDOUT: %param.loc4_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc4_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_8.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc8_8.1) [template = f64] @@ -141,11 +145,11 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %x: ref f64 = bind_name x, %x.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a: f64, %b: f64) -> f64 = "float.add"; +// CHECK:STDOUT: fn @Add(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.add"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: f64, %b: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -204,7 +208,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -222,171 +226,185 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] // CHECK:STDOUT: %.loc8_14.2: type = value_of_initializer %float.make_type.loc8_14 [template = f64] // CHECK:STDOUT: %.loc8_14.3: type = converted %float.make_type.loc8_14, %.loc8_14.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc8_22.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_22: init type = call constants.%Float(%.loc8_22.1) [template = f64] // CHECK:STDOUT: %.loc8_22.2: type = value_of_initializer %float.make_type.loc8_22 [template = f64] // CHECK:STDOUT: %.loc8_22.3: type = converted %float.make_type.loc8_22, %.loc8_22.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: f64 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc13_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%.loc13_15.1) [template = f64] // CHECK:STDOUT: %.loc13_15.2: type = value_of_initializer %float.make_type.loc13_15 [template = f64] // CHECK:STDOUT: %.loc13_15.3: type = converted %float.make_type.loc13_15, %.loc13_15.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc13_23.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%.loc13_23.1) [template = f64] // CHECK:STDOUT: %.loc13_23.2: type = value_of_initializer %float.make_type.loc13_23 [template = f64] // CHECK:STDOUT: %.loc13_23.3: type = converted %float.make_type.loc13_23, %.loc13_23.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc13_31.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%.loc13_31.1) [template = f64] // CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %float.make_type.loc13_31 [template = f64] // CHECK:STDOUT: %.loc13_31.3: type = converted %float.make_type.loc13_31, %.loc13_31.2 [template = f64] -// CHECK:STDOUT: %c.param: f64 = param c, runtime_param2 -// CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %.loc13_39.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_39: init type = call constants.%Float(%.loc13_39.1) [template = f64] // CHECK:STDOUT: %.loc13_39.2: type = value_of_initializer %float.make_type.loc13_39 [template = f64] // CHECK:STDOUT: %.loc13_39.3: type = converted %float.make_type.loc13_39, %.loc13_39.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc13_12: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc13_12 +// CHECK:STDOUT: %param.loc13_20: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc13_20 +// CHECK:STDOUT: %param.loc13_28: f64 = param runtime_param2 +// CHECK:STDOUT: %c: f64 = bind_name c, %param.loc13_28 // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc17_21.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%.loc17_21.1) [template = f64] // CHECK:STDOUT: %.loc17_21.2: type = value_of_initializer %float.make_type.loc17_21 [template = f64] // CHECK:STDOUT: %.loc17_21.3: type = converted %float.make_type.loc17_21, %.loc17_21.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc17_29.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%.loc17_29.1) [template = f64] // CHECK:STDOUT: %.loc17_29.2: type = value_of_initializer %float.make_type.loc17_29 [template = f64] // CHECK:STDOUT: %.loc17_29.3: type = converted %float.make_type.loc17_29, %.loc17_29.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc17_18: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc17_18 +// CHECK:STDOUT: %param.loc17_26: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc17_26 // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc18_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%.loc18_17.1) [template = f64] // CHECK:STDOUT: %.loc18_17.2: type = value_of_initializer %float.make_type.loc18_17 [template = f64] // CHECK:STDOUT: %.loc18_17.3: type = converted %float.make_type.loc18_17, %.loc18_17.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc18_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%.loc18_25.1) [template = f64] // CHECK:STDOUT: %.loc18_25.2: type = value_of_initializer %float.make_type.loc18_25 [template = f64] // CHECK:STDOUT: %.loc18_25.3: type = converted %float.make_type.loc18_25, %.loc18_25.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc18_33.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%.loc18_33.1) [template = f64] // CHECK:STDOUT: %.loc18_33.2: type = value_of_initializer %float.make_type.loc18_33 [template = f64] // CHECK:STDOUT: %.loc18_33.3: type = converted %float.make_type.loc18_33, %.loc18_33.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc18_14: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc18_14 +// CHECK:STDOUT: %param.loc18_22: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc18_22 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc20_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%.loc20_25.1) [template = f64] // CHECK:STDOUT: %.loc20_25.2: type = value_of_initializer %float.make_type.loc20_25 [template = f64] // CHECK:STDOUT: %.loc20_25.3: type = converted %float.make_type.loc20_25, %.loc20_25.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc20_33.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%.loc20_33.1) [template = f64] // CHECK:STDOUT: %.loc20_33.2: type = value_of_initializer %float.make_type.loc20_33 [template = f64] // CHECK:STDOUT: %.loc20_33.3: type = converted %float.make_type.loc20_33, %.loc20_33.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: f64 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc24_26.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%.loc24_26.1) [template = f64] // CHECK:STDOUT: %.loc24_26.2: type = value_of_initializer %float.make_type.loc24_26 [template = f64] // CHECK:STDOUT: %.loc24_26.3: type = converted %float.make_type.loc24_26, %.loc24_26.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc24_34.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%.loc24_34.1) [template = f64] // CHECK:STDOUT: %.loc24_34.2: type = value_of_initializer %float.make_type.loc24_34 [template = f64] // CHECK:STDOUT: %.loc24_34.3: type = converted %float.make_type.loc24_34, %.loc24_34.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc24_42.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%.loc24_42.1) [template = f64] // CHECK:STDOUT: %.loc24_42.2: type = value_of_initializer %float.make_type.loc24_42 [template = f64] // CHECK:STDOUT: %.loc24_42.3: type = converted %float.make_type.loc24_42, %.loc24_42.2 [template = f64] -// CHECK:STDOUT: %c.param: f64 = param c, runtime_param2 -// CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %.loc24_50.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%.loc24_50.1) [template = f64] // CHECK:STDOUT: %.loc24_50.2: type = value_of_initializer %float.make_type.loc24_50 [template = f64] // CHECK:STDOUT: %.loc24_50.3: type = converted %float.make_type.loc24_50, %.loc24_50.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc24_23: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc24_23 +// CHECK:STDOUT: %param.loc24_31: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc24_31 +// CHECK:STDOUT: %param.loc24_39: f64 = param runtime_param2 +// CHECK:STDOUT: %c: f64 = bind_name c, %param.loc24_39 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc28_32.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%.loc28_32.1) [template = f64] // CHECK:STDOUT: %.loc28_32.2: type = value_of_initializer %float.make_type.loc28_32 [template = f64] // CHECK:STDOUT: %.loc28_32.3: type = converted %float.make_type.loc28_32, %.loc28_32.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc28_40.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%.loc28_40.1) [template = f64] // CHECK:STDOUT: %.loc28_40.2: type = value_of_initializer %float.make_type.loc28_40 [template = f64] // CHECK:STDOUT: %.loc28_40.3: type = converted %float.make_type.loc28_40, %.loc28_40.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc28_29: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc28_29 +// CHECK:STDOUT: %param.loc28_37: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc28_37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew(%a: f64) -> f64; +// CHECK:STDOUT: fn @TooFew(%a.param_patt: f64) -> f64; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a: f64, %b: f64, %c: f64) -> f64; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a: f64, %b: f64) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a: f64, %b: f64) -> f64 = "float.add"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.add"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -396,7 +414,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc21_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a: f64, %b: f64, %c: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -408,7 +426,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc25_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a: f64, %b: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/div.carbon b/toolchain/check/testdata/builtins/float/div.carbon index 9de52e7fc60a..aaa213680df7 100644 --- a/toolchain/check/testdata/builtins/float/div.carbon +++ b/toolchain/check/testdata/builtins/float/div.carbon @@ -84,7 +84,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,47 +99,51 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] // CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %float.make_type.loc2_11 [template = f64] // CHECK:STDOUT: %.loc2_11.3: type = converted %float.make_type.loc2_11, %.loc2_11.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc2_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%.loc2_19.1) [template = f64] // CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %float.make_type.loc2_19 [template = f64] // CHECK:STDOUT: %.loc2_19.3: type = converted %float.make_type.loc2_19, %.loc2_19.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc2_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_27: init type = call constants.%Float(%.loc2_27.1) [template = f64] // CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %float.make_type.loc2_27 [template = f64] // CHECK:STDOUT: %.loc2_27.3: type = converted %float.make_type.loc2_27, %.loc2_27.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc2_8: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc4_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%.loc4_19.1) [template = f64] // CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %float.make_type.loc4_19 [template = f64] // CHECK:STDOUT: %.loc4_19.3: type = converted %float.make_type.loc4_19, %.loc4_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc4_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%.loc4_27.1) [template = f64] // CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %float.make_type.loc4_27 [template = f64] // CHECK:STDOUT: %.loc4_27.3: type = converted %float.make_type.loc4_27, %.loc4_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc4_35.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%.loc4_35.1) [template = f64] // CHECK:STDOUT: %.loc4_35.2: type = value_of_initializer %float.make_type.loc4_35 [template = f64] // CHECK:STDOUT: %.loc4_35.3: type = converted %float.make_type.loc4_35, %.loc4_35.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc4_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc4_16 +// CHECK:STDOUT: %param.loc4_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc4_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_8.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8: init type = call constants.%Float(%.loc8_8.1) [template = f64] @@ -157,11 +161,11 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc10_8.3: type = converted %float.make_type.loc10, %.loc10_8.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a: f64, %b: f64) -> f64 = "float.div"; +// CHECK:STDOUT: fn @Div(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.div"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: f64, %b: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -234,7 +238,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -252,171 +256,185 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] // CHECK:STDOUT: %.loc8_14.2: type = value_of_initializer %float.make_type.loc8_14 [template = f64] // CHECK:STDOUT: %.loc8_14.3: type = converted %float.make_type.loc8_14, %.loc8_14.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc8_22.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_22: init type = call constants.%Float(%.loc8_22.1) [template = f64] // CHECK:STDOUT: %.loc8_22.2: type = value_of_initializer %float.make_type.loc8_22 [template = f64] // CHECK:STDOUT: %.loc8_22.3: type = converted %float.make_type.loc8_22, %.loc8_22.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: f64 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc13_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%.loc13_15.1) [template = f64] // CHECK:STDOUT: %.loc13_15.2: type = value_of_initializer %float.make_type.loc13_15 [template = f64] // CHECK:STDOUT: %.loc13_15.3: type = converted %float.make_type.loc13_15, %.loc13_15.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc13_23.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%.loc13_23.1) [template = f64] // CHECK:STDOUT: %.loc13_23.2: type = value_of_initializer %float.make_type.loc13_23 [template = f64] // CHECK:STDOUT: %.loc13_23.3: type = converted %float.make_type.loc13_23, %.loc13_23.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc13_31.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%.loc13_31.1) [template = f64] // CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %float.make_type.loc13_31 [template = f64] // CHECK:STDOUT: %.loc13_31.3: type = converted %float.make_type.loc13_31, %.loc13_31.2 [template = f64] -// CHECK:STDOUT: %c.param: f64 = param c, runtime_param2 -// CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %.loc13_39.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_39: init type = call constants.%Float(%.loc13_39.1) [template = f64] // CHECK:STDOUT: %.loc13_39.2: type = value_of_initializer %float.make_type.loc13_39 [template = f64] // CHECK:STDOUT: %.loc13_39.3: type = converted %float.make_type.loc13_39, %.loc13_39.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc13_12: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc13_12 +// CHECK:STDOUT: %param.loc13_20: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc13_20 +// CHECK:STDOUT: %param.loc13_28: f64 = param runtime_param2 +// CHECK:STDOUT: %c: f64 = bind_name c, %param.loc13_28 // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc17_21.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%.loc17_21.1) [template = f64] // CHECK:STDOUT: %.loc17_21.2: type = value_of_initializer %float.make_type.loc17_21 [template = f64] // CHECK:STDOUT: %.loc17_21.3: type = converted %float.make_type.loc17_21, %.loc17_21.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc17_29.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%.loc17_29.1) [template = f64] // CHECK:STDOUT: %.loc17_29.2: type = value_of_initializer %float.make_type.loc17_29 [template = f64] // CHECK:STDOUT: %.loc17_29.3: type = converted %float.make_type.loc17_29, %.loc17_29.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc17_18: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc17_18 +// CHECK:STDOUT: %param.loc17_26: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc17_26 // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc18_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%.loc18_17.1) [template = f64] // CHECK:STDOUT: %.loc18_17.2: type = value_of_initializer %float.make_type.loc18_17 [template = f64] // CHECK:STDOUT: %.loc18_17.3: type = converted %float.make_type.loc18_17, %.loc18_17.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc18_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%.loc18_25.1) [template = f64] // CHECK:STDOUT: %.loc18_25.2: type = value_of_initializer %float.make_type.loc18_25 [template = f64] // CHECK:STDOUT: %.loc18_25.3: type = converted %float.make_type.loc18_25, %.loc18_25.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc18_33.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%.loc18_33.1) [template = f64] // CHECK:STDOUT: %.loc18_33.2: type = value_of_initializer %float.make_type.loc18_33 [template = f64] // CHECK:STDOUT: %.loc18_33.3: type = converted %float.make_type.loc18_33, %.loc18_33.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc18_14: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc18_14 +// CHECK:STDOUT: %param.loc18_22: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc18_22 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc20_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%.loc20_25.1) [template = f64] // CHECK:STDOUT: %.loc20_25.2: type = value_of_initializer %float.make_type.loc20_25 [template = f64] // CHECK:STDOUT: %.loc20_25.3: type = converted %float.make_type.loc20_25, %.loc20_25.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc20_33.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%.loc20_33.1) [template = f64] // CHECK:STDOUT: %.loc20_33.2: type = value_of_initializer %float.make_type.loc20_33 [template = f64] // CHECK:STDOUT: %.loc20_33.3: type = converted %float.make_type.loc20_33, %.loc20_33.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: f64 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc24_26.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%.loc24_26.1) [template = f64] // CHECK:STDOUT: %.loc24_26.2: type = value_of_initializer %float.make_type.loc24_26 [template = f64] // CHECK:STDOUT: %.loc24_26.3: type = converted %float.make_type.loc24_26, %.loc24_26.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc24_34.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%.loc24_34.1) [template = f64] // CHECK:STDOUT: %.loc24_34.2: type = value_of_initializer %float.make_type.loc24_34 [template = f64] // CHECK:STDOUT: %.loc24_34.3: type = converted %float.make_type.loc24_34, %.loc24_34.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc24_42.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%.loc24_42.1) [template = f64] // CHECK:STDOUT: %.loc24_42.2: type = value_of_initializer %float.make_type.loc24_42 [template = f64] // CHECK:STDOUT: %.loc24_42.3: type = converted %float.make_type.loc24_42, %.loc24_42.2 [template = f64] -// CHECK:STDOUT: %c.param: f64 = param c, runtime_param2 -// CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %.loc24_50.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%.loc24_50.1) [template = f64] // CHECK:STDOUT: %.loc24_50.2: type = value_of_initializer %float.make_type.loc24_50 [template = f64] // CHECK:STDOUT: %.loc24_50.3: type = converted %float.make_type.loc24_50, %.loc24_50.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc24_23: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc24_23 +// CHECK:STDOUT: %param.loc24_31: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc24_31 +// CHECK:STDOUT: %param.loc24_39: f64 = param runtime_param2 +// CHECK:STDOUT: %c: f64 = bind_name c, %param.loc24_39 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc28_32.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%.loc28_32.1) [template = f64] // CHECK:STDOUT: %.loc28_32.2: type = value_of_initializer %float.make_type.loc28_32 [template = f64] // CHECK:STDOUT: %.loc28_32.3: type = converted %float.make_type.loc28_32, %.loc28_32.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc28_40.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%.loc28_40.1) [template = f64] // CHECK:STDOUT: %.loc28_40.2: type = value_of_initializer %float.make_type.loc28_40 [template = f64] // CHECK:STDOUT: %.loc28_40.3: type = converted %float.make_type.loc28_40, %.loc28_40.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc28_29: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc28_29 +// CHECK:STDOUT: %param.loc28_37: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc28_37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew(%a: f64) -> f64; +// CHECK:STDOUT: fn @TooFew(%a.param_patt: f64) -> f64; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a: f64, %b: f64, %c: f64) -> f64; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a: f64, %b: f64) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a: f64, %b: f64) -> f64 = "float.div"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.div"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -426,7 +444,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc21_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a: f64, %b: f64, %c: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -438,7 +456,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc25_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a: f64, %b: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/eq.carbon b/toolchain/check/testdata/builtins/float/eq.carbon index 3b012f8382dd..82cdfb814ecb 100644 --- a/toolchain/check/testdata/builtins/float/eq.carbon +++ b/toolchain/check/testdata/builtins/float/eq.carbon @@ -72,7 +72,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -88,58 +88,64 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Eq.decl: %Eq.type = fn_decl @Eq [template = constants.%Eq] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc2_10.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_10: init type = call constants.%Float(%.loc2_10.1) [template = f64] // CHECK:STDOUT: %.loc2_10.2: type = value_of_initializer %float.make_type.loc2_10 [template = f64] // CHECK:STDOUT: %.loc2_10.3: type = converted %float.make_type.loc2_10, %.loc2_10.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc2_18.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_18: init type = call constants.%Float(%.loc2_18.1) [template = f64] // CHECK:STDOUT: %.loc2_18.2: type = value_of_initializer %float.make_type.loc2_18 [template = f64] // CHECK:STDOUT: %.loc2_18.3: type = converted %float.make_type.loc2_18, %.loc2_18.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_26.2: type = converted %bool.make_type, %.loc2_26.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_7: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc2_7 +// CHECK:STDOUT: %param.loc2_15: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc2_15 // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc7_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc7_6 +// CHECK:STDOUT: %param.loc7_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc7_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc12_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc12_19: init type = call constants.%Float(%.loc12_19.1) [template = f64] // CHECK:STDOUT: %.loc12_19.2: type = value_of_initializer %float.make_type.loc12_19 [template = f64] // CHECK:STDOUT: %.loc12_19.3: type = converted %float.make_type.loc12_19, %.loc12_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc12_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc12_27: init type = call constants.%Float(%.loc12_27.1) [template = f64] // CHECK:STDOUT: %.loc12_27.2: type = value_of_initializer %float.make_type.loc12_27 [template = f64] // CHECK:STDOUT: %.loc12_27.3: type = converted %float.make_type.loc12_27, %.loc12_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc12_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc12_16 +// CHECK:STDOUT: %param.loc12_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc12_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -157,13 +163,13 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Eq(%a: f64, %b: f64) -> bool = "float.eq"; +// CHECK:STDOUT: fn @Eq(%a.param_patt: f64, %b.param_patt: f64) -> bool = "float.eq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ // CHECK:STDOUT: %Eq.ref.loc8: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] @@ -206,7 +212,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: f64, %b: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Eq.ref: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -240,7 +246,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -251,29 +257,31 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %WrongResult.decl: %WrongResult.type = fn_decl @WrongResult [template = constants.%WrongResult] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc7_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%.loc7_19.1) [template = f64] // CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %float.make_type.loc7_19 [template = f64] // CHECK:STDOUT: %.loc7_19.3: type = converted %float.make_type.loc7_19, %.loc7_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc7_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc7_27: init type = call constants.%Float(%.loc7_27.1) [template = f64] // CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %float.make_type.loc7_27 [template = f64] // CHECK:STDOUT: %.loc7_27.3: type = converted %float.make_type.loc7_27, %.loc7_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc7_35.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc7_35: init type = call constants.%Float(%.loc7_35.1) [template = f64] // CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %float.make_type.loc7_35 [template = f64] // CHECK:STDOUT: %.loc7_35.3: type = converted %float.make_type.loc7_35, %.loc7_35.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc7_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @WrongResult(%a: f64, %b: f64) -> f64; +// CHECK:STDOUT: fn @WrongResult(%a.param_patt: f64, %b.param_patt: f64) -> f64; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/greater.carbon b/toolchain/check/testdata/builtins/float/greater.carbon index 4ad76d17c412..b352536fb95a 100644 --- a/toolchain/check/testdata/builtins/float/greater.carbon +++ b/toolchain/check/testdata/builtins/float/greater.carbon @@ -71,7 +71,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -88,73 +88,80 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Greater.decl: %Greater.type = fn_decl @Greater [template = constants.%Greater] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc2_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_15: init type = call constants.%Float(%.loc2_15.1) [template = f64] // CHECK:STDOUT: %.loc2_15.2: type = value_of_initializer %float.make_type.loc2_15 [template = f64] // CHECK:STDOUT: %.loc2_15.3: type = converted %float.make_type.loc2_15, %.loc2_15.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc2_23.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_23: init type = call constants.%Float(%.loc2_23.1) [template = f64] // CHECK:STDOUT: %.loc2_23.2: type = value_of_initializer %float.make_type.loc2_23 [template = f64] // CHECK:STDOUT: %.loc2_23.3: type = converted %float.make_type.loc2_23, %.loc2_23.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_31.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_31.2: type = converted %bool.make_type, %.loc2_31.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_12: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc2_12 +// CHECK:STDOUT: %param.loc2_20: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc2_20 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%.loc3_14.1) [template = f64] // CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %float.make_type.loc3_14 [template = f64] // CHECK:STDOUT: %.loc3_14.3: type = converted %float.make_type.loc3_14, %.loc3_14.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc3_22.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_22: init type = call constants.%Float(%.loc3_22.1) [template = f64] // CHECK:STDOUT: %.loc3_22.2: type = value_of_initializer %float.make_type.loc3_22 [template = f64] // CHECK:STDOUT: %.loc3_22.3: type = converted %float.make_type.loc3_22, %.loc3_22.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc8_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc8_6 +// CHECK:STDOUT: %param.loc8_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc8_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc16_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%.loc16_19.1) [template = f64] // CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %float.make_type.loc16_19 [template = f64] // CHECK:STDOUT: %.loc16_19.3: type = converted %float.make_type.loc16_19, %.loc16_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc16_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%.loc16_27.1) [template = f64] // CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %float.make_type.loc16_27 [template = f64] // CHECK:STDOUT: %.loc16_27.3: type = converted %float.make_type.loc16_27, %.loc16_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc16_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc16_16 +// CHECK:STDOUT: %param.loc16_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc16_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -172,15 +179,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Greater(%a: f64, %b: f64) -> bool = "float.greater"; +// CHECK:STDOUT: fn @Greater(%a.param_patt: f64, %b.param_patt: f64) -> bool = "float.greater"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: f64) -> f64 = "float.negate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: f64) -> f64 = "float.negate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc9: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] @@ -245,9 +252,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc12_32: f64 = float_literal 1 [template = constants.%.6] // CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_32) [template = constants.%.11] // CHECK:STDOUT: %.loc12_38: f64 = float_literal 0 [template = constants.%.9] -// CHECK:STDOUT: %.loc12_24.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] -// CHECK:STDOUT: %.loc12_24.2: f64 = converted %float.negate.loc12, %.loc12_24.1 [template = constants.%.11] -// CHECK:STDOUT: %float.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_24.2, %.loc12_38) [template = constants.%.8] +// CHECK:STDOUT: %.loc12_31.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] +// CHECK:STDOUT: %.loc12_31.2: f64 = converted %float.negate.loc12, %.loc12_31.1 [template = constants.%.11] +// CHECK:STDOUT: %float.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_31.2, %.loc12_38) [template = constants.%.8] // CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %float.greater.loc12 [template = constants.%.8] // CHECK:STDOUT: %.loc12_14.2: bool = converted %float.greater.loc12, %.loc12_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 @@ -268,9 +275,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc13_36: f64 = float_literal 1 [template = constants.%.6] // CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_36) [template = constants.%.11] -// CHECK:STDOUT: %.loc13_23.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] -// CHECK:STDOUT: %.loc13_23.2: f64 = converted %float.negate.loc13, %.loc13_23.1 [template = constants.%.11] -// CHECK:STDOUT: %float.greater.loc13: init bool = call %Greater.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.10] +// CHECK:STDOUT: %.loc13_35.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] +// CHECK:STDOUT: %.loc13_35.2: f64 = converted %float.negate.loc13, %.loc13_35.1 [template = constants.%.11] +// CHECK:STDOUT: %float.greater.loc13: init bool = call %Greater.ref.loc13(%.loc13_24, %.loc13_35.2) [template = constants.%.10] // CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %float.greater.loc13 [template = constants.%.10] // CHECK:STDOUT: %.loc13_13.2: bool = converted %float.greater.loc13, %.loc13_13.1 [template = constants.%.10] // CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 @@ -288,7 +295,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: f64, %b: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Greater.ref: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/greater_eq.carbon b/toolchain/check/testdata/builtins/float/greater_eq.carbon index e2f35e545d37..db67f58e1518 100644 --- a/toolchain/check/testdata/builtins/float/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/float/greater_eq.carbon @@ -71,7 +71,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -88,73 +88,80 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %GreaterEq.decl: %GreaterEq.type = fn_decl @GreaterEq [template = constants.%GreaterEq] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc2_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_17: init type = call constants.%Float(%.loc2_17.1) [template = f64] // CHECK:STDOUT: %.loc2_17.2: type = value_of_initializer %float.make_type.loc2_17 [template = f64] // CHECK:STDOUT: %.loc2_17.3: type = converted %float.make_type.loc2_17, %.loc2_17.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc2_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_25: init type = call constants.%Float(%.loc2_25.1) [template = f64] // CHECK:STDOUT: %.loc2_25.2: type = value_of_initializer %float.make_type.loc2_25 [template = f64] // CHECK:STDOUT: %.loc2_25.3: type = converted %float.make_type.loc2_25, %.loc2_25.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_33.2: type = converted %bool.make_type, %.loc2_33.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_14: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc2_14 +// CHECK:STDOUT: %param.loc2_22: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc2_22 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%.loc3_14.1) [template = f64] // CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %float.make_type.loc3_14 [template = f64] // CHECK:STDOUT: %.loc3_14.3: type = converted %float.make_type.loc3_14, %.loc3_14.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc3_22.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_22: init type = call constants.%Float(%.loc3_22.1) [template = f64] // CHECK:STDOUT: %.loc3_22.2: type = value_of_initializer %float.make_type.loc3_22 [template = f64] // CHECK:STDOUT: %.loc3_22.3: type = converted %float.make_type.loc3_22, %.loc3_22.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc8_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc8_6 +// CHECK:STDOUT: %param.loc8_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc8_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc16_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%.loc16_19.1) [template = f64] // CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %float.make_type.loc16_19 [template = f64] // CHECK:STDOUT: %.loc16_19.3: type = converted %float.make_type.loc16_19, %.loc16_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc16_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%.loc16_27.1) [template = f64] // CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %float.make_type.loc16_27 [template = f64] // CHECK:STDOUT: %.loc16_27.3: type = converted %float.make_type.loc16_27, %.loc16_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc16_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc16_16 +// CHECK:STDOUT: %param.loc16_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc16_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -172,15 +179,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GreaterEq(%a: f64, %b: f64) -> bool = "float.greater_eq"; +// CHECK:STDOUT: fn @GreaterEq(%a.param_patt: f64, %b.param_patt: f64) -> bool = "float.greater_eq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: f64) -> f64 = "float.negate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: f64) -> f64 = "float.negate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ // CHECK:STDOUT: %GreaterEq.ref.loc9: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] @@ -245,9 +252,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc12_34: f64 = float_literal 1 [template = constants.%.6] // CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_34) [template = constants.%.11] // CHECK:STDOUT: %.loc12_40: f64 = float_literal 0 [template = constants.%.10] -// CHECK:STDOUT: %.loc12_26.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] -// CHECK:STDOUT: %.loc12_26.2: f64 = converted %float.negate.loc12, %.loc12_26.1 [template = constants.%.11] -// CHECK:STDOUT: %float.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_26.2, %.loc12_40) [template = constants.%.8] +// CHECK:STDOUT: %.loc12_33.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] +// CHECK:STDOUT: %.loc12_33.2: f64 = converted %float.negate.loc12, %.loc12_33.1 [template = constants.%.11] +// CHECK:STDOUT: %float.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_33.2, %.loc12_40) [template = constants.%.8] // CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %float.greater_eq.loc12 [template = constants.%.8] // CHECK:STDOUT: %.loc12_14.2: bool = converted %float.greater_eq.loc12, %.loc12_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 @@ -268,9 +275,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc13_38: f64 = float_literal 1 [template = constants.%.6] // CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_38) [template = constants.%.11] -// CHECK:STDOUT: %.loc13_25.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] -// CHECK:STDOUT: %.loc13_25.2: f64 = converted %float.negate.loc13, %.loc13_25.1 [template = constants.%.11] -// CHECK:STDOUT: %float.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%.loc13_26, %.loc13_25.2) [template = constants.%.9] +// CHECK:STDOUT: %.loc13_37.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] +// CHECK:STDOUT: %.loc13_37.2: f64 = converted %float.negate.loc13, %.loc13_37.1 [template = constants.%.11] +// CHECK:STDOUT: %float.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%.loc13_26, %.loc13_37.2) [template = constants.%.9] // CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %float.greater_eq.loc13 [template = constants.%.9] // CHECK:STDOUT: %.loc13_13.2: bool = converted %float.greater_eq.loc13, %.loc13_13.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 @@ -288,7 +295,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: f64, %b: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %GreaterEq.ref: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/less.carbon b/toolchain/check/testdata/builtins/float/less.carbon index 3f7d08de6482..f5fee2882c11 100644 --- a/toolchain/check/testdata/builtins/float/less.carbon +++ b/toolchain/check/testdata/builtins/float/less.carbon @@ -71,7 +71,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -88,73 +88,80 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Less.decl: %Less.type = fn_decl @Less [template = constants.%Less] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc2_12.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_12: init type = call constants.%Float(%.loc2_12.1) [template = f64] // CHECK:STDOUT: %.loc2_12.2: type = value_of_initializer %float.make_type.loc2_12 [template = f64] // CHECK:STDOUT: %.loc2_12.3: type = converted %float.make_type.loc2_12, %.loc2_12.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc2_20.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_20: init type = call constants.%Float(%.loc2_20.1) [template = f64] // CHECK:STDOUT: %.loc2_20.2: type = value_of_initializer %float.make_type.loc2_20 [template = f64] // CHECK:STDOUT: %.loc2_20.3: type = converted %float.make_type.loc2_20, %.loc2_20.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_28.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_28.2: type = converted %bool.make_type, %.loc2_28.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_9: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc2_9 +// CHECK:STDOUT: %param.loc2_17: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc2_17 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%.loc3_14.1) [template = f64] // CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %float.make_type.loc3_14 [template = f64] // CHECK:STDOUT: %.loc3_14.3: type = converted %float.make_type.loc3_14, %.loc3_14.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc3_22.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_22: init type = call constants.%Float(%.loc3_22.1) [template = f64] // CHECK:STDOUT: %.loc3_22.2: type = value_of_initializer %float.make_type.loc3_22 [template = f64] // CHECK:STDOUT: %.loc3_22.3: type = converted %float.make_type.loc3_22, %.loc3_22.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc8_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc8_6 +// CHECK:STDOUT: %param.loc8_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc8_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc16_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%.loc16_19.1) [template = f64] // CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %float.make_type.loc16_19 [template = f64] // CHECK:STDOUT: %.loc16_19.3: type = converted %float.make_type.loc16_19, %.loc16_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc16_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%.loc16_27.1) [template = f64] // CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %float.make_type.loc16_27 [template = f64] // CHECK:STDOUT: %.loc16_27.3: type = converted %float.make_type.loc16_27, %.loc16_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc16_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc16_16 +// CHECK:STDOUT: %param.loc16_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc16_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -172,15 +179,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Less(%a: f64, %b: f64) -> bool = "float.less"; +// CHECK:STDOUT: fn @Less(%a.param_patt: f64, %b.param_patt: f64) -> bool = "float.less"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: f64) -> f64 = "float.negate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: f64) -> f64 = "float.negate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ // CHECK:STDOUT: %Less.ref.loc9: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] @@ -245,9 +252,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc12_28: f64 = float_literal 1 [template = constants.%.6] // CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_28) [template = constants.%.11] // CHECK:STDOUT: %.loc12_34: f64 = float_literal 0 [template = constants.%.10] -// CHECK:STDOUT: %.loc12_20.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] -// CHECK:STDOUT: %.loc12_20.2: f64 = converted %float.negate.loc12, %.loc12_20.1 [template = constants.%.11] -// CHECK:STDOUT: %float.less.loc12: init bool = call %Less.ref.loc12(%.loc12_20.2, %.loc12_34) [template = constants.%.8] +// CHECK:STDOUT: %.loc12_27.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] +// CHECK:STDOUT: %.loc12_27.2: f64 = converted %float.negate.loc12, %.loc12_27.1 [template = constants.%.11] +// CHECK:STDOUT: %float.less.loc12: init bool = call %Less.ref.loc12(%.loc12_27.2, %.loc12_34) [template = constants.%.8] // CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %float.less.loc12 [template = constants.%.8] // CHECK:STDOUT: %.loc12_13.2: bool = converted %float.less.loc12, %.loc12_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 @@ -268,9 +275,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc13_34: f64 = float_literal 1 [template = constants.%.6] // CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_34) [template = constants.%.11] -// CHECK:STDOUT: %.loc13_21.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] -// CHECK:STDOUT: %.loc13_21.2: f64 = converted %float.negate.loc13, %.loc13_21.1 [template = constants.%.11] -// CHECK:STDOUT: %float.less.loc13: init bool = call %Less.ref.loc13(%.loc13_22, %.loc13_21.2) [template = constants.%.9] +// CHECK:STDOUT: %.loc13_33.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] +// CHECK:STDOUT: %.loc13_33.2: f64 = converted %float.negate.loc13, %.loc13_33.1 [template = constants.%.11] +// CHECK:STDOUT: %float.less.loc13: init bool = call %Less.ref.loc13(%.loc13_22, %.loc13_33.2) [template = constants.%.9] // CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %float.less.loc13 [template = constants.%.9] // CHECK:STDOUT: %.loc13_14.2: bool = converted %float.less.loc13, %.loc13_14.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 @@ -288,7 +295,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: f64, %b: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Less.ref: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/less_eq.carbon b/toolchain/check/testdata/builtins/float/less_eq.carbon index e4c15d972013..1a232e51bb0f 100644 --- a/toolchain/check/testdata/builtins/float/less_eq.carbon +++ b/toolchain/check/testdata/builtins/float/less_eq.carbon @@ -71,7 +71,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -88,73 +88,80 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %LessEq.decl: %LessEq.type = fn_decl @LessEq [template = constants.%LessEq] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc2_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_14: init type = call constants.%Float(%.loc2_14.1) [template = f64] // CHECK:STDOUT: %.loc2_14.2: type = value_of_initializer %float.make_type.loc2_14 [template = f64] // CHECK:STDOUT: %.loc2_14.3: type = converted %float.make_type.loc2_14, %.loc2_14.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc2_22.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_22: init type = call constants.%Float(%.loc2_22.1) [template = f64] // CHECK:STDOUT: %.loc2_22.2: type = value_of_initializer %float.make_type.loc2_22 [template = f64] // CHECK:STDOUT: %.loc2_22.3: type = converted %float.make_type.loc2_22, %.loc2_22.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_30.2: type = converted %bool.make_type, %.loc2_30.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_11: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc2_11 +// CHECK:STDOUT: %param.loc2_19: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc2_19 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%.loc3_14.1) [template = f64] // CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %float.make_type.loc3_14 [template = f64] // CHECK:STDOUT: %.loc3_14.3: type = converted %float.make_type.loc3_14, %.loc3_14.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc3_22.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_22: init type = call constants.%Float(%.loc3_22.1) [template = f64] // CHECK:STDOUT: %.loc3_22.2: type = value_of_initializer %float.make_type.loc3_22 [template = f64] // CHECK:STDOUT: %.loc3_22.3: type = converted %float.make_type.loc3_22, %.loc3_22.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc8_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc8_6 +// CHECK:STDOUT: %param.loc8_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc8_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc16_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%.loc16_19.1) [template = f64] // CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %float.make_type.loc16_19 [template = f64] // CHECK:STDOUT: %.loc16_19.3: type = converted %float.make_type.loc16_19, %.loc16_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc16_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%.loc16_27.1) [template = f64] // CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %float.make_type.loc16_27 [template = f64] // CHECK:STDOUT: %.loc16_27.3: type = converted %float.make_type.loc16_27, %.loc16_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc16_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc16_16 +// CHECK:STDOUT: %param.loc16_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc16_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -172,15 +179,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @LessEq(%a: f64, %b: f64) -> bool = "float.less_eq"; +// CHECK:STDOUT: fn @LessEq(%a.param_patt: f64, %b.param_patt: f64) -> bool = "float.less_eq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: f64) -> f64 = "float.negate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: f64) -> f64 = "float.negate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc9: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] @@ -245,9 +252,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc12_30: f64 = float_literal 1 [template = constants.%.6] // CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_30) [template = constants.%.11] // CHECK:STDOUT: %.loc12_36: f64 = float_literal 0 [template = constants.%.9] -// CHECK:STDOUT: %.loc12_22.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] -// CHECK:STDOUT: %.loc12_22.2: f64 = converted %float.negate.loc12, %.loc12_22.1 [template = constants.%.11] -// CHECK:STDOUT: %float.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_22.2, %.loc12_36) [template = constants.%.8] +// CHECK:STDOUT: %.loc12_29.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] +// CHECK:STDOUT: %.loc12_29.2: f64 = converted %float.negate.loc12, %.loc12_29.1 [template = constants.%.11] +// CHECK:STDOUT: %float.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_29.2, %.loc12_36) [template = constants.%.8] // CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %float.less_eq.loc12 [template = constants.%.8] // CHECK:STDOUT: %.loc12_13.2: bool = converted %float.less_eq.loc12, %.loc12_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 @@ -268,9 +275,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc13_36: f64 = float_literal 1 [template = constants.%.6] // CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_36) [template = constants.%.11] -// CHECK:STDOUT: %.loc13_23.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] -// CHECK:STDOUT: %.loc13_23.2: f64 = converted %float.negate.loc13, %.loc13_23.1 [template = constants.%.11] -// CHECK:STDOUT: %float.less_eq.loc13: init bool = call %LessEq.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.10] +// CHECK:STDOUT: %.loc13_35.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] +// CHECK:STDOUT: %.loc13_35.2: f64 = converted %float.negate.loc13, %.loc13_35.1 [template = constants.%.11] +// CHECK:STDOUT: %float.less_eq.loc13: init bool = call %LessEq.ref.loc13(%.loc13_24, %.loc13_35.2) [template = constants.%.10] // CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %float.less_eq.loc13 [template = constants.%.10] // CHECK:STDOUT: %.loc13_14.2: bool = converted %float.less_eq.loc13, %.loc13_14.1 [template = constants.%.10] // CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 @@ -288,7 +295,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: f64, %b: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %LessEq.ref: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index f4150b89a2c6..063fa314197c 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -77,19 +77,20 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Float.decl: %Float.type = fn_decl @Float [template = constants.%Float] { // CHECK:STDOUT: %size.patt: i32 = binding_pattern size +// CHECK:STDOUT: %size.param_patt: i32 = param_pattern %size.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_16.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_16.2: type = converted %int.make_type_32, %.loc4_16.1 [template = i32] -// CHECK:STDOUT: %size.param: i32 = param size, runtime_param0 -// CHECK:STDOUT: %size: i32 = bind_name size, %size.param // CHECK:STDOUT: %return: ref type = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %size: i32 = bind_name size, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: --- use_types.carbon // CHECK:STDOUT: @@ -106,7 +107,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+16, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+17, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude @@ -139,21 +140,22 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %f: ref f64 = bind_name f, %f.var // CHECK:STDOUT: %GetFloat.decl: %GetFloat.type = fn_decl @GetFloat [template = constants.%GetFloat] { // CHECK:STDOUT: %dyn_size.patt: i32 = binding_pattern dyn_size +// CHECK:STDOUT: %dyn_size.param_patt: i32 = param_pattern %dyn_size.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_23.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc8_23.2: type = converted %int.make_type_32, %.loc8_23.1 [template = i32] -// CHECK:STDOUT: %dyn_size.param: i32 = param dyn_size, runtime_param0 -// CHECK:STDOUT: %dyn_size: i32 = bind_name dyn_size, %dyn_size.param // CHECK:STDOUT: %return: ref type = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %dyn_size: i32 = bind_name dyn_size, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GetFloat(%dyn_size: i32) -> type { +// CHECK:STDOUT: fn @GetFloat(%dyn_size.param_patt: i32) -> type { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] // CHECK:STDOUT: %dyn_size.ref: i32 = name_ref dyn_size, %dyn_size @@ -183,7 +185,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+16, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+17, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude @@ -230,7 +232,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %dyn: ref = bind_name dyn, %dyn.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/mul.carbon b/toolchain/check/testdata/builtins/float/mul.carbon index 37320186d601..2f4c13a4aab9 100644 --- a/toolchain/check/testdata/builtins/float/mul.carbon +++ b/toolchain/check/testdata/builtins/float/mul.carbon @@ -78,7 +78,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -91,47 +91,51 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] // CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %float.make_type.loc2_11 [template = f64] // CHECK:STDOUT: %.loc2_11.3: type = converted %float.make_type.loc2_11, %.loc2_11.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc2_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%.loc2_19.1) [template = f64] // CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %float.make_type.loc2_19 [template = f64] // CHECK:STDOUT: %.loc2_19.3: type = converted %float.make_type.loc2_19, %.loc2_19.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc2_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_27: init type = call constants.%Float(%.loc2_27.1) [template = f64] // CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %float.make_type.loc2_27 [template = f64] // CHECK:STDOUT: %.loc2_27.3: type = converted %float.make_type.loc2_27, %.loc2_27.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc2_8: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc4_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%.loc4_19.1) [template = f64] // CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %float.make_type.loc4_19 [template = f64] // CHECK:STDOUT: %.loc4_19.3: type = converted %float.make_type.loc4_19, %.loc4_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc4_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%.loc4_27.1) [template = f64] // CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %float.make_type.loc4_27 [template = f64] // CHECK:STDOUT: %.loc4_27.3: type = converted %float.make_type.loc4_27, %.loc4_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc4_35.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%.loc4_35.1) [template = f64] // CHECK:STDOUT: %.loc4_35.2: type = value_of_initializer %float.make_type.loc4_35 [template = f64] // CHECK:STDOUT: %.loc4_35.3: type = converted %float.make_type.loc4_35, %.loc4_35.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc4_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc4_16 +// CHECK:STDOUT: %param.loc4_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc4_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_8.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc8_8.1) [template = f64] @@ -141,11 +145,11 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %x: ref f64 = bind_name x, %x.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a: f64, %b: f64) -> f64 = "float.mul"; +// CHECK:STDOUT: fn @Mul(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.mul"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: f64, %b: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -204,7 +208,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -222,171 +226,185 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] // CHECK:STDOUT: %.loc8_14.2: type = value_of_initializer %float.make_type.loc8_14 [template = f64] // CHECK:STDOUT: %.loc8_14.3: type = converted %float.make_type.loc8_14, %.loc8_14.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc8_22.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_22: init type = call constants.%Float(%.loc8_22.1) [template = f64] // CHECK:STDOUT: %.loc8_22.2: type = value_of_initializer %float.make_type.loc8_22 [template = f64] // CHECK:STDOUT: %.loc8_22.3: type = converted %float.make_type.loc8_22, %.loc8_22.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: f64 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc13_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%.loc13_15.1) [template = f64] // CHECK:STDOUT: %.loc13_15.2: type = value_of_initializer %float.make_type.loc13_15 [template = f64] // CHECK:STDOUT: %.loc13_15.3: type = converted %float.make_type.loc13_15, %.loc13_15.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc13_23.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%.loc13_23.1) [template = f64] // CHECK:STDOUT: %.loc13_23.2: type = value_of_initializer %float.make_type.loc13_23 [template = f64] // CHECK:STDOUT: %.loc13_23.3: type = converted %float.make_type.loc13_23, %.loc13_23.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc13_31.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%.loc13_31.1) [template = f64] // CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %float.make_type.loc13_31 [template = f64] // CHECK:STDOUT: %.loc13_31.3: type = converted %float.make_type.loc13_31, %.loc13_31.2 [template = f64] -// CHECK:STDOUT: %c.param: f64 = param c, runtime_param2 -// CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %.loc13_39.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_39: init type = call constants.%Float(%.loc13_39.1) [template = f64] // CHECK:STDOUT: %.loc13_39.2: type = value_of_initializer %float.make_type.loc13_39 [template = f64] // CHECK:STDOUT: %.loc13_39.3: type = converted %float.make_type.loc13_39, %.loc13_39.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc13_12: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc13_12 +// CHECK:STDOUT: %param.loc13_20: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc13_20 +// CHECK:STDOUT: %param.loc13_28: f64 = param runtime_param2 +// CHECK:STDOUT: %c: f64 = bind_name c, %param.loc13_28 // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc17_21.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%.loc17_21.1) [template = f64] // CHECK:STDOUT: %.loc17_21.2: type = value_of_initializer %float.make_type.loc17_21 [template = f64] // CHECK:STDOUT: %.loc17_21.3: type = converted %float.make_type.loc17_21, %.loc17_21.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc17_29.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%.loc17_29.1) [template = f64] // CHECK:STDOUT: %.loc17_29.2: type = value_of_initializer %float.make_type.loc17_29 [template = f64] // CHECK:STDOUT: %.loc17_29.3: type = converted %float.make_type.loc17_29, %.loc17_29.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc17_18: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc17_18 +// CHECK:STDOUT: %param.loc17_26: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc17_26 // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc18_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%.loc18_17.1) [template = f64] // CHECK:STDOUT: %.loc18_17.2: type = value_of_initializer %float.make_type.loc18_17 [template = f64] // CHECK:STDOUT: %.loc18_17.3: type = converted %float.make_type.loc18_17, %.loc18_17.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc18_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%.loc18_25.1) [template = f64] // CHECK:STDOUT: %.loc18_25.2: type = value_of_initializer %float.make_type.loc18_25 [template = f64] // CHECK:STDOUT: %.loc18_25.3: type = converted %float.make_type.loc18_25, %.loc18_25.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc18_33.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%.loc18_33.1) [template = f64] // CHECK:STDOUT: %.loc18_33.2: type = value_of_initializer %float.make_type.loc18_33 [template = f64] // CHECK:STDOUT: %.loc18_33.3: type = converted %float.make_type.loc18_33, %.loc18_33.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc18_14: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc18_14 +// CHECK:STDOUT: %param.loc18_22: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc18_22 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc20_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%.loc20_25.1) [template = f64] // CHECK:STDOUT: %.loc20_25.2: type = value_of_initializer %float.make_type.loc20_25 [template = f64] // CHECK:STDOUT: %.loc20_25.3: type = converted %float.make_type.loc20_25, %.loc20_25.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc20_33.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%.loc20_33.1) [template = f64] // CHECK:STDOUT: %.loc20_33.2: type = value_of_initializer %float.make_type.loc20_33 [template = f64] // CHECK:STDOUT: %.loc20_33.3: type = converted %float.make_type.loc20_33, %.loc20_33.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: f64 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc24_26.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%.loc24_26.1) [template = f64] // CHECK:STDOUT: %.loc24_26.2: type = value_of_initializer %float.make_type.loc24_26 [template = f64] // CHECK:STDOUT: %.loc24_26.3: type = converted %float.make_type.loc24_26, %.loc24_26.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc24_34.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%.loc24_34.1) [template = f64] // CHECK:STDOUT: %.loc24_34.2: type = value_of_initializer %float.make_type.loc24_34 [template = f64] // CHECK:STDOUT: %.loc24_34.3: type = converted %float.make_type.loc24_34, %.loc24_34.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc24_42.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%.loc24_42.1) [template = f64] // CHECK:STDOUT: %.loc24_42.2: type = value_of_initializer %float.make_type.loc24_42 [template = f64] // CHECK:STDOUT: %.loc24_42.3: type = converted %float.make_type.loc24_42, %.loc24_42.2 [template = f64] -// CHECK:STDOUT: %c.param: f64 = param c, runtime_param2 -// CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %.loc24_50.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%.loc24_50.1) [template = f64] // CHECK:STDOUT: %.loc24_50.2: type = value_of_initializer %float.make_type.loc24_50 [template = f64] // CHECK:STDOUT: %.loc24_50.3: type = converted %float.make_type.loc24_50, %.loc24_50.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc24_23: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc24_23 +// CHECK:STDOUT: %param.loc24_31: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc24_31 +// CHECK:STDOUT: %param.loc24_39: f64 = param runtime_param2 +// CHECK:STDOUT: %c: f64 = bind_name c, %param.loc24_39 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc28_32.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%.loc28_32.1) [template = f64] // CHECK:STDOUT: %.loc28_32.2: type = value_of_initializer %float.make_type.loc28_32 [template = f64] // CHECK:STDOUT: %.loc28_32.3: type = converted %float.make_type.loc28_32, %.loc28_32.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc28_40.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%.loc28_40.1) [template = f64] // CHECK:STDOUT: %.loc28_40.2: type = value_of_initializer %float.make_type.loc28_40 [template = f64] // CHECK:STDOUT: %.loc28_40.3: type = converted %float.make_type.loc28_40, %.loc28_40.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc28_29: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc28_29 +// CHECK:STDOUT: %param.loc28_37: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc28_37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew(%a: f64) -> f64; +// CHECK:STDOUT: fn @TooFew(%a.param_patt: f64) -> f64; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a: f64, %b: f64, %c: f64) -> f64; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a: f64, %b: f64) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a: f64, %b: f64) -> f64 = "float.mul"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.mul"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -396,7 +414,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc21_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a: f64, %b: f64, %c: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -408,7 +426,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc25_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a: f64, %b: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/negate.carbon b/toolchain/check/testdata/builtins/float/negate.carbon index 16efd8fa0dc5..1c7620780fc6 100644 --- a/toolchain/check/testdata/builtins/float/negate.carbon +++ b/toolchain/check/testdata/builtins/float/negate.carbon @@ -98,7 +98,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -111,40 +111,43 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc2_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_14: init type = call constants.%Float(%.loc2_14.1) [template = f64] // CHECK:STDOUT: %.loc2_14.2: type = value_of_initializer %float.make_type.loc2_14 [template = f64] // CHECK:STDOUT: %.loc2_14.3: type = converted %float.make_type.loc2_14, %.loc2_14.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc2_22.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_22: init type = call constants.%Float(%.loc2_22.1) [template = f64] // CHECK:STDOUT: %.loc2_22.2: type = value_of_initializer %float.make_type.loc2_22 [template = f64] // CHECK:STDOUT: %.loc2_22.3: type = converted %float.make_type.loc2_22, %.loc2_22.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc4_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%.loc4_19.1) [template = f64] // CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %float.make_type.loc4_19 [template = f64] // CHECK:STDOUT: %.loc4_19.3: type = converted %float.make_type.loc4_19, %.loc4_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc4_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%.loc4_27.1) [template = f64] // CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %float.make_type.loc4_27 [template = f64] // CHECK:STDOUT: %.loc4_27.3: type = converted %float.make_type.loc4_27, %.loc4_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc4_35.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%.loc4_35.1) [template = f64] // CHECK:STDOUT: %.loc4_35.2: type = value_of_initializer %float.make_type.loc4_35 [template = f64] // CHECK:STDOUT: %.loc4_35.3: type = converted %float.make_type.loc4_35, %.loc4_35.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc4_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc4_16 +// CHECK:STDOUT: %param.loc4_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc4_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_8.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc8_8.1) [template = f64] @@ -152,11 +155,11 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type, %.loc8_8.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: f64) -> f64 = "float.negate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: f64) -> f64 = "float.negate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: f64, %b: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -215,7 +218,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -240,142 +243,152 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc13_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%.loc13_15.1) [template = f64] // CHECK:STDOUT: %.loc13_15.2: type = value_of_initializer %float.make_type.loc13_15 [template = f64] // CHECK:STDOUT: %.loc13_15.3: type = converted %float.make_type.loc13_15, %.loc13_15.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc13_23.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%.loc13_23.1) [template = f64] // CHECK:STDOUT: %.loc13_23.2: type = value_of_initializer %float.make_type.loc13_23 [template = f64] // CHECK:STDOUT: %.loc13_23.3: type = converted %float.make_type.loc13_23, %.loc13_23.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc13_31.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%.loc13_31.1) [template = f64] // CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %float.make_type.loc13_31 [template = f64] // CHECK:STDOUT: %.loc13_31.3: type = converted %float.make_type.loc13_31, %.loc13_31.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc13_12: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc13_12 +// CHECK:STDOUT: %param.loc13_20: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc13_20 // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc18_21.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc18_21.1) [template = f64] // CHECK:STDOUT: %.loc18_21.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc18_21.3: type = converted %float.make_type, %.loc18_21.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc19_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc19_17: init type = call constants.%Float(%.loc19_17.1) [template = f64] // CHECK:STDOUT: %.loc19_17.2: type = value_of_initializer %float.make_type.loc19_17 [template = f64] // CHECK:STDOUT: %.loc19_17.3: type = converted %float.make_type.loc19_17, %.loc19_17.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc19_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc19_25: init type = call constants.%Float(%.loc19_25.1) [template = f64] // CHECK:STDOUT: %.loc19_25.2: type = value_of_initializer %float.make_type.loc19_25 [template = f64] // CHECK:STDOUT: %.loc19_25.3: type = converted %float.make_type.loc19_25, %.loc19_25.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc21_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc21_25: init type = call constants.%Float(%.loc21_25.1) [template = f64] // CHECK:STDOUT: %.loc21_25.2: type = value_of_initializer %float.make_type.loc21_25 [template = f64] // CHECK:STDOUT: %.loc21_25.3: type = converted %float.make_type.loc21_25, %.loc21_25.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc21_33.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc21_33: init type = call constants.%Float(%.loc21_33.1) [template = f64] // CHECK:STDOUT: %.loc21_33.2: type = value_of_initializer %float.make_type.loc21_33 [template = f64] // CHECK:STDOUT: %.loc21_33.3: type = converted %float.make_type.loc21_33, %.loc21_33.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: f64 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc32_26.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc32_26: init type = call constants.%Float(%.loc32_26.1) [template = f64] // CHECK:STDOUT: %.loc32_26.2: type = value_of_initializer %float.make_type.loc32_26 [template = f64] // CHECK:STDOUT: %.loc32_26.3: type = converted %float.make_type.loc32_26, %.loc32_26.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc32_34.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc32_34: init type = call constants.%Float(%.loc32_34.1) [template = f64] // CHECK:STDOUT: %.loc32_34.2: type = value_of_initializer %float.make_type.loc32_34 [template = f64] // CHECK:STDOUT: %.loc32_34.3: type = converted %float.make_type.loc32_34, %.loc32_34.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc32_42.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc32_42: init type = call constants.%Float(%.loc32_42.1) [template = f64] // CHECK:STDOUT: %.loc32_42.2: type = value_of_initializer %float.make_type.loc32_42 [template = f64] // CHECK:STDOUT: %.loc32_42.3: type = converted %float.make_type.loc32_42, %.loc32_42.2 [template = f64] -// CHECK:STDOUT: %c.param: f64 = param c, runtime_param2 -// CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %.loc32_50.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc32_50: init type = call constants.%Float(%.loc32_50.1) [template = f64] // CHECK:STDOUT: %.loc32_50.2: type = value_of_initializer %float.make_type.loc32_50 [template = f64] // CHECK:STDOUT: %.loc32_50.3: type = converted %float.make_type.loc32_50, %.loc32_50.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc32_23: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc32_23 +// CHECK:STDOUT: %param.loc32_31: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc32_31 +// CHECK:STDOUT: %param.loc32_39: f64 = param runtime_param2 +// CHECK:STDOUT: %c: f64 = bind_name c, %param.loc32_39 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc43_32.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc43_32: init type = call constants.%Float(%.loc43_32.1) [template = f64] // CHECK:STDOUT: %.loc43_32.2: type = value_of_initializer %float.make_type.loc43_32 [template = f64] // CHECK:STDOUT: %.loc43_32.3: type = converted %float.make_type.loc43_32, %.loc43_32.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc43_40.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc43_40: init type = call constants.%Float(%.loc43_40.1) [template = f64] // CHECK:STDOUT: %.loc43_40.2: type = value_of_initializer %float.make_type.loc43_40 [template = f64] // CHECK:STDOUT: %.loc43_40.3: type = converted %float.make_type.loc43_40, %.loc43_40.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc43_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc43_48.2: type = converted %bool.make_type, %.loc43_48.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc43_29: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc43_29 +// CHECK:STDOUT: %param.loc43_37: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc43_37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @TooFew() -> f64; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a: f64, %b: f64) -> f64; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: f64, %b.param_patt: f64) -> f64; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a: f64) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: f64) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a: f64) -> f64 = "float.negate"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: f64) -> f64 = "float.negate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a: f64, %b: f64, %c: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -384,7 +397,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a: f64, %b: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/neq.carbon b/toolchain/check/testdata/builtins/float/neq.carbon index 1193e4cfd883..a08fc2fd5c00 100644 --- a/toolchain/check/testdata/builtins/float/neq.carbon +++ b/toolchain/check/testdata/builtins/float/neq.carbon @@ -72,7 +72,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -88,58 +88,64 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Neq.decl: %Neq.type = fn_decl @Neq [template = constants.%Neq] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] // CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %float.make_type.loc2_11 [template = f64] // CHECK:STDOUT: %.loc2_11.3: type = converted %float.make_type.loc2_11, %.loc2_11.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc2_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%.loc2_19.1) [template = f64] // CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %float.make_type.loc2_19 [template = f64] // CHECK:STDOUT: %.loc2_19.3: type = converted %float.make_type.loc2_19, %.loc2_19.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_27.2: type = converted %bool.make_type, %.loc2_27.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_8: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc7_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc7_6 +// CHECK:STDOUT: %param.loc7_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc7_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc12_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc12_19: init type = call constants.%Float(%.loc12_19.1) [template = f64] // CHECK:STDOUT: %.loc12_19.2: type = value_of_initializer %float.make_type.loc12_19 [template = f64] // CHECK:STDOUT: %.loc12_19.3: type = converted %float.make_type.loc12_19, %.loc12_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc12_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc12_27: init type = call constants.%Float(%.loc12_27.1) [template = f64] // CHECK:STDOUT: %.loc12_27.2: type = value_of_initializer %float.make_type.loc12_27 [template = f64] // CHECK:STDOUT: %.loc12_27.3: type = converted %float.make_type.loc12_27, %.loc12_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc12_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc12_16 +// CHECK:STDOUT: %param.loc12_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc12_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -157,13 +163,13 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Neq(%a: f64, %b: f64) -> bool = "float.neq"; +// CHECK:STDOUT: fn @Neq(%a.param_patt: f64, %b.param_patt: f64) -> bool = "float.neq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ // CHECK:STDOUT: %Neq.ref.loc8: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] @@ -206,7 +212,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: f64, %b: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Neq.ref: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -240,7 +246,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -251,29 +257,31 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %WrongResult.decl: %WrongResult.type = fn_decl @WrongResult [template = constants.%WrongResult] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc7_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%.loc7_19.1) [template = f64] // CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %float.make_type.loc7_19 [template = f64] // CHECK:STDOUT: %.loc7_19.3: type = converted %float.make_type.loc7_19, %.loc7_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc7_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc7_27: init type = call constants.%Float(%.loc7_27.1) [template = f64] // CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %float.make_type.loc7_27 [template = f64] // CHECK:STDOUT: %.loc7_27.3: type = converted %float.make_type.loc7_27, %.loc7_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc7_35.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc7_35: init type = call constants.%Float(%.loc7_35.1) [template = f64] // CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %float.make_type.loc7_35 [template = f64] // CHECK:STDOUT: %.loc7_35.3: type = converted %float.make_type.loc7_35, %.loc7_35.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc7_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @WrongResult(%a: f64, %b: f64) -> f64; +// CHECK:STDOUT: fn @WrongResult(%a.param_patt: f64, %b.param_patt: f64) -> f64; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/sub.carbon b/toolchain/check/testdata/builtins/float/sub.carbon index 2a77014b3c3e..3c63d74de737 100644 --- a/toolchain/check/testdata/builtins/float/sub.carbon +++ b/toolchain/check/testdata/builtins/float/sub.carbon @@ -78,7 +78,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -91,47 +91,51 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] // CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %float.make_type.loc2_11 [template = f64] // CHECK:STDOUT: %.loc2_11.3: type = converted %float.make_type.loc2_11, %.loc2_11.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc2_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%.loc2_19.1) [template = f64] // CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %float.make_type.loc2_19 [template = f64] // CHECK:STDOUT: %.loc2_19.3: type = converted %float.make_type.loc2_19, %.loc2_19.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc2_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_27: init type = call constants.%Float(%.loc2_27.1) [template = f64] // CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %float.make_type.loc2_27 [template = f64] // CHECK:STDOUT: %.loc2_27.3: type = converted %float.make_type.loc2_27, %.loc2_27.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc2_8: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc4_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%.loc4_19.1) [template = f64] // CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %float.make_type.loc4_19 [template = f64] // CHECK:STDOUT: %.loc4_19.3: type = converted %float.make_type.loc4_19, %.loc4_19.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc4_27.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%.loc4_27.1) [template = f64] // CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %float.make_type.loc4_27 [template = f64] // CHECK:STDOUT: %.loc4_27.3: type = converted %float.make_type.loc4_27, %.loc4_27.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc4_35.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%.loc4_35.1) [template = f64] // CHECK:STDOUT: %.loc4_35.2: type = value_of_initializer %float.make_type.loc4_35 [template = f64] // CHECK:STDOUT: %.loc4_35.3: type = converted %float.make_type.loc4_35, %.loc4_35.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc4_16: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc4_16 +// CHECK:STDOUT: %param.loc4_24: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc4_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_8.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc8_8.1) [template = f64] @@ -141,11 +145,11 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %x: ref f64 = bind_name x, %x.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a: f64, %b: f64) -> f64 = "float.sub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.sub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: f64, %b: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -204,7 +208,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -222,171 +226,185 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] // CHECK:STDOUT: %.loc8_14.2: type = value_of_initializer %float.make_type.loc8_14 [template = f64] // CHECK:STDOUT: %.loc8_14.3: type = converted %float.make_type.loc8_14, %.loc8_14.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc8_22.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_22: init type = call constants.%Float(%.loc8_22.1) [template = f64] // CHECK:STDOUT: %.loc8_22.2: type = value_of_initializer %float.make_type.loc8_22 [template = f64] // CHECK:STDOUT: %.loc8_22.3: type = converted %float.make_type.loc8_22, %.loc8_22.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: f64 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc13_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%.loc13_15.1) [template = f64] // CHECK:STDOUT: %.loc13_15.2: type = value_of_initializer %float.make_type.loc13_15 [template = f64] // CHECK:STDOUT: %.loc13_15.3: type = converted %float.make_type.loc13_15, %.loc13_15.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc13_23.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%.loc13_23.1) [template = f64] // CHECK:STDOUT: %.loc13_23.2: type = value_of_initializer %float.make_type.loc13_23 [template = f64] // CHECK:STDOUT: %.loc13_23.3: type = converted %float.make_type.loc13_23, %.loc13_23.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc13_31.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%.loc13_31.1) [template = f64] // CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %float.make_type.loc13_31 [template = f64] // CHECK:STDOUT: %.loc13_31.3: type = converted %float.make_type.loc13_31, %.loc13_31.2 [template = f64] -// CHECK:STDOUT: %c.param: f64 = param c, runtime_param2 -// CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %.loc13_39.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_39: init type = call constants.%Float(%.loc13_39.1) [template = f64] // CHECK:STDOUT: %.loc13_39.2: type = value_of_initializer %float.make_type.loc13_39 [template = f64] // CHECK:STDOUT: %.loc13_39.3: type = converted %float.make_type.loc13_39, %.loc13_39.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc13_12: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc13_12 +// CHECK:STDOUT: %param.loc13_20: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc13_20 +// CHECK:STDOUT: %param.loc13_28: f64 = param runtime_param2 +// CHECK:STDOUT: %c: f64 = bind_name c, %param.loc13_28 // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc17_21.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%.loc17_21.1) [template = f64] // CHECK:STDOUT: %.loc17_21.2: type = value_of_initializer %float.make_type.loc17_21 [template = f64] // CHECK:STDOUT: %.loc17_21.3: type = converted %float.make_type.loc17_21, %.loc17_21.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc17_29.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%.loc17_29.1) [template = f64] // CHECK:STDOUT: %.loc17_29.2: type = value_of_initializer %float.make_type.loc17_29 [template = f64] // CHECK:STDOUT: %.loc17_29.3: type = converted %float.make_type.loc17_29, %.loc17_29.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc17_18: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc17_18 +// CHECK:STDOUT: %param.loc17_26: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc17_26 // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc18_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%.loc18_17.1) [template = f64] // CHECK:STDOUT: %.loc18_17.2: type = value_of_initializer %float.make_type.loc18_17 [template = f64] // CHECK:STDOUT: %.loc18_17.3: type = converted %float.make_type.loc18_17, %.loc18_17.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc18_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%.loc18_25.1) [template = f64] // CHECK:STDOUT: %.loc18_25.2: type = value_of_initializer %float.make_type.loc18_25 [template = f64] // CHECK:STDOUT: %.loc18_25.3: type = converted %float.make_type.loc18_25, %.loc18_25.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc18_33.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%.loc18_33.1) [template = f64] // CHECK:STDOUT: %.loc18_33.2: type = value_of_initializer %float.make_type.loc18_33 [template = f64] // CHECK:STDOUT: %.loc18_33.3: type = converted %float.make_type.loc18_33, %.loc18_33.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc18_14: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc18_14 +// CHECK:STDOUT: %param.loc18_22: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc18_22 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc20_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%.loc20_25.1) [template = f64] // CHECK:STDOUT: %.loc20_25.2: type = value_of_initializer %float.make_type.loc20_25 [template = f64] // CHECK:STDOUT: %.loc20_25.3: type = converted %float.make_type.loc20_25, %.loc20_25.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc20_33.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%.loc20_33.1) [template = f64] // CHECK:STDOUT: %.loc20_33.2: type = value_of_initializer %float.make_type.loc20_33 [template = f64] // CHECK:STDOUT: %.loc20_33.3: type = converted %float.make_type.loc20_33, %.loc20_33.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: f64 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: f64 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc24_26.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%.loc24_26.1) [template = f64] // CHECK:STDOUT: %.loc24_26.2: type = value_of_initializer %float.make_type.loc24_26 [template = f64] // CHECK:STDOUT: %.loc24_26.3: type = converted %float.make_type.loc24_26, %.loc24_26.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc24_34.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%.loc24_34.1) [template = f64] // CHECK:STDOUT: %.loc24_34.2: type = value_of_initializer %float.make_type.loc24_34 [template = f64] // CHECK:STDOUT: %.loc24_34.3: type = converted %float.make_type.loc24_34, %.loc24_34.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %.loc24_42.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%.loc24_42.1) [template = f64] // CHECK:STDOUT: %.loc24_42.2: type = value_of_initializer %float.make_type.loc24_42 [template = f64] // CHECK:STDOUT: %.loc24_42.3: type = converted %float.make_type.loc24_42, %.loc24_42.2 [template = f64] -// CHECK:STDOUT: %c.param: f64 = param c, runtime_param2 -// CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %.loc24_50.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%.loc24_50.1) [template = f64] // CHECK:STDOUT: %.loc24_50.2: type = value_of_initializer %float.make_type.loc24_50 [template = f64] // CHECK:STDOUT: %.loc24_50.3: type = converted %float.make_type.loc24_50, %.loc24_50.2 [template = f64] // CHECK:STDOUT: %return: ref f64 = var +// CHECK:STDOUT: %param.loc24_23: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc24_23 +// CHECK:STDOUT: %param.loc24_31: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc24_31 +// CHECK:STDOUT: %param.loc24_39: f64 = param runtime_param2 +// CHECK:STDOUT: %c: f64 = bind_name c, %param.loc24_39 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: f64 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc28_32.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%.loc28_32.1) [template = f64] // CHECK:STDOUT: %.loc28_32.2: type = value_of_initializer %float.make_type.loc28_32 [template = f64] // CHECK:STDOUT: %.loc28_32.3: type = converted %float.make_type.loc28_32, %.loc28_32.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %.loc28_40.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%.loc28_40.1) [template = f64] // CHECK:STDOUT: %.loc28_40.2: type = value_of_initializer %float.make_type.loc28_40 [template = f64] // CHECK:STDOUT: %.loc28_40.3: type = converted %float.make_type.loc28_40, %.loc28_40.2 [template = f64] -// CHECK:STDOUT: %b.param: f64 = param b, runtime_param1 -// CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc28_29: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param.loc28_29 +// CHECK:STDOUT: %param.loc28_37: f64 = param runtime_param1 +// CHECK:STDOUT: %b: f64 = bind_name b, %param.loc28_37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew(%a: f64) -> f64; +// CHECK:STDOUT: fn @TooFew(%a.param_patt: f64) -> f64; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a: f64, %b: f64, %c: f64) -> f64; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a: f64, %b: f64) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a: f64, %b: f64) -> f64 = "float.sub"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.sub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -396,7 +414,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc21_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a: f64, %b: f64, %c: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -408,7 +426,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc25_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a: f64, %b: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index 0b61d78b68c0..2c5e1b2c89b0 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -62,22 +62,24 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %And.ref: %And.type = name_ref And, %And.decl [template = constants.%And] @@ -97,30 +99,32 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @And(%a: i32, %b: i32) -> i32 = "int.and"; +// CHECK:STDOUT: fn @And(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.and"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %And.ref: %And.type = name_ref And, file.%And.decl [template = constants.%And] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index c947e6fb4730..ae43759bb19a 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -67,35 +67,38 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Complement.decl: %Complement.type = fn_decl @Complement [template = constants.%Complement] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] // CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_32.loc2_18, %.loc2_18.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %int.make_type_32.loc2_26 [template = i32] // CHECK:STDOUT: %.loc2_26.2: type = converted %int.make_type_32.loc2_26, %.loc2_26.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc3_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_11.1: type = value_of_initializer %int.make_type_32.loc3_11 [template = i32] // CHECK:STDOUT: %.loc3_11.2: type = converted %int.make_type_32.loc3_11, %.loc3_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc3_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_19.1: type = value_of_initializer %int.make_type_32.loc3_19 [template = i32] // CHECK:STDOUT: %.loc3_19.2: type = converted %int.make_type_32.loc3_19, %.loc3_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc3_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_27.1: type = value_of_initializer %int.make_type_32.loc3_27 [template = i32] // CHECK:STDOUT: %.loc3_27.2: type = converted %int.make_type_32.loc3_27, %.loc3_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc3_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc3_8 +// CHECK:STDOUT: %param.loc3_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc3_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %And.ref: %And.type = name_ref And, %And.decl [template = constants.%And] @@ -103,9 +106,9 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %.loc5_31: i32 = int_literal 1193046 [template = constants.%.2] // CHECK:STDOUT: %int.complement: init i32 = call %Complement.ref(%.loc5_31) [template = constants.%.3] // CHECK:STDOUT: %.loc5_42: i32 = int_literal 16777215 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_19.1: i32 = value_of_initializer %int.complement [template = constants.%.3] -// CHECK:STDOUT: %.loc5_19.2: i32 = converted %int.complement, %.loc5_19.1 [template = constants.%.3] -// CHECK:STDOUT: %int.and: init i32 = call %And.ref(%.loc5_19.2, %.loc5_42) [template = constants.%.5] +// CHECK:STDOUT: %.loc5_30.1: i32 = value_of_initializer %int.complement [template = constants.%.3] +// CHECK:STDOUT: %.loc5_30.2: i32 = converted %int.complement, %.loc5_30.1 [template = constants.%.3] +// CHECK:STDOUT: %int.and: init i32 = call %And.ref(%.loc5_30.2, %.loc5_42) [template = constants.%.5] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5, %.loc5_11.1 [template = i32] // CHECK:STDOUT: %.loc5_51: type = array_type %int.and, i32 [template = constants.%.6] @@ -119,26 +122,27 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %.loc6_27: type = ptr_type %.6 [template = constants.%.7] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc8_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_32.loc8_19 [template = i32] // CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_32.loc8_19, %.loc8_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc8_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_27.1: type = value_of_initializer %int.make_type_32.loc8_27 [template = i32] // CHECK:STDOUT: %.loc8_27.2: type = converted %int.make_type_32.loc8_27, %.loc8_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Complement(%a: i32) -> i32 = "int.complement"; +// CHECK:STDOUT: fn @Complement(%a.param_patt: i32) -> i32 = "int.complement"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @And(%a: i32, %b: i32) -> i32 = "int.and"; +// CHECK:STDOUT: fn @And(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.and"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Complement.ref: %Complement.type = name_ref Complement, file.%Complement.decl [template = constants.%Complement] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index 2ebabde5e849..1026ddc6e112 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -87,54 +87,60 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Eq.decl: %Eq.type = fn_decl @Eq [template = constants.%Eq] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %int.make_type_32.loc2_10 [template = i32] // CHECK:STDOUT: %.loc2_10.2: type = converted %int.make_type_32.loc2_10, %.loc2_10.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] // CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_32.loc2_18, %.loc2_18.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_26.2: type = converted %bool.make_type, %.loc2_26.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_7: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_7 +// CHECK:STDOUT: %param.loc2_15: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_15 // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc7_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc7_6 +// CHECK:STDOUT: %param.loc7_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc7_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc12_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_32.loc12_19 [template = i32] // CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_32.loc12_19, %.loc12_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc12_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_27.1: type = value_of_initializer %int.make_type_32.loc12_27 [template = i32] // CHECK:STDOUT: %.loc12_27.2: type = converted %int.make_type_32.loc12_27, %.loc12_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc12_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc12_16 +// CHECK:STDOUT: %param.loc12_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc12_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -156,9 +162,9 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Eq(%a: i32, %b: i32) -> bool = "int.eq"; +// CHECK:STDOUT: fn @Eq(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.eq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ // CHECK:STDOUT: %Eq.ref.loc8: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] @@ -201,7 +207,7 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Eq.ref: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -245,26 +251,28 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %WrongResult.decl: %WrongResult.type = fn_decl @WrongResult [template = constants.%WrongResult] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @WrongResult(%a: i32, %b: i32) -> i32; +// CHECK:STDOUT: fn @WrongResult(%a.param_patt: i32, %b.param_patt: i32) -> i32; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index 841e35038b8d..c4dd40759642 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -87,67 +87,74 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Greater.decl: %Greater.type = fn_decl @Greater [template = constants.%Greater] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_15.1: type = value_of_initializer %int.make_type_32.loc2_15 [template = i32] // CHECK:STDOUT: %.loc2_15.2: type = converted %int.make_type_32.loc2_15, %.loc2_15.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_23.1: type = value_of_initializer %int.make_type_32.loc2_23 [template = i32] // CHECK:STDOUT: %.loc2_23.2: type = converted %int.make_type_32.loc2_23, %.loc2_23.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_31.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_31.2: type = converted %bool.make_type, %.loc2_31.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_12: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_12 +// CHECK:STDOUT: %param.loc2_20: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_20 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] // CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_32.loc3_14, %.loc3_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc3_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_32.loc3_22 [template = i32] // CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_32.loc3_22, %.loc3_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc8_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc8_6 +// CHECK:STDOUT: %param.loc8_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc8_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] // CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32.loc16_19, %.loc16_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc16_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_32.loc16_27 [template = i32] // CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_32.loc16_27, %.loc16_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc16_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc16_16 +// CHECK:STDOUT: %param.loc16_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc16_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -169,11 +176,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Greater(%a: i32, %b: i32) -> bool = "int.greater"; +// CHECK:STDOUT: fn @Greater(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.greater"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc9: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] @@ -238,9 +245,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_32: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_32) [template = constants.%.10] // CHECK:STDOUT: %.loc12_36: i32 = int_literal 0 [template = constants.%.8] -// CHECK:STDOUT: %.loc12_24.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] -// CHECK:STDOUT: %.loc12_24.2: i32 = converted %int.snegate.loc12, %.loc12_24.1 [template = constants.%.10] -// CHECK:STDOUT: %int.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_24.2, %.loc12_36) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_31.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] +// CHECK:STDOUT: %.loc12_31.2: i32 = converted %int.snegate.loc12, %.loc12_31.1 [template = constants.%.10] +// CHECK:STDOUT: %int.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_31.2, %.loc12_36) [template = constants.%.7] // CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater.loc12 [template = constants.%.7] // CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater.loc12, %.loc12_14.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 @@ -261,9 +268,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc13_34: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_34) [template = constants.%.10] -// CHECK:STDOUT: %.loc13_23.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] -// CHECK:STDOUT: %.loc13_23.2: i32 = converted %int.snegate.loc13, %.loc13_23.1 [template = constants.%.10] -// CHECK:STDOUT: %int.greater.loc13: init bool = call %Greater.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.9] +// CHECK:STDOUT: %.loc13_33.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] +// CHECK:STDOUT: %.loc13_33.2: i32 = converted %int.snegate.loc13, %.loc13_33.1 [template = constants.%.10] +// CHECK:STDOUT: %int.greater.loc13: init bool = call %Greater.ref.loc13(%.loc13_24, %.loc13_33.2) [template = constants.%.9] // CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %int.greater.loc13 [template = constants.%.9] // CHECK:STDOUT: %.loc13_13.2: bool = converted %int.greater.loc13, %.loc13_13.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 @@ -281,7 +288,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Greater.ref: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index f041eb1f3c86..eba7c7a11912 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -87,67 +87,74 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %GreaterEq.decl: %GreaterEq.type = fn_decl @GreaterEq [template = constants.%GreaterEq] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %int.make_type_32.loc2_17 [template = i32] // CHECK:STDOUT: %.loc2_17.2: type = converted %int.make_type_32.loc2_17, %.loc2_17.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_25.1: type = value_of_initializer %int.make_type_32.loc2_25 [template = i32] // CHECK:STDOUT: %.loc2_25.2: type = converted %int.make_type_32.loc2_25, %.loc2_25.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_33.2: type = converted %bool.make_type, %.loc2_33.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_14: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_14 +// CHECK:STDOUT: %param.loc2_22: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_22 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] // CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_32.loc3_14, %.loc3_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc3_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_32.loc3_22 [template = i32] // CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_32.loc3_22, %.loc3_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc8_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc8_6 +// CHECK:STDOUT: %param.loc8_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc8_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] // CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32.loc16_19, %.loc16_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc16_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_32.loc16_27 [template = i32] // CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_32.loc16_27, %.loc16_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc16_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc16_16 +// CHECK:STDOUT: %param.loc16_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc16_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -169,11 +176,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GreaterEq(%a: i32, %b: i32) -> bool = "int.greater_eq"; +// CHECK:STDOUT: fn @GreaterEq(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.greater_eq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ // CHECK:STDOUT: %GreaterEq.ref.loc9: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] @@ -238,9 +245,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_34: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_34) [template = constants.%.10] // CHECK:STDOUT: %.loc12_38: i32 = int_literal 0 [template = constants.%.9] -// CHECK:STDOUT: %.loc12_26.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] -// CHECK:STDOUT: %.loc12_26.2: i32 = converted %int.snegate.loc12, %.loc12_26.1 [template = constants.%.10] -// CHECK:STDOUT: %int.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_26.2, %.loc12_38) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_33.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] +// CHECK:STDOUT: %.loc12_33.2: i32 = converted %int.snegate.loc12, %.loc12_33.1 [template = constants.%.10] +// CHECK:STDOUT: %int.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_33.2, %.loc12_38) [template = constants.%.7] // CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater_eq.loc12 [template = constants.%.7] // CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater_eq.loc12, %.loc12_14.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 @@ -261,9 +268,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc13_36: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_36) [template = constants.%.10] -// CHECK:STDOUT: %.loc13_25.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] -// CHECK:STDOUT: %.loc13_25.2: i32 = converted %int.snegate.loc13, %.loc13_25.1 [template = constants.%.10] -// CHECK:STDOUT: %int.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%.loc13_26, %.loc13_25.2) [template = constants.%.8] +// CHECK:STDOUT: %.loc13_35.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] +// CHECK:STDOUT: %.loc13_35.2: i32 = converted %int.snegate.loc13, %.loc13_35.1 [template = constants.%.10] +// CHECK:STDOUT: %int.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%.loc13_26, %.loc13_35.2) [template = constants.%.8] // CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %int.greater_eq.loc13 [template = constants.%.8] // CHECK:STDOUT: %.loc13_13.2: bool = converted %int.greater_eq.loc13, %.loc13_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 @@ -281,7 +288,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %GreaterEq.ref: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index 16f1e597958d..171728e336d9 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -106,22 +106,24 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %LeftShift.decl: %LeftShift.type = fn_decl @LeftShift [template = constants.%LeftShift] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %int.make_type_32.loc2_17 [template = i32] // CHECK:STDOUT: %.loc2_17.2: type = converted %int.make_type_32.loc2_17, %.loc2_17.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_25.1: type = value_of_initializer %int.make_type_32.loc2_25 [template = i32] // CHECK:STDOUT: %.loc2_25.2: type = converted %int.make_type_32.loc2_25, %.loc2_25.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %int.make_type_32.loc2_33 [template = i32] // CHECK:STDOUT: %.loc2_33.2: type = converted %int.make_type_32.loc2_33, %.loc2_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_14: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_14 +// CHECK:STDOUT: %param.loc2_22: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_22 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %LeftShift.ref: %LeftShift.type = name_ref LeftShift, %LeftShift.decl [template = constants.%LeftShift] @@ -141,30 +143,32 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc5_21: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @LeftShift(%a: i32, %b: i32) -> i32 = "int.left_shift"; +// CHECK:STDOUT: fn @LeftShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.left_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %LeftShift.ref: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -235,35 +239,38 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %LeftShift.decl: %LeftShift.type = fn_decl @LeftShift [template = constants.%LeftShift] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_32.loc4_17 [template = i32] // CHECK:STDOUT: %.loc4_17.2: type = converted %int.make_type_32.loc4_17, %.loc4_17.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_25.1: type = value_of_initializer %int.make_type_32.loc4_25 [template = i32] // CHECK:STDOUT: %.loc4_25.2: type = converted %int.make_type_32.loc4_25, %.loc4_25.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_33.1: type = value_of_initializer %int.make_type_32.loc4_33 [template = i32] // CHECK:STDOUT: %.loc4_33.2: type = converted %int.make_type_32.loc4_33, %.loc4_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_14: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_14 +// CHECK:STDOUT: %param.loc4_22: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_22 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_32.loc5_14 [template = i32] // CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_32.loc5_14, %.loc5_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc5_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int.make_type_32.loc5_22 [template = i32] // CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_32.loc5_22, %.loc5_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] @@ -293,9 +300,9 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @LeftShift(%a: i32, %b: i32) -> i32 = "int.left_shift"; +// CHECK:STDOUT: fn @LeftShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.left_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -353,9 +360,9 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc40_41: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc40_41) [template = constants.%.9] -// CHECK:STDOUT: %.loc40_30.1: i32 = value_of_initializer %int.snegate [template = constants.%.9] -// CHECK:STDOUT: %.loc40_30.2: i32 = converted %int.snegate, %.loc40_30.1 [template = constants.%.9] -// CHECK:STDOUT: %int.left_shift.loc40: init i32 = call %LeftShift.ref.loc40(%.loc40_31, %.loc40_30.2) [template = ] +// CHECK:STDOUT: %.loc40_40.1: i32 = value_of_initializer %int.snegate [template = constants.%.9] +// CHECK:STDOUT: %.loc40_40.2: i32 = converted %int.snegate, %.loc40_40.1 [template = constants.%.9] +// CHECK:STDOUT: %int.left_shift.loc40: init i32 = call %LeftShift.ref.loc40(%.loc40_31, %.loc40_40.2) [template = ] // CHECK:STDOUT: %.loc40_44.1: i32 = value_of_initializer %int.left_shift.loc40 [template = ] // CHECK:STDOUT: %.loc40_44.2: i32 = converted %int.left_shift.loc40, %.loc40_44.1 [template = ] // CHECK:STDOUT: %negative: i32 = bind_name negative, %.loc40_44.2 diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index 8d7d46002a94..f56fc0572e1f 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -87,67 +87,74 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Less.decl: %Less.type = fn_decl @Less [template = constants.%Less] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_12.1: type = value_of_initializer %int.make_type_32.loc2_12 [template = i32] // CHECK:STDOUT: %.loc2_12.2: type = converted %int.make_type_32.loc2_12, %.loc2_12.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_20.1: type = value_of_initializer %int.make_type_32.loc2_20 [template = i32] // CHECK:STDOUT: %.loc2_20.2: type = converted %int.make_type_32.loc2_20, %.loc2_20.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_28.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_28.2: type = converted %bool.make_type, %.loc2_28.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_9: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_9 +// CHECK:STDOUT: %param.loc2_17: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_17 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] // CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_32.loc3_14, %.loc3_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc3_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_32.loc3_22 [template = i32] // CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_32.loc3_22, %.loc3_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc8_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc8_6 +// CHECK:STDOUT: %param.loc8_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc8_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] // CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32.loc16_19, %.loc16_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc16_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_32.loc16_27 [template = i32] // CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_32.loc16_27, %.loc16_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc16_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc16_16 +// CHECK:STDOUT: %param.loc16_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc16_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -169,11 +176,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Less(%a: i32, %b: i32) -> bool = "int.less"; +// CHECK:STDOUT: fn @Less(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.less"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ // CHECK:STDOUT: %Less.ref.loc9: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] @@ -238,9 +245,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_28: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_28) [template = constants.%.10] // CHECK:STDOUT: %.loc12_32: i32 = int_literal 0 [template = constants.%.9] -// CHECK:STDOUT: %.loc12_20.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] -// CHECK:STDOUT: %.loc12_20.2: i32 = converted %int.snegate.loc12, %.loc12_20.1 [template = constants.%.10] -// CHECK:STDOUT: %int.less.loc12: init bool = call %Less.ref.loc12(%.loc12_20.2, %.loc12_32) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_27.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] +// CHECK:STDOUT: %.loc12_27.2: i32 = converted %int.snegate.loc12, %.loc12_27.1 [template = constants.%.10] +// CHECK:STDOUT: %int.less.loc12: init bool = call %Less.ref.loc12(%.loc12_27.2, %.loc12_32) [template = constants.%.7] // CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less.loc12 [template = constants.%.7] // CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less.loc12, %.loc12_13.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 @@ -261,9 +268,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc13_32: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_32) [template = constants.%.10] -// CHECK:STDOUT: %.loc13_21.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] -// CHECK:STDOUT: %.loc13_21.2: i32 = converted %int.snegate.loc13, %.loc13_21.1 [template = constants.%.10] -// CHECK:STDOUT: %int.less.loc13: init bool = call %Less.ref.loc13(%.loc13_22, %.loc13_21.2) [template = constants.%.8] +// CHECK:STDOUT: %.loc13_31.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] +// CHECK:STDOUT: %.loc13_31.2: i32 = converted %int.snegate.loc13, %.loc13_31.1 [template = constants.%.10] +// CHECK:STDOUT: %int.less.loc13: init bool = call %Less.ref.loc13(%.loc13_22, %.loc13_31.2) [template = constants.%.8] // CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %int.less.loc13 [template = constants.%.8] // CHECK:STDOUT: %.loc13_14.2: bool = converted %int.less.loc13, %.loc13_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 @@ -281,7 +288,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Less.ref: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index e16160789204..ad59d6adac0e 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -87,67 +87,74 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %LessEq.decl: %LessEq.type = fn_decl @LessEq [template = constants.%LessEq] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] // CHECK:STDOUT: %.loc2_14.2: type = converted %int.make_type_32.loc2_14, %.loc2_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %int.make_type_32.loc2_22 [template = i32] // CHECK:STDOUT: %.loc2_22.2: type = converted %int.make_type_32.loc2_22, %.loc2_22.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_30.2: type = converted %bool.make_type, %.loc2_30.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_11: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_11 +// CHECK:STDOUT: %param.loc2_19: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_19 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] // CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_32.loc3_14, %.loc3_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc3_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_32.loc3_22 [template = i32] // CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_32.loc3_22, %.loc3_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc8_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc8_6 +// CHECK:STDOUT: %param.loc8_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc8_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] // CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32.loc16_19, %.loc16_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc16_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_32.loc16_27 [template = i32] // CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_32.loc16_27, %.loc16_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc16_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc16_16 +// CHECK:STDOUT: %param.loc16_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc16_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -169,11 +176,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @LessEq(%a: i32, %b: i32) -> bool = "int.less_eq"; +// CHECK:STDOUT: fn @LessEq(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.less_eq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc9: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] @@ -238,9 +245,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_30: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_30) [template = constants.%.10] // CHECK:STDOUT: %.loc12_34: i32 = int_literal 0 [template = constants.%.8] -// CHECK:STDOUT: %.loc12_22.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] -// CHECK:STDOUT: %.loc12_22.2: i32 = converted %int.snegate.loc12, %.loc12_22.1 [template = constants.%.10] -// CHECK:STDOUT: %int.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_22.2, %.loc12_34) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_29.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] +// CHECK:STDOUT: %.loc12_29.2: i32 = converted %int.snegate.loc12, %.loc12_29.1 [template = constants.%.10] +// CHECK:STDOUT: %int.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_29.2, %.loc12_34) [template = constants.%.7] // CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less_eq.loc12 [template = constants.%.7] // CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less_eq.loc12, %.loc12_13.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 @@ -261,9 +268,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc13_34: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_34) [template = constants.%.10] -// CHECK:STDOUT: %.loc13_23.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] -// CHECK:STDOUT: %.loc13_23.2: i32 = converted %int.snegate.loc13, %.loc13_23.1 [template = constants.%.10] -// CHECK:STDOUT: %int.less_eq.loc13: init bool = call %LessEq.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.9] +// CHECK:STDOUT: %.loc13_33.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] +// CHECK:STDOUT: %.loc13_33.2: i32 = converted %int.snegate.loc13, %.loc13_33.1 [template = constants.%.10] +// CHECK:STDOUT: %int.less_eq.loc13: init bool = call %LessEq.ref.loc13(%.loc13_24, %.loc13_33.2) [template = constants.%.9] // CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %int.less_eq.loc13 [template = constants.%.9] // CHECK:STDOUT: %.loc13_14.2: bool = converted %int.less_eq.loc13, %.loc13_14.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 @@ -281,7 +288,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %LessEq.ref: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 123dea4e8beb..3d6efea3193f 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -102,19 +102,20 @@ var m: Int(1000000000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %return: ref type = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%n.param_patt: i32) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: --- use_types.carbon // CHECK:STDOUT: @@ -133,13 +134,14 @@ var m: Int(1000000000); // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %.6: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+16, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+17, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude @@ -166,72 +168,76 @@ var m: Int(1000000000); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %n.patt: %.3 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %.3 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Int.ref.loc6_9: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %.loc6_13: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_signed.loc6_12: init type = call %Int.ref.loc6_9(%.loc6_13) [template = constants.%.3] // CHECK:STDOUT: %.loc6_15.1: type = value_of_initializer %int.make_type_signed.loc6_12 [template = constants.%.3] // CHECK:STDOUT: %.loc6_15.2: type = converted %int.make_type_signed.loc6_12, %.loc6_15.1 [template = constants.%.3] -// CHECK:STDOUT: %n.param: %.3 = param n, runtime_param0 -// CHECK:STDOUT: %n: %.3 = bind_name n, %n.param // CHECK:STDOUT: %Int.ref.loc6_21: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %.loc6_25: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_signed.loc6_24: init type = call %Int.ref.loc6_21(%.loc6_25) [template = constants.%.3] // CHECK:STDOUT: %.loc6_27.1: type = value_of_initializer %int.make_type_signed.loc6_24 [template = constants.%.3] // CHECK:STDOUT: %.loc6_27.2: type = converted %int.make_type_signed.loc6_24, %.loc6_27.1 [template = constants.%.3] // CHECK:STDOUT: %return: ref %.3 = var +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %n: %.3 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %n.patt: %.5 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %.5 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Int.ref.loc10_9: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %.loc10_13: i32 = int_literal 13 [template = constants.%.4] // CHECK:STDOUT: %int.make_type_signed.loc10_12: init type = call %Int.ref.loc10_9(%.loc10_13) [template = constants.%.5] // CHECK:STDOUT: %.loc10_15.1: type = value_of_initializer %int.make_type_signed.loc10_12 [template = constants.%.5] // CHECK:STDOUT: %.loc10_15.2: type = converted %int.make_type_signed.loc10_12, %.loc10_15.1 [template = constants.%.5] -// CHECK:STDOUT: %n.param: %.5 = param n, runtime_param0 -// CHECK:STDOUT: %n: %.5 = bind_name n, %n.param // CHECK:STDOUT: %Int.ref.loc10_21: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %.loc10_25: i32 = int_literal 13 [template = constants.%.4] // CHECK:STDOUT: %int.make_type_signed.loc10_24: init type = call %Int.ref.loc10_21(%.loc10_25) [template = constants.%.5] // CHECK:STDOUT: %.loc10_27.1: type = value_of_initializer %int.make_type_signed.loc10_24 [template = constants.%.5] // CHECK:STDOUT: %.loc10_27.2: type = converted %int.make_type_signed.loc10_24, %.loc10_27.1 [template = constants.%.5] // CHECK:STDOUT: %return: ref %.5 = var +// CHECK:STDOUT: %param: %.5 = param runtime_param0 +// CHECK:STDOUT: %n: %.5 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Symbolic.decl: %Symbolic.type = fn_decl @Symbolic [template = constants.%Symbolic] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc14_13.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc14_13.1, runtime_param [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] // CHECK:STDOUT: %x.patt: @Symbolic.%.loc14_28 (%.6) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Symbolic.%.loc14_28 (%.6) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_17.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_17.2: type = converted %int.make_type_32, %.loc14_17.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc14_13.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %Int.ref.loc14_25: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %N.ref.loc14_29: i32 = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %int.make_type_signed.loc14_28: init type = call %Int.ref.loc14_25(%N.ref.loc14_29) [symbolic = %.loc14_28 (constants.%.6)] // CHECK:STDOUT: %.loc14_30.1: type = value_of_initializer %int.make_type_signed.loc14_28 [symbolic = %.loc14_28 (constants.%.6)] // CHECK:STDOUT: %.loc14_30.2: type = converted %int.make_type_signed.loc14_28, %.loc14_30.1 [symbolic = %.loc14_28 (constants.%.6)] -// CHECK:STDOUT: %x.param: @Symbolic.%.loc14_28 (%.6) = param x, runtime_param0 -// CHECK:STDOUT: %x: @Symbolic.%.loc14_28 (%.6) = bind_name x, %x.param // CHECK:STDOUT: %Int.ref.loc14_36: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %N.ref.loc14_40: i32 = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call %Int.ref.loc14_36(%N.ref.loc14_40) [symbolic = %.loc14_28 (constants.%.6)] // CHECK:STDOUT: %.loc14_41.1: type = value_of_initializer %int.make_type_signed.loc14_39 [symbolic = %.loc14_28 (constants.%.6)] // CHECK:STDOUT: %.loc14_41.2: type = converted %int.make_type_signed.loc14_39, %.loc14_41.1 [symbolic = %.loc14_28 (constants.%.6)] // CHECK:STDOUT: %return: ref @Symbolic.%.loc14_28 (%.6) = var +// CHECK:STDOUT: %param.loc14_13: i32 = param runtime_param +// CHECK:STDOUT: %N.loc14_13.1: i32 = bind_symbolic_name N, 0, %param.loc14_13 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %param.loc14_22: @Symbolic.%.loc14_28 (%.6) = param runtime_param0 +// CHECK:STDOUT: %x: @Symbolic.%.loc14_28 (%.6) = bind_name x, %param.loc14_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%n.param_patt: i32) -> type = "int.make_type_signed"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n: %.3) -> %.3 { +// CHECK:STDOUT: fn @F(%n.param_patt: %.3) -> %.3 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %.3 = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n: %.5) -> %.5 { +// CHECK:STDOUT: fn @G(%n.param_patt: %.5) -> %.5 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %.5 = name_ref n, %n // CHECK:STDOUT: return %n.ref @@ -241,11 +247,12 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Symbolic(%N.loc14_13.1: i32) { // CHECK:STDOUT: %N.loc14_13.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc14_13.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] // CHECK:STDOUT: %.loc14_28: type = int_type signed, %N.loc14_13.2 [symbolic = %.loc14_28 (constants.%.6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.loc14_13.1: i32, %x: @Symbolic.%.loc14_28 (%.6)) -> @Symbolic.%.loc14_28 (%.6) { +// CHECK:STDOUT: fn(%N.param_patt: i32, %x.param_patt: @Symbolic.%.loc14_28 (%.6)) -> @Symbolic.%.loc14_28 (%.6) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @Symbolic.%.loc14_28 (%.6) = name_ref x, %x // CHECK:STDOUT: return %x.ref @@ -254,6 +261,7 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: specific @Symbolic(constants.%N) { // CHECK:STDOUT: %N.loc14_13.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc14_13.2 => constants.%N // CHECK:STDOUT: %.loc14_28 => constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -267,7 +275,7 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int.type = import_ref Main//types, inst+16, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref: %Int.type = import_ref Main//types, inst+17, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -297,7 +305,7 @@ var m: Int(1000000000); // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%n.param_patt: i32) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_negative_size.carbon // CHECK:STDOUT: @@ -314,7 +322,7 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+16, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+17, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude @@ -340,24 +348,25 @@ var m: Int(1000000000); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] // CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc12_19: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc12_19) [template = constants.%.3] -// CHECK:STDOUT: %.loc12_11.1: i32 = value_of_initializer %int.snegate [template = constants.%.3] -// CHECK:STDOUT: %.loc12_11.2: i32 = converted %int.snegate, %.loc12_11.1 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc12_11.2) [template = ] +// CHECK:STDOUT: %.loc12_18.1: i32 = value_of_initializer %int.snegate [template = constants.%.3] +// CHECK:STDOUT: %.loc12_18.2: i32 = converted %int.snegate, %.loc12_18.1 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc12_18.2) [template = ] // CHECK:STDOUT: %.loc12_21.1: type = value_of_initializer %int.make_type_signed [template = ] // CHECK:STDOUT: %.loc12_21.2: type = converted %int.make_type_signed, %.loc12_21.1 [template = ] // CHECK:STDOUT: %n.var: ref = var n @@ -366,9 +375,9 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%n: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%n.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%n.param_patt: i32) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_oversized.carbon // CHECK:STDOUT: @@ -380,7 +389,7 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int.type = import_ref Main//types, inst+16, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref: %Int.type = import_ref Main//types, inst+17, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -410,5 +419,5 @@ var m: Int(1000000000); // CHECK:STDOUT: %m: ref = bind_name m, %m.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%n.param_patt: i32) -> type = "int.make_type_signed"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index f2c175fc799b..ffdb43c3148e 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -102,19 +102,20 @@ var m: UInt(1000000000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %UInt.decl: %UInt.type = fn_decl @UInt [template = constants.%UInt] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_12.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_12.2: type = converted %int.make_type_32, %.loc4_12.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %return: ref type = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @UInt(%n.param_patt: i32) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: // CHECK:STDOUT: --- use_types.carbon // CHECK:STDOUT: @@ -133,13 +134,14 @@ var m: UInt(1000000000); // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %.6: type = int_type unsigned, %N [symbolic] // CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+16, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+17, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude @@ -166,72 +168,76 @@ var m: UInt(1000000000); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %n.patt: %.3 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %.3 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %UInt.ref.loc6_9: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %.loc6_14: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_unsigned.loc6_13: init type = call %UInt.ref.loc6_9(%.loc6_14) [template = constants.%.3] // CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %int.make_type_unsigned.loc6_13 [template = constants.%.3] // CHECK:STDOUT: %.loc6_16.2: type = converted %int.make_type_unsigned.loc6_13, %.loc6_16.1 [template = constants.%.3] -// CHECK:STDOUT: %n.param: %.3 = param n, runtime_param0 -// CHECK:STDOUT: %n: %.3 = bind_name n, %n.param // CHECK:STDOUT: %UInt.ref.loc6_22: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %.loc6_27: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_unsigned.loc6_26: init type = call %UInt.ref.loc6_22(%.loc6_27) [template = constants.%.3] // CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %int.make_type_unsigned.loc6_26 [template = constants.%.3] // CHECK:STDOUT: %.loc6_29.2: type = converted %int.make_type_unsigned.loc6_26, %.loc6_29.1 [template = constants.%.3] // CHECK:STDOUT: %return: ref %.3 = var +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %n: %.3 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %n.patt: %.5 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %.5 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %UInt.ref.loc10_9: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %.loc10_14: i32 = int_literal 13 [template = constants.%.4] // CHECK:STDOUT: %int.make_type_unsigned.loc10_13: init type = call %UInt.ref.loc10_9(%.loc10_14) [template = constants.%.5] // CHECK:STDOUT: %.loc10_16.1: type = value_of_initializer %int.make_type_unsigned.loc10_13 [template = constants.%.5] // CHECK:STDOUT: %.loc10_16.2: type = converted %int.make_type_unsigned.loc10_13, %.loc10_16.1 [template = constants.%.5] -// CHECK:STDOUT: %n.param: %.5 = param n, runtime_param0 -// CHECK:STDOUT: %n: %.5 = bind_name n, %n.param // CHECK:STDOUT: %UInt.ref.loc10_22: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %.loc10_27: i32 = int_literal 13 [template = constants.%.4] // CHECK:STDOUT: %int.make_type_unsigned.loc10_26: init type = call %UInt.ref.loc10_22(%.loc10_27) [template = constants.%.5] // CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_unsigned.loc10_26 [template = constants.%.5] // CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_unsigned.loc10_26, %.loc10_29.1 [template = constants.%.5] // CHECK:STDOUT: %return: ref %.5 = var +// CHECK:STDOUT: %param: %.5 = param runtime_param0 +// CHECK:STDOUT: %n: %.5 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Symbolic.decl: %Symbolic.type = fn_decl @Symbolic [template = constants.%Symbolic] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc14_13.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc14_13.1, runtime_param [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] // CHECK:STDOUT: %x.patt: @Symbolic.%.loc14_29 (%.6) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Symbolic.%.loc14_29 (%.6) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_17.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_17.2: type = converted %int.make_type_32, %.loc14_17.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc14_13.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %UInt.ref.loc14_25: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %N.ref.loc14_30: i32 = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %int.make_type_unsigned.loc14_29: init type = call %UInt.ref.loc14_25(%N.ref.loc14_30) [symbolic = %.loc14_29 (constants.%.6)] // CHECK:STDOUT: %.loc14_31.1: type = value_of_initializer %int.make_type_unsigned.loc14_29 [symbolic = %.loc14_29 (constants.%.6)] // CHECK:STDOUT: %.loc14_31.2: type = converted %int.make_type_unsigned.loc14_29, %.loc14_31.1 [symbolic = %.loc14_29 (constants.%.6)] -// CHECK:STDOUT: %x.param: @Symbolic.%.loc14_29 (%.6) = param x, runtime_param0 -// CHECK:STDOUT: %x: @Symbolic.%.loc14_29 (%.6) = bind_name x, %x.param // CHECK:STDOUT: %UInt.ref.loc14_37: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %N.ref.loc14_42: i32 = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %int.make_type_unsigned.loc14_41: init type = call %UInt.ref.loc14_37(%N.ref.loc14_42) [symbolic = %.loc14_29 (constants.%.6)] // CHECK:STDOUT: %.loc14_43.1: type = value_of_initializer %int.make_type_unsigned.loc14_41 [symbolic = %.loc14_29 (constants.%.6)] // CHECK:STDOUT: %.loc14_43.2: type = converted %int.make_type_unsigned.loc14_41, %.loc14_43.1 [symbolic = %.loc14_29 (constants.%.6)] // CHECK:STDOUT: %return: ref @Symbolic.%.loc14_29 (%.6) = var +// CHECK:STDOUT: %param.loc14_13: i32 = param runtime_param +// CHECK:STDOUT: %N.loc14_13.1: i32 = bind_symbolic_name N, 0, %param.loc14_13 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %param.loc14_22: @Symbolic.%.loc14_29 (%.6) = param runtime_param0 +// CHECK:STDOUT: %x: @Symbolic.%.loc14_29 (%.6) = bind_name x, %param.loc14_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @UInt(%n.param_patt: i32) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n: %.3) -> %.3 { +// CHECK:STDOUT: fn @F(%n.param_patt: %.3) -> %.3 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %.3 = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n: %.5) -> %.5 { +// CHECK:STDOUT: fn @G(%n.param_patt: %.5) -> %.5 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %.5 = name_ref n, %n // CHECK:STDOUT: return %n.ref @@ -241,11 +247,12 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Symbolic(%N.loc14_13.1: i32) { // CHECK:STDOUT: %N.loc14_13.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc14_13.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] // CHECK:STDOUT: %.loc14_29: type = int_type unsigned, %N.loc14_13.2 [symbolic = %.loc14_29 (constants.%.6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.loc14_13.1: i32, %x: @Symbolic.%.loc14_29 (%.6)) -> @Symbolic.%.loc14_29 (%.6) { +// CHECK:STDOUT: fn(%N.param_patt: i32, %x.param_patt: @Symbolic.%.loc14_29 (%.6)) -> @Symbolic.%.loc14_29 (%.6) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @Symbolic.%.loc14_29 (%.6) = name_ref x, %x // CHECK:STDOUT: return %x.ref @@ -254,6 +261,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: specific @Symbolic(constants.%N) { // CHECK:STDOUT: %N.loc14_13.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc14_13.2 => constants.%N // CHECK:STDOUT: %.loc14_29 => constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -267,7 +275,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Main//types, inst+16, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Main//types, inst+17, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -297,7 +305,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @UInt(%n.param_patt: i32) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_negative_size.carbon // CHECK:STDOUT: @@ -314,7 +322,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+16, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+17, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude @@ -340,24 +348,25 @@ var m: UInt(1000000000); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] // CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc12_20: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc12_20) [template = constants.%.3] -// CHECK:STDOUT: %.loc12_12.1: i32 = value_of_initializer %int.snegate [template = constants.%.3] -// CHECK:STDOUT: %.loc12_12.2: i32 = converted %int.snegate, %.loc12_12.1 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc12_12.2) [template = ] +// CHECK:STDOUT: %.loc12_19.1: i32 = value_of_initializer %int.snegate [template = constants.%.3] +// CHECK:STDOUT: %.loc12_19.2: i32 = converted %int.snegate, %.loc12_19.1 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc12_19.2) [template = ] // CHECK:STDOUT: %.loc12_22.1: type = value_of_initializer %int.make_type_unsigned [template = ] // CHECK:STDOUT: %.loc12_22.2: type = converted %int.make_type_unsigned, %.loc12_22.1 [template = ] // CHECK:STDOUT: %n.var: ref = var n @@ -366,9 +375,9 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%n: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%n.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @UInt(%n.param_patt: i32) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_oversized.carbon // CHECK:STDOUT: @@ -380,7 +389,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Main//types, inst+16, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Main//types, inst+17, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -410,5 +419,5 @@ var m: UInt(1000000000); // CHECK:STDOUT: %m: ref = bind_name m, %m.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @UInt(%n.param_patt: i32) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index 381049e4a8dd..7c63a2cc9f29 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -78,54 +78,60 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Neq.decl: %Neq.type = fn_decl @Neq [template = constants.%Neq] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_27.2: type = converted %bool.make_type, %.loc2_27.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ +// CHECK:STDOUT: %true_.param_patt: %True = param_pattern %true_.patt, runtime_param0 // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ +// CHECK:STDOUT: %false_.param_patt: %False = param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_.param: %True = param true_, runtime_param0 -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_.param: %False = param false_, runtime_param1 -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param +// CHECK:STDOUT: %param.loc7_6: %True = param runtime_param0 +// CHECK:STDOUT: %true_: %True = bind_name true_, %param.loc7_6 +// CHECK:STDOUT: %param.loc7_19: %False = param runtime_param1 +// CHECK:STDOUT: %false_: %False = bind_name false_, %param.loc7_19 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc12_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_32.loc12_19 [template = i32] // CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_32.loc12_19, %.loc12_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc12_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_27.1: type = value_of_initializer %int.make_type_32.loc12_27 [template = i32] // CHECK:STDOUT: %.loc12_27.2: type = converted %int.make_type_32.loc12_27, %.loc12_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc12_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc12_16 +// CHECK:STDOUT: %param.loc12_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc12_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,9 +153,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Neq(%a: i32, %b: i32) -> bool = "int.neq"; +// CHECK:STDOUT: fn @Neq(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.neq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_: %True, %false_: %False) { +// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref: %False = name_ref false_, %false_ // CHECK:STDOUT: %Neq.ref.loc8: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] @@ -192,7 +198,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Neq.ref: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/int/or.carbon b/toolchain/check/testdata/builtins/int/or.carbon index 3fad5309af19..f2d3cc79e895 100644 --- a/toolchain/check/testdata/builtins/int/or.carbon +++ b/toolchain/check/testdata/builtins/int/or.carbon @@ -62,22 +62,24 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Or.decl: %Or.type = fn_decl @Or [template = constants.%Or] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %int.make_type_32.loc2_10 [template = i32] // CHECK:STDOUT: %.loc2_10.2: type = converted %int.make_type_32.loc2_10, %.loc2_10.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] // CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_32.loc2_18, %.loc2_18.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %int.make_type_32.loc2_26 [template = i32] // CHECK:STDOUT: %.loc2_26.2: type = converted %int.make_type_32.loc2_26, %.loc2_26.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_7: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_7 +// CHECK:STDOUT: %param.loc2_15: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_15 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Or.ref: %Or.type = name_ref Or, %Or.decl [template = constants.%Or] @@ -97,30 +99,32 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc5_21: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Or(%a: i32, %b: i32) -> i32 = "int.or"; +// CHECK:STDOUT: fn @Or(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.or"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Or.ref: %Or.type = name_ref Or, file.%Or.decl [template = constants.%Or] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index 3b2ea989c21d..b92a871b4e2f 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -107,22 +107,24 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] // CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_32.loc2_18, %.loc2_18.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %int.make_type_32.loc2_26 [template = i32] // CHECK:STDOUT: %.loc2_26.2: type = converted %int.make_type_32.loc2_26, %.loc2_26.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_34.1: type = value_of_initializer %int.make_type_32.loc2_34 [template = i32] // CHECK:STDOUT: %.loc2_34.2: type = converted %int.make_type_32.loc2_34, %.loc2_34.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_15: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_15 +// CHECK:STDOUT: %param.loc2_23: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_23 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %RightShift.ref: %RightShift.type = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] @@ -142,30 +144,32 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift(%a: i32, %b: i32) -> i32 = "int.right_shift"; +// CHECK:STDOUT: fn @RightShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.right_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %RightShift.ref: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -235,35 +239,38 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_18.1: type = value_of_initializer %int.make_type_32.loc6_18 [template = i32] // CHECK:STDOUT: %.loc6_18.2: type = converted %int.make_type_32.loc6_18, %.loc6_18.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc6_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_26.1: type = value_of_initializer %int.make_type_32.loc6_26 [template = i32] // CHECK:STDOUT: %.loc6_26.2: type = converted %int.make_type_32.loc6_26, %.loc6_26.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc6_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_34.1: type = value_of_initializer %int.make_type_32.loc6_34 [template = i32] // CHECK:STDOUT: %.loc6_34.2: type = converted %int.make_type_32.loc6_34, %.loc6_34.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc6_15: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc6_15 +// CHECK:STDOUT: %param.loc6_23: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc6_23 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_14.1: type = value_of_initializer %int.make_type_32.loc7_14 [template = i32] // CHECK:STDOUT: %.loc7_14.2: type = converted %int.make_type_32.loc7_14, %.loc7_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_22.1: type = value_of_initializer %int.make_type_32.loc7_22 [template = i32] // CHECK:STDOUT: %.loc7_22.2: type = converted %int.make_type_32.loc7_22, %.loc7_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Negate.ref.loc10_17: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] @@ -272,12 +279,12 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc10_42: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %int.snegate.loc10_41: init i32 = call %Negate.ref.loc10_35(%.loc10_42) [template = constants.%.3] // CHECK:STDOUT: %.loc10_46: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc10_34.1: i32 = value_of_initializer %int.snegate.loc10_41 [template = constants.%.3] -// CHECK:STDOUT: %.loc10_34.2: i32 = converted %int.snegate.loc10_41, %.loc10_34.1 [template = constants.%.3] -// CHECK:STDOUT: %int.right_shift.loc10: init i32 = call %RightShift.ref.loc10(%.loc10_34.2, %.loc10_46) [template = constants.%.3] -// CHECK:STDOUT: %.loc10_23.1: i32 = value_of_initializer %int.right_shift.loc10 [template = constants.%.3] -// CHECK:STDOUT: %.loc10_23.2: i32 = converted %int.right_shift.loc10, %.loc10_23.1 [template = constants.%.3] -// CHECK:STDOUT: %int.snegate.loc10_23: init i32 = call %Negate.ref.loc10_17(%.loc10_23.2) [template = constants.%.2] +// CHECK:STDOUT: %.loc10_41.1: i32 = value_of_initializer %int.snegate.loc10_41 [template = constants.%.3] +// CHECK:STDOUT: %.loc10_41.2: i32 = converted %int.snegate.loc10_41, %.loc10_41.1 [template = constants.%.3] +// CHECK:STDOUT: %int.right_shift.loc10: init i32 = call %RightShift.ref.loc10(%.loc10_41.2, %.loc10_46) [template = constants.%.3] +// CHECK:STDOUT: %.loc10_34.1: i32 = value_of_initializer %int.right_shift.loc10 [template = constants.%.3] +// CHECK:STDOUT: %.loc10_34.2: i32 = converted %int.right_shift.loc10, %.loc10_34.1 [template = constants.%.3] +// CHECK:STDOUT: %int.snegate.loc10_23: init i32 = call %Negate.ref.loc10_17(%.loc10_34.2) [template = constants.%.2] // CHECK:STDOUT: %.loc10_12.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] // CHECK:STDOUT: %.loc10_12.2: type = converted %int.make_type_32.loc10, %.loc10_12.1 [template = i32] // CHECK:STDOUT: %.loc10_49: type = array_type %int.snegate.loc10_23, i32 [template = constants.%.4] @@ -296,12 +303,12 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc14_42: i32 = int_literal 10 [template = constants.%.6] // CHECK:STDOUT: %int.snegate.loc14_41: init i32 = call %Negate.ref.loc14_35(%.loc14_42) [template = constants.%.7] // CHECK:STDOUT: %.loc14_47: i32 = int_literal 2 [template = constants.%.8] -// CHECK:STDOUT: %.loc14_34.1: i32 = value_of_initializer %int.snegate.loc14_41 [template = constants.%.7] -// CHECK:STDOUT: %.loc14_34.2: i32 = converted %int.snegate.loc14_41, %.loc14_34.1 [template = constants.%.7] -// CHECK:STDOUT: %int.right_shift.loc14: init i32 = call %RightShift.ref.loc14(%.loc14_34.2, %.loc14_47) [template = constants.%.9] -// CHECK:STDOUT: %.loc14_23.1: i32 = value_of_initializer %int.right_shift.loc14 [template = constants.%.9] -// CHECK:STDOUT: %.loc14_23.2: i32 = converted %int.right_shift.loc14, %.loc14_23.1 [template = constants.%.9] -// CHECK:STDOUT: %int.snegate.loc14_23: init i32 = call %Negate.ref.loc14_17(%.loc14_23.2) [template = constants.%.10] +// CHECK:STDOUT: %.loc14_41.1: i32 = value_of_initializer %int.snegate.loc14_41 [template = constants.%.7] +// CHECK:STDOUT: %.loc14_41.2: i32 = converted %int.snegate.loc14_41, %.loc14_41.1 [template = constants.%.7] +// CHECK:STDOUT: %int.right_shift.loc14: init i32 = call %RightShift.ref.loc14(%.loc14_41.2, %.loc14_47) [template = constants.%.9] +// CHECK:STDOUT: %.loc14_34.1: i32 = value_of_initializer %int.right_shift.loc14 [template = constants.%.9] +// CHECK:STDOUT: %.loc14_34.2: i32 = converted %int.right_shift.loc14, %.loc14_34.1 [template = constants.%.9] +// CHECK:STDOUT: %int.snegate.loc14_23: init i32 = call %Negate.ref.loc14_17(%.loc14_34.2) [template = constants.%.10] // CHECK:STDOUT: %.loc14_12.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_12.2: type = converted %int.make_type_32.loc14, %.loc14_12.1 [template = i32] // CHECK:STDOUT: %.loc14_50: type = array_type %int.snegate.loc14_23, i32 [template = constants.%.11] @@ -317,9 +324,9 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift(%a: i32, %b: i32) -> i32 = "int.right_shift"; +// CHECK:STDOUT: fn @RightShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.right_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -378,35 +385,38 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_18.1: type = value_of_initializer %int.make_type_32.loc4_18 [template = i32] // CHECK:STDOUT: %.loc4_18.2: type = converted %int.make_type_32.loc4_18, %.loc4_18.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_26.1: type = value_of_initializer %int.make_type_32.loc4_26 [template = i32] // CHECK:STDOUT: %.loc4_26.2: type = converted %int.make_type_32.loc4_26, %.loc4_26.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_34.1: type = value_of_initializer %int.make_type_32.loc4_34 [template = i32] // CHECK:STDOUT: %.loc4_34.2: type = converted %int.make_type_32.loc4_34, %.loc4_34.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_15: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_15 +// CHECK:STDOUT: %param.loc4_23: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_23 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_32.loc5_14 [template = i32] // CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_32.loc5_14, %.loc5_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc5_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int.make_type_32.loc5_22 [template = i32] // CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_32.loc5_22, %.loc5_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] @@ -424,9 +434,9 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift(%a: i32, %b: i32) -> i32 = "int.right_shift"; +// CHECK:STDOUT: fn @RightShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.right_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -456,9 +466,9 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc24_42: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc24_42) [template = constants.%.7] -// CHECK:STDOUT: %.loc24_31.1: i32 = value_of_initializer %int.snegate [template = constants.%.7] -// CHECK:STDOUT: %.loc24_31.2: i32 = converted %int.snegate, %.loc24_31.1 [template = constants.%.7] -// CHECK:STDOUT: %int.right_shift.loc24: init i32 = call %RightShift.ref.loc24(%.loc24_32, %.loc24_31.2) [template = ] +// CHECK:STDOUT: %.loc24_41.1: i32 = value_of_initializer %int.snegate [template = constants.%.7] +// CHECK:STDOUT: %.loc24_41.2: i32 = converted %int.snegate, %.loc24_41.1 [template = constants.%.7] +// CHECK:STDOUT: %int.right_shift.loc24: init i32 = call %RightShift.ref.loc24(%.loc24_32, %.loc24_41.2) [template = ] // CHECK:STDOUT: %.loc24_45.1: i32 = value_of_initializer %int.right_shift.loc24 [template = ] // CHECK:STDOUT: %.loc24_45.2: i32 = converted %int.right_shift.loc24, %.loc24_45.1 [template = ] // CHECK:STDOUT: %negative: i32 = bind_name negative, %.loc24_45.2 diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 1aa505372b83..ccd398cac7ad 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -132,22 +132,24 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] @@ -167,30 +169,32 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a: i32, %b: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -271,79 +275,87 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc8_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %int.make_type_32.loc8_14 [template = i32] // CHECK:STDOUT: %.loc8_14.2: type = converted %int.make_type_32.loc8_14, %.loc8_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc8_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_22.1: type = value_of_initializer %int.make_type_32.loc8_22 [template = i32] // CHECK:STDOUT: %.loc8_22.2: type = converted %int.make_type_32.loc8_22, %.loc8_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: i32 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] // CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_32.loc13_15, %.loc13_15.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc13_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_32.loc13_23 [template = i32] // CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_32.loc13_23, %.loc13_23.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc13_31: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32.loc13_31 [template = i32] // CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] -// CHECK:STDOUT: %c.param: i32 = param c, runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc13_39: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_39.1: type = value_of_initializer %int.make_type_32.loc13_39 [template = i32] // CHECK:STDOUT: %.loc13_39.2: type = converted %int.make_type_32.loc13_39, %.loc13_39.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc13_12: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc13_12 +// CHECK:STDOUT: %param.loc13_20: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc13_20 +// CHECK:STDOUT: %param.loc13_28: i32 = param runtime_param2 +// CHECK:STDOUT: %c: i32 = bind_name c, %param.loc13_28 // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc18_21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32.loc18_21 [template = i32] // CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_32.loc18_21, %.loc18_21.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc18_29: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %int.make_type_32.loc18_29 [template = i32] // CHECK:STDOUT: %.loc18_29.2: type = converted %int.make_type_32.loc18_29, %.loc18_29.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc18_18: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc18_18 +// CHECK:STDOUT: %param.loc18_26: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc18_26 // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] // CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_32.loc19_17, %.loc19_17.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc19_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_32.loc19_25 [template = i32] // CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc19_33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_33.1: type = value_of_initializer %int.make_type_32.loc19_33 [template = i32] // CHECK:STDOUT: %.loc19_33.2: type = converted %int.make_type_32.loc19_33, %.loc19_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc19_14: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc19_14 +// CHECK:STDOUT: %param.loc19_22: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc19_22 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] @@ -378,76 +390,82 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc46_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_32.loc46_25 [template = i32] // CHECK:STDOUT: %.loc46_25.2: type = converted %int.make_type_32.loc46_25, %.loc46_25.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc46_33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_33.1: type = value_of_initializer %int.make_type_32.loc46_33 [template = i32] // CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_32.loc46_33, %.loc46_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: i32 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc50_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc50_26.1: type = value_of_initializer %int.make_type_32.loc50_26 [template = i32] // CHECK:STDOUT: %.loc50_26.2: type = converted %int.make_type_32.loc50_26, %.loc50_26.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc50_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc50_34.1: type = value_of_initializer %int.make_type_32.loc50_34 [template = i32] // CHECK:STDOUT: %.loc50_34.2: type = converted %int.make_type_32.loc50_34, %.loc50_34.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc50_42: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc50_42.1: type = value_of_initializer %int.make_type_32.loc50_42 [template = i32] // CHECK:STDOUT: %.loc50_42.2: type = converted %int.make_type_32.loc50_42, %.loc50_42.1 [template = i32] -// CHECK:STDOUT: %c.param: i32 = param c, runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc50_50: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc50_50.1: type = value_of_initializer %int.make_type_32.loc50_50 [template = i32] // CHECK:STDOUT: %.loc50_50.2: type = converted %int.make_type_32.loc50_50, %.loc50_50.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc50_23: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc50_23 +// CHECK:STDOUT: %param.loc50_31: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc50_31 +// CHECK:STDOUT: %param.loc50_39: i32 = param runtime_param2 +// CHECK:STDOUT: %c: i32 = bind_name c, %param.loc50_39 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc54_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc54_32.1: type = value_of_initializer %int.make_type_32.loc54_32 [template = i32] // CHECK:STDOUT: %.loc54_32.2: type = converted %int.make_type_32.loc54_32, %.loc54_32.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc54_40: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc54_40.1: type = value_of_initializer %int.make_type_32.loc54_40 [template = i32] // CHECK:STDOUT: %.loc54_40.2: type = converted %int.make_type_32.loc54_40, %.loc54_40.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc54_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc54_48.2: type = converted %bool.make_type, %.loc54_48.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc54_29: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc54_29 +// CHECK:STDOUT: %param.loc54_37: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc54_37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew(%a: i32) -> i32; +// CHECK:STDOUT: fn @TooFew(%a.param_patt: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a: i32, %b: i32, %c: i32) -> i32; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a: i32, %b: i32) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a: i32, %b: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -457,7 +475,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: return %.loc47_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a: i32, %b: i32, %c: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -469,7 +487,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: return %.loc51_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a: i32, %b: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -519,22 +537,24 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] @@ -546,7 +566,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a: i32, %b: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index 990c83cdfb0f..900a994ca8f7 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -100,22 +100,24 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, %Div.decl [template = constants.%Div] @@ -135,30 +137,32 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a: i32, %b: i32) -> i32 = "int.sdiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sdiv"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -224,54 +228,59 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] // CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] // CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc5_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc5_8 +// CHECK:STDOUT: %param.loc5_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc5_16 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] // CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] @@ -286,11 +295,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a: i32, %b: i32) -> i32 = "int.sdiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sdiv"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a: i32, %b: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -301,11 +310,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc9_46: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %int.snegate.loc9_45: init i32 = call %Negate.ref.loc9_39(%.loc9_46) [template = constants.%.5] -// CHECK:STDOUT: %.loc9_17.1: i32 = value_of_initializer %int.snegate.loc9_24 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_17.2: i32 = converted %int.snegate.loc9_24, %.loc9_17.1 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_17.3: i32 = value_of_initializer %int.snegate.loc9_45 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_17.4: i32 = converted %int.snegate.loc9_45, %.loc9_17.3 [template = constants.%.5] -// CHECK:STDOUT: %int.sdiv.loc9: init i32 = call %Div.ref.loc9(%.loc9_17.2, %.loc9_17.4) [template = constants.%.2] +// CHECK:STDOUT: %.loc9_24.1: i32 = value_of_initializer %int.snegate.loc9_24 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_24.2: i32 = converted %int.snegate.loc9_24, %.loc9_24.1 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_45.1: i32 = value_of_initializer %int.snegate.loc9_45 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_45.2: i32 = converted %int.snegate.loc9_45, %.loc9_45.1 [template = constants.%.5] +// CHECK:STDOUT: %int.sdiv.loc9: init i32 = call %Div.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.2] // CHECK:STDOUT: %.loc9_49.1: i32 = value_of_initializer %int.sdiv.loc9 [template = constants.%.2] // CHECK:STDOUT: %.loc9_49.2: i32 = converted %int.sdiv.loc9, %.loc9_49.1 [template = constants.%.2] // CHECK:STDOUT: %a: i32 = bind_name a, %.loc9_49.2 @@ -315,13 +324,13 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc12_29: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_29) [template = constants.%.3] // CHECK:STDOUT: %.loc12_43: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.3] -// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.snegate.loc12, %.loc12_21.1 [template = constants.%.3] -// CHECK:STDOUT: %int.ssub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_21.2, %.loc12_43) [template = constants.%.6] +// CHECK:STDOUT: %.loc12_28.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_28.2: i32 = converted %int.snegate.loc12, %.loc12_28.1 [template = constants.%.3] +// CHECK:STDOUT: %int.ssub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43) [template = constants.%.6] // CHECK:STDOUT: %.loc12_47: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_17.1: i32 = value_of_initializer %int.ssub.loc12 [template = constants.%.6] -// CHECK:STDOUT: %.loc12_17.2: i32 = converted %int.ssub.loc12, %.loc12_17.1 [template = constants.%.6] -// CHECK:STDOUT: %int.sdiv.loc12: init i32 = call %Div.ref.loc12(%.loc12_17.2, %.loc12_47) [template = constants.%.6] +// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.ssub.loc12 [template = constants.%.6] +// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.ssub.loc12, %.loc12_21.1 [template = constants.%.6] +// CHECK:STDOUT: %int.sdiv.loc12: init i32 = call %Div.ref.loc12(%.loc12_21.2, %.loc12_47) [template = constants.%.6] // CHECK:STDOUT: %.loc12_49.1: i32 = value_of_initializer %int.sdiv.loc12 [template = constants.%.6] // CHECK:STDOUT: %.loc12_49.2: i32 = converted %int.sdiv.loc12, %.loc12_49.1 [template = constants.%.6] // CHECK:STDOUT: %b: i32 = bind_name b, %.loc12_49.2 @@ -331,17 +340,17 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc19_29: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.snegate.loc19_28: init i32 = call %Negate.ref.loc19_22(%.loc19_29) [template = constants.%.3] // CHECK:STDOUT: %.loc19_43: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc19_21.1: i32 = value_of_initializer %int.snegate.loc19_28 [template = constants.%.3] -// CHECK:STDOUT: %.loc19_21.2: i32 = converted %int.snegate.loc19_28, %.loc19_21.1 [template = constants.%.3] -// CHECK:STDOUT: %int.ssub.loc19: init i32 = call %Sub.ref.loc19(%.loc19_21.2, %.loc19_43) [template = constants.%.6] +// CHECK:STDOUT: %.loc19_28.1: i32 = value_of_initializer %int.snegate.loc19_28 [template = constants.%.3] +// CHECK:STDOUT: %.loc19_28.2: i32 = converted %int.snegate.loc19_28, %.loc19_28.1 [template = constants.%.3] +// CHECK:STDOUT: %int.ssub.loc19: init i32 = call %Sub.ref.loc19(%.loc19_28.2, %.loc19_43) [template = constants.%.6] // CHECK:STDOUT: %Negate.ref.loc19_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc19_54: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %int.snegate.loc19_53: init i32 = call %Negate.ref.loc19_47(%.loc19_54) [template = constants.%.5] -// CHECK:STDOUT: %.loc19_17.1: i32 = value_of_initializer %int.ssub.loc19 [template = constants.%.6] -// CHECK:STDOUT: %.loc19_17.2: i32 = converted %int.ssub.loc19, %.loc19_17.1 [template = constants.%.6] -// CHECK:STDOUT: %.loc19_17.3: i32 = value_of_initializer %int.snegate.loc19_53 [template = constants.%.5] -// CHECK:STDOUT: %.loc19_17.4: i32 = converted %int.snegate.loc19_53, %.loc19_17.3 [template = constants.%.5] -// CHECK:STDOUT: %int.sdiv.loc19: init i32 = call %Div.ref.loc19(%.loc19_17.2, %.loc19_17.4) [template = constants.%.6] +// CHECK:STDOUT: %.loc19_21.1: i32 = value_of_initializer %int.ssub.loc19 [template = constants.%.6] +// CHECK:STDOUT: %.loc19_21.2: i32 = converted %int.ssub.loc19, %.loc19_21.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc19_53.1: i32 = value_of_initializer %int.snegate.loc19_53 [template = constants.%.5] +// CHECK:STDOUT: %.loc19_53.2: i32 = converted %int.snegate.loc19_53, %.loc19_53.1 [template = constants.%.5] +// CHECK:STDOUT: %int.sdiv.loc19: init i32 = call %Div.ref.loc19(%.loc19_21.2, %.loc19_53.2) [template = constants.%.6] // CHECK:STDOUT: %.loc19_57.1: i32 = value_of_initializer %int.sdiv.loc19 [template = constants.%.6] // CHECK:STDOUT: %.loc19_57.2: i32 = converted %int.sdiv.loc19, %.loc19_57.1 [template = constants.%.6] // CHECK:STDOUT: %c: i32 = bind_name c, %.loc19_57.2 @@ -385,22 +394,24 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] @@ -412,7 +423,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a: i32, %b: i32) -> i32 = "int.sdiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sdiv"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index 9806fe6f6811..bd7fddc3c2c0 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -103,22 +103,24 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, %Mod.decl [template = constants.%Mod] @@ -138,30 +140,32 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a: i32, %b: i32) -> i32 = "int.smod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smod"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -228,54 +232,59 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] // CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] // CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc5_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc5_8 +// CHECK:STDOUT: %param.loc5_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc5_16 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] // CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] @@ -290,11 +299,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a: i32, %b: i32) -> i32 = "int.smod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smod"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a: i32, %b: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -305,11 +314,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc9_46: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %int.snegate.loc9_45: init i32 = call %Negate.ref.loc9_39(%.loc9_46) [template = constants.%.5] -// CHECK:STDOUT: %.loc9_17.1: i32 = value_of_initializer %int.snegate.loc9_24 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_17.2: i32 = converted %int.snegate.loc9_24, %.loc9_17.1 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_17.3: i32 = value_of_initializer %int.snegate.loc9_45 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_17.4: i32 = converted %int.snegate.loc9_45, %.loc9_17.3 [template = constants.%.5] -// CHECK:STDOUT: %int.smod.loc9: init i32 = call %Mod.ref.loc9(%.loc9_17.2, %.loc9_17.4) [template = constants.%.6] +// CHECK:STDOUT: %.loc9_24.1: i32 = value_of_initializer %int.snegate.loc9_24 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_24.2: i32 = converted %int.snegate.loc9_24, %.loc9_24.1 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_45.1: i32 = value_of_initializer %int.snegate.loc9_45 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_45.2: i32 = converted %int.snegate.loc9_45, %.loc9_45.1 [template = constants.%.5] +// CHECK:STDOUT: %int.smod.loc9: init i32 = call %Mod.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.6] // CHECK:STDOUT: %.loc9_49.1: i32 = value_of_initializer %int.smod.loc9 [template = constants.%.6] // CHECK:STDOUT: %.loc9_49.2: i32 = converted %int.smod.loc9, %.loc9_49.1 [template = constants.%.6] // CHECK:STDOUT: %a: i32 = bind_name a, %.loc9_49.2 @@ -319,13 +328,13 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc12_29: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_29) [template = constants.%.3] // CHECK:STDOUT: %.loc12_43: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.3] -// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.snegate.loc12, %.loc12_21.1 [template = constants.%.3] -// CHECK:STDOUT: %int.ssub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_21.2, %.loc12_43) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_28.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_28.2: i32 = converted %int.snegate.loc12, %.loc12_28.1 [template = constants.%.3] +// CHECK:STDOUT: %int.ssub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43) [template = constants.%.7] // CHECK:STDOUT: %.loc12_47: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_17.1: i32 = value_of_initializer %int.ssub.loc12 [template = constants.%.7] -// CHECK:STDOUT: %.loc12_17.2: i32 = converted %int.ssub.loc12, %.loc12_17.1 [template = constants.%.7] -// CHECK:STDOUT: %int.smod.loc12: init i32 = call %Mod.ref.loc12(%.loc12_17.2, %.loc12_47) [template = constants.%.6] +// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.ssub.loc12 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.ssub.loc12, %.loc12_21.1 [template = constants.%.7] +// CHECK:STDOUT: %int.smod.loc12: init i32 = call %Mod.ref.loc12(%.loc12_21.2, %.loc12_47) [template = constants.%.6] // CHECK:STDOUT: %.loc12_49.1: i32 = value_of_initializer %int.smod.loc12 [template = constants.%.6] // CHECK:STDOUT: %.loc12_49.2: i32 = converted %int.smod.loc12, %.loc12_49.1 [template = constants.%.6] // CHECK:STDOUT: %b: i32 = bind_name b, %.loc12_49.2 @@ -335,17 +344,17 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc20_29: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.snegate.loc20_28: init i32 = call %Negate.ref.loc20_22(%.loc20_29) [template = constants.%.3] // CHECK:STDOUT: %.loc20_43: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc20_21.1: i32 = value_of_initializer %int.snegate.loc20_28 [template = constants.%.3] -// CHECK:STDOUT: %.loc20_21.2: i32 = converted %int.snegate.loc20_28, %.loc20_21.1 [template = constants.%.3] -// CHECK:STDOUT: %int.ssub.loc20: init i32 = call %Sub.ref.loc20(%.loc20_21.2, %.loc20_43) [template = constants.%.7] +// CHECK:STDOUT: %.loc20_28.1: i32 = value_of_initializer %int.snegate.loc20_28 [template = constants.%.3] +// CHECK:STDOUT: %.loc20_28.2: i32 = converted %int.snegate.loc20_28, %.loc20_28.1 [template = constants.%.3] +// CHECK:STDOUT: %int.ssub.loc20: init i32 = call %Sub.ref.loc20(%.loc20_28.2, %.loc20_43) [template = constants.%.7] // CHECK:STDOUT: %Negate.ref.loc20_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc20_54: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %int.snegate.loc20_53: init i32 = call %Negate.ref.loc20_47(%.loc20_54) [template = constants.%.5] -// CHECK:STDOUT: %.loc20_17.1: i32 = value_of_initializer %int.ssub.loc20 [template = constants.%.7] -// CHECK:STDOUT: %.loc20_17.2: i32 = converted %int.ssub.loc20, %.loc20_17.1 [template = constants.%.7] -// CHECK:STDOUT: %.loc20_17.3: i32 = value_of_initializer %int.snegate.loc20_53 [template = constants.%.5] -// CHECK:STDOUT: %.loc20_17.4: i32 = converted %int.snegate.loc20_53, %.loc20_17.3 [template = constants.%.5] -// CHECK:STDOUT: %int.smod.loc20: init i32 = call %Mod.ref.loc20(%.loc20_17.2, %.loc20_17.4) [template = constants.%.6] +// CHECK:STDOUT: %.loc20_21.1: i32 = value_of_initializer %int.ssub.loc20 [template = constants.%.7] +// CHECK:STDOUT: %.loc20_21.2: i32 = converted %int.ssub.loc20, %.loc20_21.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc20_53.1: i32 = value_of_initializer %int.snegate.loc20_53 [template = constants.%.5] +// CHECK:STDOUT: %.loc20_53.2: i32 = converted %int.snegate.loc20_53, %.loc20_53.1 [template = constants.%.5] +// CHECK:STDOUT: %int.smod.loc20: init i32 = call %Mod.ref.loc20(%.loc20_21.2, %.loc20_53.2) [template = constants.%.6] // CHECK:STDOUT: %.loc20_57.1: i32 = value_of_initializer %int.smod.loc20 [template = constants.%.6] // CHECK:STDOUT: %.loc20_57.2: i32 = converted %int.smod.loc20, %.loc20_57.1 [template = constants.%.6] // CHECK:STDOUT: %c: i32 = bind_name c, %.loc20_57.2 @@ -389,22 +398,24 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] @@ -416,7 +427,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a: i32, %b: i32) -> i32 = "int.smod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smod"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index de0a48d7513d..3aeead3a4093 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -74,22 +74,24 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, %Mul.decl [template = constants.%Mul] @@ -109,30 +111,32 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a: i32, %b: i32) -> i32 = "int.smul"; +// CHECK:STDOUT: fn @Mul(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smul"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -191,22 +195,24 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] @@ -218,7 +224,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a: i32, %b: i32) -> i32 = "int.smul"; +// CHECK:STDOUT: fn @Mul(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smul"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index f9a4ded6a65b..32462d6f13b3 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -161,25 +161,26 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] // CHECK:STDOUT: %.loc2_14.2: type = converted %int.make_type_32.loc2_14, %.loc2_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %int.make_type_32.loc2_22 [template = i32] // CHECK:STDOUT: %.loc2_22.2: type = converted %int.make_type_32.loc2_22, %.loc2_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc4_30: i32 = int_literal 123 [template = constants.%.2] // CHECK:STDOUT: %int.snegate.loc4_29: init i32 = call %Negate.ref.loc4_23(%.loc4_30) [template = constants.%.3] -// CHECK:STDOUT: %.loc4_22.1: i32 = value_of_initializer %int.snegate.loc4_29 [template = constants.%.3] -// CHECK:STDOUT: %.loc4_22.2: i32 = converted %int.snegate.loc4_29, %.loc4_22.1 [template = constants.%.3] -// CHECK:STDOUT: %int.snegate.loc4_22: init i32 = call %Negate.ref.loc4_16(%.loc4_22.2) [template = constants.%.2] +// CHECK:STDOUT: %.loc4_29.1: i32 = value_of_initializer %int.snegate.loc4_29 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_29.2: i32 = converted %int.snegate.loc4_29, %.loc4_29.1 [template = constants.%.3] +// CHECK:STDOUT: %int.snegate.loc4_22: init i32 = call %Negate.ref.loc4_16(%.loc4_29.2) [template = constants.%.2] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] // CHECK:STDOUT: %.loc4_35: type = array_type %int.snegate.loc4_22, i32 [template = constants.%.4] @@ -196,30 +197,32 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc9_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_32.loc9_19 [template = i32] // CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_32.loc9_19, %.loc9_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc9_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_27.1: type = value_of_initializer %int.make_type_32.loc9_27 [template = i32] // CHECK:STDOUT: %.loc9_27.2: type = converted %int.make_type_32.loc9_27, %.loc9_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc9_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_35.1: type = value_of_initializer %int.make_type_32.loc9_35 [template = i32] // CHECK:STDOUT: %.loc9_35.2: type = converted %int.make_type_32.loc9_35, %.loc9_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc9_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc9_16 +// CHECK:STDOUT: %param.loc9_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc9_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -310,48 +313,52 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] // CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_32.loc13_15, %.loc13_15.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc13_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_32.loc13_23 [template = i32] // CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_32.loc13_23, %.loc13_23.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc13_31: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32.loc13_31 [template = i32] // CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc13_12: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc13_12 +// CHECK:STDOUT: %param.loc13_20: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc13_20 // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_32, %.loc18_21.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] // CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_32.loc19_17, %.loc19_17.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc19_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_32.loc19_25 [template = i32] // CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] @@ -382,60 +389,66 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc46_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_32.loc46_25 [template = i32] // CHECK:STDOUT: %.loc46_25.2: type = converted %int.make_type_32.loc46_25, %.loc46_25.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc46_33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_33.1: type = value_of_initializer %int.make_type_32.loc46_33 [template = i32] // CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_32.loc46_33, %.loc46_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: i32 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc57_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_26.1: type = value_of_initializer %int.make_type_32.loc57_26 [template = i32] // CHECK:STDOUT: %.loc57_26.2: type = converted %int.make_type_32.loc57_26, %.loc57_26.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc57_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_34.1: type = value_of_initializer %int.make_type_32.loc57_34 [template = i32] // CHECK:STDOUT: %.loc57_34.2: type = converted %int.make_type_32.loc57_34, %.loc57_34.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc57_42: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_42.1: type = value_of_initializer %int.make_type_32.loc57_42 [template = i32] // CHECK:STDOUT: %.loc57_42.2: type = converted %int.make_type_32.loc57_42, %.loc57_42.1 [template = i32] -// CHECK:STDOUT: %c.param: i32 = param c, runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc57_50: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_50.1: type = value_of_initializer %int.make_type_32.loc57_50 [template = i32] // CHECK:STDOUT: %.loc57_50.2: type = converted %int.make_type_32.loc57_50, %.loc57_50.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc57_23: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc57_23 +// CHECK:STDOUT: %param.loc57_31: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc57_31 +// CHECK:STDOUT: %param.loc57_39: i32 = param runtime_param2 +// CHECK:STDOUT: %c: i32 = bind_name c, %param.loc57_39 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc68_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc68_32.1: type = value_of_initializer %int.make_type_32.loc68_32 [template = i32] // CHECK:STDOUT: %.loc68_32.2: type = converted %int.make_type_32.loc68_32, %.loc68_32.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc68_40: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc68_40.1: type = value_of_initializer %int.make_type_32.loc68_40 [template = i32] // CHECK:STDOUT: %.loc68_40.2: type = converted %int.make_type_32.loc68_40, %.loc68_40.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type, %.loc68_48.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc68_29: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc68_29 +// CHECK:STDOUT: %param.loc68_37: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc68_37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -443,22 +456,22 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @TooFew() -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a: i32, %b: i32) -> i32; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: i32, %b.param_patt: i32) -> i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a: i32) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: i32) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a: i32, %b: i32, %c: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -467,7 +480,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a: i32, %b: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -517,35 +530,38 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32.loc4_14 [template = i32] // CHECK:STDOUT: %.loc4_14.2: type = converted %int.make_type_32.loc4_14, %.loc4_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_32.loc4_22 [template = i32] // CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_32.loc4_22, %.loc4_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] // CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] // CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc5_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc5_8 +// CHECK:STDOUT: %param.loc5_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc5_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] @@ -557,9 +573,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a: i32, %b: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -567,9 +583,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Negate.ref.loc8_21: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc8_28: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.snegate.loc8_27: init i32 = call %Negate.ref.loc8_21(%.loc8_28) [template = constants.%.3] -// CHECK:STDOUT: %.loc8_20.1: i32 = value_of_initializer %int.snegate.loc8_27 [template = constants.%.3] -// CHECK:STDOUT: %.loc8_20.2: i32 = converted %int.snegate.loc8_27, %.loc8_20.1 [template = constants.%.3] -// CHECK:STDOUT: %int.snegate.loc8_20: init i32 = call %Negate.ref.loc8_14(%.loc8_20.2) [template = constants.%.2] +// CHECK:STDOUT: %.loc8_27.1: i32 = value_of_initializer %int.snegate.loc8_27 [template = constants.%.3] +// CHECK:STDOUT: %.loc8_27.2: i32 = converted %int.snegate.loc8_27, %.loc8_27.1 [template = constants.%.3] +// CHECK:STDOUT: %int.snegate.loc8_20: init i32 = call %Negate.ref.loc8_14(%.loc8_27.2) [template = constants.%.2] // CHECK:STDOUT: %.loc8_40.1: i32 = value_of_initializer %int.snegate.loc8_20 [template = constants.%.2] // CHECK:STDOUT: %.loc8_40.2: i32 = converted %int.snegate.loc8_20, %.loc8_40.1 [template = constants.%.2] // CHECK:STDOUT: %a: i32 = bind_name a, %.loc8_40.2 @@ -579,12 +595,12 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc14_32: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.snegate.loc14_31: init i32 = call %Negate.ref.loc14_25(%.loc14_32) [template = constants.%.3] // CHECK:STDOUT: %.loc14_45: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_24.1: i32 = value_of_initializer %int.snegate.loc14_31 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_24.2: i32 = converted %int.snegate.loc14_31, %.loc14_24.1 [template = constants.%.3] -// CHECK:STDOUT: %int.ssub: init i32 = call %Sub.ref(%.loc14_24.2, %.loc14_45) [template = constants.%.5] -// CHECK:STDOUT: %.loc14_20.1: i32 = value_of_initializer %int.ssub [template = constants.%.5] -// CHECK:STDOUT: %.loc14_20.2: i32 = converted %int.ssub, %.loc14_20.1 [template = constants.%.5] -// CHECK:STDOUT: %int.snegate.loc14_20: init i32 = call %Negate.ref.loc14_14(%.loc14_20.2) [template = constants.%.5] +// CHECK:STDOUT: %.loc14_31.1: i32 = value_of_initializer %int.snegate.loc14_31 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_31.2: i32 = converted %int.snegate.loc14_31, %.loc14_31.1 [template = constants.%.3] +// CHECK:STDOUT: %int.ssub: init i32 = call %Sub.ref(%.loc14_31.2, %.loc14_45) [template = constants.%.5] +// CHECK:STDOUT: %.loc14_24.1: i32 = value_of_initializer %int.ssub [template = constants.%.5] +// CHECK:STDOUT: %.loc14_24.2: i32 = converted %int.ssub, %.loc14_24.1 [template = constants.%.5] +// CHECK:STDOUT: %int.snegate.loc14_20: init i32 = call %Negate.ref.loc14_14(%.loc14_24.2) [template = constants.%.5] // CHECK:STDOUT: %.loc14_48.1: i32 = value_of_initializer %int.snegate.loc14_20 [template = constants.%.5] // CHECK:STDOUT: %.loc14_48.2: i32 = converted %int.snegate.loc14_20, %.loc14_48.1 [template = constants.%.5] // CHECK:STDOUT: %b: i32 = bind_name b, %.loc14_48.2 diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index bf473552b4e6..219265b3046a 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -75,22 +75,24 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, %Sub.decl [template = constants.%Sub] @@ -110,30 +112,32 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a: i32, %b: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -194,22 +198,24 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] @@ -224,7 +230,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a: i32, %b: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -241,9 +247,9 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc7_25: i32 = int_literal 2147483647 [template = constants.%.3] // CHECK:STDOUT: %int.ssub.loc7_21: init i32 = call %Sub.ref.loc7_18(%.loc7_22, %.loc7_25) [template = constants.%.4] // CHECK:STDOUT: %.loc7_38: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc7_17.1: i32 = value_of_initializer %int.ssub.loc7_21 [template = constants.%.4] -// CHECK:STDOUT: %.loc7_17.2: i32 = converted %int.ssub.loc7_21, %.loc7_17.1 [template = constants.%.4] -// CHECK:STDOUT: %int.ssub.loc7_17: init i32 = call %Sub.ref.loc7_14(%.loc7_17.2, %.loc7_38) [template = constants.%.6] +// CHECK:STDOUT: %.loc7_21.1: i32 = value_of_initializer %int.ssub.loc7_21 [template = constants.%.4] +// CHECK:STDOUT: %.loc7_21.2: i32 = converted %int.ssub.loc7_21, %.loc7_21.1 [template = constants.%.4] +// CHECK:STDOUT: %int.ssub.loc7_17: init i32 = call %Sub.ref.loc7_14(%.loc7_21.2, %.loc7_38) [template = constants.%.6] // CHECK:STDOUT: %.loc7_40.1: i32 = value_of_initializer %int.ssub.loc7_17 [template = constants.%.6] // CHECK:STDOUT: %.loc7_40.2: i32 = converted %int.ssub.loc7_17, %.loc7_40.1 [template = constants.%.6] // CHECK:STDOUT: %b: i32 = bind_name b, %.loc7_40.2 @@ -253,9 +259,9 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc11_25: i32 = int_literal 2147483647 [template = constants.%.3] // CHECK:STDOUT: %int.ssub.loc11_21: init i32 = call %Sub.ref.loc11_18(%.loc11_22, %.loc11_25) [template = constants.%.4] // CHECK:STDOUT: %.loc11_38: i32 = int_literal 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc11_17.1: i32 = value_of_initializer %int.ssub.loc11_21 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_17.2: i32 = converted %int.ssub.loc11_21, %.loc11_17.1 [template = constants.%.4] -// CHECK:STDOUT: %int.ssub.loc11_17: init i32 = call %Sub.ref.loc11_14(%.loc11_17.2, %.loc11_38) [template = constants.%.3] +// CHECK:STDOUT: %.loc11_21.1: i32 = value_of_initializer %int.ssub.loc11_21 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_21.2: i32 = converted %int.ssub.loc11_21, %.loc11_21.1 [template = constants.%.4] +// CHECK:STDOUT: %int.ssub.loc11_17: init i32 = call %Sub.ref.loc11_14(%.loc11_21.2, %.loc11_38) [template = constants.%.3] // CHECK:STDOUT: %.loc11_40.1: i32 = value_of_initializer %int.ssub.loc11_17 [template = constants.%.3] // CHECK:STDOUT: %.loc11_40.2: i32 = converted %int.ssub.loc11_17, %.loc11_40.1 [template = constants.%.3] // CHECK:STDOUT: %c: i32 = bind_name c, %.loc11_40.2 diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index 7ff00a57a130..2ebbdbf9cbdd 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -129,22 +129,24 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] @@ -164,30 +166,32 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a: i32, %b: i32) -> i32 = "int.uadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.uadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -268,79 +272,87 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc8_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %int.make_type_32.loc8_14 [template = i32] // CHECK:STDOUT: %.loc8_14.2: type = converted %int.make_type_32.loc8_14, %.loc8_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc8_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_22.1: type = value_of_initializer %int.make_type_32.loc8_22 [template = i32] // CHECK:STDOUT: %.loc8_22.2: type = converted %int.make_type_32.loc8_22, %.loc8_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: i32 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] // CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_32.loc13_15, %.loc13_15.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc13_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_32.loc13_23 [template = i32] // CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_32.loc13_23, %.loc13_23.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc13_31: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32.loc13_31 [template = i32] // CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] -// CHECK:STDOUT: %c.param: i32 = param c, runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc13_39: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_39.1: type = value_of_initializer %int.make_type_32.loc13_39 [template = i32] // CHECK:STDOUT: %.loc13_39.2: type = converted %int.make_type_32.loc13_39, %.loc13_39.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc13_12: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc13_12 +// CHECK:STDOUT: %param.loc13_20: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc13_20 +// CHECK:STDOUT: %param.loc13_28: i32 = param runtime_param2 +// CHECK:STDOUT: %c: i32 = bind_name c, %param.loc13_28 // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc18_21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32.loc18_21 [template = i32] // CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_32.loc18_21, %.loc18_21.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc18_29: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %int.make_type_32.loc18_29 [template = i32] // CHECK:STDOUT: %.loc18_29.2: type = converted %int.make_type_32.loc18_29, %.loc18_29.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc18_18: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc18_18 +// CHECK:STDOUT: %param.loc18_26: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc18_26 // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] // CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_32.loc19_17, %.loc19_17.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc19_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_32.loc19_25 [template = i32] // CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc19_33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_33.1: type = value_of_initializer %int.make_type_32.loc19_33 [template = i32] // CHECK:STDOUT: %.loc19_33.2: type = converted %int.make_type_32.loc19_33, %.loc19_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc19_14: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc19_14 +// CHECK:STDOUT: %param.loc19_22: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc19_22 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] @@ -375,76 +387,82 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc45_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc45_25.1: type = value_of_initializer %int.make_type_32.loc45_25 [template = i32] // CHECK:STDOUT: %.loc45_25.2: type = converted %int.make_type_32.loc45_25, %.loc45_25.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc45_33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc45_33.1: type = value_of_initializer %int.make_type_32.loc45_33 [template = i32] // CHECK:STDOUT: %.loc45_33.2: type = converted %int.make_type_32.loc45_33, %.loc45_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: i32 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc49_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc49_26.1: type = value_of_initializer %int.make_type_32.loc49_26 [template = i32] // CHECK:STDOUT: %.loc49_26.2: type = converted %int.make_type_32.loc49_26, %.loc49_26.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc49_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc49_34.1: type = value_of_initializer %int.make_type_32.loc49_34 [template = i32] // CHECK:STDOUT: %.loc49_34.2: type = converted %int.make_type_32.loc49_34, %.loc49_34.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc49_42: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc49_42.1: type = value_of_initializer %int.make_type_32.loc49_42 [template = i32] // CHECK:STDOUT: %.loc49_42.2: type = converted %int.make_type_32.loc49_42, %.loc49_42.1 [template = i32] -// CHECK:STDOUT: %c.param: i32 = param c, runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc49_50: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc49_50.1: type = value_of_initializer %int.make_type_32.loc49_50 [template = i32] // CHECK:STDOUT: %.loc49_50.2: type = converted %int.make_type_32.loc49_50, %.loc49_50.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc49_23: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc49_23 +// CHECK:STDOUT: %param.loc49_31: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc49_31 +// CHECK:STDOUT: %param.loc49_39: i32 = param runtime_param2 +// CHECK:STDOUT: %c: i32 = bind_name c, %param.loc49_39 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc53_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc53_32.1: type = value_of_initializer %int.make_type_32.loc53_32 [template = i32] // CHECK:STDOUT: %.loc53_32.2: type = converted %int.make_type_32.loc53_32, %.loc53_32.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc53_40: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc53_40.1: type = value_of_initializer %int.make_type_32.loc53_40 [template = i32] // CHECK:STDOUT: %.loc53_40.2: type = converted %int.make_type_32.loc53_40, %.loc53_40.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc53_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc53_48.2: type = converted %bool.make_type, %.loc53_48.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc53_29: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc53_29 +// CHECK:STDOUT: %param.loc53_37: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc53_37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew(%a: i32) -> i32; +// CHECK:STDOUT: fn @TooFew(%a.param_patt: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a: i32, %b: i32, %c: i32) -> i32; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a: i32, %b: i32) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a: i32, %b: i32) -> i32 = "int.uadd"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.uadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -454,7 +472,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: return %.loc46_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a: i32, %b: i32, %c: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -466,7 +484,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: return %.loc50_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a: i32, %b: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -516,22 +534,24 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] @@ -543,7 +563,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a: i32, %b: i32) -> i32 = "int.uadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.uadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index 8522b4295a8d..4e98de35b24c 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -96,22 +96,24 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, %Div.decl [template = constants.%Div] @@ -131,30 +133,32 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a: i32, %b: i32) -> i32 = "int.udiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.udiv"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -221,54 +225,59 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] // CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] // CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc5_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc5_8 +// CHECK:STDOUT: %param.loc5_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc5_16 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] // CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] @@ -283,11 +292,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a: i32, %b: i32) -> i32 = "int.udiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.udiv"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a: i32, %b: i32) -> i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.usub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.unegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -298,11 +307,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc9_46: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %int.unegate.loc9_45: init i32 = call %Negate.ref.loc9_39(%.loc9_46) [template = constants.%.5] -// CHECK:STDOUT: %.loc9_17.1: i32 = value_of_initializer %int.unegate.loc9_24 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_17.2: i32 = converted %int.unegate.loc9_24, %.loc9_17.1 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_17.3: i32 = value_of_initializer %int.unegate.loc9_45 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_17.4: i32 = converted %int.unegate.loc9_45, %.loc9_17.3 [template = constants.%.5] -// CHECK:STDOUT: %int.udiv.loc9: init i32 = call %Div.ref.loc9(%.loc9_17.2, %.loc9_17.4) [template = constants.%.6] +// CHECK:STDOUT: %.loc9_24.1: i32 = value_of_initializer %int.unegate.loc9_24 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_24.2: i32 = converted %int.unegate.loc9_24, %.loc9_24.1 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_45.1: i32 = value_of_initializer %int.unegate.loc9_45 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_45.2: i32 = converted %int.unegate.loc9_45, %.loc9_45.1 [template = constants.%.5] +// CHECK:STDOUT: %int.udiv.loc9: init i32 = call %Div.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.6] // CHECK:STDOUT: %.loc9_49.1: i32 = value_of_initializer %int.udiv.loc9 [template = constants.%.6] // CHECK:STDOUT: %.loc9_49.2: i32 = converted %int.udiv.loc9, %.loc9_49.1 [template = constants.%.6] // CHECK:STDOUT: %a: i32 = bind_name a, %.loc9_49.2 @@ -312,13 +321,13 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc12_29: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.unegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_29) [template = constants.%.3] // CHECK:STDOUT: %.loc12_43: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.unegate.loc12 [template = constants.%.3] -// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.unegate.loc12, %.loc12_21.1 [template = constants.%.3] -// CHECK:STDOUT: %int.usub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_21.2, %.loc12_43) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_28.1: i32 = value_of_initializer %int.unegate.loc12 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_28.2: i32 = converted %int.unegate.loc12, %.loc12_28.1 [template = constants.%.3] +// CHECK:STDOUT: %int.usub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43) [template = constants.%.7] // CHECK:STDOUT: %.loc12_47: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_17.1: i32 = value_of_initializer %int.usub.loc12 [template = constants.%.7] -// CHECK:STDOUT: %.loc12_17.2: i32 = converted %int.usub.loc12, %.loc12_17.1 [template = constants.%.7] -// CHECK:STDOUT: %int.udiv.loc12: init i32 = call %Div.ref.loc12(%.loc12_17.2, %.loc12_47) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.usub.loc12 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.usub.loc12, %.loc12_21.1 [template = constants.%.7] +// CHECK:STDOUT: %int.udiv.loc12: init i32 = call %Div.ref.loc12(%.loc12_21.2, %.loc12_47) [template = constants.%.7] // CHECK:STDOUT: %.loc12_49.1: i32 = value_of_initializer %int.udiv.loc12 [template = constants.%.7] // CHECK:STDOUT: %.loc12_49.2: i32 = converted %int.udiv.loc12, %.loc12_49.1 [template = constants.%.7] // CHECK:STDOUT: %b: i32 = bind_name b, %.loc12_49.2 @@ -328,17 +337,17 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc15_29: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.unegate.loc15_28: init i32 = call %Negate.ref.loc15_22(%.loc15_29) [template = constants.%.3] // CHECK:STDOUT: %.loc15_43: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc15_21.1: i32 = value_of_initializer %int.unegate.loc15_28 [template = constants.%.3] -// CHECK:STDOUT: %.loc15_21.2: i32 = converted %int.unegate.loc15_28, %.loc15_21.1 [template = constants.%.3] -// CHECK:STDOUT: %int.usub.loc15: init i32 = call %Sub.ref.loc15(%.loc15_21.2, %.loc15_43) [template = constants.%.7] +// CHECK:STDOUT: %.loc15_28.1: i32 = value_of_initializer %int.unegate.loc15_28 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_28.2: i32 = converted %int.unegate.loc15_28, %.loc15_28.1 [template = constants.%.3] +// CHECK:STDOUT: %int.usub.loc15: init i32 = call %Sub.ref.loc15(%.loc15_28.2, %.loc15_43) [template = constants.%.7] // CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc15_54: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %int.unegate.loc15_53: init i32 = call %Negate.ref.loc15_47(%.loc15_54) [template = constants.%.5] -// CHECK:STDOUT: %.loc15_17.1: i32 = value_of_initializer %int.usub.loc15 [template = constants.%.7] -// CHECK:STDOUT: %.loc15_17.2: i32 = converted %int.usub.loc15, %.loc15_17.1 [template = constants.%.7] -// CHECK:STDOUT: %.loc15_17.3: i32 = value_of_initializer %int.unegate.loc15_53 [template = constants.%.5] -// CHECK:STDOUT: %.loc15_17.4: i32 = converted %int.unegate.loc15_53, %.loc15_17.3 [template = constants.%.5] -// CHECK:STDOUT: %int.udiv.loc15: init i32 = call %Div.ref.loc15(%.loc15_17.2, %.loc15_17.4) [template = constants.%.6] +// CHECK:STDOUT: %.loc15_21.1: i32 = value_of_initializer %int.usub.loc15 [template = constants.%.7] +// CHECK:STDOUT: %.loc15_21.2: i32 = converted %int.usub.loc15, %.loc15_21.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc15_53.1: i32 = value_of_initializer %int.unegate.loc15_53 [template = constants.%.5] +// CHECK:STDOUT: %.loc15_53.2: i32 = converted %int.unegate.loc15_53, %.loc15_53.1 [template = constants.%.5] +// CHECK:STDOUT: %int.udiv.loc15: init i32 = call %Div.ref.loc15(%.loc15_21.2, %.loc15_53.2) [template = constants.%.6] // CHECK:STDOUT: %.loc15_57.1: i32 = value_of_initializer %int.udiv.loc15 [template = constants.%.6] // CHECK:STDOUT: %.loc15_57.2: i32 = converted %int.udiv.loc15, %.loc15_57.1 [template = constants.%.6] // CHECK:STDOUT: %c: i32 = bind_name c, %.loc15_57.2 @@ -382,22 +391,24 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] @@ -409,7 +420,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a: i32, %b: i32) -> i32 = "int.udiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.udiv"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index 562d2a72d757..89c26f88a0d3 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -98,22 +98,24 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, %Mod.decl [template = constants.%Mod] @@ -133,30 +135,32 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a: i32, %b: i32) -> i32 = "int.umod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umod"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -223,54 +227,59 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] // CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] // CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc5_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc5_8 +// CHECK:STDOUT: %param.loc5_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc5_16 // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] // CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] @@ -285,11 +294,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a: i32, %b: i32) -> i32 = "int.umod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umod"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a: i32, %b: i32) -> i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.usub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.unegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -300,11 +309,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc9_46: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %int.unegate.loc9_45: init i32 = call %Negate.ref.loc9_39(%.loc9_46) [template = constants.%.5] -// CHECK:STDOUT: %.loc9_17.1: i32 = value_of_initializer %int.unegate.loc9_24 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_17.2: i32 = converted %int.unegate.loc9_24, %.loc9_17.1 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_17.3: i32 = value_of_initializer %int.unegate.loc9_45 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_17.4: i32 = converted %int.unegate.loc9_45, %.loc9_17.3 [template = constants.%.5] -// CHECK:STDOUT: %int.umod.loc9: init i32 = call %Mod.ref.loc9(%.loc9_17.2, %.loc9_17.4) [template = constants.%.3] +// CHECK:STDOUT: %.loc9_24.1: i32 = value_of_initializer %int.unegate.loc9_24 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_24.2: i32 = converted %int.unegate.loc9_24, %.loc9_24.1 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_45.1: i32 = value_of_initializer %int.unegate.loc9_45 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_45.2: i32 = converted %int.unegate.loc9_45, %.loc9_45.1 [template = constants.%.5] +// CHECK:STDOUT: %int.umod.loc9: init i32 = call %Mod.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.3] // CHECK:STDOUT: %.loc9_49.1: i32 = value_of_initializer %int.umod.loc9 [template = constants.%.3] // CHECK:STDOUT: %.loc9_49.2: i32 = converted %int.umod.loc9, %.loc9_49.1 [template = constants.%.3] // CHECK:STDOUT: %a: i32 = bind_name a, %.loc9_49.2 @@ -314,13 +323,13 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc12_29: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.unegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_29) [template = constants.%.3] // CHECK:STDOUT: %.loc12_43: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.unegate.loc12 [template = constants.%.3] -// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.unegate.loc12, %.loc12_21.1 [template = constants.%.3] -// CHECK:STDOUT: %int.usub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_21.2, %.loc12_43) [template = constants.%.6] +// CHECK:STDOUT: %.loc12_28.1: i32 = value_of_initializer %int.unegate.loc12 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_28.2: i32 = converted %int.unegate.loc12, %.loc12_28.1 [template = constants.%.3] +// CHECK:STDOUT: %int.usub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43) [template = constants.%.6] // CHECK:STDOUT: %.loc12_47: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_17.1: i32 = value_of_initializer %int.usub.loc12 [template = constants.%.6] -// CHECK:STDOUT: %.loc12_17.2: i32 = converted %int.usub.loc12, %.loc12_17.1 [template = constants.%.6] -// CHECK:STDOUT: %int.umod.loc12: init i32 = call %Mod.ref.loc12(%.loc12_17.2, %.loc12_47) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.usub.loc12 [template = constants.%.6] +// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.usub.loc12, %.loc12_21.1 [template = constants.%.6] +// CHECK:STDOUT: %int.umod.loc12: init i32 = call %Mod.ref.loc12(%.loc12_21.2, %.loc12_47) [template = constants.%.7] // CHECK:STDOUT: %.loc12_49.1: i32 = value_of_initializer %int.umod.loc12 [template = constants.%.7] // CHECK:STDOUT: %.loc12_49.2: i32 = converted %int.umod.loc12, %.loc12_49.1 [template = constants.%.7] // CHECK:STDOUT: %b: i32 = bind_name b, %.loc12_49.2 @@ -330,17 +339,17 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc15_29: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.unegate.loc15_28: init i32 = call %Negate.ref.loc15_22(%.loc15_29) [template = constants.%.3] // CHECK:STDOUT: %.loc15_43: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc15_21.1: i32 = value_of_initializer %int.unegate.loc15_28 [template = constants.%.3] -// CHECK:STDOUT: %.loc15_21.2: i32 = converted %int.unegate.loc15_28, %.loc15_21.1 [template = constants.%.3] -// CHECK:STDOUT: %int.usub.loc15: init i32 = call %Sub.ref.loc15(%.loc15_21.2, %.loc15_43) [template = constants.%.6] +// CHECK:STDOUT: %.loc15_28.1: i32 = value_of_initializer %int.unegate.loc15_28 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_28.2: i32 = converted %int.unegate.loc15_28, %.loc15_28.1 [template = constants.%.3] +// CHECK:STDOUT: %int.usub.loc15: init i32 = call %Sub.ref.loc15(%.loc15_28.2, %.loc15_43) [template = constants.%.6] // CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc15_54: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %int.unegate.loc15_53: init i32 = call %Negate.ref.loc15_47(%.loc15_54) [template = constants.%.5] -// CHECK:STDOUT: %.loc15_17.1: i32 = value_of_initializer %int.usub.loc15 [template = constants.%.6] -// CHECK:STDOUT: %.loc15_17.2: i32 = converted %int.usub.loc15, %.loc15_17.1 [template = constants.%.6] -// CHECK:STDOUT: %.loc15_17.3: i32 = value_of_initializer %int.unegate.loc15_53 [template = constants.%.5] -// CHECK:STDOUT: %.loc15_17.4: i32 = converted %int.unegate.loc15_53, %.loc15_17.3 [template = constants.%.5] -// CHECK:STDOUT: %int.umod.loc15: init i32 = call %Mod.ref.loc15(%.loc15_17.2, %.loc15_17.4) [template = constants.%.6] +// CHECK:STDOUT: %.loc15_21.1: i32 = value_of_initializer %int.usub.loc15 [template = constants.%.6] +// CHECK:STDOUT: %.loc15_21.2: i32 = converted %int.usub.loc15, %.loc15_21.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc15_53.1: i32 = value_of_initializer %int.unegate.loc15_53 [template = constants.%.5] +// CHECK:STDOUT: %.loc15_53.2: i32 = converted %int.unegate.loc15_53, %.loc15_53.1 [template = constants.%.5] +// CHECK:STDOUT: %int.umod.loc15: init i32 = call %Mod.ref.loc15(%.loc15_21.2, %.loc15_53.2) [template = constants.%.6] // CHECK:STDOUT: %.loc15_57.1: i32 = value_of_initializer %int.umod.loc15 [template = constants.%.6] // CHECK:STDOUT: %.loc15_57.2: i32 = converted %int.umod.loc15, %.loc15_57.1 [template = constants.%.6] // CHECK:STDOUT: %c: i32 = bind_name c, %.loc15_57.2 @@ -384,22 +393,24 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] @@ -411,7 +422,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a: i32, %b: i32) -> i32 = "int.umod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umod"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/builtins/int/umul.carbon b/toolchain/check/testdata/builtins/int/umul.carbon index 4497fc3bc28d..61542f6b4908 100644 --- a/toolchain/check/testdata/builtins/int/umul.carbon +++ b/toolchain/check/testdata/builtins/int/umul.carbon @@ -71,22 +71,24 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, %Mul.decl [template = constants.%Mul] @@ -106,30 +108,32 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a: i32, %b: i32) -> i32 = "int.umul"; +// CHECK:STDOUT: fn @Mul(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umul"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -188,22 +192,24 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] @@ -215,7 +221,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a: i32, %b: i32) -> i32 = "int.umul"; +// CHECK:STDOUT: fn @Mul(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umul"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index d1580f3b282c..f3dd5752134f 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -157,25 +157,26 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] // CHECK:STDOUT: %.loc2_14.2: type = converted %int.make_type_32.loc2_14, %.loc2_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %int.make_type_32.loc2_22 [template = i32] // CHECK:STDOUT: %.loc2_22.2: type = converted %int.make_type_32.loc2_22, %.loc2_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc4_30: i32 = int_literal 123 [template = constants.%.2] // CHECK:STDOUT: %int.unegate.loc4_29: init i32 = call %Negate.ref.loc4_23(%.loc4_30) [template = constants.%.3] -// CHECK:STDOUT: %.loc4_22.1: i32 = value_of_initializer %int.unegate.loc4_29 [template = constants.%.3] -// CHECK:STDOUT: %.loc4_22.2: i32 = converted %int.unegate.loc4_29, %.loc4_22.1 [template = constants.%.3] -// CHECK:STDOUT: %int.unegate.loc4_22: init i32 = call %Negate.ref.loc4_16(%.loc4_22.2) [template = constants.%.2] +// CHECK:STDOUT: %.loc4_29.1: i32 = value_of_initializer %int.unegate.loc4_29 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_29.2: i32 = converted %int.unegate.loc4_29, %.loc4_29.1 [template = constants.%.3] +// CHECK:STDOUT: %int.unegate.loc4_22: init i32 = call %Negate.ref.loc4_16(%.loc4_29.2) [template = constants.%.2] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] // CHECK:STDOUT: %.loc4_35: type = array_type %int.unegate.loc4_22, i32 [template = constants.%.4] @@ -192,30 +193,32 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc9_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_32.loc9_19 [template = i32] // CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_32.loc9_19, %.loc9_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc9_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_27.1: type = value_of_initializer %int.make_type_32.loc9_27 [template = i32] // CHECK:STDOUT: %.loc9_27.2: type = converted %int.make_type_32.loc9_27, %.loc9_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc9_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_35.1: type = value_of_initializer %int.make_type_32.loc9_35 [template = i32] // CHECK:STDOUT: %.loc9_35.2: type = converted %int.make_type_32.loc9_35, %.loc9_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc9_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc9_16 +// CHECK:STDOUT: %param.loc9_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc9_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.unegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -306,48 +309,52 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] // CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_32.loc13_15, %.loc13_15.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc13_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_32.loc13_23 [template = i32] // CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_32.loc13_23, %.loc13_23.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc13_31: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32.loc13_31 [template = i32] // CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc13_12: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc13_12 +// CHECK:STDOUT: %param.loc13_20: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc13_20 // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_32, %.loc18_21.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] // CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_32.loc19_17, %.loc19_17.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc19_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_32.loc19_25 [template = i32] // CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] @@ -378,60 +385,66 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc46_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_32.loc46_25 [template = i32] // CHECK:STDOUT: %.loc46_25.2: type = converted %int.make_type_32.loc46_25, %.loc46_25.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc46_33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_33.1: type = value_of_initializer %int.make_type_32.loc46_33 [template = i32] // CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_32.loc46_33, %.loc46_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: i32 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc57_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_26.1: type = value_of_initializer %int.make_type_32.loc57_26 [template = i32] // CHECK:STDOUT: %.loc57_26.2: type = converted %int.make_type_32.loc57_26, %.loc57_26.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc57_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_34.1: type = value_of_initializer %int.make_type_32.loc57_34 [template = i32] // CHECK:STDOUT: %.loc57_34.2: type = converted %int.make_type_32.loc57_34, %.loc57_34.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc57_42: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_42.1: type = value_of_initializer %int.make_type_32.loc57_42 [template = i32] // CHECK:STDOUT: %.loc57_42.2: type = converted %int.make_type_32.loc57_42, %.loc57_42.1 [template = i32] -// CHECK:STDOUT: %c.param: i32 = param c, runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc57_50: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_50.1: type = value_of_initializer %int.make_type_32.loc57_50 [template = i32] // CHECK:STDOUT: %.loc57_50.2: type = converted %int.make_type_32.loc57_50, %.loc57_50.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc57_23: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc57_23 +// CHECK:STDOUT: %param.loc57_31: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc57_31 +// CHECK:STDOUT: %param.loc57_39: i32 = param runtime_param2 +// CHECK:STDOUT: %c: i32 = bind_name c, %param.loc57_39 // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc68_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc68_32.1: type = value_of_initializer %int.make_type_32.loc68_32 [template = i32] // CHECK:STDOUT: %.loc68_32.2: type = converted %int.make_type_32.loc68_32, %.loc68_32.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc68_40: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc68_40.1: type = value_of_initializer %int.make_type_32.loc68_40 [template = i32] // CHECK:STDOUT: %.loc68_40.2: type = converted %int.make_type_32.loc68_40, %.loc68_40.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type, %.loc68_48.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc68_29: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc68_29 +// CHECK:STDOUT: %param.loc68_37: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc68_37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -439,22 +452,22 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @TooFew() -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a: i32, %b: i32) -> i32; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: i32, %b.param_patt: i32) -> i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a: i32) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: i32) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a: i32) -> i32 = "int.unegate"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: i32) -> i32 = "int.unegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a: i32, %b: i32, %c: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -463,7 +476,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a: i32, %b: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -513,35 +526,38 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32.loc4_14 [template = i32] // CHECK:STDOUT: %.loc4_14.2: type = converted %int.make_type_32.loc4_14, %.loc4_14.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_32.loc4_22 [template = i32] // CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_32.loc4_22, %.loc4_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] // CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] // CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc5_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc5_8 +// CHECK:STDOUT: %param.loc5_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc5_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] @@ -553,9 +569,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.unegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a: i32, %b: i32) -> i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.usub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -563,9 +579,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Negate.ref.loc8_21: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc8_28: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.unegate.loc8_27: init i32 = call %Negate.ref.loc8_21(%.loc8_28) [template = constants.%.3] -// CHECK:STDOUT: %.loc8_20.1: i32 = value_of_initializer %int.unegate.loc8_27 [template = constants.%.3] -// CHECK:STDOUT: %.loc8_20.2: i32 = converted %int.unegate.loc8_27, %.loc8_20.1 [template = constants.%.3] -// CHECK:STDOUT: %int.unegate.loc8_20: init i32 = call %Negate.ref.loc8_14(%.loc8_20.2) [template = constants.%.2] +// CHECK:STDOUT: %.loc8_27.1: i32 = value_of_initializer %int.unegate.loc8_27 [template = constants.%.3] +// CHECK:STDOUT: %.loc8_27.2: i32 = converted %int.unegate.loc8_27, %.loc8_27.1 [template = constants.%.3] +// CHECK:STDOUT: %int.unegate.loc8_20: init i32 = call %Negate.ref.loc8_14(%.loc8_27.2) [template = constants.%.2] // CHECK:STDOUT: %.loc8_40.1: i32 = value_of_initializer %int.unegate.loc8_20 [template = constants.%.2] // CHECK:STDOUT: %.loc8_40.2: i32 = converted %int.unegate.loc8_20, %.loc8_40.1 [template = constants.%.2] // CHECK:STDOUT: %a: i32 = bind_name a, %.loc8_40.2 @@ -575,12 +591,12 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc11_32: i32 = int_literal 2147483647 [template = constants.%.2] // CHECK:STDOUT: %int.unegate.loc11_31: init i32 = call %Negate.ref.loc11_25(%.loc11_32) [template = constants.%.3] // CHECK:STDOUT: %.loc11_45: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_24.1: i32 = value_of_initializer %int.unegate.loc11_31 [template = constants.%.3] -// CHECK:STDOUT: %.loc11_24.2: i32 = converted %int.unegate.loc11_31, %.loc11_24.1 [template = constants.%.3] -// CHECK:STDOUT: %int.usub: init i32 = call %Sub.ref(%.loc11_24.2, %.loc11_45) [template = constants.%.5] -// CHECK:STDOUT: %.loc11_20.1: i32 = value_of_initializer %int.usub [template = constants.%.5] -// CHECK:STDOUT: %.loc11_20.2: i32 = converted %int.usub, %.loc11_20.1 [template = constants.%.5] -// CHECK:STDOUT: %int.unegate.loc11_20: init i32 = call %Negate.ref.loc11_14(%.loc11_20.2) [template = constants.%.5] +// CHECK:STDOUT: %.loc11_31.1: i32 = value_of_initializer %int.unegate.loc11_31 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_31.2: i32 = converted %int.unegate.loc11_31, %.loc11_31.1 [template = constants.%.3] +// CHECK:STDOUT: %int.usub: init i32 = call %Sub.ref(%.loc11_31.2, %.loc11_45) [template = constants.%.5] +// CHECK:STDOUT: %.loc11_24.1: i32 = value_of_initializer %int.usub [template = constants.%.5] +// CHECK:STDOUT: %.loc11_24.2: i32 = converted %int.usub, %.loc11_24.1 [template = constants.%.5] +// CHECK:STDOUT: %int.unegate.loc11_20: init i32 = call %Negate.ref.loc11_14(%.loc11_24.2) [template = constants.%.5] // CHECK:STDOUT: %.loc11_48.1: i32 = value_of_initializer %int.unegate.loc11_20 [template = constants.%.5] // CHECK:STDOUT: %.loc11_48.2: i32 = converted %int.unegate.loc11_20, %.loc11_48.1 [template = constants.%.5] // CHECK:STDOUT: %b: i32 = bind_name b, %.loc11_48.2 diff --git a/toolchain/check/testdata/builtins/int/usub.carbon b/toolchain/check/testdata/builtins/int/usub.carbon index 2d333cbf4571..c2032395f182 100644 --- a/toolchain/check/testdata/builtins/int/usub.carbon +++ b/toolchain/check/testdata/builtins/int/usub.carbon @@ -72,22 +72,24 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, %Sub.decl [template = constants.%Sub] @@ -107,30 +109,32 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a: i32, %b: i32) -> i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.usub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a @@ -191,22 +195,24 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] // CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc4_8 +// CHECK:STDOUT: %param.loc4_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc4_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] @@ -221,7 +227,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a: i32, %b: i32) -> i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.usub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -238,9 +244,9 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc7_25: i32 = int_literal 2147483647 [template = constants.%.3] // CHECK:STDOUT: %int.usub.loc7_21: init i32 = call %Sub.ref.loc7_18(%.loc7_22, %.loc7_25) [template = constants.%.4] // CHECK:STDOUT: %.loc7_38: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc7_17.1: i32 = value_of_initializer %int.usub.loc7_21 [template = constants.%.4] -// CHECK:STDOUT: %.loc7_17.2: i32 = converted %int.usub.loc7_21, %.loc7_17.1 [template = constants.%.4] -// CHECK:STDOUT: %int.usub.loc7_17: init i32 = call %Sub.ref.loc7_14(%.loc7_17.2, %.loc7_38) [template = constants.%.6] +// CHECK:STDOUT: %.loc7_21.1: i32 = value_of_initializer %int.usub.loc7_21 [template = constants.%.4] +// CHECK:STDOUT: %.loc7_21.2: i32 = converted %int.usub.loc7_21, %.loc7_21.1 [template = constants.%.4] +// CHECK:STDOUT: %int.usub.loc7_17: init i32 = call %Sub.ref.loc7_14(%.loc7_21.2, %.loc7_38) [template = constants.%.6] // CHECK:STDOUT: %.loc7_40.1: i32 = value_of_initializer %int.usub.loc7_17 [template = constants.%.6] // CHECK:STDOUT: %.loc7_40.2: i32 = converted %int.usub.loc7_17, %.loc7_40.1 [template = constants.%.6] // CHECK:STDOUT: %b: i32 = bind_name b, %.loc7_40.2 @@ -250,9 +256,9 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc8_25: i32 = int_literal 2147483647 [template = constants.%.3] // CHECK:STDOUT: %int.usub.loc8_21: init i32 = call %Sub.ref.loc8_18(%.loc8_22, %.loc8_25) [template = constants.%.4] // CHECK:STDOUT: %.loc8_38: i32 = int_literal 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc8_17.1: i32 = value_of_initializer %int.usub.loc8_21 [template = constants.%.4] -// CHECK:STDOUT: %.loc8_17.2: i32 = converted %int.usub.loc8_21, %.loc8_17.1 [template = constants.%.4] -// CHECK:STDOUT: %int.usub.loc8_17: init i32 = call %Sub.ref.loc8_14(%.loc8_17.2, %.loc8_38) [template = constants.%.3] +// CHECK:STDOUT: %.loc8_21.1: i32 = value_of_initializer %int.usub.loc8_21 [template = constants.%.4] +// CHECK:STDOUT: %.loc8_21.2: i32 = converted %int.usub.loc8_21, %.loc8_21.1 [template = constants.%.4] +// CHECK:STDOUT: %int.usub.loc8_17: init i32 = call %Sub.ref.loc8_14(%.loc8_21.2, %.loc8_38) [template = constants.%.3] // CHECK:STDOUT: %.loc8_40.1: i32 = value_of_initializer %int.usub.loc8_17 [template = constants.%.3] // CHECK:STDOUT: %.loc8_40.2: i32 = converted %int.usub.loc8_17, %.loc8_40.1 [template = constants.%.3] // CHECK:STDOUT: %c: i32 = bind_name c, %.loc8_40.2 diff --git a/toolchain/check/testdata/builtins/int/xor.carbon b/toolchain/check/testdata/builtins/int/xor.carbon index 1f271898a7fd..edcebc83797b 100644 --- a/toolchain/check/testdata/builtins/int/xor.carbon +++ b/toolchain/check/testdata/builtins/int/xor.carbon @@ -62,22 +62,24 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Xor.decl: %Xor.type = fn_decl @Xor [template = constants.%Xor] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] // CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] // CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc2_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc2_8 +// CHECK:STDOUT: %param.loc2_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc2_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Xor.ref: %Xor.type = name_ref Xor, %Xor.decl [template = constants.%Xor] @@ -97,30 +99,32 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] // CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc7_16 +// CHECK:STDOUT: %param.loc7_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc7_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Xor(%a: i32, %b: i32) -> i32 = "int.xor"; +// CHECK:STDOUT: fn @Xor(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.xor"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a: i32, %b: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Xor.ref: %Xor.type = name_ref Xor, file.%Xor.decl [template = constants.%Xor] // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/print.carbon b/toolchain/check/testdata/builtins/print.carbon index 309c73130c3e..e176378c1017 100644 --- a/toolchain/check/testdata/builtins/print.carbon +++ b/toolchain/check/testdata/builtins/print.carbon @@ -46,7 +46,7 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Print.type.2 = import_ref Core//prelude, inst+46, loaded [template = constants.%Print.2] +// CHECK:STDOUT: %import_ref.2: %Print.type.2 = import_ref Core//prelude, inst+47, loaded [template = constants.%Print.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -58,19 +58,20 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Print.decl: %Print.type.1 = fn_decl @Print.1 [template = constants.%Print.1] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32, %.loc11_13.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Print.1(%a: i32) = "print.int"; +// CHECK:STDOUT: fn @Print.1(%a.param_patt: i32) = "print.int"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: @@ -84,5 +85,5 @@ fn Main() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Print.2(%x: i32) = "print.int"; +// CHECK:STDOUT: fn @Print.2(%x.param_patt: i32) = "print.int"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index b209875ee0db..3cec6f9c27d9 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -386,14 +386,15 @@ class A { // CHECK:STDOUT: %.loc5_21: %.2 = field_decl radius, element0 [template] // CHECK:STDOUT: %GetRadius.decl: %GetRadius.type = fn_decl @GetRadius [template = constants.%GetRadius] { // CHECK:STDOUT: %self.patt: %Circle = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Circle = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] -// CHECK:STDOUT: %self.param: %Circle = param self, runtime_param0 -// CHECK:STDOUT: %self: %Circle = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_33.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc7_33.2: type = converted %int.make_type_32, %.loc7_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Circle = param runtime_param0 +// CHECK:STDOUT: %self: %Circle = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %SomeInternalFunction.decl: %SomeInternalFunction.type = fn_decl @SomeInternalFunction [template = constants.%SomeInternalFunction] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -403,14 +404,15 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %Compute.decl: %Compute.type = fn_decl @Compute [template = constants.%Compute] { // CHECK:STDOUT: %self.patt: %Circle = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Circle = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] -// CHECK:STDOUT: %self.param: %Circle = param self, runtime_param0 -// CHECK:STDOUT: %self: %Circle = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_31.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_31.2: type = converted %int.make_type_32, %.loc15_31.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Circle = param runtime_param0 +// CHECK:STDOUT: %self: %Circle = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc18: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -424,7 +426,7 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GetRadius[%self: %Circle]() -> i32 { +// CHECK:STDOUT: fn @GetRadius[%self.param_patt: %Circle]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Circle = name_ref self, %self // CHECK:STDOUT: %radius.ref: %.2 = name_ref radius, @Circle.%.loc5_21 [template = @Circle.%.loc5_21] @@ -439,7 +441,7 @@ class A { // CHECK:STDOUT: return %.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Compute[%self: %Circle]() -> i32 { +// CHECK:STDOUT: fn @Compute[%self.param_patt: %Circle]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Circle = name_ref self, %self // CHECK:STDOUT: %SomeInternalFunction.ref: %SomeInternalFunction.type = name_ref SomeInternalFunction, @Circle.%SomeInternalFunction.decl [template = constants.%SomeInternalFunction] diff --git a/toolchain/check/testdata/class/adapt.carbon b/toolchain/check/testdata/class/adapt.carbon index d057b53f3928..ccdff16ca5c5 100644 --- a/toolchain/check/testdata/class/adapt.carbon +++ b/toolchain/check/testdata/class/adapt.carbon @@ -173,10 +173,11 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: %AdaptNotExtend.decl: type = class_decl @AdaptNotExtend [template = constants.%AdaptNotExtend] {} {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %a.patt: %AdaptNotExtend = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %AdaptNotExtend = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %AdaptNotExtend.ref: type = name_ref AdaptNotExtend, file.%AdaptNotExtend.decl [template = constants.%AdaptNotExtend] -// CHECK:STDOUT: %a.param: %AdaptNotExtend = param a, runtime_param0 -// CHECK:STDOUT: %a: %AdaptNotExtend = bind_name a, %a.param +// CHECK:STDOUT: %param: %AdaptNotExtend = param runtime_param0 +// CHECK:STDOUT: %a: %AdaptNotExtend = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -200,7 +201,7 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2(%a: %AdaptNotExtend) { +// CHECK:STDOUT: fn @F.2(%a.param_patt: %AdaptNotExtend) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %AdaptNotExtend = name_ref a, %a // CHECK:STDOUT: %F.ref: = name_ref F, [template = ] diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index d48039438693..5ff607a6a152 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -91,10 +91,9 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d +// CHECK:STDOUT: %d.param_patt: %Derived = param_pattern %d.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.param: %Derived = param d, runtime_param0 -// CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %int.make_type_32.loc25_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc25_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc25_35.1: %.16 = tuple_literal (%int.make_type_32.loc25_27, %int.make_type_32.loc25_32) @@ -104,6 +103,8 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %.loc25_35.5: type = converted %int.make_type_32.loc25_32, %.loc25_35.4 [template = i32] // CHECK:STDOUT: %.loc25_35.6: type = converted %.loc25_35.1, constants.%.17 [template = constants.%.17] // CHECK:STDOUT: %return: ref %.17 = var +// CHECK:STDOUT: %param: %Derived = param runtime_param0 +// CHECK:STDOUT: %d: %Derived = bind_name d, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -155,7 +156,7 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: return %.loc22_36 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Access(%d: %Derived) -> %return: %.17 { +// CHECK:STDOUT: fn @Access(%d.param_patt: %Derived) -> %return: %.17 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref.loc26_11: %Derived = name_ref d, %d // CHECK:STDOUT: %d.ref.loc26_12: %.7 = name_ref d, @Derived.%.loc18_8 [template = @Derived.%.loc18_8] diff --git a/toolchain/check/testdata/class/base_field.carbon b/toolchain/check/testdata/class/base_field.carbon index e4e82b79c2f5..c8d3d2186020 100644 --- a/toolchain/check/testdata/class/base_field.carbon +++ b/toolchain/check/testdata/class/base_field.carbon @@ -77,16 +77,17 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} // CHECK:STDOUT: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { // CHECK:STDOUT: %p.patt: %.10 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.10 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %.loc24_21: type = ptr_type %Derived [template = constants.%.10] -// CHECK:STDOUT: %p.param: %.10 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.10 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc24_30.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc24_30.2: type = converted %int.make_type_32, %.loc24_30.1 [template = i32] // CHECK:STDOUT: %.loc24_30.3: type = ptr_type i32 [template = constants.%.11] // CHECK:STDOUT: %return: ref %.11 = var +// CHECK:STDOUT: %param: %.10 = param runtime_param0 +// CHECK:STDOUT: %p: %.10 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -135,7 +136,7 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Access(%p: %.10) -> %.11 { +// CHECK:STDOUT: fn @Access(%p.param_patt: %.10) -> %.11 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.10 = name_ref p, %p // CHECK:STDOUT: %.loc25_12: ref %Derived = deref %p.ref diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index 84251121dc5d..08aeedf08f84 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -78,21 +78,23 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.3 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc17_11: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Base [template = constants.%Base] // CHECK:STDOUT: %.loc17_26: type = ptr_type %Base [template = constants.%.3] -// CHECK:STDOUT: %self.param.loc17: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc17: %.3 = bind_name self, %self.param.loc17 -// CHECK:STDOUT: %.loc17_11: %.3 = addr_pattern %self.loc17 +// CHECK:STDOUT: %param.loc17: %.3 = param runtime_param0 +// CHECK:STDOUT: %self.loc17: %.3 = bind_name self, %param.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %p.patt: %.11 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.11 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %.loc25: type = ptr_type %Derived [template = constants.%.11] -// CHECK:STDOUT: %p.param: %.11 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.11 = bind_name p, %p.param +// CHECK:STDOUT: %param: %.11 = param runtime_param0 +// CHECK:STDOUT: %p: %.11 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -103,12 +105,13 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.3 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc17_11: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %.loc14_23: type = ptr_type %Base [template = constants.%.3] -// CHECK:STDOUT: %self.param.loc14: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc14: %.3 = bind_name self, %self.param.loc14 -// CHECK:STDOUT: %.loc14_8: %.3 = addr_pattern %self.loc14 +// CHECK:STDOUT: %.loc14: type = ptr_type %Base [template = constants.%.3] +// CHECK:STDOUT: %param.loc14: %.3 = param runtime_param0 +// CHECK:STDOUT: %self.loc14: %.3 = bind_name self, %param.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: @@ -131,7 +134,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[addr %self.loc17: %.3]() { +// CHECK:STDOUT: fn @F[addr %self.param_patt: %.3]() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %.3 = name_ref self, %self.loc17 // CHECK:STDOUT: %.loc18_4: ref %Base = deref %self.ref @@ -142,18 +145,18 @@ fn Call(p: Derived*) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%p: %.11) { +// CHECK:STDOUT: fn @Call(%p.param_patt: %.11) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.11 = name_ref p, %p // CHECK:STDOUT: %.loc26_4.1: ref %Derived = deref %p.ref // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Base.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc26_7: = bound_method %.loc26_4.1, %F.ref // CHECK:STDOUT: %.loc26_4.2: %.11 = addr_of %.loc26_4.1 -// CHECK:STDOUT: %.loc26_9.1: ref %Derived = deref %.loc26_4.2 -// CHECK:STDOUT: %.loc26_9.2: ref %Base = class_element_access %.loc26_9.1, element0 -// CHECK:STDOUT: %.loc26_9.3: %.3 = addr_of %.loc26_9.2 -// CHECK:STDOUT: %.loc26_9.4: %.3 = converted %.loc26_4.2, %.loc26_9.3 -// CHECK:STDOUT: %F.call: init %.1 = call %.loc26_7(%.loc26_9.4) +// CHECK:STDOUT: %.loc26_4.3: ref %Derived = deref %.loc26_4.2 +// CHECK:STDOUT: %.loc26_4.4: ref %Base = class_element_access %.loc26_4.3, element0 +// CHECK:STDOUT: %.loc26_4.5: %.3 = addr_of %.loc26_4.4 +// CHECK:STDOUT: %.loc26_4.6: %.3 = converted %.loc26_4.2, %.loc26_4.5 +// CHECK:STDOUT: %F.call: init %.1 = call %.loc26_7(%.loc26_4.6) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base_method_qualified.carbon b/toolchain/check/testdata/class/base_method_qualified.carbon index bad9bb5d4bd0..efbf5a5b860d 100644 --- a/toolchain/check/testdata/class/base_method_qualified.carbon +++ b/toolchain/check/testdata/class/base_method_qualified.carbon @@ -104,49 +104,53 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %Derived.decl.loc18: type = class_decl @Derived [template = constants.%Derived] {} {} // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %a.patt: %Derived = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %Derived = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %a.param: %Derived = param a, runtime_param0 -// CHECK:STDOUT: %a: %Derived = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc25_24.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc25_24.2: type = converted %int.make_type_32, %.loc25_24.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Derived = param runtime_param0 +// CHECK:STDOUT: %a: %Derived = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [template = constants.%CallIndirect] { // CHECK:STDOUT: %p.patt: %.10 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.10 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %.loc29_27: type = ptr_type %Derived [template = constants.%.10] -// CHECK:STDOUT: %p.param: %.10 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.10 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc29_33.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc29_33.2: type = converted %int.make_type_32, %.loc29_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.10 = param runtime_param0 +// CHECK:STDOUT: %p: %.10 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %PassDerivedToBase.decl: %PassDerivedToBase.type = fn_decl @PassDerivedToBase [template = constants.%PassDerivedToBase] { // CHECK:STDOUT: %a.patt: %Derived = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %Derived = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %a.param: %Derived = param a, runtime_param0 -// CHECK:STDOUT: %a: %Derived = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc33_37.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc33_37.2: type = converted %int.make_type_32, %.loc33_37.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Derived = param runtime_param0 +// CHECK:STDOUT: %a: %Derived = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %PassDerivedToBaseIndirect.decl: %PassDerivedToBaseIndirect.type = fn_decl @PassDerivedToBaseIndirect [template = constants.%PassDerivedToBaseIndirect] { // CHECK:STDOUT: %p.patt: %.10 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.10 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %.loc37_40: type = ptr_type %Derived [template = constants.%.10] -// CHECK:STDOUT: %p.param: %.10 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.10 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc37_46.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc37_46.2: type = converted %int.make_type_32, %.loc37_46.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.10 = param runtime_param0 +// CHECK:STDOUT: %p: %.10 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -155,17 +159,19 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %.loc19: %.5 = base_decl %Base, element0 [template] // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %self.patt: %Derived = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Derived = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Derived [template = constants.%Derived] -// CHECK:STDOUT: %self.param: %Derived = param self, runtime_param0 -// CHECK:STDOUT: %self: %Derived = bind_name self, %self.param +// CHECK:STDOUT: %param: %Derived = param runtime_param0 +// CHECK:STDOUT: %self: %Derived = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] { // CHECK:STDOUT: %self.patt: %Derived = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Derived = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Derived [template = constants.%Derived] -// CHECK:STDOUT: %self.param: %Derived = param self, runtime_param0 -// CHECK:STDOUT: %self: %Derived = bind_name self, %self.param +// CHECK:STDOUT: %param: %Derived = param runtime_param0 +// CHECK:STDOUT: %self: %Derived = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc23: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: @@ -180,25 +186,27 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: %Base = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Base = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %self.param: %Base = param self, runtime_param0 -// CHECK:STDOUT: %self: %Base = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_25.2: type = converted %int.make_type_32, %.loc14_25.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Base = param runtime_param0 +// CHECK:STDOUT: %self: %Base = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] { // CHECK:STDOUT: %self.patt: %Derived = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Derived = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %self.param: %Derived = param self, runtime_param0 -// CHECK:STDOUT: %self: %Derived = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_28.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_28.2: type = converted %int.make_type_32, %.loc15_28.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Derived = param runtime_param0 +// CHECK:STDOUT: %self: %Derived = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -210,46 +218,46 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1[%self: %Base]() -> i32; +// CHECK:STDOUT: fn @F.1[%self.param_patt: %Base]() -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G.1[%self: %Derived]() -> i32; +// CHECK:STDOUT: fn @G.1[%self.param_patt: %Derived]() -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[%self: %Derived](); +// CHECK:STDOUT: fn @F.2[%self.param_patt: %Derived](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G.2[%self: %Derived](); +// CHECK:STDOUT: fn @G.2[%self.param_patt: %Derived](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%a: %Derived) -> i32 { +// CHECK:STDOUT: fn @Call(%a.param_patt: %Derived) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Derived = name_ref a, %a // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %F.ref: %F.type.1 = name_ref F, @Base.%F.decl [template = constants.%F.1] // CHECK:STDOUT: %.loc26_11: = bound_method %a.ref, %F.ref -// CHECK:STDOUT: %.loc26_20.1: ref %Base = class_element_access %a.ref, element0 -// CHECK:STDOUT: %.loc26_20.2: ref %Base = converted %a.ref, %.loc26_20.1 -// CHECK:STDOUT: %.loc26_20.3: %Base = bind_value %.loc26_20.2 -// CHECK:STDOUT: %F.call: init i32 = call %.loc26_11(%.loc26_20.3) +// CHECK:STDOUT: %.loc26_10.1: ref %Base = class_element_access %a.ref, element0 +// CHECK:STDOUT: %.loc26_10.2: ref %Base = converted %a.ref, %.loc26_10.1 +// CHECK:STDOUT: %.loc26_10.3: %Base = bind_value %.loc26_10.2 +// CHECK:STDOUT: %F.call: init i32 = call %.loc26_11(%.loc26_10.3) // CHECK:STDOUT: %.loc26_22.1: i32 = value_of_initializer %F.call // CHECK:STDOUT: %.loc26_22.2: i32 = converted %F.call, %.loc26_22.1 // CHECK:STDOUT: return %.loc26_22.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallIndirect(%p: %.10) -> i32 { +// CHECK:STDOUT: fn @CallIndirect(%p.param_patt: %.10) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.10 = name_ref p, %p // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %F.ref: %F.type.1 = name_ref F, @Base.%F.decl [template = constants.%F.1] // CHECK:STDOUT: %.loc30_11.1: ref %Derived = deref %p.ref // CHECK:STDOUT: %.loc30_11.2: = bound_method %.loc30_11.1, %F.ref -// CHECK:STDOUT: %.loc30_21.1: ref %Base = class_element_access %.loc30_11.1, element0 -// CHECK:STDOUT: %.loc30_21.2: ref %Base = converted %.loc30_11.1, %.loc30_21.1 -// CHECK:STDOUT: %.loc30_21.3: %Base = bind_value %.loc30_21.2 -// CHECK:STDOUT: %F.call: init i32 = call %.loc30_11.2(%.loc30_21.3) +// CHECK:STDOUT: %.loc30_11.3: ref %Base = class_element_access %.loc30_11.1, element0 +// CHECK:STDOUT: %.loc30_11.4: ref %Base = converted %.loc30_11.1, %.loc30_11.3 +// CHECK:STDOUT: %.loc30_11.5: %Base = bind_value %.loc30_11.4 +// CHECK:STDOUT: %F.call: init i32 = call %.loc30_11.2(%.loc30_11.5) // CHECK:STDOUT: %.loc30_23.1: i32 = value_of_initializer %F.call // CHECK:STDOUT: %.loc30_23.2: i32 = converted %F.call, %.loc30_23.1 // CHECK:STDOUT: return %.loc30_23.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @PassDerivedToBase(%a: %Derived) -> i32 { +// CHECK:STDOUT: fn @PassDerivedToBase(%a.param_patt: %Derived) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Derived = name_ref a, %a // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] @@ -261,7 +269,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: return %.loc34_22.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @PassDerivedToBaseIndirect(%p: %.10) -> i32 { +// CHECK:STDOUT: fn @PassDerivedToBaseIndirect(%p.param_patt: %.10) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.10 = name_ref p, %p // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] diff --git a/toolchain/check/testdata/class/base_method_shadow.carbon b/toolchain/check/testdata/class/base_method_shadow.carbon index 2dcda479efe3..fc6c84099349 100644 --- a/toolchain/check/testdata/class/base_method_shadow.carbon +++ b/toolchain/check/testdata/class/base_method_shadow.carbon @@ -98,38 +98,43 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %a.patt: %.1 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.1 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %.7 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %.7 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: %.13 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %.13 = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: %d.patt: %.17 = binding_pattern d +// CHECK:STDOUT: %d.param_patt: %.17 = param_pattern %d.patt, runtime_param3 // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc29_13: type = ptr_type %A [template = constants.%.1] -// CHECK:STDOUT: %a.param: %.1 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.1 = bind_name a, %a.param // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc29_20: type = ptr_type %B [template = constants.%.7] -// CHECK:STDOUT: %b.param: %.7 = param b, runtime_param1 -// CHECK:STDOUT: %b: %.7 = bind_name b, %b.param // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc29_27: type = ptr_type %C [template = constants.%.13] -// CHECK:STDOUT: %c.param: %.13 = param c, runtime_param2 -// CHECK:STDOUT: %c: %.13 = bind_name c, %c.param // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %.loc29_34: type = ptr_type %D [template = constants.%.17] -// CHECK:STDOUT: %d.param: %.17 = param d, runtime_param3 -// CHECK:STDOUT: %d: %.17 = bind_name d, %d.param +// CHECK:STDOUT: %param.loc29_9: %.1 = param runtime_param0 +// CHECK:STDOUT: %a: %.1 = bind_name a, %param.loc29_9 +// CHECK:STDOUT: %param.loc29_16: %.7 = param runtime_param1 +// CHECK:STDOUT: %b: %.7 = bind_name b, %param.loc29_16 +// CHECK:STDOUT: %param.loc29_23: %.13 = param runtime_param2 +// CHECK:STDOUT: %c: %.13 = bind_name c, %param.loc29_23 +// CHECK:STDOUT: %param.loc29_30: %.17 = param runtime_param3 +// CHECK:STDOUT: %d: %.17 = bind_name d, %param.loc29_30 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: %.1 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.1 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc12_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%A [template = constants.%A] // CHECK:STDOUT: %.loc12_23: type = ptr_type %A [template = constants.%.1] -// CHECK:STDOUT: %self.param: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.1 = bind_name self, %self.param -// CHECK:STDOUT: %.loc12_8: %.1 = addr_pattern %self +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %self: %.1 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -143,12 +148,13 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %.loc16: %.6 = base_decl %A, element0 [template] // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %self.patt: %.7 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.7 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc17_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] // CHECK:STDOUT: %.loc17_23: type = ptr_type %B [template = constants.%.7] -// CHECK:STDOUT: %self.param: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.7 = bind_name self, %self.param -// CHECK:STDOUT: %.loc17_8: %.7 = addr_pattern %self +// CHECK:STDOUT: %param: %.7 = param runtime_param0 +// CHECK:STDOUT: %self: %.7 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc18: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: @@ -164,12 +170,13 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %.loc21: %.12 = base_decl %B, element0 [template] // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] { // CHECK:STDOUT: %self.patt: %.13 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.13 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc22_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %.loc22_23: type = ptr_type %C [template = constants.%.13] -// CHECK:STDOUT: %self.param: %.13 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.13 = bind_name self, %self.param -// CHECK:STDOUT: %.loc22_8: %.13 = addr_pattern %self +// CHECK:STDOUT: %param: %.13 = param runtime_param0 +// CHECK:STDOUT: %self: %.13 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc23: = complete_type_witness %.14 [template = constants.%.15] // CHECK:STDOUT: @@ -191,13 +198,13 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: extend name_scope3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1[addr %self: %.1](); +// CHECK:STDOUT: fn @F.1[addr %self.param_patt: %.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[addr %self: %.7](); +// CHECK:STDOUT: fn @F.2[addr %self.param_patt: %.7](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.3[addr %self: %.13](); +// CHECK:STDOUT: fn @F.3[addr %self.param_patt: %.13](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%a: %.1, %b: %.7, %c: %.13, %d: %.17) { +// CHECK:STDOUT: fn @Call(%a.param_patt: %.1, %b.param_patt: %.7, %c.param_patt: %.13, %d.param_patt: %.17) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.1 = name_ref a, %a // CHECK:STDOUT: %.loc30_4.1: ref %A = deref %a.ref @@ -222,11 +229,11 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %F.ref.loc33: %F.type.2 = name_ref F, @B.%F.decl [template = constants.%F.2] // CHECK:STDOUT: %.loc33_7: = bound_method %.loc33_4.1, %F.ref.loc33 // CHECK:STDOUT: %.loc33_4.2: %.17 = addr_of %.loc33_4.1 -// CHECK:STDOUT: %.loc33_9.1: ref %D = deref %.loc33_4.2 -// CHECK:STDOUT: %.loc33_9.2: ref %B = class_element_access %.loc33_9.1, element0 -// CHECK:STDOUT: %.loc33_9.3: %.7 = addr_of %.loc33_9.2 -// CHECK:STDOUT: %.loc33_9.4: %.7 = converted %.loc33_4.2, %.loc33_9.3 -// CHECK:STDOUT: %F.call.loc33: init %.2 = call %.loc33_7(%.loc33_9.4) +// CHECK:STDOUT: %.loc33_4.3: ref %D = deref %.loc33_4.2 +// CHECK:STDOUT: %.loc33_4.4: ref %B = class_element_access %.loc33_4.3, element0 +// CHECK:STDOUT: %.loc33_4.5: %.7 = addr_of %.loc33_4.4 +// CHECK:STDOUT: %.loc33_4.6: %.7 = converted %.loc33_4.2, %.loc33_4.5 +// CHECK:STDOUT: %F.call.loc33: init %.2 = call %.loc33_7(%.loc33_4.6) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index 97ad4fe8c144..320800ff4661 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -71,16 +71,17 @@ fn Run() -> i32 { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc21_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_15.1: type = value_of_initializer %int.make_type_32.loc21_15 [template = i32] // CHECK:STDOUT: %.loc21_15.2: type = converted %int.make_type_32.loc21_15, %.loc21_15.1 [template = i32] -// CHECK:STDOUT: %n.param.loc21: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc21: i32 = bind_name n, %n.param.loc21 // CHECK:STDOUT: %int.make_type_32.loc21_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_23.1: type = value_of_initializer %int.make_type_32.loc21_23 [template = i32] // CHECK:STDOUT: %.loc21_23.2: type = converted %int.make_type_32.loc21_23, %.loc21_23.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc21: i32 = param runtime_param0 +// CHECK:STDOUT: %n.loc21: i32 = bind_name n, %param.loc21 // CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -93,29 +94,31 @@ fn Run() -> i32 { // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc12_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32.loc12_11 [template = i32] // CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32.loc12_11, %.loc12_11.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %int.make_type_32.loc12_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_32.loc12_19 [template = i32] // CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_32.loc12_19, %.loc12_19.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc16_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_32.loc16_11 [template = i32] // CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_32.loc16_11, %.loc16_11.1 [template = i32] -// CHECK:STDOUT: %n.param.loc16: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc16: i32 = bind_name n, %n.param.loc16 // CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] // CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32.loc16_19, %.loc16_19.1 [template = i32] // CHECK:STDOUT: %return.var.loc16: ref i32 = var +// CHECK:STDOUT: %param.loc16: i32 = param runtime_param0 +// CHECK:STDOUT: %n.loc16: i32 = bind_name n, %param.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -132,13 +135,13 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n: i32) -> i32 { +// CHECK:STDOUT: fn @F(%n.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n.loc21: i32) -> i32 { +// CHECK:STDOUT: fn @G(%n.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc21 // CHECK:STDOUT: return %n.ref diff --git a/toolchain/check/testdata/class/complete_in_member_fn.carbon b/toolchain/check/testdata/class/complete_in_member_fn.carbon index a4cace469247..a9c80b1e0aee 100644 --- a/toolchain/check/testdata/class/complete_in_member_fn.carbon +++ b/toolchain/check/testdata/class/complete_in_member_fn.carbon @@ -56,14 +56,15 @@ class C { // CHECK:STDOUT: class @C { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %C = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %c.param: %C = param c, runtime_param0 -// CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_17.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_17.2: type = converted %int.make_type_32, %.loc12_17.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %c: %C = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -79,7 +80,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%c: %C) -> i32 { +// CHECK:STDOUT: fn @F(%c.param_patt: %C) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %a.ref: %.2 = name_ref a, @C.%.loc14_8 [template = @C.%.loc14_8] diff --git a/toolchain/check/testdata/class/compound_field.carbon b/toolchain/check/testdata/class/compound_field.carbon index 4613c614d1b9..9c941f6504f0 100644 --- a/toolchain/check/testdata/class/compound_field.carbon +++ b/toolchain/check/testdata/class/compound_field.carbon @@ -98,51 +98,55 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} // CHECK:STDOUT: %AccessDerived.decl: %AccessDerived.type = fn_decl @AccessDerived [template = constants.%AccessDerived] { // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d +// CHECK:STDOUT: %d.param_patt: %Derived = param_pattern %d.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref.loc24: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.param: %Derived = param d, runtime_param0 -// CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc24_33.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc24_33.2: type = converted %int.make_type_32, %.loc24_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Derived = param runtime_param0 +// CHECK:STDOUT: %d: %Derived = bind_name d, %param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessBase.decl: %AccessBase.type = fn_decl @AccessBase [template = constants.%AccessBase] { // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d +// CHECK:STDOUT: %d.param_patt: %Derived = param_pattern %d.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.param: %Derived = param d, runtime_param0 -// CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc28_30.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc28_30.2: type = converted %int.make_type_32, %.loc28_30.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Derived = param runtime_param0 +// CHECK:STDOUT: %d: %Derived = bind_name d, %param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessDerivedIndirect.decl: %AccessDerivedIndirect.type = fn_decl @AccessDerivedIndirect [template = constants.%AccessDerivedIndirect] { // CHECK:STDOUT: %p.patt: %.13 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.13 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref.loc32: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %.loc32_36: type = ptr_type %Derived [template = constants.%.13] -// CHECK:STDOUT: %p.param: %.13 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.13 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc32_45.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc32_45.2: type = converted %int.make_type_32, %.loc32_45.1 [template = i32] // CHECK:STDOUT: %.loc32_45.3: type = ptr_type i32 [template = constants.%.14] // CHECK:STDOUT: %return: ref %.14 = var +// CHECK:STDOUT: %param: %.13 = param runtime_param0 +// CHECK:STDOUT: %p: %.13 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessBaseIndirect.decl: %AccessBaseIndirect.type = fn_decl @AccessBaseIndirect [template = constants.%AccessBaseIndirect] { // CHECK:STDOUT: %p.patt: %.13 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.13 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %.loc36_33: type = ptr_type %Derived [template = constants.%.13] -// CHECK:STDOUT: %p.param: %.13 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.13 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc36_42.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc36_42.2: type = converted %int.make_type_32, %.loc36_42.1 [template = i32] // CHECK:STDOUT: %.loc36_42.3: type = ptr_type i32 [template = constants.%.14] // CHECK:STDOUT: %return: ref %.14 = var +// CHECK:STDOUT: %param: %.13 = param runtime_param0 +// CHECK:STDOUT: %p: %.13 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -191,7 +195,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessDerived(%d: %Derived) -> i32 { +// CHECK:STDOUT: fn @AccessDerived(%d.param_patt: %Derived) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref.loc25_10: %Derived = name_ref d, %d // CHECK:STDOUT: %Derived.ref.loc25: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] @@ -201,7 +205,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: return %.loc25_11.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessBase(%d: %Derived) -> i32 { +// CHECK:STDOUT: fn @AccessBase(%d.param_patt: %Derived) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] @@ -213,7 +217,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: return %.loc29_11.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessDerivedIndirect(%p: %.13) -> %.14 { +// CHECK:STDOUT: fn @AccessDerivedIndirect(%p.param_patt: %.13) -> %.14 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.13 = name_ref p, %p // CHECK:STDOUT: %Derived.ref.loc33: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] @@ -224,7 +228,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: return %.loc33_10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessBaseIndirect(%p: %.13) -> %.14 { +// CHECK:STDOUT: fn @AccessBaseIndirect(%p.param_patt: %.13) -> %.14 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.13 = name_ref p, %p // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index 98d90598b306..ab3826df4e98 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -124,54 +124,59 @@ fn ConvertInit() { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %ConvertCToB.decl: %ConvertCToB.type = fn_decl @ConvertCToB [template = constants.%ConvertCToB] { // CHECK:STDOUT: %p.patt: %.17 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.17 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc25_20: type = ptr_type %C [template = constants.%.17] -// CHECK:STDOUT: %p.param: %.17 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.17 = bind_name p, %p.param // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc25_27: type = ptr_type %B [template = constants.%.18] // CHECK:STDOUT: %return: ref %.18 = var +// CHECK:STDOUT: %param: %.17 = param runtime_param0 +// CHECK:STDOUT: %p: %.17 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertBToA.decl: %ConvertBToA.type = fn_decl @ConvertBToA [template = constants.%ConvertBToA] { // CHECK:STDOUT: %p.patt: %.18 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.18 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc26_20: type = ptr_type %B [template = constants.%.18] -// CHECK:STDOUT: %p.param: %.18 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.18 = bind_name p, %p.param // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc26_27: type = ptr_type %A [template = constants.%.22] // CHECK:STDOUT: %return: ref %.22 = var +// CHECK:STDOUT: %param: %.18 = param runtime_param0 +// CHECK:STDOUT: %p: %.18 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertCToA.decl: %ConvertCToA.type = fn_decl @ConvertCToA [template = constants.%ConvertCToA] { // CHECK:STDOUT: %p.patt: %.17 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.17 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc27_20: type = ptr_type %C [template = constants.%.17] -// CHECK:STDOUT: %p.param: %.17 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.17 = bind_name p, %p.param // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc27_27: type = ptr_type %A [template = constants.%.22] // CHECK:STDOUT: %return: ref %.22 = var +// CHECK:STDOUT: %param: %.17 = param runtime_param0 +// CHECK:STDOUT: %p: %.17 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertValue.decl: %ConvertValue.type = fn_decl @ConvertValue [template = constants.%ConvertValue] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %C = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %c.param: %C = param c, runtime_param0 -// CHECK:STDOUT: %c: %C = bind_name c, %c.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %c: %C = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertRef.decl: %ConvertRef.type = fn_decl @ConvertRef [template = constants.%ConvertRef] { // CHECK:STDOUT: %c.patt: %.17 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %.17 = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc33_19: type = ptr_type %C [template = constants.%.17] -// CHECK:STDOUT: %c.param: %.17 = param c, runtime_param0 -// CHECK:STDOUT: %c: %.17 = bind_name c, %c.param // CHECK:STDOUT: %A.ref.loc33: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc33_26: type = ptr_type %A [template = constants.%.22] // CHECK:STDOUT: %return: ref %.22 = var +// CHECK:STDOUT: %param: %.17 = param runtime_param0 +// CHECK:STDOUT: %c: %.17 = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertInit.decl: %ConvertInit.type = fn_decl @ConvertInit [template = constants.%ConvertInit] {} {} // CHECK:STDOUT: } @@ -222,7 +227,7 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertCToB(%p: %.17) -> %.18 { +// CHECK:STDOUT: fn @ConvertCToB(%p.param_patt: %.17) -> %.18 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.17 = name_ref p, %p // CHECK:STDOUT: %.loc25_39.1: ref %C = deref %p.ref @@ -232,7 +237,7 @@ fn ConvertInit() { // CHECK:STDOUT: return %.loc25_39.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertBToA(%p: %.18) -> %.22 { +// CHECK:STDOUT: fn @ConvertBToA(%p.param_patt: %.18) -> %.22 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.18 = name_ref p, %p // CHECK:STDOUT: %.loc26_39.1: ref %B = deref %p.ref @@ -242,7 +247,7 @@ fn ConvertInit() { // CHECK:STDOUT: return %.loc26_39.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertCToA(%p: %.17) -> %.22 { +// CHECK:STDOUT: fn @ConvertCToA(%p.param_patt: %.17) -> %.22 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.17 = name_ref p, %p // CHECK:STDOUT: %.loc27_39.1: ref %C = deref %p.ref @@ -253,7 +258,7 @@ fn ConvertInit() { // CHECK:STDOUT: return %.loc27_39.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertValue(%c: %C) { +// CHECK:STDOUT: fn @ConvertValue(%c.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %c.ref: %C = name_ref c, %c @@ -265,7 +270,7 @@ fn ConvertInit() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertRef(%c: %.17) -> %.22 { +// CHECK:STDOUT: fn @ConvertRef(%c.param_patt: %.17) -> %.22 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %.17 = name_ref c, %c // CHECK:STDOUT: %.loc34_12: ref %C = deref %c.ref diff --git a/toolchain/check/testdata/class/extend_adapt.carbon b/toolchain/check/testdata/class/extend_adapt.carbon index 55dc2469f62f..ec28dbe21fdd 100644 --- a/toolchain/check/testdata/class/extend_adapt.carbon +++ b/toolchain/check/testdata/class/extend_adapt.carbon @@ -50,13 +50,13 @@ class SomeClassAdapter { fn F(a: SomeClassAdapter) { // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass` // CHECK:STDERR: a.F(); - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: ^ // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+7]]:3: note: type `SomeClassAdapter` does not implement interface `ImplicitAs` // CHECK:STDERR: a.F(); - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: ^ // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE-14]]:8: note: initializing `self` parameter of method declared here // CHECK:STDERR: fn F[self: Self](); - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: a.F(); } @@ -148,17 +148,19 @@ class StructAdapter { // CHECK:STDOUT: %SomeClassAdapter.decl.loc15: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {} // CHECK:STDOUT: %TestStaticMemberFunction.decl: %TestStaticMemberFunction.type = fn_decl @TestStaticMemberFunction [template = constants.%TestStaticMemberFunction] { // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] -// CHECK:STDOUT: %a.param: %SomeClassAdapter = param a, runtime_param0 -// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param +// CHECK:STDOUT: %param: %SomeClassAdapter = param runtime_param0 +// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAdapterMethod.decl: %TestAdapterMethod.type = fn_decl @TestAdapterMethod [template = constants.%TestAdapterMethod] { // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] -// CHECK:STDOUT: %a.param: %SomeClassAdapter = param a, runtime_param0 -// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param +// CHECK:STDOUT: %param: %SomeClassAdapter = param runtime_param0 +// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -184,10 +186,11 @@ class StructAdapter { // CHECK:STDOUT: %StaticMemberFunction.decl: %StaticMemberFunction.type = fn_decl @StaticMemberFunction [template = constants.%StaticMemberFunction] {} {} // CHECK:STDOUT: %AdapterMethod.decl: %AdapterMethod.type = fn_decl @AdapterMethod [template = constants.%AdapterMethod] { // CHECK:STDOUT: %self.patt: %SomeClassAdapter = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %SomeClassAdapter = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] -// CHECK:STDOUT: %self.param: %SomeClassAdapter = param self, runtime_param0 -// CHECK:STDOUT: %self: %SomeClassAdapter = bind_name self, %self.param +// CHECK:STDOUT: %param: %SomeClassAdapter = param runtime_param0 +// CHECK:STDOUT: %self: %SomeClassAdapter = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -203,9 +206,9 @@ class StructAdapter { // CHECK:STDOUT: // CHECK:STDOUT: fn @StaticMemberFunction(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @AdapterMethod[%self: %SomeClassAdapter](); +// CHECK:STDOUT: fn @AdapterMethod[%self.param_patt: %SomeClassAdapter](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestStaticMemberFunction(%a: %SomeClassAdapter) { +// CHECK:STDOUT: fn @TestStaticMemberFunction(%a.param_patt: %SomeClassAdapter) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a // CHECK:STDOUT: %StaticMemberFunction.ref: %StaticMemberFunction.type = name_ref StaticMemberFunction, @SomeClass.%StaticMemberFunction.decl [template = constants.%StaticMemberFunction] @@ -213,7 +216,7 @@ class StructAdapter { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAdapterMethod(%a: %SomeClassAdapter) { +// CHECK:STDOUT: fn @TestAdapterMethod(%a.param_patt: %SomeClassAdapter) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a // CHECK:STDOUT: %AdapterMethod.ref: %AdapterMethod.type = name_ref AdapterMethod, @SomeClass.%AdapterMethod.decl [template = constants.%AdapterMethod] @@ -241,6 +244,7 @@ class StructAdapter { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -266,12 +270,12 @@ class StructAdapter { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -286,15 +290,17 @@ class StructAdapter { // CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter] -// CHECK:STDOUT: %a.param: %SomeClassAdapter = param a, runtime_param0 -// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param +// CHECK:STDOUT: %param: %SomeClassAdapter = param runtime_param0 +// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -315,10 +321,11 @@ class StructAdapter { // CHECK:STDOUT: class @SomeClass { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: %SomeClass = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %SomeClass = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SomeClass [template = constants.%SomeClass] -// CHECK:STDOUT: %self.param: %SomeClass = param self, runtime_param0 -// CHECK:STDOUT: %self: %SomeClass = bind_name self, %self.param +// CHECK:STDOUT: %param: %SomeClass = param runtime_param0 +// CHECK:STDOUT: %self: %SomeClass = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -337,17 +344,17 @@ class StructAdapter { // CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1[%self: %SomeClass](); +// CHECK:STDOUT: fn @F.1[%self.param_patt: %SomeClass](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2(%a: %SomeClassAdapter) { +// CHECK:STDOUT: fn @F.2(%a.param_patt: %SomeClassAdapter) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a // CHECK:STDOUT: %F.ref: %F.type.1 = name_ref F, @SomeClass.%F.decl [template = constants.%F.1] // CHECK:STDOUT: %.loc23_4: = bound_method %a.ref, %F.ref // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%SomeClass) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc23_6.1: %.8 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%SomeClass) [template = constants.%.9] -// CHECK:STDOUT: %Convert.ref: %.8 = name_ref Convert, %.loc23_6.1 [template = constants.%.9] -// CHECK:STDOUT: %.loc23_6.2: %SomeClass = converted %a.ref, [template = ] +// CHECK:STDOUT: %.loc23_3.1: %.8 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%SomeClass) [template = constants.%.9] +// CHECK:STDOUT: %Convert.ref: %.8 = name_ref Convert, %.loc23_3.1 [template = constants.%.9] +// CHECK:STDOUT: %.loc23_3.2: %SomeClass = converted %a.ref, [template = ] // CHECK:STDOUT: %F.call: init %.1 = call %.loc23_4() [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -357,19 +364,22 @@ class StructAdapter { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -380,6 +390,7 @@ class StructAdapter { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%SomeClass) { // CHECK:STDOUT: %Dest => constants.%SomeClass +// CHECK:STDOUT: %Dest.patt => constants.%SomeClass // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -410,6 +421,7 @@ class StructAdapter { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -437,12 +449,12 @@ class StructAdapter { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.7) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.11)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.7) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.11)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -457,19 +469,21 @@ class StructAdapter { // CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter] -// CHECK:STDOUT: %a.param: %SomeClassAdapter = param a, runtime_param0 -// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_30.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc13_30.2: type = converted %int.make_type_32, %.loc13_30.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %SomeClassAdapter = param runtime_param0 +// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -516,7 +530,7 @@ class StructAdapter { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a: %SomeClassAdapter) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: %SomeClassAdapter) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a // CHECK:STDOUT: %b.ref: %.2 = name_ref b, @SomeClass.%.loc6_8 [template = @SomeClass.%.loc6_8] @@ -533,19 +547,22 @@ class StructAdapter { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -556,6 +573,7 @@ class StructAdapter { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%SomeClass) { // CHECK:STDOUT: %Dest => constants.%SomeClass +// CHECK:STDOUT: %Dest.patt => constants.%SomeClass // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index e2424d6aec44..157c8bd9dd9a 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -326,10 +326,11 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: %Abstract = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %Abstract = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Abstract.ref.loc7: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] -// CHECK:STDOUT: %a.param: %Abstract = param a, runtime_param0 -// CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param +// CHECK:STDOUT: %param: %Abstract = param runtime_param0 +// CHECK:STDOUT: %a: %Abstract = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -340,7 +341,7 @@ fn CallReturnAbstract() { // CHECK:STDOUT: .Self = constants.%Abstract // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a: %Abstract) { +// CHECK:STDOUT: fn @F(%a.param_patt: %Abstract) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Abstract.ref.loc8: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %a.ref: %Abstract = name_ref a, %a @@ -437,17 +438,19 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {} // CHECK:STDOUT: %Param.decl: %Param.type = fn_decl @Param [template = constants.%Param] { // CHECK:STDOUT: %a.patt: %Abstract = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %Abstract = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] -// CHECK:STDOUT: %a.param: %Abstract = param a, runtime_param0 -// CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param +// CHECK:STDOUT: %param: %Abstract = param runtime_param0 +// CHECK:STDOUT: %a: %Abstract = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %p.patt: %Abstract = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %Abstract = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] -// CHECK:STDOUT: %p.param: %Abstract = param p, runtime_param0 -// CHECK:STDOUT: %p: %Abstract = bind_name p, %p.param +// CHECK:STDOUT: %param: %Abstract = param runtime_param0 +// CHECK:STDOUT: %p: %Abstract = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -458,9 +461,9 @@ fn CallReturnAbstract() { // CHECK:STDOUT: .Self = constants.%Abstract // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Param(%a: %Abstract); +// CHECK:STDOUT: fn @Param(%a.param_patt: %Abstract); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%p: %Abstract) { +// CHECK:STDOUT: fn @Call(%p.param_patt: %Abstract) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Param.ref: %Param.type = name_ref Param, file.%Param.decl [template = constants.%Param] // CHECK:STDOUT: %p.ref: %Abstract = name_ref p, %p @@ -605,12 +608,13 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} // CHECK:STDOUT: %Return.decl: %Return.type = fn_decl @Return [template = constants.%Return] { // CHECK:STDOUT: %a.patt: %Abstract = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %Abstract = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Abstract.ref.loc13_14: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] -// CHECK:STDOUT: %a.param: %Abstract = param a, runtime_param0 -// CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param // CHECK:STDOUT: %Abstract.ref.loc13_27: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %return: ref %Abstract = var +// CHECK:STDOUT: %param: %Abstract = param runtime_param0 +// CHECK:STDOUT: %a: %Abstract = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -639,7 +643,7 @@ fn CallReturnAbstract() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Return(%a: %Abstract) -> %return: %Abstract { +// CHECK:STDOUT: fn @Return(%a.param_patt: %Abstract) -> %return: %Abstract { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Abstract = name_ref a, %a // CHECK:STDOUT: return to %return @@ -695,14 +699,15 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} // CHECK:STDOUT: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d +// CHECK:STDOUT: %d.param_patt: %Derived = param_pattern %d.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.param: %Derived = param d, runtime_param0 -// CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_26.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_26.2: type = converted %int.make_type_32, %.loc14_26.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Derived = param runtime_param0 +// CHECK:STDOUT: %d: %Derived = bind_name d, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -736,7 +741,7 @@ fn CallReturnAbstract() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Access(%d: %Derived) -> i32 { +// CHECK:STDOUT: fn @Access(%d.param_patt: %Derived) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d // CHECK:STDOUT: %base.ref: %.6 = name_ref base, @Derived.%.loc9 [template = @Derived.%.loc9] diff --git a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon index 46c76f75b4be..1a62974af1de 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon @@ -113,6 +113,7 @@ class C { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -140,12 +141,12 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -158,15 +159,17 @@ class C { // CHECK:STDOUT: %Bad.decl: type = class_decl @Bad [template = constants.%Bad] {} {} // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { // CHECK:STDOUT: %b.patt: %Bad = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %Bad = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Bad.ref: type = name_ref Bad, file.%Bad.decl [template = constants.%Bad] -// CHECK:STDOUT: %b.param: %Bad = param b, runtime_param0 -// CHECK:STDOUT: %b: %Bad = bind_name b, %b.param +// CHECK:STDOUT: %param: %Bad = param runtime_param0 +// CHECK:STDOUT: %b: %Bad = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -202,10 +205,10 @@ class C { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Use(%b: %Bad) { +// CHECK:STDOUT: fn @Use(%b.param_patt: %Bad) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: %Bad = name_ref b, %b // CHECK:STDOUT: %F.ref: = name_ref F, [template = ] @@ -214,14 +217,17 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -232,6 +238,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -253,6 +260,7 @@ class C { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -280,12 +288,12 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -298,15 +306,17 @@ class C { // CHECK:STDOUT: %Bad.decl: type = class_decl @Bad [template = constants.%Bad] {} {} // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { // CHECK:STDOUT: %b.patt: %Bad = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %Bad = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Bad.ref: type = name_ref Bad, file.%Bad.decl [template = constants.%Bad] -// CHECK:STDOUT: %b.param: %Bad = param b, runtime_param0 -// CHECK:STDOUT: %b: %Bad = bind_name b, %b.param +// CHECK:STDOUT: %param: %Bad = param runtime_param0 +// CHECK:STDOUT: %b: %Bad = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -343,10 +353,10 @@ class C { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Use(%b: %Bad) { +// CHECK:STDOUT: fn @Use(%b.param_patt: %Bad) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: %Bad = name_ref b, %b // CHECK:STDOUT: %F.ref: = name_ref F, [template = ] @@ -355,14 +365,17 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -373,6 +386,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/class/fail_addr_not_self.carbon b/toolchain/check/testdata/class/fail_addr_not_self.carbon index df2702dbb6b3..5d45933528cc 100644 --- a/toolchain/check/testdata/class/fail_addr_not_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_not_self.carbon @@ -27,6 +27,7 @@ class Class { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %.1: type = ptr_type %Class [template] // CHECK:STDOUT: %a: %.1 = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt: %.1 = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.2: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -60,20 +61,22 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %a.patt: %.1 = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc16_13.2: %.1 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc16_13.1 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: %.1 = param_pattern %a.patt.loc16_13.2, runtime_param [symbolic = %a.patt.loc16_13.1 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc16: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %a.param: %.1 = param a, runtime_param -// CHECK:STDOUT: %a.loc16_13.1: %.1 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc16_13.2 (constants.%a)] +// CHECK:STDOUT: %param: %.1 = param runtime_param +// CHECK:STDOUT: %a.loc16_13.2: %.1 = bind_symbolic_name a, 0, %param [symbolic = %a.loc16_13.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %b.patt: %.1 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %.1 = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc21: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %b.param: %.1 = param b, runtime_param0 -// CHECK:STDOUT: %b: %.1 = bind_name b, %b.param +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %b: %.1 = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -83,15 +86,17 @@ class Class { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%a.loc16_13.1: %.1) { -// CHECK:STDOUT: %a.loc16_13.2: %.1 = bind_symbolic_name a, 0 [symbolic = %a.loc16_13.2 (constants.%a)] +// CHECK:STDOUT: generic fn @F(%a.loc16_13.2: %.1) { +// CHECK:STDOUT: %a.loc16_13.1: %.1 = bind_symbolic_name a, 0 [symbolic = %a.loc16_13.1 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc16_13.1: %.1 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc16_13.1 (constants.%a.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%a.loc16_13.1: %.1](); +// CHECK:STDOUT: fn[%a.param_patt: %.1](); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%b: %.1); +// CHECK:STDOUT: fn @G(%b.param_patt: %.1); // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%a) { -// CHECK:STDOUT: %a.loc16_13.2 => constants.%a +// CHECK:STDOUT: %a.loc16_13.1 => constants.%a +// CHECK:STDOUT: %a.patt.loc16_13.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index 19abf7921133..8c8875389ec2 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -10,40 +10,27 @@ class Class { fn F[addr self: Class*](); + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+4]]:8: error: `addr` can only be applied to a binding with a pointer type + // CHECK:STDERR: fn G[addr self: Class](); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn G[addr self: Class](); } fn F(c: Class, p: Class*) { - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+7]]:6: error: `addr self` method cannot be invoked on a value + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+6]]:3: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: c.F(); - // CHECK:STDERR: ^ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-8]]:13: note: initializing `addr self` parameter of method declared here + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-12]]:8: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: Class*](); - // CHECK:STDERR: ^~~~ - // CHECK:STDERR: + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ c.F(); - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+7]]:6: error: `addr self` method cannot be invoked on a value - // CHECK:STDERR: c.G(); - // CHECK:STDERR: ^ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-16]]:13: note: initializing `addr self` parameter of method declared here - // CHECK:STDERR: fn G[addr self: Class](); - // CHECK:STDERR: ^~~~ - // CHECK:STDERR: c.G(); // This call is OK. (*p).F(); - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `Class*` to `Class` - // CHECK:STDERR: (*p).G(); - // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+6]]:3: note: type `Class*` does not implement interface `ImplicitAs` - // CHECK:STDERR: (*p).G(); - // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-31]]:13: note: initializing `addr self` parameter of method declared here - // CHECK:STDERR: fn G[addr self: Class](); - // CHECK:STDERR: ^~~~ (*p).G(); } @@ -62,27 +49,10 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %.5: type = ptr_type %.3 [template] -// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] -// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = interface_type @ImplicitAs, @ImplicitAs(%Class) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%Class) [template] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [template] -// CHECK:STDOUT: %.10: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -92,12 +62,6 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -110,56 +74,40 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %Class = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: %p.patt: %.1 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.1 = param_pattern %p.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref.loc16_9: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.param: %Class = param c, runtime_param0 -// CHECK:STDOUT: %c: %Class = bind_name c, %c.param -// CHECK:STDOUT: %Class.ref.loc16_19: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc16: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %p.param: %.1 = param p, runtime_param1 -// CHECK:STDOUT: %p: %.1 = bind_name p, %p.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] -// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] -// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.6)] -// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.6) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.2 (constants.%.7)] -// CHECK:STDOUT: -// CHECK:STDOUT: interface { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .Convert = imports.%import_ref.3 -// CHECK:STDOUT: witness = (imports.%import_ref.4) +// CHECK:STDOUT: %Class.ref.loc20_9: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %Class.ref.loc20_19: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %.loc20: type = ptr_type %Class [template = constants.%.1] +// CHECK:STDOUT: %param.loc20_6: %Class = param runtime_param0 +// CHECK:STDOUT: %c: %Class = bind_name c, %param.loc20_6 +// CHECK:STDOUT: %param.loc20_16: %.1 = param runtime_param1 +// CHECK:STDOUT: %p: %.1 = bind_name p, %param.loc20_16 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: %.1 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.1 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc12_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc12_24: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %self.param: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.1 = bind_name self, %self.param -// CHECK:STDOUT: %.loc12_8: %.1 = addr_pattern %self +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %self: %.1 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %self.param: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self: %Class = bind_name self, %self.param -// CHECK:STDOUT: %.loc13: %Class = addr_pattern %self +// CHECK:STDOUT: %param: %Class = param runtime_param0 +// CHECK:STDOUT: %self: %Class = bind_name self, %param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc18: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -167,74 +115,32 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1[addr %self: %.1](); +// CHECK:STDOUT: fn @F.1[addr %self.param_patt: %.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr %self: %Class](); +// CHECK:STDOUT: fn @G[%self.param_patt: %Class](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2(%c: %Class, %p: %.1) { +// CHECK:STDOUT: fn @F.2(%c.param_patt: %Class, %p.param_patt: %.1) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %c.ref.loc24: %Class = name_ref c, %c -// CHECK:STDOUT: %F.ref.loc24: %F.type.1 = name_ref F, @Class.%F.decl [template = constants.%F.1] -// CHECK:STDOUT: %.loc24: = bound_method %c.ref.loc24, %F.ref.loc24 -// CHECK:STDOUT: %F.call.loc24: init %.2 = call %.loc24() [template = ] -// CHECK:STDOUT: %c.ref.loc33: %Class = name_ref c, %c -// CHECK:STDOUT: %G.ref.loc33: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] -// CHECK:STDOUT: %.loc33: = bound_method %c.ref.loc33, %G.ref.loc33 -// CHECK:STDOUT: %G.call.loc33: init %.2 = call %.loc33() [template = ] -// CHECK:STDOUT: %p.ref.loc36: %.1 = name_ref p, %p -// CHECK:STDOUT: %.loc36_4.1: ref %Class = deref %p.ref.loc36 -// CHECK:STDOUT: %F.ref.loc36: %F.type.1 = name_ref F, @Class.%F.decl [template = constants.%F.1] -// CHECK:STDOUT: %.loc36_7: = bound_method %.loc36_4.1, %F.ref.loc36 -// CHECK:STDOUT: %.loc36_4.2: %.1 = addr_of %.loc36_4.1 -// CHECK:STDOUT: %F.call.loc36: init %.2 = call %.loc36_7(%.loc36_4.2) -// CHECK:STDOUT: %p.ref.loc47: %.1 = name_ref p, %p -// CHECK:STDOUT: %.loc47_4.1: ref %Class = deref %p.ref.loc47 -// CHECK:STDOUT: %G.ref.loc47: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] -// CHECK:STDOUT: %.loc47_7: = bound_method %.loc47_4.1, %G.ref.loc47 -// CHECK:STDOUT: %.loc47_4.2: %.1 = addr_of %.loc47_4.1 -// CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%Class) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc47_9.1: %.8 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class) [template = constants.%.9] -// CHECK:STDOUT: %Convert.ref: %.8 = name_ref Convert, %.loc47_9.1 [template = constants.%.9] -// CHECK:STDOUT: %.loc47_9.2: %Class = converted %.loc47_4.2, [template = ] -// CHECK:STDOUT: %G.call.loc47: init %.2 = call %.loc47_7() [template = ] +// CHECK:STDOUT: %c.ref.loc27: %Class = name_ref c, %c +// CHECK:STDOUT: %F.ref.loc27: %F.type.1 = name_ref F, @Class.%F.decl [template = constants.%F.1] +// CHECK:STDOUT: %.loc27: = bound_method %c.ref.loc27, %F.ref.loc27 +// CHECK:STDOUT: %F.call.loc27: init %.2 = call %.loc27() [template = ] +// CHECK:STDOUT: %c.ref.loc29: %Class = name_ref c, %c +// CHECK:STDOUT: %G.ref.loc29: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] +// CHECK:STDOUT: %.loc29: = bound_method %c.ref.loc29, %G.ref.loc29 +// CHECK:STDOUT: %G.call.loc29: init %.2 = call %.loc29(%c.ref.loc29) +// CHECK:STDOUT: %p.ref.loc32: %.1 = name_ref p, %p +// CHECK:STDOUT: %.loc32_4.1: ref %Class = deref %p.ref.loc32 +// CHECK:STDOUT: %F.ref.loc32: %F.type.1 = name_ref F, @Class.%F.decl [template = constants.%F.1] +// CHECK:STDOUT: %.loc32_7: = bound_method %.loc32_4.1, %F.ref.loc32 +// CHECK:STDOUT: %.loc32_4.2: %.1 = addr_of %.loc32_4.1 +// CHECK:STDOUT: %F.call.loc32: init %.2 = call %.loc32_7(%.loc32_4.2) +// CHECK:STDOUT: %p.ref.loc34: %.1 = name_ref p, %p +// CHECK:STDOUT: %.loc34_4.1: ref %Class = deref %p.ref.loc34 +// CHECK:STDOUT: %G.ref.loc34: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] +// CHECK:STDOUT: %.loc34_7: = bound_method %.loc34_4.1, %G.ref.loc34 +// CHECK:STDOUT: %.loc34_4.2: %Class = bind_value %.loc34_4.1 +// CHECK:STDOUT: %G.call.loc34: init %.2 = call %.loc34_7(%.loc34_4.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] -// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { -// CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { -// CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { -// CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { -// CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 -// CHECK:STDOUT: %Self => constants.%Self.1 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%Class) { -// CHECK:STDOUT: %Dest => constants.%Class -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.8 -// CHECK:STDOUT: %.2 => constants.%.9 -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index 4d65040223cd..29f3976bdb40 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -215,15 +215,16 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromError.decl: type = class_decl @DeriveFromError [template = constants.%DeriveFromError] {} {} // CHECK:STDOUT: %AccessMemberWithInvalidBaseError.decl: %AccessMemberWithInvalidBaseError.type = fn_decl @AccessMemberWithInvalidBaseError [template = constants.%AccessMemberWithInvalidBaseError] { // CHECK:STDOUT: %p.patt: %.1 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.1 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromError.ref: type = name_ref DeriveFromError, file.%DeriveFromError.decl [template = constants.%DeriveFromError] // CHECK:STDOUT: %.loc13_55: type = ptr_type %DeriveFromError [template = constants.%.1] -// CHECK:STDOUT: %p.param: %.1 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.1 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_61.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc13_61.2: type = converted %int.make_type_32, %.loc13_61.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %p: %.1 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -240,7 +241,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseError(%p: %.1) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseError(%p.param_patt: %.1) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p // CHECK:STDOUT: %.loc13_75: ref %DeriveFromError = deref %p.ref @@ -259,6 +260,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -290,12 +292,12 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -309,20 +311,22 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromNonType.decl: type = class_decl @DeriveFromNonType [template = constants.%DeriveFromNonType] {} {} // CHECK:STDOUT: %AccessMemberWithInvalidBasNonType.decl: %AccessMemberWithInvalidBasNonType.type = fn_decl @AccessMemberWithInvalidBasNonType [template = constants.%AccessMemberWithInvalidBasNonType] { // CHECK:STDOUT: %p.patt: %.8 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.8 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromNonType.ref: type = name_ref DeriveFromNonType, file.%DeriveFromNonType.decl [template = constants.%DeriveFromNonType] // CHECK:STDOUT: %.loc15_58: type = ptr_type %DeriveFromNonType [template = constants.%.8] -// CHECK:STDOUT: %p.param: %.8 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.8 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_64.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_64.2: type = converted %int.make_type_32, %.loc15_64.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.8 = param runtime_param0 +// CHECK:STDOUT: %p: %.8 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -360,12 +364,12 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBasNonType(%p: %.8) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBasNonType(%p.param_patt: %.8) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p // CHECK:STDOUT: %.loc15_78: ref %DeriveFromNonType = deref %p.ref @@ -375,14 +379,17 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -393,6 +400,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -419,6 +427,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -448,12 +457,12 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -467,33 +476,36 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromi32.decl: type = class_decl @DeriveFromi32 [template = constants.%DeriveFromi32] {} {} // CHECK:STDOUT: %ConvertToBadBasei32.decl: %ConvertToBadBasei32.type = fn_decl @ConvertToBadBasei32 [template = constants.%ConvertToBadBasei32] { // CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.2 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] // CHECK:STDOUT: %.loc21_40: type = ptr_type %DeriveFromi32 [template = constants.%.2] -// CHECK:STDOUT: %p.param: %.2 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.2 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_49.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc21_49.2: type = converted %int.make_type_32, %.loc21_49.1 [template = i32] // CHECK:STDOUT: %.loc21_49.3: type = ptr_type i32 [template = constants.%.3] // CHECK:STDOUT: %return: ref %.3 = var +// CHECK:STDOUT: %param: %.2 = param runtime_param0 +// CHECK:STDOUT: %p: %.2 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBasei32.decl: %AccessMemberWithInvalidBasei32.type = fn_decl @AccessMemberWithInvalidBasei32 [template = constants.%AccessMemberWithInvalidBasei32] { // CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.2 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] // CHECK:STDOUT: %.loc23_51: type = ptr_type %DeriveFromi32 [template = constants.%.2] -// CHECK:STDOUT: %p.param: %.2 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.2 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_57.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc23_57.2: type = converted %int.make_type_32, %.loc23_57.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.2 = param runtime_param0 +// CHECK:STDOUT: %p: %.2 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -526,7 +538,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBasei32(%p: %.2) -> %.3 { +// CHECK:STDOUT: fn @ConvertToBadBasei32(%p.param_patt: %.2) -> %.3 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.2 = name_ref p, %p // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.3) [template = constants.%ImplicitAs.type.3] @@ -541,10 +553,10 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBasei32(%p: %.2) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBasei32(%p.param_patt: %.2) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.2 = name_ref p, %p // CHECK:STDOUT: %.loc23_71: ref %DeriveFromi32 = deref %p.ref @@ -554,14 +566,17 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -572,6 +587,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.3) { // CHECK:STDOUT: %Dest => constants.%.3 +// CHECK:STDOUT: %Dest.patt => constants.%.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -603,6 +619,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -633,12 +650,12 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.10) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.14)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.10) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.14)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -655,33 +672,36 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromTuple.decl: type = class_decl @DeriveFromTuple [template = constants.%DeriveFromTuple] {} {} // CHECK:STDOUT: %ConvertToBadBaseTuple.decl: %ConvertToBadBaseTuple.type = fn_decl @ConvertToBadBaseTuple [template = constants.%ConvertToBadBaseTuple] { // CHECK:STDOUT: %p.patt: %.8 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.8 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromTuple.ref: type = name_ref DeriveFromTuple, file.%DeriveFromTuple.decl [template = constants.%DeriveFromTuple] // CHECK:STDOUT: %.loc21_44: type = ptr_type %DeriveFromTuple [template = constants.%.8] -// CHECK:STDOUT: %p.param: %.8 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.8 = bind_name p, %p.param // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc21_56: %.3 = tuple_literal (%Base.ref) // CHECK:STDOUT: %.loc21_57.1: type = converted %.loc21_56, constants.%.4 [template = constants.%.4] // CHECK:STDOUT: %.loc21_57.2: type = ptr_type %.4 [template = constants.%.9] // CHECK:STDOUT: %return: ref %.9 = var +// CHECK:STDOUT: %param: %.8 = param runtime_param0 +// CHECK:STDOUT: %p: %.8 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple.decl: %AccessMemberWithInvalidBaseTuple.type = fn_decl @AccessMemberWithInvalidBaseTuple [template = constants.%AccessMemberWithInvalidBaseTuple] { // CHECK:STDOUT: %p.patt: %.8 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.8 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromTuple.ref: type = name_ref DeriveFromTuple, file.%DeriveFromTuple.decl [template = constants.%DeriveFromTuple] // CHECK:STDOUT: %.loc23_55: type = ptr_type %DeriveFromTuple [template = constants.%.8] -// CHECK:STDOUT: %p.param: %.8 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.8 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_61.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc23_61.2: type = converted %int.make_type_32, %.loc23_61.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.8 = param runtime_param0 +// CHECK:STDOUT: %p: %.8 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -719,7 +739,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBaseTuple(%p: %.8) -> %.9 { +// CHECK:STDOUT: fn @ConvertToBadBaseTuple(%p.param_patt: %.8) -> %.9 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.9) [template = constants.%ImplicitAs.type.3] @@ -734,12 +754,12 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseTuple(%p: %.8) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseTuple(%p.param_patt: %.8) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p // CHECK:STDOUT: %.loc23_75: ref %DeriveFromTuple = deref %p.ref @@ -749,14 +769,17 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -767,6 +790,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { // CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -794,6 +818,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -823,12 +848,12 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -842,11 +867,10 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromStruct.decl: type = class_decl @DeriveFromStruct [template = constants.%DeriveFromStruct] {} {} // CHECK:STDOUT: %ConvertToBadBaseStruct.decl: %ConvertToBadBaseStruct.type = fn_decl @ConvertToBadBaseStruct [template = constants.%ConvertToBadBaseStruct] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] // CHECK:STDOUT: %.loc21_46: type = ptr_type %DeriveFromStruct [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32.loc21_57: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_57.1: type = value_of_initializer %int.make_type_32.loc21_57 [template = i32] // CHECK:STDOUT: %.loc21_57.2: type = converted %int.make_type_32.loc21_57, %.loc21_57.1 [template = i32] @@ -856,23 +880,27 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %.loc21_69: type = struct_type {.a: i32, .b: i32} [template = constants.%.2] // CHECK:STDOUT: %.loc21_70: type = ptr_type %.2 [template = constants.%.3] // CHECK:STDOUT: %return: ref %.3 = var +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseStruct.decl: %AccessMemberWithInvalidBaseStruct.type = fn_decl @AccessMemberWithInvalidBaseStruct [template = constants.%AccessMemberWithInvalidBaseStruct] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] // CHECK:STDOUT: %.loc24_57: type = ptr_type %DeriveFromStruct [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc24_63.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc24_63.2: type = converted %int.make_type_32, %.loc24_63.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -909,7 +937,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBaseStruct(%p: %.4) -> %.3 { +// CHECK:STDOUT: fn @ConvertToBadBaseStruct(%p.param_patt: %.4) -> %.3 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.3) [template = constants.%ImplicitAs.type.3] @@ -924,10 +952,10 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseStruct(%p: %.4) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseStruct(%p.param_patt: %.4) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: %.loc24_77: ref %DeriveFromStruct = deref %p.ref @@ -937,14 +965,17 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -955,6 +986,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.3) { // CHECK:STDOUT: %Dest => constants.%.3 +// CHECK:STDOUT: %Dest.patt => constants.%.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -980,6 +1012,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -1010,12 +1043,12 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1032,31 +1065,34 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromIncomplete.decl: type = class_decl @DeriveFromIncomplete [template = constants.%DeriveFromIncomplete] {} {} // CHECK:STDOUT: %ConvertToBadBaseIncomplete.decl: %ConvertToBadBaseIncomplete.type = fn_decl @ConvertToBadBaseIncomplete [template = constants.%ConvertToBadBaseIncomplete] { // CHECK:STDOUT: %p.patt: %.1 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.1 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromIncomplete.ref: type = name_ref DeriveFromIncomplete, file.%DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] // CHECK:STDOUT: %.loc28_54: type = ptr_type %DeriveFromIncomplete [template = constants.%.1] -// CHECK:STDOUT: %p.param: %.1 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.1 = bind_name p, %p.param // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc28_70: type = ptr_type %Incomplete [template = constants.%.2] // CHECK:STDOUT: %return: ref %.2 = var +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %p: %.1 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete.decl: %AccessMemberWithInvalidBaseIncomplete.type = fn_decl @AccessMemberWithInvalidBaseIncomplete [template = constants.%AccessMemberWithInvalidBaseIncomplete] { // CHECK:STDOUT: %p.patt: %.1 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.1 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromIncomplete.ref: type = name_ref DeriveFromIncomplete, file.%DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] // CHECK:STDOUT: %.loc30_65: type = ptr_type %DeriveFromIncomplete [template = constants.%.1] -// CHECK:STDOUT: %p.param: %.1 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.1 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc30_71.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc30_71.2: type = converted %int.make_type_32, %.loc30_71.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %p: %.1 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -1087,7 +1123,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBaseIncomplete(%p: %.1) -> %.2 { +// CHECK:STDOUT: fn @ConvertToBadBaseIncomplete(%p.param_patt: %.1) -> %.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.2) [template = constants.%ImplicitAs.type.3] @@ -1102,12 +1138,12 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseIncomplete(%p: %.1) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseIncomplete(%p.param_patt: %.1) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p // CHECK:STDOUT: %.loc30_85: ref %DeriveFromIncomplete = deref %p.ref @@ -1117,14 +1153,17 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -1135,6 +1174,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.2) { // CHECK:STDOUT: %Dest => constants.%.2 +// CHECK:STDOUT: %Dest.patt => constants.%.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -1201,38 +1241,41 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromFinal.decl: type = class_decl @DeriveFromFinal [template = constants.%DeriveFromFinal] {} {} // CHECK:STDOUT: %ConvertToBadBaseFinal.decl: %ConvertToBadBaseFinal.type = fn_decl @ConvertToBadBaseFinal [template = constants.%ConvertToBadBaseFinal] { // CHECK:STDOUT: %p.patt: %.9 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.9 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] // CHECK:STDOUT: %.loc15_44: type = ptr_type %DeriveFromFinal [template = constants.%.9] -// CHECK:STDOUT: %p.param: %.9 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.9 = bind_name p, %p.param // CHECK:STDOUT: %Final.ref: type = name_ref Final, file.%Final.decl [template = constants.%Final] // CHECK:STDOUT: %.loc15_55: type = ptr_type %Final [template = constants.%.10] // CHECK:STDOUT: %return: ref %.10 = var +// CHECK:STDOUT: %param: %.9 = param runtime_param0 +// CHECK:STDOUT: %p: %.9 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_WithMember.decl: %AccessMemberWithInvalidBaseFinal_WithMember.type = fn_decl @AccessMemberWithInvalidBaseFinal_WithMember [template = constants.%AccessMemberWithInvalidBaseFinal_WithMember] { // CHECK:STDOUT: %p.patt: %.9 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.9 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] // CHECK:STDOUT: %.loc19_66: type = ptr_type %DeriveFromFinal [template = constants.%.9] -// CHECK:STDOUT: %p.param: %.9 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.9 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_72.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc19_72.2: type = converted %int.make_type_32, %.loc19_72.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.9 = param runtime_param0 +// CHECK:STDOUT: %p: %.9 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_NoMember.decl: %AccessMemberWithInvalidBaseFinal_NoMember.type = fn_decl @AccessMemberWithInvalidBaseFinal_NoMember [template = constants.%AccessMemberWithInvalidBaseFinal_NoMember] { // CHECK:STDOUT: %p.patt: %.9 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.9 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] // CHECK:STDOUT: %.loc23_64: type = ptr_type %DeriveFromFinal [template = constants.%.9] -// CHECK:STDOUT: %p.param: %.9 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.9 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_70.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc23_70.2: type = converted %int.make_type_32, %.loc23_70.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.9 = param runtime_param0 +// CHECK:STDOUT: %p: %.9 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1261,7 +1304,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBaseFinal(%p: %.9) -> %.10 { +// CHECK:STDOUT: fn @ConvertToBadBaseFinal(%p.param_patt: %.9) -> %.10 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.9 = name_ref p, %p // CHECK:STDOUT: %.loc16_11.1: ref %DeriveFromFinal = deref %p.ref @@ -1271,7 +1314,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: return %.loc16_11.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_WithMember(%p: %.9) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_WithMember(%p.param_patt: %.9) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.9 = name_ref p, %p // CHECK:STDOUT: %.loc20_11: ref %DeriveFromFinal = deref %p.ref @@ -1283,7 +1326,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: return %.loc20_14.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_NoMember(%p: %.9) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_NoMember(%p.param_patt: %.9) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.9 = name_ref p, %p // CHECK:STDOUT: %.loc27: ref %DeriveFromFinal = deref %p.ref diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 02a916063081..71c15d24e674 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -49,6 +49,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -76,12 +77,12 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.10) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.14)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.10) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.14)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -96,19 +97,21 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %AccessBInA.decl: %AccessBInA.type = fn_decl @AccessBInA [template = constants.%AccessBInA] { // CHECK:STDOUT: %a.patt: %A = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %A = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %a.param: %A = param a, runtime_param0 -// CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_24.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc19_24.2: type = converted %int.make_type_32, %.loc19_24.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %A = param runtime_param0 +// CHECK:STDOUT: %a: %A = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -152,7 +155,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessBInA(%a: %A) -> i32 { +// CHECK:STDOUT: fn @AccessBInA(%a.param_patt: %A) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] @@ -170,19 +173,22 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -193,6 +199,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%B) { // CHECK:STDOUT: %Dest => constants.%B +// CHECK:STDOUT: %Dest.patt => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index c68f5615475b..ba03d1b36ab0 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -70,6 +70,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -107,12 +108,12 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.16) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.20)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.16) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.20)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -131,31 +132,34 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} {} // CHECK:STDOUT: %ConvertUnrelated.decl: %ConvertUnrelated.type = fn_decl @ConvertUnrelated [template = constants.%ConvertUnrelated] { // CHECK:STDOUT: %p.patt: %.11 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.11 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %B2.ref: type = name_ref B2, file.%B2.decl [template = constants.%B2] // CHECK:STDOUT: %.loc31_26: type = ptr_type %B2 [template = constants.%.11] -// CHECK:STDOUT: %p.param: %.11 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.11 = bind_name p, %p.param // CHECK:STDOUT: %A1.ref: type = name_ref A1, file.%A1.decl [template = constants.%A1] // CHECK:STDOUT: %.loc31_34: type = ptr_type %A1 [template = constants.%.12] // CHECK:STDOUT: %return: ref %.12 = var +// CHECK:STDOUT: %param: %.11 = param runtime_param0 +// CHECK:STDOUT: %p: %.11 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} // CHECK:STDOUT: %ConvertIncomplete.decl: %ConvertIncomplete.type = fn_decl @ConvertIncomplete [template = constants.%ConvertIncomplete] { // CHECK:STDOUT: %p.patt: %.21 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.21 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc41_35: type = ptr_type %Incomplete [template = constants.%.21] -// CHECK:STDOUT: %p.param: %.21 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.21 = bind_name p, %p.param // CHECK:STDOUT: %A2.ref: type = name_ref A2, file.%A2.decl [template = constants.%A2] // CHECK:STDOUT: %.loc41_43: type = ptr_type %A2 [template = constants.%.22] // CHECK:STDOUT: %return: ref %.22 = var +// CHECK:STDOUT: %param: %.21 = param runtime_param0 +// CHECK:STDOUT: %p: %.21 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -217,7 +221,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertUnrelated(%p: %.11) -> %.12 { +// CHECK:STDOUT: fn @ConvertUnrelated(%p.param_patt: %.11) -> %.12 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.11 = name_ref p, %p // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.12) [template = constants.%ImplicitAs.type.3] @@ -232,10 +236,10 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertIncomplete(%p: %.21) -> %.22 { +// CHECK:STDOUT: fn @ConvertIncomplete(%p.param_patt: %.21) -> %.22 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.21 = name_ref p, %p // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.22) [template = constants.%ImplicitAs.type.4] @@ -247,14 +251,17 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -265,6 +272,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { // CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -277,6 +285,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.22) { // CHECK:STDOUT: %Dest => constants.%.22 +// CHECK:STDOUT: %Dest.patt => constants.%.22 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 4ca01a75a2e3..d9a43233fc1a 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -17,10 +17,10 @@ class Class(T:! type) { // enter the scope anyway if the parameters don't match. // CHECK:STDERR: fail_generic_method.carbon:[[@LINE+14]]:10: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_generic_method.carbon:[[@LINE-10]]:13: note: previous declaration's corresponding parameter here // CHECK:STDERR: class Class(T:! type) { -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_generic_method.carbon:[[@LINE+7]]:27: error: name `Self` not found // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} @@ -35,6 +35,7 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] @@ -47,6 +48,7 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.5: %.type = struct_value () [template] // CHECK:STDOUT: } @@ -73,31 +75,35 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_13.1, runtime_param [symbolic = %T.patt.loc11_13.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.5] { // CHECK:STDOUT: %self.patt: = binding_pattern self +// CHECK:STDOUT: %self.param_patt: = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %n.patt: = binding_pattern n +// CHECK:STDOUT: %n.param_patt: = param_pattern %n.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc32_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc32_14.2: type = converted %int.make_type_32, %.loc32_14.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc32_10.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc32_10.2 (constants.%N)] +// CHECK:STDOUT: %param.loc32_10: i32 = param runtime_param +// CHECK:STDOUT: %N.loc32_10.1: i32 = bind_symbolic_name N, 0, %param.loc32_10 [symbolic = %N.loc32_10.2 (constants.%N)] // CHECK:STDOUT: %Self.ref: = name_ref Self, [template = ] -// CHECK:STDOUT: %self.param: = param self, runtime_param0 -// CHECK:STDOUT: %self: = bind_name self, %self.param // CHECK:STDOUT: %T.ref: = name_ref T, [template = ] -// CHECK:STDOUT: %n.param: = param n, runtime_param1 -// CHECK:STDOUT: %n: = bind_name n, %n.param +// CHECK:STDOUT: %param.loc32_21: = param runtime_param0 +// CHECK:STDOUT: %self: = bind_name self, %param.loc32_21 +// CHECK:STDOUT: %param.loc32_33: = param runtime_param1 +// CHECK:STDOUT: %n: = bind_name n, %param.loc32_33 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc11_13.1: type) { // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc11_13.2) [symbolic = %Class (constants.%Class.2)] @@ -112,15 +118,17 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %.loc12_8.1: @Class.%.loc12_8.2 (%.2) = field_decl a, element0 [template] // CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = @Class.%F (constants.%F)] { // CHECK:STDOUT: %self.patt: @F.%Class (%Class.2) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.%Class (%Class.2) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %n.patt: @F.%T (%T) = binding_pattern n +// CHECK:STDOUT: %n.param_patt: @F.%T (%T) = param_pattern %n.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc13: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc13 [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %self.param: @F.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self: @F.%Class (%Class.2) = bind_name self, %self.param // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc11_13.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %n.param: @F.%T (%T) = param n, runtime_param1 -// CHECK:STDOUT: %n: @F.%T (%T) = bind_name n, %n.param +// CHECK:STDOUT: %param.loc13_8: @F.%Class (%Class.2) = param runtime_param0 +// CHECK:STDOUT: %self: @F.%Class (%Class.2) = bind_name self, %param.loc13_8 +// CHECK:STDOUT: %param.loc13_20: @F.%T (%T) = param runtime_param1 +// CHECK:STDOUT: %n: @F.%T (%T) = bind_name n, %param.loc13_20 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14_1.1: = complete_type_witness %.3 [symbolic = %.loc14_1.3 (constants.%.4)] // CHECK:STDOUT: @@ -135,17 +143,18 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @F.%Class (%Class.2)](%n: @F.%T (%T)); +// CHECK:STDOUT: fn[%self.param_patt: @F.%Class (%Class.2)](%n.param_patt: @F.%T (%T)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(%N.loc32_10.1: i32) { // CHECK:STDOUT: %N.loc32_10.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc32_10.2 (constants.%N)] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: ](%n: ) { +// CHECK:STDOUT: fn[%self.param_patt: ](%n.param_patt: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -153,10 +162,12 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@F.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { @@ -166,9 +177,11 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.loc11_13.2) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%N) { // CHECK:STDOUT: %N.loc32_10.2 => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index 8fd8b1141edb..07951998e1db 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -97,9 +97,9 @@ fn TakeIncomplete(c: Class); fn ReturnIncomplete() -> Class; fn CallTakeIncomplete(p: Class*) { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:3: error: forming value of incomplete type `Class` + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:18: error: forming value of incomplete type `Class` // CHECK:STDERR: TakeIncomplete(*p); - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: ^~ // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-92]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ @@ -109,9 +109,9 @@ fn CallTakeIncomplete(p: Class*) { // CHECK:STDERR: TakeIncomplete(*p); - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:3: error: forming value of incomplete type `Class` + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:18: error: forming value of incomplete type `Class` // CHECK:STDERR: TakeIncomplete({}); - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: ^~ // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-104]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ @@ -212,52 +212,57 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc51_14: type = ptr_type %Class [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc51_20.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc51_20.2: type = converted %int.make_type_32, %.loc51_20.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %MemberAccess.decl: %MemberAccess.type = fn_decl @MemberAccess [template = constants.%MemberAccess] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc62_25: type = ptr_type %Class [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc62_31.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc62_31.2: type = converted %int.make_type_32, %.loc62_31.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Copy.decl: %Copy.type = fn_decl @Copy [template = constants.%Copy] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref.loc80_12: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc80: type = ptr_type %Class [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param // CHECK:STDOUT: %Class.ref.loc80_23: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %return: ref %Class = var +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Let.decl: %Let.type = fn_decl @Let [template = constants.%Let] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref.loc84: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc84: type = ptr_type %Class [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %TakeIncomplete.decl: %TakeIncomplete.type = fn_decl @TakeIncomplete [template = constants.%TakeIncomplete] { // CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %Class = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.param: %Class = param c, runtime_param0 -// CHECK:STDOUT: %c: %Class = bind_name c, %c.param +// CHECK:STDOUT: %param: %Class = param runtime_param0 +// CHECK:STDOUT: %c: %Class = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %ReturnIncomplete.decl: %ReturnIncomplete.type = fn_decl @ReturnIncomplete [template = constants.%ReturnIncomplete] {} { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] @@ -265,11 +270,12 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: } // CHECK:STDOUT: %CallTakeIncomplete.decl: %CallTakeIncomplete.type = fn_decl @CallTakeIncomplete [template = constants.%CallTakeIncomplete] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc99: type = ptr_type %Class [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %CallReturnIncomplete.decl: %CallReturnIncomplete.type = fn_decl @CallReturnIncomplete [template = constants.%CallReturnIncomplete] {} {} // CHECK:STDOUT: } @@ -296,28 +302,28 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p: %.4) -> i32 { +// CHECK:STDOUT: fn @G(%p.param_patt: %.4) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: %.loc59: ref %Class = deref %p.ref // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @MemberAccess(%p: %.4) -> i32 { +// CHECK:STDOUT: fn @MemberAccess(%p.param_patt: %.4) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: %.loc70: ref %Class = deref %p.ref // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Copy(%p: %.4) -> %Class { +// CHECK:STDOUT: fn @Copy(%p.param_patt: %.4) -> %Class { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: %.loc81: ref %Class = deref %p.ref // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Let(%p: %.4) { +// CHECK:STDOUT: fn @Let(%p.param_patt: %.4) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref.loc92: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p @@ -326,11 +332,11 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TakeIncomplete(%c: %Class); +// CHECK:STDOUT: fn @TakeIncomplete(%c.param_patt: %Class); // CHECK:STDOUT: // CHECK:STDOUT: fn @ReturnIncomplete() -> %Class; // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallTakeIncomplete(%p: %.4) { +// CHECK:STDOUT: fn @CallTakeIncomplete(%p.param_patt: %.4) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TakeIncomplete.ref.loc110: %TakeIncomplete.type = name_ref TakeIncomplete, file.%TakeIncomplete.decl [template = constants.%TakeIncomplete] // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 8c0b1dd3c257..ce8aabc252ed 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -73,11 +73,12 @@ fn F() { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %p.patt: %.5 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.5 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc16: type = ptr_type %Class [template = constants.%.5] -// CHECK:STDOUT: %p.param: %.5 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.5 = bind_name p, %p.param +// CHECK:STDOUT: %param: %.5 = param runtime_param0 +// CHECK:STDOUT: %p: %.5 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } @@ -101,7 +102,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p: %.5); +// CHECK:STDOUT: fn @G(%p.param_patt: %.5); // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index 8562635393a3..352bbc47decf 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -18,23 +18,23 @@ class B { fn F(s: {.a: A}, b: B) { // `s` has only a value representation, so this must be invalid. - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+7]]:8: error: `addr self` method cannot be invoked on a value + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+7]]:4: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: s.a.F(); - // CHECK:STDERR: ^ - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-12]]:13: note: initializing `addr self` parameter of method declared here + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-12]]:8: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: A*](); - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: s.a.F(); // `b` has an object representation for `A`, but this is still invalid for // consistency. - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+6]]:8: error: `addr self` method cannot be invoked on a value + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+6]]:4: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: b.a.F(); - // CHECK:STDERR: ^ - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-23]]:13: note: initializing `addr self` parameter of method declared here + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-23]]:8: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: A*](); - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: ^~~~~~~~~~~~~ b.a.F(); } @@ -84,27 +84,30 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %s.patt: %.7 = binding_pattern s +// CHECK:STDOUT: %s.param_patt: %.7 = param_pattern %s.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %B = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %B = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc19: type = struct_type {.a: %A} [template = constants.%.7] -// CHECK:STDOUT: %s.param: %.7 = param s, runtime_param0 -// CHECK:STDOUT: %s: %.7 = bind_name s, %s.param // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %b.param: %B = param b, runtime_param1 -// CHECK:STDOUT: %b: %B = bind_name b, %b.param +// CHECK:STDOUT: %param.loc19_6: %.7 = param runtime_param0 +// CHECK:STDOUT: %s: %.7 = bind_name s, %param.loc19_6 +// CHECK:STDOUT: %param.loc19_18: %B = param runtime_param1 +// CHECK:STDOUT: %b: %B = bind_name b, %param.loc19_18 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: %.1 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.1 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc12_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc12_20: type = ptr_type %A [template = constants.%.1] -// CHECK:STDOUT: %self.param: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.1 = bind_name self, %self.param -// CHECK:STDOUT: %.loc12_8: %.1 = addr_pattern %self +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %self: %.1 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: @@ -123,9 +126,9 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: .a = %.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1[addr %self: %.1](); +// CHECK:STDOUT: fn @F.1[addr %self.param_patt: %.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2(%s: %.7, %b: %B) { +// CHECK:STDOUT: fn @F.2(%s.param_patt: %.7, %b.param_patt: %B) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %.7 = name_ref s, %s // CHECK:STDOUT: %.loc28_4: %A = struct_access %s.ref, element0 diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index 88f2ad41dff1..9bcfb871f0fd 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -89,10 +89,11 @@ fn F(c: Class) { // CHECK:STDOUT: %A: %WithSelf.type = bind_alias A, @Class.%WithSelf.decl [template = constants.%WithSelf] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %Class = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref.loc18: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.param: %Class = param c, runtime_param0 -// CHECK:STDOUT: %c: %Class = bind_name c, %c.param +// CHECK:STDOUT: %param: %Class = param runtime_param0 +// CHECK:STDOUT: %c: %Class = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -100,10 +101,11 @@ fn F(c: Class) { // CHECK:STDOUT: %NoSelf.decl: %NoSelf.type = fn_decl @NoSelf [template = constants.%NoSelf] {} {} // CHECK:STDOUT: %WithSelf.decl: %WithSelf.type = fn_decl @WithSelf [template = constants.%WithSelf] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %self.param: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self: %Class = bind_name self, %self.param +// CHECK:STDOUT: %param: %Class = param runtime_param0 +// CHECK:STDOUT: %self: %Class = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -115,9 +117,9 @@ fn F(c: Class) { // CHECK:STDOUT: // CHECK:STDOUT: fn @NoSelf(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @WithSelf[%self: %Class](); +// CHECK:STDOUT: fn @WithSelf[%self.param_patt: %Class](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%c: %Class) { +// CHECK:STDOUT: fn @F(%c.param_patt: %Class) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref.loc19: %Class = name_ref c, %c // CHECK:STDOUT: %NoSelf.ref.loc19: %NoSelf.type = name_ref NoSelf, @Class.%NoSelf.decl [template = constants.%NoSelf] diff --git a/toolchain/check/testdata/class/fail_method_modifiers.carbon b/toolchain/check/testdata/class/fail_method_modifiers.carbon index 152ac780115e..47a6bf5229d3 100644 --- a/toolchain/check/testdata/class/fail_method_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_method_modifiers.carbon @@ -105,17 +105,19 @@ base class BaseClass { // CHECK:STDOUT: class @FinalClass { // CHECK:STDOUT: %Abstract.decl: %Abstract.type.1 = fn_decl @Abstract.1 [template = constants.%Abstract.1] { // CHECK:STDOUT: %self.patt: %FinalClass = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %FinalClass = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FinalClass [template = constants.%FinalClass] -// CHECK:STDOUT: %self.param: %FinalClass = param self, runtime_param0 -// CHECK:STDOUT: %self: %FinalClass = bind_name self, %self.param +// CHECK:STDOUT: %param: %FinalClass = param runtime_param0 +// CHECK:STDOUT: %self: %FinalClass = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Virtual.decl: %Virtual.type = fn_decl @Virtual [template = constants.%Virtual] { // CHECK:STDOUT: %self.patt: %FinalClass = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %FinalClass = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FinalClass [template = constants.%FinalClass] -// CHECK:STDOUT: %self.param: %FinalClass = param self, runtime_param0 -// CHECK:STDOUT: %self: %FinalClass = bind_name self, %self.param +// CHECK:STDOUT: %param: %FinalClass = param runtime_param0 +// CHECK:STDOUT: %self: %FinalClass = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc30: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -128,17 +130,19 @@ base class BaseClass { // CHECK:STDOUT: class @AbstractClass { // CHECK:STDOUT: %Default.decl: %Default.type = fn_decl @Default [template = constants.%Default] { // CHECK:STDOUT: %self.patt: %AbstractClass = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %AbstractClass = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%AbstractClass [template = constants.%AbstractClass] -// CHECK:STDOUT: %self.param: %AbstractClass = param self, runtime_param0 -// CHECK:STDOUT: %self: %AbstractClass = bind_name self, %self.param +// CHECK:STDOUT: %param: %AbstractClass = param runtime_param0 +// CHECK:STDOUT: %self: %AbstractClass = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Final.decl: %Final.type = fn_decl @Final [template = constants.%Final] { // CHECK:STDOUT: %self.patt: %AbstractClass = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %AbstractClass = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%AbstractClass [template = constants.%AbstractClass] -// CHECK:STDOUT: %self.param: %AbstractClass = param self, runtime_param0 -// CHECK:STDOUT: %self: %AbstractClass = bind_name self, %self.param +// CHECK:STDOUT: %param: %AbstractClass = param runtime_param0 +// CHECK:STDOUT: %self: %AbstractClass = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc45: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -151,10 +155,11 @@ base class BaseClass { // CHECK:STDOUT: class @BaseClass { // CHECK:STDOUT: %Abstract.decl: %Abstract.type.2 = fn_decl @Abstract.2 [template = constants.%Abstract.2] { // CHECK:STDOUT: %self.patt: %BaseClass = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %BaseClass = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%BaseClass [template = constants.%BaseClass] -// CHECK:STDOUT: %self.param: %BaseClass = param self, runtime_param0 -// CHECK:STDOUT: %self: %BaseClass = bind_name self, %self.param +// CHECK:STDOUT: %param: %BaseClass = param runtime_param0 +// CHECK:STDOUT: %self: %BaseClass = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc56: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -163,13 +168,13 @@ base class BaseClass { // CHECK:STDOUT: .Abstract = %Abstract.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Abstract.1[%self: %FinalClass](); +// CHECK:STDOUT: fn @Abstract.1[%self.param_patt: %FinalClass](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Virtual[%self: %FinalClass](); +// CHECK:STDOUT: fn @Virtual[%self.param_patt: %FinalClass](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Default[%self: %AbstractClass](); +// CHECK:STDOUT: fn @Default[%self.param_patt: %AbstractClass](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Final[%self: %AbstractClass](); +// CHECK:STDOUT: fn @Final[%self.param_patt: %AbstractClass](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Abstract.2[%self: %BaseClass](); +// CHECK:STDOUT: fn @Abstract.2[%self.param_patt: %BaseClass](); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index b992c830ff92..03114f240aa7 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -45,13 +45,13 @@ class WrongSelf { fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDERR: fail_self.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `WrongSelf` to `Class` // CHECK:STDERR: ws.F(); - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: ^~ // CHECK:STDERR: fail_self.carbon:[[@LINE+6]]:3: note: type `WrongSelf` does not implement interface `ImplicitAs` // CHECK:STDERR: ws.F(); - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: ^~ // CHECK:STDERR: fail_self.carbon:[[@LINE-10]]:8: note: initializing `self` parameter of method declared here // CHECK:STDERR: fn F[self: Class](); - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: ^~~~~~~~~~~ ws.F(); } @@ -77,6 +77,7 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -102,12 +103,12 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -121,10 +122,11 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc25: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc25: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc25: %Class = bind_name self, %self.param.loc25 +// CHECK:STDOUT: %param.loc25: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc25: %Class = bind_name self, %param.loc25 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %Self.ref.loc28: type = name_ref Self, constants.%Class [template = constants.%Class] @@ -133,15 +135,17 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %WrongSelf.decl: type = class_decl @WrongSelf [template = constants.%WrongSelf] {} {} // CHECK:STDOUT: %CallWrongSelf.decl: %CallWrongSelf.type = fn_decl @CallWrongSelf [template = constants.%CallWrongSelf] { // CHECK:STDOUT: %ws.patt: %WrongSelf = binding_pattern ws +// CHECK:STDOUT: %ws.param_patt: %WrongSelf = param_pattern %ws.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %WrongSelf.ref: type = name_ref WrongSelf, file.%WrongSelf.decl [template = constants.%WrongSelf] -// CHECK:STDOUT: %ws.param: %WrongSelf = param ws, runtime_param0 -// CHECK:STDOUT: %ws: %WrongSelf = bind_name ws, %ws.param +// CHECK:STDOUT: %param: %WrongSelf = param runtime_param0 +// CHECK:STDOUT: %ws: %WrongSelf = bind_name ws, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -162,10 +166,11 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc16: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc16: %Class = bind_name self, %self.param.loc16 +// CHECK:STDOUT: %param.loc16: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc16: %Class = bind_name self, %param.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %Self.ref.loc18: type = name_ref Self, constants.%Class [template = constants.%Class] @@ -182,10 +187,11 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: class @WrongSelf { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %self.param: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self: %Class = bind_name self, %self.param +// CHECK:STDOUT: %param: %Class = param runtime_param0 +// CHECK:STDOUT: %self: %Class = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc43: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -194,7 +200,7 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1(%self.loc25: %Class) { +// CHECK:STDOUT: fn @F.1(%self.param_patt: %Class) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -209,17 +215,17 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[%self: %Class](); +// CHECK:STDOUT: fn @F.2[%self.param_patt: %Class](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallWrongSelf(%ws: %WrongSelf) { +// CHECK:STDOUT: fn @CallWrongSelf(%ws.param_patt: %WrongSelf) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ws.ref: %WrongSelf = name_ref ws, %ws // CHECK:STDOUT: %F.ref: %F.type.2 = name_ref F, @WrongSelf.%F.decl [template = constants.%F.2] // CHECK:STDOUT: %.loc55_5: = bound_method %ws.ref, %F.ref // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%Class) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc55_7.1: %.7 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class) [template = constants.%.8] -// CHECK:STDOUT: %Convert.ref: %.7 = name_ref Convert, %.loc55_7.1 [template = constants.%.8] -// CHECK:STDOUT: %.loc55_7.2: %Class = converted %ws.ref, [template = ] +// CHECK:STDOUT: %.loc55_3.1: %.7 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class) [template = constants.%.8] +// CHECK:STDOUT: %Convert.ref: %.7 = name_ref Convert, %.loc55_3.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc55_3.2: %Class = converted %ws.ref, [template = ] // CHECK:STDOUT: %F.call: init %.1 = call %.loc55_5() [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -229,19 +235,22 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -252,6 +261,7 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Class) { // CHECK:STDOUT: %Dest => constants.%Class +// CHECK:STDOUT: %Dest.patt => constants.%Class // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/class/fail_self_param.carbon b/toolchain/check/testdata/class/fail_self_param.carbon index 20fbc05f4a41..4eeb64d01b46 100644 --- a/toolchain/check/testdata/class/fail_self_param.carbon +++ b/toolchain/check/testdata/class/fail_self_param.carbon @@ -10,7 +10,7 @@ // CHECK:STDERR: fail_self_param.carbon:[[@LINE+3]]:9: error: `self` parameter only allowed on functions // CHECK:STDERR: class C[self:! type](x:! self) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: ^~~~~~~~~~~ class C[self:! type](x:! self) {} var v: C(0); @@ -18,7 +18,9 @@ var v: C(0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %self: type = bind_symbolic_name self, 0 [symbolic] +// CHECK:STDOUT: %self.patt: type = symbolic_binding_pattern self, 0 [symbolic] // CHECK:STDOUT: %x: %self = bind_symbolic_name x, 1 [symbolic] +// CHECK:STDOUT: %x.patt: %self = symbolic_binding_pattern x, 1 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] @@ -51,14 +53,16 @@ var v: C(0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %self.patt: type = symbolic_binding_pattern self, 0 -// CHECK:STDOUT: %x.patt: @C.%self.loc14_9.2 (%self) = symbolic_binding_pattern x, 1 +// CHECK:STDOUT: %self.patt.loc14_9.1: type = symbolic_binding_pattern self, 0 [symbolic = %self.patt.loc14_9.2 (constants.%self.patt)] +// CHECK:STDOUT: %self.param_patt: type = param_pattern %self.patt.loc14_9.1, runtime_param [symbolic = %self.patt.loc14_9.2 (constants.%self.patt)] +// CHECK:STDOUT: %x.patt.loc14_22.1: @C.%self.loc14_9.2 (%self) = symbolic_binding_pattern x, 1 [symbolic = %x.patt.loc14_22.2 (constants.%x.patt)] +// CHECK:STDOUT: %x.param_patt: @C.%self.loc14_9.2 (%self) = param_pattern %x.patt.loc14_22.1, runtime_param [symbolic = %x.patt.loc14_22.2 (constants.%x.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: type = param self, runtime_param -// CHECK:STDOUT: %self.loc14_9.1: type = bind_symbolic_name self, 0, %self.param [symbolic = %self.loc14_9.2 (constants.%self)] // CHECK:STDOUT: %self.ref: type = name_ref self, %self.loc14_9.1 [symbolic = %self.loc14_9.2 (constants.%self)] -// CHECK:STDOUT: %x.param: @C.%self.loc14_9.2 (%self) = param x, runtime_param -// CHECK:STDOUT: %x.loc14_22.1: @C.%self.loc14_9.2 (%self) = bind_symbolic_name x, 1, %x.param [symbolic = %x.loc14_22.2 (constants.%x)] +// CHECK:STDOUT: %param.loc14_9: type = param runtime_param +// CHECK:STDOUT: %self.loc14_9.1: type = bind_symbolic_name self, 0, %param.loc14_9 [symbolic = %self.loc14_9.2 (constants.%self)] +// CHECK:STDOUT: %param.loc14_22: @C.%self.loc14_9.2 (%self) = param runtime_param +// CHECK:STDOUT: %x.loc14_22.1: @C.%self.loc14_9.2 (%self) = bind_symbolic_name x, 1, %param.loc14_22 [symbolic = %x.loc14_22.2 (constants.%x)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [template = constants.%C.1] // CHECK:STDOUT: %.loc15: i32 = int_literal 0 [template = constants.%.4] @@ -69,7 +73,9 @@ var v: C(0); // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%self.loc14_9.1: type, %x.loc14_22.1: @C.%self.loc14_9.2 (%self)) { // CHECK:STDOUT: %self.loc14_9.2: type = bind_symbolic_name self, 0 [symbolic = %self.loc14_9.2 (constants.%self)] +// CHECK:STDOUT: %self.patt.loc14_9.2: type = symbolic_binding_pattern self, 0 [symbolic = %self.patt.loc14_9.2 (constants.%self.patt)] // CHECK:STDOUT: %x.loc14_22.2: %self = bind_symbolic_name x, 1 [symbolic = %x.loc14_22.2 (constants.%x)] +// CHECK:STDOUT: %x.patt.loc14_22.2: %self = symbolic_binding_pattern x, 1 [symbolic = %x.patt.loc14_22.2 (constants.%x.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -83,12 +89,16 @@ var v: C(0); // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%self, constants.%x) { // CHECK:STDOUT: %self.loc14_9.2 => constants.%self +// CHECK:STDOUT: %self.patt.loc14_9.2 => constants.%self // CHECK:STDOUT: %x.loc14_22.2 => constants.%x +// CHECK:STDOUT: %x.patt.loc14_22.2 => constants.%x // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(i32, constants.%.4) { // CHECK:STDOUT: %self.loc14_9.2 => i32 +// CHECK:STDOUT: %self.patt.loc14_9.2 => i32 // CHECK:STDOUT: %x.loc14_22.2 => constants.%.4 +// CHECK:STDOUT: %x.patt.loc14_22.2 => constants.%.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index 374e997f8453..422c10471f05 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -60,14 +60,15 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %Class = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.param: %Class = param c, runtime_param0 -// CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_19.2: type = converted %int.make_type_32, %.loc15_19.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Class = param runtime_param0 +// CHECK:STDOUT: %c: %Class = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -85,7 +86,7 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%c: %Class) -> i32 { +// CHECK:STDOUT: fn @G(%c.param_patt: %Class) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class = name_ref c, %c // CHECK:STDOUT: %something.ref: = name_ref something, [template = ] diff --git a/toolchain/check/testdata/class/forward_declared.carbon b/toolchain/check/testdata/class/forward_declared.carbon index a65ef852a06c..47afce4d22e8 100644 --- a/toolchain/check/testdata/class/forward_declared.carbon +++ b/toolchain/check/testdata/class/forward_declared.carbon @@ -45,20 +45,21 @@ fn F(p: Class*) -> Class* { return p; } // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %p.patt: %.1 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.1 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref.loc13_9: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc13_14: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %p.param: %.1 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.1 = bind_name p, %p.param // CHECK:STDOUT: %Class.ref.loc13_20: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc13_25: type = ptr_type %Class [template = constants.%.1] // CHECK:STDOUT: %return: ref %.1 = var +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %p: %.1 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%p: %.1) -> %.1 { +// CHECK:STDOUT: fn @F(%p.param_patt: %.1) -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p // CHECK:STDOUT: return %p.ref diff --git a/toolchain/check/testdata/class/generic/basic.carbon b/toolchain/check/testdata/class/generic/basic.carbon index e818ffb06fd4..f25d2f5215b8 100644 --- a/toolchain/check/testdata/class/generic/basic.carbon +++ b/toolchain/check/testdata/class/generic/basic.carbon @@ -27,6 +27,7 @@ class Declaration(T:! type); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] @@ -41,6 +42,7 @@ class Declaration(T:! type); // CHECK:STDOUT: %.5: type = struct_type {.k: %T} [symbolic] // CHECK:STDOUT: %.6: = complete_type_witness %.5 [symbolic] // CHECK:STDOUT: %.7: type = ptr_type %.5 [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Declaration.type: type = generic_class_type @Declaration [template] // CHECK:STDOUT: %Declaration.1: %Declaration.type = struct_value () [template] // CHECK:STDOUT: %Declaration.2: type = class_type @Declaration, @Declaration(%T) [symbolic] @@ -67,21 +69,24 @@ class Declaration(T:! type); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_13.1, runtime_param [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %Declaration.decl: %Declaration.type = class_decl @Declaration [template = constants.%Declaration.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc24_19.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc24_19.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc24_19.1, runtime_param [symbolic = %T.patt.loc24_19.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc24_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc24_19.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc24_19.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc24_19.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc11_13.1: type) { // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GetAddr.type: type = fn_type @GetAddr, @Class(%T.loc11_13.2) [symbolic = %GetAddr.type (constants.%GetAddr.type)] @@ -96,26 +101,28 @@ class Declaration(T:! type); // CHECK:STDOUT: class { // CHECK:STDOUT: %GetAddr.decl: @Class.%GetAddr.type (%GetAddr.type) = fn_decl @GetAddr [symbolic = @Class.%GetAddr (constants.%GetAddr)] { // CHECK:STDOUT: %self.patt: @GetAddr.%.loc12_29.1 (%.2) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @GetAddr.%.loc12_29.1 (%.2) = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc12_14: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc12_25: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc12_25 [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %.loc12_29.2: type = ptr_type %Class.2 [symbolic = %.loc12_29.1 (constants.%.2)] -// CHECK:STDOUT: %self.param: @GetAddr.%.loc12_29.1 (%.2) = param self, runtime_param0 -// CHECK:STDOUT: %self: @GetAddr.%.loc12_29.1 (%.2) = bind_name self, %self.param -// CHECK:STDOUT: %.loc12_14: @GetAddr.%.loc12_29.1 (%.2) = addr_pattern %self // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc11_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %.loc12_38.2: type = ptr_type %T [symbolic = %.loc12_38.1 (constants.%.3)] // CHECK:STDOUT: %return: ref @GetAddr.%.loc12_38.1 (%.3) = var +// CHECK:STDOUT: %param: @GetAddr.%.loc12_29.1 (%.2) = param runtime_param0 +// CHECK:STDOUT: %self: @GetAddr.%.loc12_29.1 (%.2) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %GetValue.decl: @Class.%GetValue.type (%GetValue.type) = fn_decl @GetValue [symbolic = @Class.%GetValue (constants.%GetValue)] { // CHECK:STDOUT: %self.patt: @GetValue.%Class (%Class.2) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @GetValue.%Class (%Class.2) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc17: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc17 [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %self.param: @GetValue.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self: @GetValue.%Class (%Class.2) = bind_name self, %self.param // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc11_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %return: ref @GetValue.%T (%T) = var +// CHECK:STDOUT: %param: @GetValue.%Class (%Class.2) = param runtime_param0 +// CHECK:STDOUT: %self: @GetValue.%Class (%Class.2) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_13.1 [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: %.loc21_8.1: @Class.%.loc21_8.2 (%.4) = field_decl k, element0 [template] @@ -131,6 +138,7 @@ class Declaration(T:! type); // CHECK:STDOUT: // CHECK:STDOUT: generic class @Declaration(%T.loc24_19.1: type) { // CHECK:STDOUT: %T.loc24_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc24_19.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc24_19.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc24_19.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } @@ -144,7 +152,7 @@ class Declaration(T:! type); // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc13_17.3: type = unbound_element_type @GetAddr.%Class (%Class.2), @GetAddr.%T (%T) [symbolic = %.loc13_17.3 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @GetAddr.%.loc12_29.1 (%.2)]() -> @GetAddr.%.loc12_38.1 (%.3) { +// CHECK:STDOUT: fn[addr %self.param_patt: @GetAddr.%.loc12_29.1 (%.2)]() -> @GetAddr.%.loc12_38.1 (%.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @GetAddr.%.loc12_29.1 (%.2) = name_ref self, %self // CHECK:STDOUT: %.loc13_17.1: ref @GetAddr.%Class (%Class.2) = deref %self.ref @@ -162,7 +170,7 @@ class Declaration(T:! type); // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc18_16.3: type = unbound_element_type @GetValue.%Class (%Class.2), @GetValue.%T (%T) [symbolic = %.loc18_16.3 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @GetValue.%Class (%Class.2)]() -> @GetValue.%T (%T) { +// CHECK:STDOUT: fn[%self.param_patt: @GetValue.%Class (%Class.2)]() -> @GetValue.%T (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @GetValue.%Class (%Class.2) = name_ref self, %self // CHECK:STDOUT: %k.ref: @GetValue.%.loc18_16.3 (%.4) = name_ref k, @Class.%.loc21_8.1 [template = @Class.%.loc21_8.1] @@ -174,6 +182,7 @@ class Declaration(T:! type); // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GetAddr.type => constants.%GetAddr.type @@ -188,6 +197,7 @@ class Declaration(T:! type); // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@GetAddr.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetAddr(constants.%T) { @@ -199,6 +209,7 @@ class Declaration(T:! type); // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@GetValue.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetValue(constants.%T) { @@ -208,9 +219,11 @@ class Declaration(T:! type); // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.loc11_13.2) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Declaration(constants.%T) { // CHECK:STDOUT: %T.loc24_19.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc24_19.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 6f8e064a843f..3a2499a287c1 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -55,15 +55,12 @@ library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+9]]:8: error: cannot implicitly convert from `i32` to `type` +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: note: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:8: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE-8]]:13: note: initializing generic parameter `T` declared here -// CHECK:STDERR: class Class(T:! type, N:! i32) {} -// CHECK:STDERR: ^ var a: Class(5, i32*); // --- call_in_nested_return_type.carbon @@ -89,10 +86,12 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic] @@ -130,16 +129,18 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %param.loc4_13: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param.loc4_13 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_23: i32 = param runtime_param +// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %param.loc4_23 [symbolic = %N.loc4_23.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref.loc6: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -161,7 +162,9 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -177,19 +180,25 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: %N.loc4_23.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%.4, constants.%.5) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%.4 +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%.4 // CHECK:STDOUT: %N.loc4_23.2 => constants.%.5 +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%.5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%.1, constants.%.7) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%.1 +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%.1 // CHECK:STDOUT: %N.loc4_23.2 => constants.%.7 +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%.7 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -198,10 +207,12 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic] @@ -233,16 +244,18 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %param.loc4_13: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param.loc4_13 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_23: i32 = param runtime_param +// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %param.loc4_23 [symbolic = %N.loc4_23.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -255,7 +268,9 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -271,17 +286,21 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: %N.loc4_23.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_too_many.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic] @@ -315,16 +334,18 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %param.loc4_13: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param.loc4_13 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_23: i32 = param runtime_param +// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %param.loc4_23 [symbolic = %N.loc4_23.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -339,7 +360,9 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -355,17 +378,21 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: %N.loc4_23.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_no_conversion.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic] @@ -378,6 +405,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -405,12 +433,12 @@ class Outer(T:! type) { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -421,33 +449,36 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %param.loc4_13: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param.loc4_13 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_23: i32 = param runtime_param +// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %param.loc4_23 [symbolic = %N.loc4_23.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %.loc15_14: i32 = int_literal 5 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_14: i32 = int_literal 5 [template = constants.%.4] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_20.2: type = converted %int.make_type_32, %.loc15_20.1 [template = i32] -// CHECK:STDOUT: %.loc15_20.3: type = ptr_type i32 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_32, %.loc12_20.1 [template = i32] +// CHECK:STDOUT: %.loc12_20.3: type = ptr_type i32 [template = constants.%.5] // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc15_13.1: %.8 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.9] -// CHECK:STDOUT: %Convert.ref: %.8 = name_ref Convert, %.loc15_13.1 [template = constants.%.9] -// CHECK:STDOUT: %.loc15_13.2: type = converted %.loc15_14, [template = ] +// CHECK:STDOUT: %.loc12_13.1: %.8 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.9] +// CHECK:STDOUT: %Convert.ref: %.8 = name_ref Convert, %.loc12_13.1 [template = constants.%.9] +// CHECK:STDOUT: %.loc12_13.2: type = converted %.loc12_14, [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -467,7 +498,9 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -486,24 +519,29 @@ class Outer(T:! type) { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: %N.loc4_23.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -514,6 +552,7 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -528,11 +567,13 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Outer.type: type = generic_class_type @Outer [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Outer.1: %Outer.type = struct_value () [template] // CHECK:STDOUT: %Outer.2: type = class_type @Outer, @Outer(%T) [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %Inner.type.1: type = generic_class_type @Inner, @Outer(%T) [symbolic] // CHECK:STDOUT: %Inner.1: %Inner.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %Inner.2: type = class_type @Inner, @Inner(%T, %U) [symbolic] @@ -585,15 +626,17 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Outer.decl: %Outer.type = class_decl @Outer [template = constants.%Outer.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc2_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc2_13.1, runtime_param [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc2_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc2_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc2_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc2_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Outer(%T.loc2_13.1: type) { // CHECK:STDOUT: %T.loc2_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc2_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc2_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T.loc2_13.2) [symbolic = %Inner.type (constants.%Inner.type.1)] @@ -601,10 +644,11 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Inner.decl: @Outer.%Inner.type (%Inner.type.1) = class_decl @Inner [symbolic = @Outer.%Inner (constants.%Inner.1)] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %U.patt.loc3_15.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc3_15.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc3_15.1, runtime_param [symbolic = %U.patt.loc3_15.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc3_15.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc3_15.2 (constants.%U)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc3_15.1: type = bind_symbolic_name U, 1, %param [symbolic = %U.loc3_15.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -616,6 +660,7 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Inner(@Outer.%T.loc2_13.1: type, %U.loc3_15.1: type) { // CHECK:STDOUT: %U.loc3_15.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc3_15.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc3_15.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc3_15.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] @@ -737,6 +782,7 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%T) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Inner.type => constants.%Inner.type.1 @@ -745,6 +791,7 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(constants.%T, constants.%U) { // CHECK:STDOUT: %U.loc3_15.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T => constants.%T @@ -760,6 +807,7 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(@A.%T) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%T, constants.%U) { @@ -769,6 +817,7 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%U) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%U +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Inner.type => constants.%Inner.type.2 @@ -777,6 +826,7 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(@B.%U) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%U +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @B(constants.%T, constants.%U) { @@ -786,6 +836,7 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(constants.%T, constants.%T) { // CHECK:STDOUT: %U.loc3_15.2 => constants.%T +// CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T => constants.%T @@ -801,10 +852,12 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(@C.%T) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(@C.%T, @C.%T) { // CHECK:STDOUT: %U.loc3_15.2 => constants.%T +// CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T, constants.%U) { @@ -816,10 +869,12 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(@D.%T) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(@D.%T, @D.%U) { // CHECK:STDOUT: %U.loc3_15.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%T, constants.%U) { @@ -832,9 +887,11 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(@Inner.%T, @Inner.%U.loc3_15.2) { // CHECK:STDOUT: %U.loc3_15.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(@Outer.%T.loc2_13.2) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/field.carbon b/toolchain/check/testdata/class/generic/field.carbon index 4ac7a07ac6e4..eb30fccc9a3c 100644 --- a/toolchain/check/testdata/class/generic/field.carbon +++ b/toolchain/check/testdata/class/generic/field.carbon @@ -28,6 +28,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] @@ -44,10 +45,12 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %.6: type = struct_type {.x: i32} [template] // CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %.8: type = ptr_type %.6 [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.9: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %Class.4: type = class_type @Class, @Class(%U) [symbolic] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] @@ -82,58 +85,65 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_13.1, runtime_param [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %c.patt: %Class.3 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %Class.3 = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %int.make_type_32.loc15_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_32.loc15_15 [template = i32] // CHECK:STDOUT: %.loc15_14.2: type = converted %int.make_type_32.loc15_15, %.loc15_14.1 [template = i32] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %c.param: %Class.3 = param c, runtime_param0 -// CHECK:STDOUT: %c: %Class.3 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc15_24: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_24.1: type = value_of_initializer %int.make_type_32.loc15_24 [template = i32] // CHECK:STDOUT: %.loc15_24.2: type = converted %int.make_type_32.loc15_24, %.loc15_24.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Class.3 = param runtime_param0 +// CHECK:STDOUT: %c: %Class.3 = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc19_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_6.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc19_6.1, runtime_param [symbolic = %T.patt.loc19_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: %c.patt: @G.%Class.loc19_24.2 (%Class.2) = binding_pattern c +// CHECK:STDOUT: %c.param_patt: @G.%Class.loc19_24.2 (%Class.2) = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc19_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc19_6.2 (constants.%T)] // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %T.ref.loc19_25: type = name_ref T, %T.loc19_6.1 [symbolic = %T.loc19_6.2 (constants.%T)] // CHECK:STDOUT: %Class.loc19_24.1: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.loc19_24.2 (constants.%Class.2)] -// CHECK:STDOUT: %c.param: @G.%Class.loc19_24.2 (%Class.2) = param c, runtime_param0 -// CHECK:STDOUT: %c: @G.%Class.loc19_24.2 (%Class.2) = bind_name c, %c.param // CHECK:STDOUT: %T.ref.loc19_32: type = name_ref T, %T.loc19_6.1 [symbolic = %T.loc19_6.2 (constants.%T)] // CHECK:STDOUT: %return: ref @G.%T.loc19_6.2 (%T) = var +// CHECK:STDOUT: %param.loc19_6: type = param runtime_param +// CHECK:STDOUT: %T.loc19_6.1: type = bind_symbolic_name T, 0, %param.loc19_6 [symbolic = %T.loc19_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc19_16: @G.%Class.loc19_24.2 (%Class.2) = param runtime_param0 +// CHECK:STDOUT: %c: @G.%Class.loc19_24.2 (%Class.2) = bind_name c, %param.loc19_16 // CHECK:STDOUT: } // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 +// CHECK:STDOUT: %U.patt.loc23_6.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc23_6.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc23_6.1, runtime_param [symbolic = %U.patt.loc23_6.2 (constants.%U.patt)] // CHECK:STDOUT: %c.patt: @H.%Class.loc23_24.2 (%Class.4) = binding_pattern c +// CHECK:STDOUT: %c.param_patt: @H.%Class.loc23_24.2 (%Class.4) = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc23_6.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc23_6.2 (constants.%U)] // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %U.ref.loc23_25: type = name_ref U, %U.loc23_6.1 [symbolic = %U.loc23_6.2 (constants.%U)] // CHECK:STDOUT: %Class.loc23_24.1: type = class_type @Class, @Class(constants.%U) [symbolic = %Class.loc23_24.2 (constants.%Class.4)] -// CHECK:STDOUT: %c.param: @H.%Class.loc23_24.2 (%Class.4) = param c, runtime_param0 -// CHECK:STDOUT: %c: @H.%Class.loc23_24.2 (%Class.4) = bind_name c, %c.param // CHECK:STDOUT: %U.ref.loc23_32: type = name_ref U, %U.loc23_6.1 [symbolic = %U.loc23_6.2 (constants.%U)] // CHECK:STDOUT: %return: ref @H.%U.loc23_6.2 (%U) = var +// CHECK:STDOUT: %param.loc23_6: type = param runtime_param +// CHECK:STDOUT: %U.loc23_6.1: type = bind_symbolic_name U, 0, %param.loc23_6 [symbolic = %U.loc23_6.2 (constants.%U)] +// CHECK:STDOUT: %param.loc23_16: @H.%Class.loc23_24.2 (%Class.4) = param runtime_param0 +// CHECK:STDOUT: %c: @H.%Class.loc23_24.2 (%Class.4) = bind_name c, %param.loc23_16 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc11_13.1: type) { // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc11_13.2) [symbolic = %Class (constants.%Class.2)] @@ -154,7 +164,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%c: %Class.3) -> i32 { +// CHECK:STDOUT: fn @F(%c.param_patt: %Class.3) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class.3 = name_ref c, %c // CHECK:STDOUT: %x.ref: %.5 = name_ref x, @Class.%.loc12_8.1 [template = @Class.%.loc12_8.1] @@ -165,12 +175,13 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%T.loc19_6.1: type) { // CHECK:STDOUT: %T.loc19_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc19_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc19_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: %Class.loc19_24.2: type = class_type @Class, @Class(%T.loc19_6.2) [symbolic = %Class.loc19_24.2 (constants.%Class.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc20_11.3: type = unbound_element_type @G.%Class.loc19_24.2 (%Class.2), @G.%T.loc19_6.2 (%T) [symbolic = %.loc20_11.3 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc19_6.1: type, %c: @G.%Class.loc19_24.2 (%Class.2)) -> @G.%T.loc19_6.2 (%T) { +// CHECK:STDOUT: fn(%T.param_patt: type, %c.param_patt: @G.%Class.loc19_24.2 (%Class.2)) -> @G.%T.loc19_6.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: @G.%Class.loc19_24.2 (%Class.2) = name_ref c, %c // CHECK:STDOUT: %x.ref: @G.%.loc20_11.3 (%.2) = name_ref x, @Class.%.loc12_8.1 [template = @Class.%.loc12_8.1] @@ -182,12 +193,13 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @H(%U.loc23_6.1: type) { // CHECK:STDOUT: %U.loc23_6.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc23_6.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc23_6.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc23_6.2 (constants.%U.patt)] // CHECK:STDOUT: %Class.loc23_24.2: type = class_type @Class, @Class(%U.loc23_6.2) [symbolic = %Class.loc23_24.2 (constants.%Class.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc24_11.3: type = unbound_element_type @H.%Class.loc23_24.2 (%Class.4), @H.%U.loc23_6.2 (%U) [symbolic = %.loc24_11.3 (constants.%.10)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.loc23_6.1: type, %c: @H.%Class.loc23_24.2 (%Class.4)) -> @H.%U.loc23_6.2 (%U) { +// CHECK:STDOUT: fn(%U.param_patt: type, %c.param_patt: @H.%Class.loc23_24.2 (%Class.4)) -> @H.%U.loc23_6.2 (%U) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: @H.%Class.loc23_24.2 (%Class.4) = name_ref c, %c // CHECK:STDOUT: %x.ref: @H.%.loc24_11.3 (%.10) = name_ref x, @Class.%.loc12_8.1 [template = @Class.%.loc12_8.1] @@ -199,6 +211,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.2 @@ -209,10 +222,12 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.loc11_13.2) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(i32) { // CHECK:STDOUT: %T.loc11_13.2 => i32 +// CHECK:STDOUT: %T.patt.loc11_13.2 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.3 @@ -223,15 +238,18 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@G.%T.loc19_6.2) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T.loc19_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc19_6.2 => constants.%T // CHECK:STDOUT: %Class.loc19_24.2 => constants.%Class.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%U) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%U +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.4 @@ -242,10 +260,12 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@H.%U.loc23_6.2) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%U +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%U) { // CHECK:STDOUT: %U.loc23_6.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc23_6.2 => constants.%U // CHECK:STDOUT: %Class.loc23_24.2 => constants.%Class.4 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 08ee4a47a675..12cd6ce62c10 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -71,11 +71,11 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+8]]:13: error: redeclaration differs at parameter 1 // CHECK:STDERR: class Class(U:! type) { -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_foo.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: foo.carbon:4:13: note: previous declaration's corresponding parameter here // CHECK:STDERR: class Class(T:! type); -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: class Class(U:! type) { // CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+3]]:10: error: name `T` not found @@ -88,10 +88,12 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [template] // CHECK:STDOUT: %CompleteClass.1: %CompleteClass.type = struct_value () [template] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] @@ -132,16 +134,18 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %CompleteClass.decl: %CompleteClass.type = class_decl @CompleteClass [template = constants.%CompleteClass.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6_21.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_21.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6_21.1, runtime_param [symbolic = %T.patt.loc6_21.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_21.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_21.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc6_21.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc6_21.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} { // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, file.%CompleteClass.decl [template = constants.%CompleteClass.1] @@ -155,12 +159,14 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @CompleteClass(%T.loc6_21.1: type) { // CHECK:STDOUT: %T.loc6_21.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_21.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_21.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_21.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T.loc6_21.2) [symbolic = %CompleteClass (constants.%CompleteClass.2)] @@ -204,10 +210,12 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(constants.%T) { // CHECK:STDOUT: %T.loc6_21.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_21.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 @@ -220,20 +228,24 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(@CompleteClass.%T.loc6_21.2) { // CHECK:STDOUT: %T.loc6_21.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_21.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(i32) { // CHECK:STDOUT: %T.loc6_21.2 => i32 +// CHECK:STDOUT: %T.patt.loc6_21.2 => i32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- foo.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.2: type = unbound_element_type %Class.2, %T [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] @@ -259,9 +271,9 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+7, loaded [template = constants.%Class.1] -// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+16, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.2 = import_ref Main//foo, inst+57, loaded [template = constants.%F.2] +// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+9, loaded [template = constants.%Class.1] +// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+21, loaded [template = constants.%CompleteClass.1] +// CHECK:STDOUT: %import_ref.3: %F.type.2 = import_ref Main//foo, inst+63, loaded [template = constants.%F.2] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude @@ -273,9 +285,9 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+20, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+30, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+37, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+26, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+36, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+43, unloaded // CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -290,10 +302,11 @@ class Class(U:! type) { // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4: type = symbolic_binding_pattern T, 0 [symbolic = constants.%T.patt.1] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4, runtime_param [symbolic = constants.%T.patt.1] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T, 0, %param [symbolic = constants.%T] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} { // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.1] @@ -307,6 +320,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(constants.%T: type) { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T, 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.1 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] @@ -327,6 +341,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @CompleteClass(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic = %CompleteClass (constants.%CompleteClass.2)] @@ -363,14 +378,17 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %T.patt.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.1) { // CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %T.patt.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 @@ -381,12 +399,14 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(@CompleteClass.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(i32) { // CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: %T.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.3 @@ -409,6 +429,7 @@ class Class(U:! type) { // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.4: type = unbound_element_type %CompleteClass.2, i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] @@ -425,9 +446,9 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+7, unloaded -// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+16, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+57, loaded [template = constants.%F.3] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+9, unloaded +// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+21, loaded [template = constants.%CompleteClass.1] +// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+63, loaded [template = constants.%F.3] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.4 // CHECK:STDOUT: import Core//prelude @@ -440,9 +461,9 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+20, unloaded -// CHECK:STDOUT: %import_ref.6: @CompleteClass.%.1 (%.4) = import_ref Main//foo, inst+30, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, inst+37, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+26, unloaded +// CHECK:STDOUT: %import_ref.6: @CompleteClass.%.1 (%.4) = import_ref Main//foo, inst+36, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.7: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, inst+43, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -472,6 +493,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @CompleteClass(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic = %CompleteClass (constants.%CompleteClass.2)] @@ -542,6 +564,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 @@ -552,12 +575,14 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(@CompleteClass.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(i32) { // CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: %T.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.3 @@ -582,6 +607,7 @@ class Class(U:! type) { // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.4: type = unbound_element_type %CompleteClass.2, i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] @@ -604,6 +630,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -618,9 +645,9 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+7, unloaded -// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+16, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+57, loaded [template = constants.%F.3] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+9, unloaded +// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+21, loaded [template = constants.%CompleteClass.1] +// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+63, loaded [template = constants.%F.3] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: .ImplicitAs = %import_ref.8 @@ -633,16 +660,16 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+20, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+30, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+37, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+26, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+36, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+43, unloaded // CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.10: @ImplicitAs.%.1 (%.9) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.13)] -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.8: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.10: @ImplicitAs.%.1 (%.9) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.13)] +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -660,6 +687,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -679,6 +707,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @CompleteClass(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic = %CompleteClass (constants.%CompleteClass.2)] @@ -731,11 +760,12 @@ class Class(U:! type) { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 @@ -746,12 +776,14 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(@CompleteClass.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(constants.%.5) { // CHECK:STDOUT: %T => constants.%.5 +// CHECK:STDOUT: %T.patt => constants.%.5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.3 @@ -762,6 +794,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(i32) { // CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: %T.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.4 @@ -772,14 +805,17 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -790,6 +826,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%CompleteClass.3) { // CHECK:STDOUT: %Dest => constants.%CompleteClass.3 +// CHECK:STDOUT: %Dest.patt => constants.%CompleteClass.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -804,20 +841,22 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: %.3: type = class_type @.1, @.1(%U) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+7, loaded [template = constants.%Class.1] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//foo, inst+16, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//foo, inst+57, unloaded +// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+9, loaded [template = constants.%Class.1] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//foo, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//foo, inst+63, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -841,21 +880,24 @@ class Class(U:! type) { // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 +// CHECK:STDOUT: %U.patt.loc12_13.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc12_13.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc12_13.1, runtime_param [symbolic = %U.patt.loc12_13.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc12_13.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc12_13.2 (constants.%U)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc12_13.1: type = bind_symbolic_name U, 0, %param [symbolic = %U.loc12_13.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%U.loc12_13.1: type) { // CHECK:STDOUT: %U.loc12_13.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc12_13.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc12_13.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc12_13.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -872,9 +914,11 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%U) { // CHECK:STDOUT: %U.loc12_13.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc12_13.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index 47b9469683d1..867db7b86dc1 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -46,6 +46,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] @@ -53,6 +54,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %.2: type = unbound_element_type %Class.2, %T [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.k: %T} [symbolic] // CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %InitFromStructGeneric.type: type = fn_type @InitFromStructGeneric [template] // CHECK:STDOUT: %InitFromStructGeneric: %InitFromStructGeneric.type = struct_value () [template] // CHECK:STDOUT: %.5: type = ptr_type %.3 [symbolic] @@ -91,40 +93,45 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromStructGeneric.decl: %InitFromStructGeneric.type = fn_decl @InitFromStructGeneric [template = constants.%InitFromStructGeneric] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_26.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_26.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_26.1, runtime_param [symbolic = %T.patt.loc8_26.2 (constants.%T.patt.2)] // CHECK:STDOUT: %x.patt: @InitFromStructGeneric.%T.loc8_26.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @InitFromStructGeneric.%T.loc8_26.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_26.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_26.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc8_39: type = name_ref T, %T.loc8_26.1 [symbolic = %T.loc8_26.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @InitFromStructGeneric.%T.loc8_26.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @InitFromStructGeneric.%T.loc8_26.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc8_45: type = name_ref T, %T.loc8_26.1 [symbolic = %T.loc8_26.2 (constants.%T)] // CHECK:STDOUT: %return: ref @InitFromStructGeneric.%T.loc8_26.2 (%T) = var +// CHECK:STDOUT: %param.loc8_26: type = param runtime_param +// CHECK:STDOUT: %T.loc8_26.1: type = bind_symbolic_name T, 0, %param.loc8_26 [symbolic = %T.loc8_26.2 (constants.%T)] +// CHECK:STDOUT: %param.loc8_36: @InitFromStructGeneric.%T.loc8_26.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @InitFromStructGeneric.%T.loc8_26.2 (%T) = bind_name x, %param.loc8_36 // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromStructSpecific.decl: %InitFromStructSpecific.type = fn_decl @InitFromStructSpecific [template = constants.%InitFromStructSpecific] { // CHECK:STDOUT: %x.patt: i32 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: i32 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc13_30: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_30.1: type = value_of_initializer %int.make_type_32.loc13_30 [template = i32] // CHECK:STDOUT: %.loc13_30.2: type = converted %int.make_type_32.loc13_30, %.loc13_30.1 [template = i32] -// CHECK:STDOUT: %x.param: i32 = param x, runtime_param0 -// CHECK:STDOUT: %x: i32 = bind_name x, %x.param // CHECK:STDOUT: %int.make_type_32.loc13_38: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_38.1: type = value_of_initializer %int.make_type_32.loc13_38 [template = i32] // CHECK:STDOUT: %.loc13_38.2: type = converted %int.make_type_32.loc13_38, %.loc13_38.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %x: i32 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc4_13.2) [symbolic = %Class (constants.%Class.2)] @@ -145,13 +152,14 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @InitFromStructGeneric(%T.loc8_26.1: type) { // CHECK:STDOUT: %T.loc8_26.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_26.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_26.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_26.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class.loc9_15.2: type = class_type @Class, @Class(%T.loc8_26.2) [symbolic = %Class.loc9_15.2 (constants.%Class.2)] // CHECK:STDOUT: %.loc9_28.5: type = struct_type {.k: @InitFromStructGeneric.%T.loc8_26.2 (%T)} [symbolic = %.loc9_28.5 (constants.%.3)] // CHECK:STDOUT: %.loc10_11.3: type = unbound_element_type @InitFromStructGeneric.%Class.loc9_15.2 (%Class.2), @InitFromStructGeneric.%T.loc8_26.2 (%T) [symbolic = %.loc10_11.3 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc8_26.1: type, %x: @InitFromStructGeneric.%T.loc8_26.2 (%T)) -> @InitFromStructGeneric.%T.loc8_26.2 (%T) { +// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @InitFromStructGeneric.%T.loc8_26.2 (%T)) -> @InitFromStructGeneric.%T.loc8_26.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc8_26.1 [symbolic = %T.loc8_26.2 (constants.%T)] @@ -175,7 +183,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @InitFromStructSpecific(%x: i32) -> i32 { +// CHECK:STDOUT: fn @InitFromStructSpecific(%x.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] @@ -200,6 +208,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.2 @@ -210,18 +219,22 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.loc4_13.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @InitFromStructGeneric(constants.%T) { // CHECK:STDOUT: %T.loc8_26.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_26.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@InitFromStructGeneric.%T.loc8_26.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(i32) { // CHECK:STDOUT: %T.loc4_13.2 => i32 +// CHECK:STDOUT: %T.patt.loc4_13.2 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.3 @@ -234,11 +247,13 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Adapt.type: type = generic_class_type @Adapt [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Adapt.1: %Adapt.type = struct_value () [template] // CHECK:STDOUT: %Adapt.2: type = class_type @Adapt, @Adapt(%T) [symbolic] // CHECK:STDOUT: %.2: = complete_type_witness %T [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %InitFromAdaptedGeneric.type: type = fn_type @InitFromAdaptedGeneric [template] // CHECK:STDOUT: %InitFromAdaptedGeneric: %InitFromAdaptedGeneric.type = struct_value () [template] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] @@ -273,40 +288,45 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Adapt.decl: %Adapt.type = class_decl @Adapt [template = constants.%Adapt.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromAdaptedGeneric.decl: %InitFromAdaptedGeneric.type = fn_decl @InitFromAdaptedGeneric [template = constants.%InitFromAdaptedGeneric] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_27.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_27.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_27.1, runtime_param [symbolic = %T.patt.loc8_27.2 (constants.%T.patt.2)] // CHECK:STDOUT: %x.patt: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_27.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_27.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc8_40: type = name_ref T, %T.loc8_27.1 [symbolic = %T.loc8_27.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc8_46: type = name_ref T, %T.loc8_27.1 [symbolic = %T.loc8_27.2 (constants.%T)] // CHECK:STDOUT: %return: ref @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = var +// CHECK:STDOUT: %param.loc8_27: type = param runtime_param +// CHECK:STDOUT: %T.loc8_27.1: type = bind_symbolic_name T, 0, %param.loc8_27 [symbolic = %T.loc8_27.2 (constants.%T)] +// CHECK:STDOUT: %param.loc8_37: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = bind_name x, %param.loc8_37 // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromAdaptedSpecific.decl: %InitFromAdaptedSpecific.type = fn_decl @InitFromAdaptedSpecific [template = constants.%InitFromAdaptedSpecific] { // CHECK:STDOUT: %x.patt: i32 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: i32 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc12_31: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_31.1: type = value_of_initializer %int.make_type_32.loc12_31 [template = i32] // CHECK:STDOUT: %.loc12_31.2: type = converted %int.make_type_32.loc12_31, %.loc12_31.1 [template = i32] -// CHECK:STDOUT: %x.param: i32 = param x, runtime_param0 -// CHECK:STDOUT: %x: i32 = bind_name x, %x.param // CHECK:STDOUT: %int.make_type_32.loc12_39: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_39.1: type = value_of_initializer %int.make_type_32.loc12_39 [template = i32] // CHECK:STDOUT: %.loc12_39.2: type = converted %int.make_type_32.loc12_39, %.loc12_39.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %x: i32 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Adapt(%T.loc4_13.1: type) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc6_1.2: = complete_type_witness @Adapt.%T.loc4_13.2 (%T) [symbolic = %.loc6_1.2 (constants.%.2)] @@ -323,11 +343,12 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @InitFromAdaptedGeneric(%T.loc8_27.1: type) { // CHECK:STDOUT: %T.loc8_27.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_27.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_27.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_27.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Adapt.loc9_21.2: type = class_type @Adapt, @Adapt(%T.loc8_27.2) [symbolic = %Adapt.loc9_21.2 (constants.%Adapt.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc8_27.1: type, %x: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T)) -> @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) { +// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T)) -> @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = name_ref x, %x // CHECK:STDOUT: %Adapt.ref: %Adapt.type = name_ref Adapt, file.%Adapt.decl [template = constants.%Adapt.1] @@ -344,7 +365,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @InitFromAdaptedSpecific(%x: i32) -> i32 { +// CHECK:STDOUT: fn @InitFromAdaptedSpecific(%x.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: i32 = name_ref x, %x // CHECK:STDOUT: %Adapt.ref: %Adapt.type = name_ref Adapt, file.%Adapt.decl [template = constants.%Adapt.1] @@ -364,6 +385,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Adapt(constants.%T) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc6_1.2 => constants.%.2 @@ -371,14 +393,17 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @InitFromAdaptedGeneric(constants.%T) { // CHECK:STDOUT: %T.loc8_27.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_27.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Adapt(@InitFromAdaptedGeneric.%T.loc8_27.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Adapt(i32) { // CHECK:STDOUT: %T.loc4_13.2 => i32 +// CHECK:STDOUT: %T.patt.loc4_13.2 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc6_1.2 => constants.%.3 diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index 18e2b6a85aad..ce7be49193d6 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -52,6 +52,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] @@ -112,43 +113,47 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc2_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc2_13.1, runtime_param [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc2_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc2_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc2_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc2_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %DirectFieldAccess.decl: %DirectFieldAccess.type = fn_decl @DirectFieldAccess [template = constants.%DirectFieldAccess] { // CHECK:STDOUT: %x.patt: %Class.3 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %Class.3 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %int.make_type_32.loc10_31: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_30.1: type = value_of_initializer %int.make_type_32.loc10_31 [template = i32] // CHECK:STDOUT: %.loc10_30.2: type = converted %int.make_type_32.loc10_31, %.loc10_30.1 [template = i32] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %x.param: %Class.3 = param x, runtime_param0 -// CHECK:STDOUT: %x: %Class.3 = bind_name x, %x.param // CHECK:STDOUT: %int.make_type_32.loc10_40: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_40.1: type = value_of_initializer %int.make_type_32.loc10_40 [template = i32] // CHECK:STDOUT: %.loc10_40.2: type = converted %int.make_type_32.loc10_40, %.loc10_40.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Class.3 = param runtime_param0 +// CHECK:STDOUT: %x: %Class.3 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %MethodCall.decl: %MethodCall.type = fn_decl @MethodCall [template = constants.%MethodCall] { // CHECK:STDOUT: %x.patt: %Class.3 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %Class.3 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %int.make_type_32.loc14_24: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_23.1: type = value_of_initializer %int.make_type_32.loc14_24 [template = i32] // CHECK:STDOUT: %.loc14_23.2: type = converted %int.make_type_32.loc14_24, %.loc14_23.1 [template = i32] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %x.param: %Class.3 = param x, runtime_param0 -// CHECK:STDOUT: %x: %Class.3 = bind_name x, %x.param // CHECK:STDOUT: %int.make_type_32.loc14_33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_33.1: type = value_of_initializer %int.make_type_32.loc14_33 [template = i32] // CHECK:STDOUT: %.loc14_33.2: type = converted %int.make_type_32.loc14_33, %.loc14_33.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Class.3 = param runtime_param0 +// CHECK:STDOUT: %x: %Class.3 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %AddrMethodCall.decl: %AddrMethodCall.type = fn_decl @AddrMethodCall [template = constants.%AddrMethodCall] { // CHECK:STDOUT: %p.patt: %.12 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.12 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %int.make_type_32.loc18_28: init type = call constants.%Int32() [template = i32] @@ -156,17 +161,18 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %.loc18_27.2: type = converted %int.make_type_32.loc18_28, %.loc18_27.1 [template = i32] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] // CHECK:STDOUT: %.loc18_32: type = ptr_type %Class.3 [template = constants.%.12] -// CHECK:STDOUT: %p.param: %.12 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.12 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32.loc18_38: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_38.1: type = value_of_initializer %int.make_type_32.loc18_38 [template = i32] // CHECK:STDOUT: %.loc18_38.2: type = converted %int.make_type_32.loc18_38, %.loc18_38.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.12 = param runtime_param0 +// CHECK:STDOUT: %p: %.12 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc2_13.1: type) { // CHECK:STDOUT: %T.loc2_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc2_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc2_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc2_13.2) [symbolic = %Class (constants.%Class.2)] @@ -183,26 +189,28 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %.loc3_8.1: @Class.%.loc3_8.2 (%.2) = field_decl x, element0 [template] // CHECK:STDOUT: %Get.decl: @Class.%Get.type (%Get.type.1) = fn_decl @Get [symbolic = @Class.%Get (constants.%Get.1)] { // CHECK:STDOUT: %self.patt: @Get.%Class (%Class.2) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Get.%Class (%Class.2) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc5_16: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_16 [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %self.param: @Get.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self: @Get.%Class (%Class.2) = bind_name self, %self.param // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc2_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %return: ref @Get.%T (%T) = var +// CHECK:STDOUT: %param: @Get.%Class (%Class.2) = param runtime_param0 +// CHECK:STDOUT: %self: @Get.%Class (%Class.2) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %GetAddr.decl: @Class.%GetAddr.type (%GetAddr.type.1) = fn_decl @GetAddr [symbolic = @Class.%GetAddr (constants.%GetAddr.1)] { // CHECK:STDOUT: %self.patt: @GetAddr.%.loc7_29.1 (%.3) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @GetAddr.%.loc7_29.1 (%.3) = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc7_14: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc7_25: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc7_25 [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %.loc7_29.2: type = ptr_type %Class.2 [symbolic = %.loc7_29.1 (constants.%.3)] -// CHECK:STDOUT: %self.param: @GetAddr.%.loc7_29.1 (%.3) = param self, runtime_param0 -// CHECK:STDOUT: %self: @GetAddr.%.loc7_29.1 (%.3) = bind_name self, %self.param -// CHECK:STDOUT: %.loc7_14: @GetAddr.%.loc7_29.1 (%.3) = addr_pattern %self // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc2_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %.loc7_38.2: type = ptr_type %T [symbolic = %.loc7_38.1 (constants.%.4)] // CHECK:STDOUT: %return: ref @GetAddr.%.loc7_38.1 (%.4) = var +// CHECK:STDOUT: %param: @GetAddr.%.loc7_29.1 (%.3) = param runtime_param0 +// CHECK:STDOUT: %self: @GetAddr.%.loc7_29.1 (%.3) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_1.1: = complete_type_witness %.5 [symbolic = %.loc8_1.3 (constants.%.6)] // CHECK:STDOUT: @@ -221,7 +229,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc5_42.3: type = unbound_element_type @Get.%Class (%Class.2), @Get.%T (%T) [symbolic = %.loc5_42.3 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Get.%Class (%Class.2)]() -> @Get.%T (%T) { +// CHECK:STDOUT: fn[%self.param_patt: @Get.%Class (%Class.2)]() -> @Get.%T (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @Get.%Class (%Class.2) = name_ref self, %self // CHECK:STDOUT: %x.ref: @Get.%.loc5_42.3 (%.2) = name_ref x, @Class.%.loc3_8.1 [template = @Class.%.loc3_8.1] @@ -240,7 +248,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc7_54.3: type = unbound_element_type @GetAddr.%Class (%Class.2), @GetAddr.%T (%T) [symbolic = %.loc7_54.3 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @GetAddr.%.loc7_29.1 (%.3)]() -> @GetAddr.%.loc7_38.1 (%.4) { +// CHECK:STDOUT: fn[addr %self.param_patt: @GetAddr.%.loc7_29.1 (%.3)]() -> @GetAddr.%.loc7_38.1 (%.4) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @GetAddr.%.loc7_29.1 (%.3) = name_ref self, %self // CHECK:STDOUT: %.loc7_54.1: ref @GetAddr.%Class (%Class.2) = deref %self.ref @@ -253,7 +261,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @DirectFieldAccess(%x: %Class.3) -> i32 { +// CHECK:STDOUT: fn @DirectFieldAccess(%x.param_patt: %Class.3) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref.loc11_10: %Class.3 = name_ref x, %x // CHECK:STDOUT: %x.ref.loc11_11: %.8 = name_ref x, @Class.%.loc3_8.1 [template = @Class.%.loc3_8.1] @@ -262,7 +270,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: return %.loc11_11.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @MethodCall(%x: %Class.3) -> i32 { +// CHECK:STDOUT: fn @MethodCall(%x.param_patt: %Class.3) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %Class.3 = name_ref x, %x // CHECK:STDOUT: %.loc15_11.1: %Get.type.2 = specific_constant @Class.%Get.decl, @Class(i32) [template = constants.%Get.2] @@ -275,7 +283,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: return %.loc15_17.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddrMethodCall(%p: %.12) -> i32 { +// CHECK:STDOUT: fn @AddrMethodCall(%p.param_patt: %.12) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.12 = name_ref p, %p // CHECK:STDOUT: %.loc19_12.1: ref %Class.3 = deref %p.ref @@ -294,6 +302,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.2 @@ -308,6 +317,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Get.%T) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Get(constants.%T) { @@ -317,6 +327,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@GetAddr.%T) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetAddr(constants.%T) { @@ -328,10 +339,12 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.loc2_13.2) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(i32) { // CHECK:STDOUT: %T.loc2_13.2 => i32 +// CHECK:STDOUT: %T.patt.loc2_13.2 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.3 @@ -366,6 +379,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] @@ -376,6 +390,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %struct: %Class.2 = struct_value () [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %StaticMemberFunctionCall.type: type = fn_type @StaticMemberFunctionCall [template] // CHECK:STDOUT: %StaticMemberFunctionCall: %StaticMemberFunctionCall.type = struct_value () [template] // CHECK:STDOUT: %.5: = specific_function %Make, @Make(%T) [symbolic] @@ -384,6 +399,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -409,12 +425,12 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -425,25 +441,28 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %StaticMemberFunctionCall.decl: %StaticMemberFunctionCall.type = fn_decl @StaticMemberFunctionCall [template = constants.%StaticMemberFunctionCall] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_29.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_29.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_29.1, runtime_param [symbolic = %T.patt.loc8_29.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_29.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_29.2 (constants.%T)] // CHECK:STDOUT: %Class.ref.loc8: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %T.ref.loc8: type = name_ref T, %T.loc8_29.1 [symbolic = %T.loc8_29.2 (constants.%T)] // CHECK:STDOUT: %Class.loc8_47.1: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.loc8_47.2 (constants.%Class.2)] // CHECK:STDOUT: %return: ref @StaticMemberFunctionCall.%Class.loc8_47.2 (%Class.2) = var +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc8_29.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_29.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -463,6 +482,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Class(%T.loc4_13.2) [symbolic = %Make.type (constants.%Make.type)] @@ -501,6 +521,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @StaticMemberFunctionCall(%T.loc8_29.1: type) { // CHECK:STDOUT: %T.loc8_29.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_29.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_29.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_29.2 (constants.%T.patt.2)] // CHECK:STDOUT: %Class.loc8_47.2: type = class_type @Class, @Class(%T.loc8_29.2) [symbolic = %Class.loc8_47.2 (constants.%Class.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -512,7 +533,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %.loc15_25.3: type = assoc_entity_type @StaticMemberFunctionCall.%ImplicitAs.type.loc15_25.2 (%ImplicitAs.type.3), @StaticMemberFunctionCall.%Convert.type (%Convert.type.2) [symbolic = %.loc15_25.3 (constants.%.8)] // CHECK:STDOUT: %.loc15_25.4: @StaticMemberFunctionCall.%.loc15_25.3 (%.8) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.loc15_25.4 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc8_29.1: type) -> %return: @StaticMemberFunctionCall.%Class.loc8_47.2 (%Class.2) { +// CHECK:STDOUT: fn(%T.param_patt: type) -> %return: @StaticMemberFunctionCall.%Class.loc8_47.2 (%Class.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref.loc15: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %T.ref.loc15: type = name_ref T, %T.loc8_29.1 [symbolic = %T.loc8_29.2 (constants.%T)] @@ -536,11 +557,12 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type @@ -549,6 +571,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Make.%T) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Make(constants.%T) { @@ -561,27 +584,33 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.loc4_13.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@StaticMemberFunctionCall.%T.loc8_29.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @StaticMemberFunctionCall(constants.%T) { // CHECK:STDOUT: %T.loc8_29.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_29.2 => constants.%T // CHECK:STDOUT: %Class.loc8_47.2 => constants.%Class.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -592,6 +621,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Class.2) { // CHECK:STDOUT: %Dest => constants.%Class.2 +// CHECK:STDOUT: %Dest.patt => constants.%Class.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -609,5 +639,6 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@StaticMemberFunctionCall.%Class.loc8_47.2) { // CHECK:STDOUT: %Dest => constants.%Class.2 +// CHECK:STDOUT: %Dest.patt => constants.%Class.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index 8027f483c8b2..743d6fced923 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -42,6 +42,7 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] @@ -76,15 +77,17 @@ class C(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T.loc4_13.2) [symbolic = %F.type (constants.%F.type)] @@ -99,22 +102,24 @@ class C(T:! type) { // CHECK:STDOUT: class { // CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = @Class.%F (constants.%F)] { // CHECK:STDOUT: %n.patt: @F.%T (%T) = binding_pattern n +// CHECK:STDOUT: %n.param_patt: @F.%T (%T) = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref.loc5_11: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %n.param: @F.%T (%T) = param n, runtime_param0 -// CHECK:STDOUT: %n: @F.%T (%T) = bind_name n, %n.param // CHECK:STDOUT: %T.ref.loc5_17: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %return: ref @F.%T (%T) = var +// CHECK:STDOUT: %param: @F.%T (%T) = param runtime_param0 +// CHECK:STDOUT: %n: @F.%T (%T) = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: @Class.%G.type (%G.type) = fn_decl @G [symbolic = @Class.%G (constants.%G)] { // CHECK:STDOUT: %self.patt: @G.%Class (%Class.2) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @G.%Class (%Class.2) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc9: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc9 [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %self.param: @G.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self: @G.%Class (%Class.2) = bind_name self, %self.param // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %return: ref @G.%T (%T) = var +// CHECK:STDOUT: %param: @G.%Class (%Class.2) = param runtime_param0 +// CHECK:STDOUT: %self: @G.%Class (%Class.2) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %.loc13_8.1: @Class.%.loc13_8.2 (%.2) = field_decl n, element0 [template] @@ -133,7 +138,7 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%n: @F.%T (%T)) -> @F.%T (%T) { +// CHECK:STDOUT: fn(%n.param_patt: @F.%T (%T)) -> @F.%T (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: @F.%T (%T) = name_ref n, %n // CHECK:STDOUT: return %n.ref @@ -147,7 +152,7 @@ class C(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc10_16.3: type = unbound_element_type @G.%Class (%Class.2), @G.%T (%T) [symbolic = %.loc10_16.3 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @G.%Class (%Class.2)]() -> @G.%T (%T) { +// CHECK:STDOUT: fn[%self.param_patt: @G.%Class (%Class.2)]() -> @G.%T (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @G.%Class (%Class.2) = name_ref self, %self // CHECK:STDOUT: %n.ref: @G.%.loc10_16.3 (%.2) = name_ref n, @Class.%.loc13_8.1 [template = @Class.%.loc13_8.1] @@ -159,6 +164,7 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type @@ -177,6 +183,7 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@G.%T) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { @@ -186,12 +193,14 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.loc4_13.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_member_inline.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] @@ -224,15 +233,17 @@ class C(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_9.1, runtime_param [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc4_9.1: type) { // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F, @C(%T.loc4_9.2) [symbolic = %F.type (constants.%F.type)] @@ -269,6 +280,7 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type @@ -281,9 +293,11 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @C(@C.%T.loc4_9.2) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(@F.%T) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index 32a43c555286..79021daede58 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -99,16 +99,17 @@ class Generic(T:! type) { // CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE+6]]:12: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn Generic(T:! ()).WrongType() {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE-7]]:15: note: previous declaration's corresponding parameter here // CHECK:STDERR: class Generic(T:! type) { -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: --- basic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] @@ -120,6 +121,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %.2: type = unbound_element_type %Class.2, %T [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.n: %T} [symbolic] // CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.3: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.5: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -143,38 +146,42 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [symbolic = constants.%F] { // CHECK:STDOUT: %n.patt: %T = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %T = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc10: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] +// CHECK:STDOUT: %param.loc10_10: type = param runtime_param +// CHECK:STDOUT: %T.loc10: type = bind_symbolic_name T, 0, %param.loc10_10 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref.loc10_25: type = name_ref T, %T.loc10 [symbolic = constants.%T] -// CHECK:STDOUT: %n.param.loc10: %T = param n, runtime_param0 -// CHECK:STDOUT: %n.loc10: %T = bind_name n, %n.param.loc10 // CHECK:STDOUT: %T.ref.loc10_31: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %return: ref %T = var +// CHECK:STDOUT: %param.loc10_22: %T = param runtime_param0 +// CHECK:STDOUT: %n.loc10: %T = bind_name n, %param.loc10_22 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [symbolic = constants.%G] { // CHECK:STDOUT: %self.patt: %Class.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class.2 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc14: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] +// CHECK:STDOUT: %param.loc14_10: type = param runtime_param +// CHECK:STDOUT: %T.loc14: type = bind_symbolic_name T, 0, %param.loc14_10 [symbolic = constants.%T] // CHECK:STDOUT: %.loc14: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = constants.%Class.2] // CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, %.loc14 [symbolic = constants.%Class.2] -// CHECK:STDOUT: %self.param.loc14: %Class.2 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc14: %Class.2 = bind_name self, %self.param.loc14 // CHECK:STDOUT: %T.ref.loc14: type = name_ref T, %T.loc14 [symbolic = constants.%T] // CHECK:STDOUT: %return: ref %T = var +// CHECK:STDOUT: %param.loc14_22: %Class.2 = param runtime_param0 +// CHECK:STDOUT: %self.loc14: %Class.2 = bind_name self, %param.loc14_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T.loc4_13.2) [symbolic = %F.type (constants.%F.type)] @@ -189,22 +196,24 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: class { // CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = @Class.%F (constants.%F)] { // CHECK:STDOUT: %n.patt: %T = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %T = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref.loc5_11: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T.loc5 (constants.%T)] -// CHECK:STDOUT: %n.param.loc5: @F.%T.loc5 (%T) = param n, runtime_param0 -// CHECK:STDOUT: %n.loc5: @F.%T.loc5 (%T) = bind_name n, %n.param.loc5 // CHECK:STDOUT: %T.ref.loc5_17: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T.loc5 (constants.%T)] // CHECK:STDOUT: %return.var.loc5: ref @F.%T.loc5 (%T) = var +// CHECK:STDOUT: %param.loc5: @F.%T.loc5 (%T) = param runtime_param0 +// CHECK:STDOUT: %n.loc5: @F.%T.loc5 (%T) = bind_name n, %param.loc5 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: @Class.%G.type (%G.type) = fn_decl @G [symbolic = @Class.%G (constants.%G)] { // CHECK:STDOUT: %self.patt: %Class.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class.2 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc6: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, %.loc6 [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %self.param.loc6: @G.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc6: @G.%Class (%Class.2) = bind_name self, %self.param.loc6 // CHECK:STDOUT: %T.ref.loc6: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T.loc6 (constants.%T)] // CHECK:STDOUT: %return.var.loc6: ref @G.%T.loc6 (%T) = var +// CHECK:STDOUT: %param.loc6: @G.%Class (%Class.2) = param runtime_param0 +// CHECK:STDOUT: %self.loc6: @G.%Class (%Class.2) = bind_name self, %param.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %.loc7_8.1: @Class.%.loc7_8.2 (%.2) = field_decl n, element0 [template] @@ -223,7 +232,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%n.loc10: %T) -> %T { +// CHECK:STDOUT: fn(%n.param_patt: %T) -> %T { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: @F.%T.loc5 (%T) = name_ref n, %n.loc10 // CHECK:STDOUT: return %n.ref @@ -237,7 +246,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc15_14.3: type = unbound_element_type @G.%Class (%Class.2), @G.%T.loc6 (%T) [symbolic = %.loc15_14.3 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.loc14: %Class.2]() -> %T { +// CHECK:STDOUT: fn[%self.param_patt: %Class.2]() -> %T { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @G.%Class (%Class.2) = name_ref self, %self.loc14 // CHECK:STDOUT: %n.ref: @G.%.loc15_14.3 (%.2) = name_ref n, @Class.%.loc7_8.1 [template = @Class.%.loc7_8.1] @@ -249,6 +258,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type @@ -267,6 +277,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@G.%T.loc6) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { @@ -276,17 +287,20 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.loc4_13.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- nested.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %A.type: type = generic_class_type @A [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %A.1: %A.type = struct_value () [template] // CHECK:STDOUT: %A.2: type = class_type @A, @A(%T) [symbolic] // CHECK:STDOUT: %N: %T = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.1: %T = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %B.type: type = generic_class_type @B, @A(%T) [symbolic] // CHECK:STDOUT: %B.1: %B.type = struct_value () [symbolic] // CHECK:STDOUT: %B.2: type = class_type @B, @B(%T, %N) [symbolic] @@ -294,6 +308,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %T = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -317,32 +333,36 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_9.1, runtime_param [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [symbolic = constants.%F] { // CHECK:STDOUT: %self.patt: %B.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %B.2 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %a.patt: %T = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %T = param_pattern %a.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc10: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] +// CHECK:STDOUT: %param.loc10_6: type = param runtime_param +// CHECK:STDOUT: %T.loc10: type = bind_symbolic_name T, 0, %param.loc10_6 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref.loc10_22: type = name_ref T, %T.loc10 [symbolic = constants.%T] -// CHECK:STDOUT: %N.param: %T = param N, runtime_param -// CHECK:STDOUT: %N.loc10: %T = bind_symbolic_name N, 1, %N.param [symbolic = constants.%N] +// CHECK:STDOUT: %param.loc10_18: %T = param runtime_param +// CHECK:STDOUT: %N.loc10: %T = bind_symbolic_name N, 1, %param.loc10_18 [symbolic = constants.%N] // CHECK:STDOUT: %.loc10: type = specific_constant constants.%B.2, @B(constants.%T, constants.%N) [symbolic = constants.%B.2] // CHECK:STDOUT: %Self.ref.loc10: type = name_ref Self, %.loc10 [symbolic = constants.%B.2] -// CHECK:STDOUT: %self.param.loc10: %B.2 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc10: %B.2 = bind_name self, %self.param.loc10 // CHECK:STDOUT: %T.ref.loc10_42: type = name_ref T, %T.loc10 [symbolic = constants.%T] -// CHECK:STDOUT: %a.param.loc10: %T = param a, runtime_param1 -// CHECK:STDOUT: %a.loc10: %T = bind_name a, %a.param.loc10 +// CHECK:STDOUT: %param.loc10_27: %B.2 = param runtime_param0 +// CHECK:STDOUT: %self.loc10: %B.2 = bind_name self, %param.loc10_27 +// CHECK:STDOUT: %param.loc10_39: %T = param runtime_param1 +// CHECK:STDOUT: %a.loc10: %T = bind_name a, %param.loc10_39 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @A(%T.loc4_9.1: type) { // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %B.type: type = generic_class_type @B, @A(%T.loc4_9.2) [symbolic = %B.type (constants.%B.type)] @@ -350,11 +370,12 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %B.decl: @A.%B.type (%B.type) = class_decl @B [symbolic = @A.%B (constants.%B.1)] { -// CHECK:STDOUT: %N.patt: @B.%T (%T) = symbolic_binding_pattern N, 1 +// CHECK:STDOUT: %N.patt.loc5_11.1: @B.%T (%T) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc5_11.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: @B.%T (%T) = param_pattern %N.patt.loc5_11.1, runtime_param [symbolic = %N.patt.loc5_11.2 (constants.%N.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc4_9.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %N.param: @B.%T (%T) = param N, runtime_param -// CHECK:STDOUT: %N.loc5_11.1: @B.%T (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc5_11.2 (constants.%N)] +// CHECK:STDOUT: %param: @B.%T (%T) = param runtime_param +// CHECK:STDOUT: %N.loc5_11.1: @B.%T (%T) = bind_symbolic_name N, 1, %param [symbolic = %N.loc5_11.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -367,6 +388,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: generic class @B(@A.%T.loc4_9.1: type, %N.loc5_11.1: @B.%T (%T)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %N.loc5_11.2: %T = bind_symbolic_name N, 1 [symbolic = %N.loc5_11.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc5_11.2: %T = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc5_11.2 (constants.%N.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F, @B(%T, %N.loc5_11.2) [symbolic = %F.type (constants.%F.type)] @@ -375,15 +397,17 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: class { // CHECK:STDOUT: %F.decl: @B.%F.type (%F.type) = fn_decl @F [symbolic = @B.%F (constants.%F)] { // CHECK:STDOUT: %self.patt: %B.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %B.2 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %a.patt: %T = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %T = param_pattern %a.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc6: type = specific_constant constants.%B.2, @B(constants.%T, constants.%N) [symbolic = %B (constants.%B.2)] // CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, %.loc6 [symbolic = %B (constants.%B.2)] -// CHECK:STDOUT: %self.param.loc6: @F.%B (%B.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc6: @F.%B (%B.2) = bind_name self, %self.param.loc6 // CHECK:STDOUT: %T.ref.loc6: type = name_ref T, @A.%T.loc4_9.1 [symbolic = %T.loc6 (constants.%T)] -// CHECK:STDOUT: %a.param.loc6: @F.%T.loc6 (%T) = param a, runtime_param1 -// CHECK:STDOUT: %a.loc6: @F.%T.loc6 (%T) = bind_name a, %a.param.loc6 +// CHECK:STDOUT: %param.loc6_10: @F.%B (%B.2) = param runtime_param0 +// CHECK:STDOUT: %self.loc6: @F.%B (%B.2) = bind_name self, %param.loc6_10 +// CHECK:STDOUT: %param.loc6_22: @F.%T.loc6 (%T) = param runtime_param1 +// CHECK:STDOUT: %a.loc6: @F.%T.loc6 (%T) = bind_name a, %param.loc6_22 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -400,7 +424,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.loc10: %B.2](%a.loc10: %T) { +// CHECK:STDOUT: fn[%self.param_patt: %B.2](%a.param_patt: %T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -408,6 +432,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%T) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %B.type => constants.%B.type @@ -417,6 +442,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: specific @B(constants.%T, constants.%N) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %N.loc5_11.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc5_11.2 => constants.%N // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type @@ -426,6 +452,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: specific @B(@F.%T.loc6, @F.%N.loc6) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %N.loc5_11.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc5_11.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%N) { @@ -437,10 +464,12 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: specific @B(@B.%T, @B.%N.loc5_11.2) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %N.loc5_11.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc5_11.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A(@A.%T.loc4_9.2) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_not_generic_vs_generic.carbon @@ -453,6 +482,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } @@ -478,8 +508,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NotGeneric.decl: type = class_decl @NotGeneric [template = constants.%NotGeneric] {} {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc15_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc15_15.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc15_15.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc15_15.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -496,6 +526,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(%T.loc15_15.1: type) { // CHECK:STDOUT: %T.loc15_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_15.2 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -507,12 +538,14 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T) { // CHECK:STDOUT: %T.loc15_15.2 => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_too_few_args.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Generic.type: type = generic_class_type @Generic [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Generic.1: %Generic.type = struct_value () [template] @@ -545,16 +578,18 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Generic.decl: %Generic.type = class_decl @Generic [template = constants.%Generic.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_15.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_15.1, runtime_param [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_15.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_15.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Generic(%T.loc4_15.1: type) { // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_15.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_15.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew, @Generic(%T.loc4_15.2) [symbolic = %TooFew.type (constants.%TooFew.type)] @@ -582,18 +617,21 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T) { // CHECK:STDOUT: %T.loc4_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TooFew(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(@Generic.%T.loc4_15.2) { // CHECK:STDOUT: %T.loc4_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_too_many_args.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Generic.type: type = generic_class_type @Generic [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Generic.1: %Generic.type = struct_value () [template] @@ -602,7 +640,9 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %TooMany: %TooMany.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } @@ -627,21 +667,23 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Generic.decl: %Generic.type = class_decl @Generic [template = constants.%Generic.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_15.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_15.1, runtime_param [symbolic = %T.patt.loc4_15.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_15.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_15.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc15_12.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc15_12.2 (constants.%T)] -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc15_22.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc15_22.2 (constants.%U)] +// CHECK:STDOUT: %param.loc15_12: type = param runtime_param +// CHECK:STDOUT: %T.loc15_12.1: type = bind_symbolic_name T, 0, %param.loc15_12 [symbolic = %T.loc15_12.2 (constants.%T)] +// CHECK:STDOUT: %param.loc15_22: type = param runtime_param +// CHECK:STDOUT: %U.loc15_22.1: type = bind_symbolic_name U, 1, %param.loc15_22 [symbolic = %U.loc15_22.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Generic(%T.loc4_15.1: type) { // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_15.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_15.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany, @Generic(%T.loc4_15.2) [symbolic = %TooMany.type (constants.%TooMany.type)] @@ -664,7 +706,9 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(%T.loc15_12.1: type, %U.loc15_22.1: type) { // CHECK:STDOUT: %T.loc15_12.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_12.2 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.2)] // CHECK:STDOUT: %U.loc15_22.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc15_22.2 (constants.%U)] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -676,23 +720,28 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T) { // CHECK:STDOUT: %T.loc4_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TooMany(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(@Generic.%T.loc4_15.2) { // CHECK:STDOUT: %T.loc4_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc15_12.2 => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %U.loc15_22.2 => constants.%U +// CHECK:STDOUT: %U.patt => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_wrong_arg_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Generic.type: type = generic_class_type @Generic [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Generic.1: %Generic.type = struct_value () [template] @@ -702,6 +751,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %T.2: %.1 = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.2: %.1 = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } @@ -726,21 +776,23 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Generic.decl: %Generic.type = class_decl @Generic [template = constants.%Generic.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_15.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_15.1, runtime_param [symbolic = %T.patt.loc4_15.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_15.2 (constants.%T.1)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_15.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} { // CHECK:STDOUT: %.loc14_17.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc14_17.2: type = converted %.loc14_17.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %T.param: %.1 = param T, runtime_param -// CHECK:STDOUT: %T.loc14_12.1: %.1 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc14_12.2 (constants.%T.2)] +// CHECK:STDOUT: %param: %.1 = param runtime_param +// CHECK:STDOUT: %T.loc14_12.1: %.1 = bind_symbolic_name T, 0, %param [symbolic = %T.loc14_12.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Generic(%T.loc4_15.1: type) { // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_15.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc4_15.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %WrongType.type: type = fn_type @WrongType, @Generic(%T.loc4_15.2) [symbolic = %WrongType.type (constants.%WrongType.type)] @@ -763,6 +815,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(%T.loc14_12.1: %.1) { // CHECK:STDOUT: %T.loc14_12.2: %.1 = bind_symbolic_name T, 0 [symbolic = %T.loc14_12.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt: %.1 = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -774,15 +827,18 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T.1) { // CHECK:STDOUT: %T.loc4_15.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WrongType(constants.%T.1) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(@Generic.%T.loc4_15.2) { // CHECK:STDOUT: %T.loc4_15.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T.2) { // CHECK:STDOUT: %T.loc14_12.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/method_deduce.carbon b/toolchain/check/testdata/class/generic/method_deduce.carbon index 81b1db19c516..fa7bd2c7ce3c 100644 --- a/toolchain/check/testdata/class/generic/method_deduce.carbon +++ b/toolchain/check/testdata/class/generic/method_deduce.carbon @@ -32,15 +32,18 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt.1: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.4: type = tuple_type (type, type) [template] // CHECK:STDOUT: %.5: type = tuple_type (%T, %U) [symbolic] // CHECK:STDOUT: %Get.type.1: type = fn_type @Get, @Class(%T) [symbolic] // CHECK:STDOUT: %Get.1: %Get.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %U.patt.2: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %GetNoDeduce.type.1: type = fn_type @GetNoDeduce, @Class(%T) [symbolic] // CHECK:STDOUT: %GetNoDeduce.1: %GetNoDeduce.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.6: type = ptr_type %.5 [symbolic] @@ -90,38 +93,41 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc14_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc14_13.1, runtime_param [symbolic = %T.patt.loc14_13.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc14_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc14_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc14_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc14_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallGenericMethod.decl: %CallGenericMethod.type = fn_decl @CallGenericMethod [template = constants.%CallGenericMethod] { // CHECK:STDOUT: %c.patt: %Class.3 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %Class.3 = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %A.ref.loc19_31: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%A) [template = constants.%Class.3] -// CHECK:STDOUT: %c.param: %Class.3 = param c, runtime_param0 -// CHECK:STDOUT: %c: %Class.3 = bind_name c, %c.param // CHECK:STDOUT: %A.ref.loc19_39: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %B.ref.loc19: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc19_43.1: %.4 = tuple_literal (%A.ref.loc19_39, %B.ref.loc19) // CHECK:STDOUT: %.loc19_43.2: type = converted %.loc19_43.1, constants.%.9 [template = constants.%.9] // CHECK:STDOUT: %return: ref %.9 = var +// CHECK:STDOUT: %param: %Class.3 = param runtime_param0 +// CHECK:STDOUT: %c: %Class.3 = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %CallGenericMethodWithNonDeducedParam.decl: %CallGenericMethodWithNonDeducedParam.type = fn_decl @CallGenericMethodWithNonDeducedParam [template = constants.%CallGenericMethodWithNonDeducedParam] { // CHECK:STDOUT: %c.patt: %Class.3 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %Class.3 = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %A.ref.loc23_50: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%A) [template = constants.%Class.3] -// CHECK:STDOUT: %c.param: %Class.3 = param c, runtime_param0 -// CHECK:STDOUT: %c: %Class.3 = bind_name c, %c.param // CHECK:STDOUT: %A.ref.loc23_58: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %B.ref.loc23: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc23_62.1: %.4 = tuple_literal (%A.ref.loc23_58, %B.ref.loc23) // CHECK:STDOUT: %.loc23_62.2: type = converted %.loc23_62.1, constants.%.9 [template = constants.%.9] // CHECK:STDOUT: %return: ref %.9 = var +// CHECK:STDOUT: %param: %Class.3 = param runtime_param0 +// CHECK:STDOUT: %c: %Class.3 = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -141,6 +147,7 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc14_13.1: type) { // CHECK:STDOUT: %T.loc14_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc14_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Get.type: type = fn_type @Get, @Class(%T.loc14_13.2) [symbolic = %Get.type (constants.%Get.type.1)] @@ -150,30 +157,33 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Get.decl: @Class.%Get.type (%Get.type.1) = fn_decl @Get [symbolic = @Class.%Get (constants.%Get.1)] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %U.patt.loc15_10.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc15_10.1 (constants.%U.patt.1)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc15_10.2, runtime_param [symbolic = %U.patt.loc15_10.1 (constants.%U.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc15_10.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc15_10.2 (constants.%U)] // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc14_13.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %U.ref.loc15_27: type = name_ref U, %U.loc15_10.1 [symbolic = %U.loc15_10.2 (constants.%U)] +// CHECK:STDOUT: %U.ref.loc15_27: type = name_ref U, %U.loc15_10.2 [symbolic = %U.loc15_10.1 (constants.%U)] // CHECK:STDOUT: %.loc15_28.2: %.4 = tuple_literal (%T.ref, %U.ref.loc15_27) // CHECK:STDOUT: %.loc15_28.3: type = converted %.loc15_28.2, constants.%.5 [symbolic = %.loc15_28.1 (constants.%.5)] // CHECK:STDOUT: %return: ref @Get.%.loc15_28.1 (%.5) = var +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc15_10.2: type = bind_symbolic_name U, 1, %param [symbolic = %U.loc15_10.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %GetNoDeduce.decl: @Class.%GetNoDeduce.type (%GetNoDeduce.type.1) = fn_decl @GetNoDeduce [symbolic = @Class.%GetNoDeduce (constants.%GetNoDeduce.1)] { // CHECK:STDOUT: %x.patt: @GetNoDeduce.%T (%T) = binding_pattern x -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %x.param_patt: @GetNoDeduce.%T (%T) = param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %U.patt.loc16_24.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc16_24.1 (constants.%U.patt.2)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc16_24.2, runtime_param [symbolic = %U.patt.loc16_24.1 (constants.%U.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref.loc16_21: type = name_ref T, @Class.%T.loc14_13.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %x.param: @GetNoDeduce.%T (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @GetNoDeduce.%T (%T) = bind_name x, %x.param -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc16_24.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc16_24.2 (constants.%U)] // CHECK:STDOUT: %T.ref.loc16_38: type = name_ref T, @Class.%T.loc14_13.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %U.ref.loc16_41: type = name_ref U, %U.loc16_24.1 [symbolic = %U.loc16_24.2 (constants.%U)] +// CHECK:STDOUT: %U.ref.loc16_41: type = name_ref U, %U.loc16_24.2 [symbolic = %U.loc16_24.1 (constants.%U)] // CHECK:STDOUT: %.loc16_42.2: %.4 = tuple_literal (%T.ref.loc16_38, %U.ref.loc16_41) // CHECK:STDOUT: %.loc16_42.3: type = converted %.loc16_42.2, constants.%.5 [symbolic = %.loc16_42.1 (constants.%.5)] // CHECK:STDOUT: %return: ref @GetNoDeduce.%.loc16_42.1 (%.5) = var +// CHECK:STDOUT: %param.loc16_18: @GetNoDeduce.%T (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @GetNoDeduce.%T (%T) = bind_name x, %param.loc16_18 +// CHECK:STDOUT: %param.loc16_24: type = param runtime_param +// CHECK:STDOUT: %U.loc16_24.2: type = bind_symbolic_name U, 1, %param.loc16_24 [symbolic = %U.loc16_24.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: @@ -184,21 +194,22 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Get(@Class.%T.loc14_13.1: type, %U.loc15_10.1: type) { -// CHECK:STDOUT: %U.loc15_10.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc15_10.2 (constants.%U)] +// CHECK:STDOUT: generic fn @Get(@Class.%T.loc14_13.1: type, %U.loc15_10.2: type) { +// CHECK:STDOUT: %U.loc15_10.1: type = bind_symbolic_name U, 1 [symbolic = %U.loc15_10.1 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc15_10.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc15_10.1 (constants.%U.patt.1)] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.loc15_28.1: type = tuple_type (@Get.%T (%T), @Get.%U.loc15_10.2 (%U)) [symbolic = %.loc15_28.1 (constants.%.5)] +// CHECK:STDOUT: %.loc15_28.1: type = tuple_type (@Get.%T (%T), @Get.%U.loc15_10.1 (%U)) [symbolic = %.loc15_28.1 (constants.%.5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Get.type: type = fn_type @Get, @Class(%T) [symbolic = %Get.type (constants.%Get.type.1)] // CHECK:STDOUT: %Get: @Get.%Get.type (%Get.type.1) = struct_value () [symbolic = %Get (constants.%Get.1)] -// CHECK:STDOUT: %.loc15_39.3: = specific_function %Get, @Get(%T, %U.loc15_10.2) [symbolic = %.loc15_39.3 (constants.%.7)] +// CHECK:STDOUT: %.loc15_39.3: = specific_function %Get, @Get(%T, %U.loc15_10.1) [symbolic = %.loc15_39.3 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.loc15_10.1: type) -> %return: @Get.%.loc15_28.1 (%.5) { +// CHECK:STDOUT: fn(%U.param_patt: type) -> %return: @Get.%.loc15_28.1 (%.5) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc15_39.1: @Get.%Get.type (%Get.type.1) = specific_constant @Class.%Get.decl, @Class(constants.%T) [symbolic = %Get (constants.%Get.1)] // CHECK:STDOUT: %Get.ref: @Get.%Get.type (%Get.type.1) = name_ref Get, %.loc15_39.1 [symbolic = %Get (constants.%Get.1)] -// CHECK:STDOUT: %U.ref.loc15_43: type = name_ref U, %U.loc15_10.1 [symbolic = %U.loc15_10.2 (constants.%U)] +// CHECK:STDOUT: %U.ref.loc15_43: type = name_ref U, %U.loc15_10.2 [symbolic = %U.loc15_10.1 (constants.%U)] // CHECK:STDOUT: %.loc15_39.2: = specific_function %Get.ref, @Get(constants.%T, constants.%U) [symbolic = %.loc15_39.3 (constants.%.7)] // CHECK:STDOUT: %.loc15_42.1: ref @Get.%.loc15_28.1 (%.5) = temporary_storage // CHECK:STDOUT: %Get.call: init @Get.%.loc15_28.1 (%.5) = call %.loc15_39.2() to %.loc15_42.1 @@ -207,32 +218,33 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %.loc15_42.4: @Get.%T (%T) = bind_value %.loc15_42.3 // CHECK:STDOUT: %.loc15_42.5: ref @Get.%T (%T) = tuple_access %return, element0 // CHECK:STDOUT: %.loc15_42.6: init @Get.%T (%T) = initialize_from %.loc15_42.4 to %.loc15_42.5 -// CHECK:STDOUT: %.loc15_42.7: ref @Get.%U.loc15_10.2 (%U) = tuple_access %.loc15_42.2, element1 -// CHECK:STDOUT: %.loc15_42.8: @Get.%U.loc15_10.2 (%U) = bind_value %.loc15_42.7 -// CHECK:STDOUT: %.loc15_42.9: ref @Get.%U.loc15_10.2 (%U) = tuple_access %return, element1 -// CHECK:STDOUT: %.loc15_42.10: init @Get.%U.loc15_10.2 (%U) = initialize_from %.loc15_42.8 to %.loc15_42.9 +// CHECK:STDOUT: %.loc15_42.7: ref @Get.%U.loc15_10.1 (%U) = tuple_access %.loc15_42.2, element1 +// CHECK:STDOUT: %.loc15_42.8: @Get.%U.loc15_10.1 (%U) = bind_value %.loc15_42.7 +// CHECK:STDOUT: %.loc15_42.9: ref @Get.%U.loc15_10.1 (%U) = tuple_access %return, element1 +// CHECK:STDOUT: %.loc15_42.10: init @Get.%U.loc15_10.1 (%U) = initialize_from %.loc15_42.8 to %.loc15_42.9 // CHECK:STDOUT: %.loc15_42.11: init @Get.%.loc15_28.1 (%.5) = tuple_init (%.loc15_42.6, %.loc15_42.10) to %return // CHECK:STDOUT: %.loc15_45: init @Get.%.loc15_28.1 (%.5) = converted %Get.call, %.loc15_42.11 // CHECK:STDOUT: return %.loc15_45 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @GetNoDeduce(@Class.%T.loc14_13.1: type, %U.loc16_24.1: type) { +// CHECK:STDOUT: generic fn @GetNoDeduce(@Class.%T.loc14_13.1: type, %U.loc16_24.2: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %U.loc16_24.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc16_24.2 (constants.%U)] -// CHECK:STDOUT: %.loc16_42.1: type = tuple_type (@GetNoDeduce.%T (%T), @GetNoDeduce.%U.loc16_24.2 (%U)) [symbolic = %.loc16_42.1 (constants.%.5)] +// CHECK:STDOUT: %U.loc16_24.1: type = bind_symbolic_name U, 1 [symbolic = %U.loc16_24.1 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc16_24.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc16_24.1 (constants.%U.patt.2)] +// CHECK:STDOUT: %.loc16_42.1: type = tuple_type (@GetNoDeduce.%T (%T), @GetNoDeduce.%U.loc16_24.1 (%U)) [symbolic = %.loc16_42.1 (constants.%.5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GetNoDeduce.type: type = fn_type @GetNoDeduce, @Class(%T) [symbolic = %GetNoDeduce.type (constants.%GetNoDeduce.type.1)] // CHECK:STDOUT: %GetNoDeduce: @GetNoDeduce.%GetNoDeduce.type (%GetNoDeduce.type.1) = struct_value () [symbolic = %GetNoDeduce (constants.%GetNoDeduce.1)] -// CHECK:STDOUT: %.loc16_53.3: = specific_function %GetNoDeduce, @GetNoDeduce(%T, %U.loc16_24.2) [symbolic = %.loc16_53.3 (constants.%.8)] +// CHECK:STDOUT: %.loc16_53.3: = specific_function %GetNoDeduce, @GetNoDeduce(%T, %U.loc16_24.1) [symbolic = %.loc16_53.3 (constants.%.8)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x: @GetNoDeduce.%T (%T), %U.loc16_24.1: type) -> %return: @GetNoDeduce.%.loc16_42.1 (%.5) { +// CHECK:STDOUT: fn(%x.param_patt: @GetNoDeduce.%T (%T), %U.param_patt: type) -> %return: @GetNoDeduce.%.loc16_42.1 (%.5) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc16_53.1: @GetNoDeduce.%GetNoDeduce.type (%GetNoDeduce.type.1) = specific_constant @Class.%GetNoDeduce.decl, @Class(constants.%T) [symbolic = %GetNoDeduce (constants.%GetNoDeduce.1)] // CHECK:STDOUT: %GetNoDeduce.ref: @GetNoDeduce.%GetNoDeduce.type (%GetNoDeduce.type.1) = name_ref GetNoDeduce, %.loc16_53.1 [symbolic = %GetNoDeduce (constants.%GetNoDeduce.1)] // CHECK:STDOUT: %x.ref: @GetNoDeduce.%T (%T) = name_ref x, %x -// CHECK:STDOUT: %U.ref.loc16_68: type = name_ref U, %U.loc16_24.1 [symbolic = %U.loc16_24.2 (constants.%U)] +// CHECK:STDOUT: %U.ref.loc16_68: type = name_ref U, %U.loc16_24.2 [symbolic = %U.loc16_24.1 (constants.%U)] // CHECK:STDOUT: %.loc16_53.2: = specific_function %GetNoDeduce.ref, @GetNoDeduce(constants.%T, constants.%U) [symbolic = %.loc16_53.3 (constants.%.8)] // CHECK:STDOUT: %.loc16_64.1: ref @GetNoDeduce.%.loc16_42.1 (%.5) = temporary_storage // CHECK:STDOUT: %GetNoDeduce.call: init @GetNoDeduce.%.loc16_42.1 (%.5) = call %.loc16_53.2(%x.ref) to %.loc16_64.1 @@ -241,17 +253,17 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %.loc16_64.4: @GetNoDeduce.%T (%T) = bind_value %.loc16_64.3 // CHECK:STDOUT: %.loc16_64.5: ref @GetNoDeduce.%T (%T) = tuple_access %return, element0 // CHECK:STDOUT: %.loc16_64.6: init @GetNoDeduce.%T (%T) = initialize_from %.loc16_64.4 to %.loc16_64.5 -// CHECK:STDOUT: %.loc16_64.7: ref @GetNoDeduce.%U.loc16_24.2 (%U) = tuple_access %.loc16_64.2, element1 -// CHECK:STDOUT: %.loc16_64.8: @GetNoDeduce.%U.loc16_24.2 (%U) = bind_value %.loc16_64.7 -// CHECK:STDOUT: %.loc16_64.9: ref @GetNoDeduce.%U.loc16_24.2 (%U) = tuple_access %return, element1 -// CHECK:STDOUT: %.loc16_64.10: init @GetNoDeduce.%U.loc16_24.2 (%U) = initialize_from %.loc16_64.8 to %.loc16_64.9 +// CHECK:STDOUT: %.loc16_64.7: ref @GetNoDeduce.%U.loc16_24.1 (%U) = tuple_access %.loc16_64.2, element1 +// CHECK:STDOUT: %.loc16_64.8: @GetNoDeduce.%U.loc16_24.1 (%U) = bind_value %.loc16_64.7 +// CHECK:STDOUT: %.loc16_64.9: ref @GetNoDeduce.%U.loc16_24.1 (%U) = tuple_access %return, element1 +// CHECK:STDOUT: %.loc16_64.10: init @GetNoDeduce.%U.loc16_24.1 (%U) = initialize_from %.loc16_64.8 to %.loc16_64.9 // CHECK:STDOUT: %.loc16_64.11: init @GetNoDeduce.%.loc16_42.1 (%.5) = tuple_init (%.loc16_64.6, %.loc16_64.10) to %return // CHECK:STDOUT: %.loc16_70: init @GetNoDeduce.%.loc16_42.1 (%.5) = converted %GetNoDeduce.call, %.loc16_64.11 // CHECK:STDOUT: return %.loc16_70 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallGenericMethod(%c: %Class.3) -> %return: %.9 { +// CHECK:STDOUT: fn @CallGenericMethod(%c.param_patt: %Class.3) -> %return: %.9 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class.3 = name_ref c, %c // CHECK:STDOUT: %.loc20_11.1: %Get.type.2 = specific_constant @Class.%Get.decl, @Class(constants.%A) [template = constants.%Get.2] @@ -263,7 +275,7 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: return %Get.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallGenericMethodWithNonDeducedParam(%c: %Class.3) -> %return: %.9 { +// CHECK:STDOUT: fn @CallGenericMethodWithNonDeducedParam(%c.param_patt: %Class.3) -> %return: %.9 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class.3 = name_ref c, %c // CHECK:STDOUT: %.loc24_11.1: %GetNoDeduce.type.2 = specific_constant @Class.%GetNoDeduce.decl, @Class(constants.%A) [template = constants.%GetNoDeduce.2] @@ -275,14 +287,15 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %.loc24_25.2: ref %A = temporary_storage // CHECK:STDOUT: %.loc24_25.3: init %A = class_init (), %.loc24_25.2 [template = constants.%struct] // CHECK:STDOUT: %.loc24_25.4: ref %A = temporary %.loc24_25.2, %.loc24_25.3 -// CHECK:STDOUT: %.loc24_23.1: ref %A = converted %.loc24_25.1, %.loc24_25.4 -// CHECK:STDOUT: %.loc24_23.2: %A = bind_value %.loc24_23.1 -// CHECK:STDOUT: %GetNoDeduce.call: init %.9 = call %.loc24_11.2(%.loc24_23.2) to %.loc23_54 +// CHECK:STDOUT: %.loc24_25.5: ref %A = converted %.loc24_25.1, %.loc24_25.4 +// CHECK:STDOUT: %.loc24_25.6: %A = bind_value %.loc24_25.5 +// CHECK:STDOUT: %GetNoDeduce.call: init %.9 = call %.loc24_11.2(%.loc24_25.6) to %.loc23_54 // CHECK:STDOUT: return %GetNoDeduce.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc14_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc14_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Get.type => constants.%Get.type.1 @@ -292,7 +305,8 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Get(constants.%T, constants.%U) { -// CHECK:STDOUT: %U.loc15_10.2 => constants.%U +// CHECK:STDOUT: %U.loc15_10.1 => constants.%U +// CHECK:STDOUT: %U.patt.loc15_10.1 => constants.%U // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %.loc15_28.1 => constants.%.5 // CHECK:STDOUT: @@ -304,7 +318,8 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: // CHECK:STDOUT: specific @GetNoDeduce(constants.%T, constants.%U) { // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %U.loc16_24.2 => constants.%U +// CHECK:STDOUT: %U.loc16_24.1 => constants.%U +// CHECK:STDOUT: %U.patt.loc16_24.1 => constants.%U // CHECK:STDOUT: %.loc16_42.1 => constants.%.5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -315,30 +330,36 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.loc14_13.2) { // CHECK:STDOUT: %T.loc14_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc14_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Get.%T) { // CHECK:STDOUT: %T.loc14_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc14_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Get(@Get.%T, @Get.%U.loc15_10.2) { -// CHECK:STDOUT: %U.loc15_10.2 => constants.%U +// CHECK:STDOUT: specific @Get(@Get.%T, @Get.%U.loc15_10.1) { +// CHECK:STDOUT: %U.loc15_10.1 => constants.%U +// CHECK:STDOUT: %U.patt.loc15_10.1 => constants.%U // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %.loc15_28.1 => constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@GetNoDeduce.%T) { // CHECK:STDOUT: %T.loc14_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc14_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @GetNoDeduce(@GetNoDeduce.%T, @GetNoDeduce.%U.loc16_24.2) { +// CHECK:STDOUT: specific @GetNoDeduce(@GetNoDeduce.%T, @GetNoDeduce.%U.loc16_24.1) { // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %U.loc16_24.2 => constants.%U +// CHECK:STDOUT: %U.loc16_24.1 => constants.%U +// CHECK:STDOUT: %U.patt.loc16_24.1 => constants.%U // CHECK:STDOUT: %.loc16_42.1 => constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%A) { // CHECK:STDOUT: %T.loc14_13.2 => constants.%A +// CHECK:STDOUT: %T.patt.loc14_13.2 => constants.%A // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Get.type => constants.%Get.type.2 @@ -348,7 +369,8 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Get(constants.%A, constants.%B) { -// CHECK:STDOUT: %U.loc15_10.2 => constants.%B +// CHECK:STDOUT: %U.loc15_10.1 => constants.%B +// CHECK:STDOUT: %U.patt.loc15_10.1 => constants.%B // CHECK:STDOUT: %T => constants.%A // CHECK:STDOUT: %.loc15_28.1 => constants.%.9 // CHECK:STDOUT: @@ -360,7 +382,8 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: // CHECK:STDOUT: specific @GetNoDeduce(constants.%A, constants.%B) { // CHECK:STDOUT: %T => constants.%A -// CHECK:STDOUT: %U.loc16_24.2 => constants.%B +// CHECK:STDOUT: %U.loc16_24.1 => constants.%B +// CHECK:STDOUT: %U.patt.loc16_24.1 => constants.%B // CHECK:STDOUT: %.loc16_42.1 => constants.%.9 // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index 8a8e32bde6f4..97109daaa8b7 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -66,10 +66,10 @@ library "[[@TEST_NAME]]"; class D(T:! type); // CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE+7]]:9: error: redeclaration differs at parameter 1 // CHECK:STDERR: class D(T:! i32) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE-4]]:9: note: previous declaration's corresponding parameter here // CHECK:STDERR: class D(T:! type); -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: class D(T:! i32) {} @@ -80,20 +80,22 @@ library "[[@TEST_NAME]]"; class E(T:! type); // CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE+6]]:9: error: redeclaration differs at parameter 1 // CHECK:STDERR: class E(U:! type) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE-4]]:9: note: previous declaration's corresponding parameter here // CHECK:STDERR: class E(T:! type); -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ class E(U:! type) {} // CHECK:STDOUT: --- valid.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Generic.type: type = generic_class_type @Generic [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Generic.1: %Generic.type = struct_value () [template] // CHECK:STDOUT: %Generic.2: type = class_type @Generic, @Generic(%T) [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } @@ -118,21 +120,24 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Generic.decl.loc4: %Generic.type = class_decl @Generic [template = constants.%Generic.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6: type = symbolic_binding_pattern T, 0 [symbolic = constants.%T.patt.2] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6, runtime_param [symbolic = constants.%T.patt.2] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param.loc4: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %T.param.loc4 [symbolic = %T.loc4_15.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4: type = param runtime_param +// CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %param.loc4 [symbolic = %T.loc4_15.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %Generic.decl.loc6: %Generic.type = class_decl @Generic [template = constants.%Generic.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6: type = symbolic_binding_pattern T, 0 [symbolic = constants.%T.patt.2] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6, runtime_param [symbolic = constants.%T.patt.2] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param.loc6: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6: type = bind_symbolic_name T, 0, %T.param.loc6 [symbolic = constants.%T] +// CHECK:STDOUT: %param.loc6: type = param runtime_param +// CHECK:STDOUT: %T.loc6: type = bind_symbolic_name T, 0, %param.loc6 [symbolic = constants.%T] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Generic(%T.loc4_15.1: type) { // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_15.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -146,6 +151,7 @@ class E(U:! type) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T) { // CHECK:STDOUT: %T.loc4_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_list.carbon @@ -153,6 +159,7 @@ class E(U:! type) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: %.type = struct_value () [template] @@ -182,10 +189,11 @@ class E(U:! type) {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc12_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc12_9.1, runtime_param [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -193,6 +201,7 @@ class E(U:! type) {} // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%T.loc12_9.1: type) { // CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc12_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -206,6 +215,7 @@ class E(U:! type) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T) { // CHECK:STDOUT: %T.loc12_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc12_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_implicit_param_list.carbon @@ -215,11 +225,14 @@ class E(U:! type) {} // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %B.type: type = generic_class_type @B [template] // CHECK:STDOUT: %B.1: %B.type = struct_value () [template] // CHECK:STDOUT: %B.2: type = class_type @B, @B(%N.1) [symbolic] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %N.2: %T = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.2: %T = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: %.3: type = class_type @.1, @.1(%T, %N.2) [symbolic] @@ -249,35 +262,41 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: %B.type = class_decl @B [template = constants.%B.1] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc4_9.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_9.1, runtime_param [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_32, %.loc4_13.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_9.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.1)] +// CHECK:STDOUT: %param: i32 = param runtime_param +// CHECK:STDOUT: %N.loc4_9.1: i32 = bind_symbolic_name N, 0, %param [symbolic = %N.loc4_9.2 (constants.%N.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %N.patt: @.1.%T.loc12_9.2 (%T) = symbolic_binding_pattern N, 1 +// CHECK:STDOUT: %T.patt.loc12_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc12_9.1, runtime_param [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.patt.loc12_19.1: @.1.%T.loc12_9.2 (%T) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: @.1.%T.loc12_9.2 (%T) = param_pattern %N.patt.loc12_19.1, runtime_param [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_9.1 [symbolic = %T.loc12_9.2 (constants.%T)] -// CHECK:STDOUT: %N.param: @.1.%T.loc12_9.2 (%T) = param N, runtime_param -// CHECK:STDOUT: %N.loc12_19.1: @.1.%T.loc12_9.2 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc12_19.2 (constants.%N.2)] +// CHECK:STDOUT: %param.loc12_9: type = param runtime_param +// CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0, %param.loc12_9 [symbolic = %T.loc12_9.2 (constants.%T)] +// CHECK:STDOUT: %param.loc12_19: @.1.%T.loc12_9.2 (%T) = param runtime_param +// CHECK:STDOUT: %N.loc12_19.1: @.1.%T.loc12_9.2 (%T) = bind_symbolic_name N, 1, %param.loc12_19 [symbolic = %N.loc12_19.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @B(%N.loc4_9.1: i32) { // CHECK:STDOUT: %N.loc4_9.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc4_9.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%T.loc12_9.1: type, %N.loc12_19.1: @.1.%T.loc12_9.2 (%T)) { // CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc12_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] // CHECK:STDOUT: %N.loc12_19.2: %T = bind_symbolic_name N, 1 [symbolic = %N.loc12_19.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc12_19.2: %T = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -293,24 +312,30 @@ class E(U:! type) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @B(constants.%N.1) { // CHECK:STDOUT: %N.loc4_9.2 => constants.%N.1 +// CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%N.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%N.2) { // CHECK:STDOUT: %T.loc12_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc12_9.2 => constants.%T // CHECK:STDOUT: %N.loc12_19.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc12_19.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_count.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%T) [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %U: i32 = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt: i32 = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: %.3: type = class_type @.1, @.1(%T, %U) [symbolic] @@ -340,34 +365,40 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_9.1, runtime_param [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %U.patt: i32 = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %T.patt.loc12_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc12_9.1, runtime_param [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %U.patt.loc12_19.1: i32 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: i32 = param_pattern %U.patt.loc12_19.1, runtime_param [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_23.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_23.2: type = converted %int.make_type_32, %.loc12_23.1 [template = i32] -// CHECK:STDOUT: %U.param: i32 = param U, runtime_param -// CHECK:STDOUT: %U.loc12_19.1: i32 = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc12_19.2 (constants.%U)] +// CHECK:STDOUT: %param.loc12_9: type = param runtime_param +// CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0, %param.loc12_9 [symbolic = %T.loc12_9.2 (constants.%T)] +// CHECK:STDOUT: %param.loc12_19: i32 = param runtime_param +// CHECK:STDOUT: %U.loc12_19.1: i32 = bind_symbolic_name U, 1, %param.loc12_19 [symbolic = %U.loc12_19.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc4_9.1: type) { // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%T.loc12_9.1: type, %U.loc12_19.1: i32) { // CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc12_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: %U.loc12_19.2: i32 = bind_symbolic_name U, 1 [symbolic = %U.loc12_19.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc12_19.2: i32 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -383,17 +414,21 @@ class E(U:! type) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc12_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc12_9.2 => constants.%T // CHECK:STDOUT: %U.loc12_19.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc12_19.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %D.type: type = generic_class_type @D [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %D.1: %D.type = struct_value () [template] @@ -401,6 +436,7 @@ class E(U:! type) {} // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %T.2: i32 = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.2: i32 = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: %.3: type = class_type @.1, @.1(%T.2) [symbolic] @@ -430,30 +466,34 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %D.decl: %D.type = class_decl @D [template = constants.%D.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_9.1, runtime_param [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T.1)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_9.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %T.patt: i32 = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc12_9.1: i32 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: i32 = param_pattern %T.patt.loc12_9.1, runtime_param [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %T.param: i32 = param T, runtime_param -// CHECK:STDOUT: %T.loc12_9.1: i32 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T.2)] +// CHECK:STDOUT: %param: i32 = param runtime_param +// CHECK:STDOUT: %T.loc12_9.1: i32 = bind_symbolic_name T, 0, %param [symbolic = %T.loc12_9.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @D(%T.loc4_9.1: type) { // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%T.loc12_9.1: i32) { // CHECK:STDOUT: %T.loc12_9.2: i32 = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt.loc12_9.2: i32 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -469,21 +509,25 @@ class E(U:! type) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%T.1) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T.2) { // CHECK:STDOUT: %T.loc12_9.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt.loc12_9.2 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_name.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %E.type: type = generic_class_type @E [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %E.1: %E.type = struct_value () [template] // CHECK:STDOUT: %E.2: type = class_type @E, @E(%T) [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: %.3: type = class_type @.1, @.1(%U) [symbolic] @@ -511,27 +555,31 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %E.decl: %E.type = class_decl @E [template = constants.%E.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_9.1, runtime_param [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 +// CHECK:STDOUT: %U.patt.loc11_9.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_9.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc11_9.1, runtime_param [symbolic = %U.patt.loc11_9.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc11_9.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc11_9.2 (constants.%U)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc11_9.1: type = bind_symbolic_name U, 0, %param [symbolic = %U.loc11_9.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @E(%T.loc4_9.1: type) { // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%U.loc11_9.1: type) { // CHECK:STDOUT: %U.loc11_9.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc11_9.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc11_9.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_9.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -545,9 +593,11 @@ class E(U:! type) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @E(constants.%T) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%U) { // CHECK:STDOUT: %U.loc11_9.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc11_9.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index e72bd766f34d..8e160cc04e94 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -23,6 +23,7 @@ class Class(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] @@ -61,15 +62,17 @@ class Class(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_13.1, runtime_param [symbolic = %T.patt.loc11_13.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc11_13.1: type) { // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %MakeSelf.type: type = fn_type @MakeSelf, @Class(%T.loc11_13.2) [symbolic = %MakeSelf.type (constants.%MakeSelf.type)] @@ -174,6 +177,7 @@ class Class(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %MakeSelf.type => constants.%MakeSelf.type @@ -186,6 +190,7 @@ class Class(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@MakeSelf.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @MakeSelf(constants.%T) { @@ -198,6 +203,7 @@ class Class(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@MakeClass.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @MakeClass(constants.%T) { @@ -212,10 +218,12 @@ class Class(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.loc11_13.2) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@F.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @MakeSelf(@F.%T) { diff --git a/toolchain/check/testdata/class/generic_method.carbon b/toolchain/check/testdata/class/generic_method.carbon index 3b23f8d062b2..0e4d42060ce4 100644 --- a/toolchain/check/testdata/class/generic_method.carbon +++ b/toolchain/check/testdata/class/generic_method.carbon @@ -19,6 +19,7 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] @@ -28,6 +29,7 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.a: %T} [symbolic] // CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.5: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -51,29 +53,33 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_13.1, runtime_param [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [symbolic = constants.%F] { // CHECK:STDOUT: %self.patt: %Class.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class.2 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %n.patt: %T = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %T = param_pattern %n.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc16: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] +// CHECK:STDOUT: %param.loc16_10: type = param runtime_param +// CHECK:STDOUT: %T.loc16: type = bind_symbolic_name T, 0, %param.loc16_10 [symbolic = constants.%T] // CHECK:STDOUT: %.loc16: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = constants.%Class.2] // CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, %.loc16 [symbolic = constants.%Class.2] -// CHECK:STDOUT: %self.param.loc16: %Class.2 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc16: %Class.2 = bind_name self, %self.param.loc16 // CHECK:STDOUT: %T.ref.loc16: type = name_ref T, %T.loc16 [symbolic = constants.%T] -// CHECK:STDOUT: %n.param.loc16: %T = param n, runtime_param1 -// CHECK:STDOUT: %n.loc16: %T = bind_name n, %n.param.loc16 +// CHECK:STDOUT: %param.loc16_22: %Class.2 = param runtime_param0 +// CHECK:STDOUT: %self.loc16: %Class.2 = bind_name self, %param.loc16_22 +// CHECK:STDOUT: %param.loc16_34: %T = param runtime_param1 +// CHECK:STDOUT: %n.loc16: %T = bind_name n, %param.loc16_34 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc11_13.1: type) { // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc11_13.2) [symbolic = %Class (constants.%Class.2)] @@ -88,15 +94,17 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %.loc12_8.1: @Class.%.loc12_8.2 (%.2) = field_decl a, element0 [template] // CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = @Class.%F (constants.%F)] { // CHECK:STDOUT: %self.patt: %Class.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class.2 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %n.patt: %T = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %T = param_pattern %n.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc13: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, %.loc13 [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %self.param.loc13: @F.%Class (%Class.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13: @F.%Class (%Class.2) = bind_name self, %self.param.loc13 // CHECK:STDOUT: %T.ref.loc13: type = name_ref T, @Class.%T.loc11_13.1 [symbolic = %T.loc13 (constants.%T)] -// CHECK:STDOUT: %n.param.loc13: @F.%T.loc13 (%T) = param n, runtime_param1 -// CHECK:STDOUT: %n.loc13: @F.%T.loc13 (%T) = bind_name n, %n.param.loc13 +// CHECK:STDOUT: %param.loc13_8: @F.%Class (%Class.2) = param runtime_param0 +// CHECK:STDOUT: %self.loc13: @F.%Class (%Class.2) = bind_name self, %param.loc13_8 +// CHECK:STDOUT: %param.loc13_20: @F.%T.loc13 (%T) = param runtime_param1 +// CHECK:STDOUT: %n.loc13: @F.%T.loc13 (%T) = bind_name n, %param.loc13_20 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14_1.1: = complete_type_witness %.3 [symbolic = %.loc14_1.3 (constants.%.4)] // CHECK:STDOUT: @@ -113,7 +121,7 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.loc16: %Class.2](%n.loc16: %T) { +// CHECK:STDOUT: fn[%self.param_patt: %Class.2](%n.param_patt: %T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -121,6 +129,7 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.2 @@ -133,6 +142,7 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@F.%T.loc13) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { @@ -142,5 +152,6 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T.loc11_13.2) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 1e2b74f050d6..3876e95254f7 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -124,19 +124,21 @@ fn Run() { // CHECK:STDOUT: class @ForwardDeclared { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %ForwardDeclared = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %ForwardDeclared = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared] -// CHECK:STDOUT: %self.param: %ForwardDeclared = param self, runtime_param0 -// CHECK:STDOUT: %self: %ForwardDeclared = bind_name self, %self.param +// CHECK:STDOUT: %param: %ForwardDeclared = param runtime_param0 +// CHECK:STDOUT: %self: %ForwardDeclared = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %.7 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.7 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc15_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared] // CHECK:STDOUT: %.loc15_23: type = ptr_type %ForwardDeclared [template = constants.%.7] -// CHECK:STDOUT: %self.param: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.7 = bind_name self, %self.param -// CHECK:STDOUT: %.loc15_8: %.7 = addr_pattern %self +// CHECK:STDOUT: %param: %.7 = param runtime_param0 +// CHECK:STDOUT: %self: %.7 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: @@ -150,9 +152,9 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self: %ForwardDeclared](); +// CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr %self: %.7](); +// CHECK:STDOUT: fn @G[addr %self.param_patt: %.7](); // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon // CHECK:STDOUT: @@ -189,7 +191,7 @@ fn Run() { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%Empty] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+8, loaded [template = constants.%Field] // CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+26, loaded [template = constants.%ForwardDeclared.1] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+47, loaded [template = constants.%Incomplete] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+49, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -204,11 +206,11 @@ fn Run() { // CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+9, unloaded // CHECK:STDOUT: %import_ref.7: %.9 = import_ref Main//a, inst+20, loaded [template = %.1] // CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+27, unloaded -// CHECK:STDOUT: %import_ref.9: %F.type = import_ref Main//a, inst+33, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.10: %G.type = import_ref Main//a, inst+43, loaded [template = constants.%G] +// CHECK:STDOUT: %import_ref.9: %F.type = import_ref Main//a, inst+34, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.10: %G.type = import_ref Main//a, inst+45, loaded [template = constants.%G] // CHECK:STDOUT: %import_ref.11 = import_ref Main//a, inst+27, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//a, inst+33, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//a, inst+43, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//a, inst+34, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//a, inst+45, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -307,7 +309,7 @@ fn Run() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self: %ForwardDeclared.1](); +// CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr %self: %.11](); +// CHECK:STDOUT: fn @G[addr .inst+94: %.11](); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index cb53498ee0fd..293a791a95d1 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -86,17 +86,19 @@ fn Run() { // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Base = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Base = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %self.param: %Base = param self, runtime_param0 -// CHECK:STDOUT: %self: %Base = bind_name self, %self.param +// CHECK:STDOUT: %param: %Base = param runtime_param0 +// CHECK:STDOUT: %self: %Base = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Unused.decl: %Unused.type = fn_decl @Unused [template = constants.%Unused] { // CHECK:STDOUT: %self.patt: %Base = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Base = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %self.param: %Base = param self, runtime_param0 -// CHECK:STDOUT: %self: %Base = bind_name self, %self.param +// CHECK:STDOUT: %param: %Base = param runtime_param0 +// CHECK:STDOUT: %self: %Base = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] @@ -127,9 +129,9 @@ fn Run() { // CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self: %Base](); +// CHECK:STDOUT: fn @F[%self.param_patt: %Base](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Unused[%self: %Base](); +// CHECK:STDOUT: fn @Unused[%self.param_patt: %Base](); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: @@ -162,7 +164,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+41, loaded [template = constants.%Child] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+43, loaded [template = constants.%Child] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -174,12 +176,12 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//a, inst+9, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+17, unloaded -// CHECK:STDOUT: %import_ref.6: %.13 = import_ref Main//a, inst+29, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+35, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+42, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, inst+46, unloaded +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//a, inst+10, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+19, unloaded +// CHECK:STDOUT: %import_ref.6: %.13 = import_ref Main//a, inst+31, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+37, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+44, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, inst+48, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -239,12 +241,12 @@ fn Run() { // CHECK:STDOUT: %a.ref.loc9: ref %Child = name_ref a, %a // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc9_4: = bound_method %a.ref.loc9, %F.ref -// CHECK:STDOUT: %.loc9_6.1: ref %Base = class_element_access %a.ref.loc9, element0 -// CHECK:STDOUT: %.loc9_6.2: ref %Base = converted %a.ref.loc9, %.loc9_6.1 -// CHECK:STDOUT: %.loc9_6.3: %Base = bind_value %.loc9_6.2 -// CHECK:STDOUT: %F.call: init %.1 = call %.loc9_4(%.loc9_6.3) +// CHECK:STDOUT: %.loc9_3.1: ref %Base = class_element_access %a.ref.loc9, element0 +// CHECK:STDOUT: %.loc9_3.2: ref %Base = converted %a.ref.loc9, %.loc9_3.1 +// CHECK:STDOUT: %.loc9_3.3: %Base = bind_value %.loc9_3.2 +// CHECK:STDOUT: %F.call: init %.1 = call %.loc9_4(%.loc9_3.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self: %Base](); +// CHECK:STDOUT: fn @F[%self.param_patt: %Base](); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index 39fb3704ffe6..d86f61ad657d 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -298,10 +298,9 @@ class B { // CHECK:STDOUT: %.loc10: %.6 = base_decl %Shape, element0 [template] // CHECK:STDOUT: %GetPosition.decl: %GetPosition.type = fn_decl @GetPosition [template = constants.%GetPosition] { // CHECK:STDOUT: %self.patt: %Circle = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Circle = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] -// CHECK:STDOUT: %self.param: %Circle = param self, runtime_param0 -// CHECK:STDOUT: %self: %Circle = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32.loc12_36: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc12_41: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_44.1: %.7 = tuple_literal (%int.make_type_32.loc12_36, %int.make_type_32.loc12_41) @@ -311,6 +310,8 @@ class B { // CHECK:STDOUT: %.loc12_44.5: type = converted %int.make_type_32.loc12_41, %.loc12_44.4 [template = i32] // CHECK:STDOUT: %.loc12_44.6: type = converted %.loc12_44.1, constants.%.8 [template = constants.%.8] // CHECK:STDOUT: %return: ref %.8 = var +// CHECK:STDOUT: %param: %Circle = param runtime_param0 +// CHECK:STDOUT: %self: %Circle = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15: = complete_type_witness %.9 [template = constants.%.10] // CHECK:STDOUT: @@ -323,7 +324,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GetPosition[%self: %Circle]() -> %return: %.8 { +// CHECK:STDOUT: fn @GetPosition[%self.param_patt: %Circle]() -> %return: %.8 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc13_13: %Circle = name_ref self, %self // CHECK:STDOUT: %x.ref: %.2 = name_ref x, @Shape.%.loc5_18 [template = @Shape.%.loc5_18] @@ -438,13 +439,14 @@ class B { // CHECK:STDOUT: %.loc14: %.10 = base_decl %B, element0 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %.loc15_26.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc15_26.2: type = converted %.loc15_26.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %return: ref %.1 = var +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16: = complete_type_witness %.11 [template = constants.%.12] // CHECK:STDOUT: @@ -461,7 +463,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[%self: %C]() -> %.1 { +// CHECK:STDOUT: fn @G[%self.param_patt: %C]() -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %C = name_ref self, %self // CHECK:STDOUT: %F.ref: %F.type.1 = name_ref F, @A.%F.decl [template = constants.%F.1] @@ -656,14 +658,15 @@ class B { // CHECK:STDOUT: %.loc9: %.6 = base_decl %Shape, element0 [template] // CHECK:STDOUT: %GetPosition.decl: %GetPosition.type = fn_decl @GetPosition [template = constants.%GetPosition] { // CHECK:STDOUT: %self.patt: %Square = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Square = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Square [template = constants.%Square] -// CHECK:STDOUT: %self.param: %Square = param self, runtime_param0 -// CHECK:STDOUT: %self: %Square = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_35.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_35.2: type = converted %int.make_type_32, %.loc11_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Square = param runtime_param0 +// CHECK:STDOUT: %self: %Square = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc21: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: @@ -676,7 +679,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GetPosition[%self: %Square]() -> i32 { +// CHECK:STDOUT: fn @GetPosition[%self.param_patt: %Square]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Square = name_ref self, %self // CHECK:STDOUT: %y.ref: = name_ref y, [template = ] @@ -1055,14 +1058,15 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: %SomeFunc.decl: %SomeFunc.type = fn_decl @SomeFunc [template = constants.%SomeFunc] { // CHECK:STDOUT: %self.patt: %B = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %B = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] -// CHECK:STDOUT: %self.param: %B = param self, runtime_param0 -// CHECK:STDOUT: %self: %B = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc36_32.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc36_32.2: type = converted %int.make_type_32, %.loc36_32.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %B = param runtime_param0 +// CHECK:STDOUT: %self: %B = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc46: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: @@ -1084,7 +1088,7 @@ class B { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SomeFunc[%self: %B]() -> i32 { +// CHECK:STDOUT: fn @SomeFunc[%self.param_patt: %B]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %B = name_ref self, %self // CHECK:STDOUT: %internal.ref: %.6 = name_ref internal, @B.%.loc14 [template = @B.%.loc14] @@ -1158,10 +1162,11 @@ class B { // CHECK:STDOUT: %.loc9: %.6 = base_decl %A, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %B = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %B = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] -// CHECK:STDOUT: %self.param: %B = param self, runtime_param0 -// CHECK:STDOUT: %self: %B = bind_name self, %self.param +// CHECK:STDOUT: %param: %B = param runtime_param0 +// CHECK:STDOUT: %self: %B = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: @@ -1174,7 +1179,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self: %B]() { +// CHECK:STDOUT: fn @F[%self.param_patt: %B]() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %B = name_ref self, %self // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] @@ -1246,10 +1251,11 @@ class B { // CHECK:STDOUT: %.loc9: %.6 = base_decl %A, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %B = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %B = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] -// CHECK:STDOUT: %self.param: %B = param self, runtime_param0 -// CHECK:STDOUT: %self: %B = bind_name self, %self.param +// CHECK:STDOUT: %param: %B = param runtime_param0 +// CHECK:STDOUT: %self: %B = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: @@ -1262,7 +1268,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self: %B]() { +// CHECK:STDOUT: fn @F[%self.param_patt: %B]() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %B = name_ref self, %self // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index d7db88af15d2..8e9aa58ab295 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -67,35 +67,39 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %next.patt: %.3 = binding_pattern next +// CHECK:STDOUT: %next.param_patt: %.3 = param_pattern %next.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_12.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc16_12.2: type = converted %int.make_type_32, %.loc16_12.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %Class.ref.loc16_23: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc16_28: type = ptr_type %Class [template = constants.%.3] -// CHECK:STDOUT: %next.param: %.3 = param next, runtime_param1 -// CHECK:STDOUT: %next: %.3 = bind_name next, %next.param // CHECK:STDOUT: %Class.ref.loc16_34: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %return: ref %Class = var +// CHECK:STDOUT: %param.loc16_9: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param.loc16_9 +// CHECK:STDOUT: %param.loc16_17: %.3 = param runtime_param1 +// CHECK:STDOUT: %next: %.3 = bind_name next, %param.loc16_17 // CHECK:STDOUT: } // CHECK:STDOUT: %MakeReorder.decl: %MakeReorder.type = fn_decl @MakeReorder [template = constants.%MakeReorder] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %next.patt: %.3 = binding_pattern next +// CHECK:STDOUT: %next.param_patt: %.3 = param_pattern %next.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_19.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc20_19.2: type = converted %int.make_type_32, %.loc20_19.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %Class.ref.loc20_30: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc20_35: type = ptr_type %Class [template = constants.%.3] -// CHECK:STDOUT: %next.param: %.3 = param next, runtime_param1 -// CHECK:STDOUT: %next: %.3 = bind_name next, %next.param // CHECK:STDOUT: %Class.ref.loc20_41: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %return: ref %Class = var +// CHECK:STDOUT: %param.loc20_16: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param.loc20_16 +// CHECK:STDOUT: %param.loc20_24: %.3 = param runtime_param1 +// CHECK:STDOUT: %next: %.3 = bind_name next, %param.loc20_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -117,7 +121,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Make(%n: i32, %next: %.3) -> %return: %Class { +// CHECK:STDOUT: fn @Make(%n.param_patt: i32, %next.param_patt: %.3) -> %return: %Class { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n // CHECK:STDOUT: %next.ref: %.3 = name_ref next, %next @@ -131,7 +135,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: return %.loc17_32 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @MakeReorder(%n: i32, %next: %.3) -> %return: %Class { +// CHECK:STDOUT: fn @MakeReorder(%n.param_patt: i32, %next.param_patt: %.3) -> %return: %Class { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %next.ref: %.3 = name_ref next, %next // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n diff --git a/toolchain/check/testdata/class/init_adapt.carbon b/toolchain/check/testdata/class/init_adapt.carbon index a2db1af6cc35..f8606a9feea2 100644 --- a/toolchain/check/testdata/class/init_adapt.carbon +++ b/toolchain/check/testdata/class/init_adapt.carbon @@ -258,6 +258,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -294,12 +295,12 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.9) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.13)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.9) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.13)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -339,6 +340,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -389,7 +391,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @MakeC() -> %C; @@ -446,14 +448,17 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -464,6 +469,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%AdaptC) { // CHECK:STDOUT: %Dest => constants.%AdaptC +// CHECK:STDOUT: %Dest.patt => constants.%AdaptC // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -476,6 +482,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%C) { // CHECK:STDOUT: %Dest => constants.%C +// CHECK:STDOUT: %Dest.patt => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index fd08137a32f8..17810222f781 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -129,36 +129,39 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc20: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc20: %Class = bind_name self, %self.param.loc20 // CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_29.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] // CHECK:STDOUT: %.loc20_29.2: type = converted %int.make_type_32.loc20, %.loc20_29.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc20: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc20: %Class = bind_name self, %param.loc20 // CHECK:STDOUT: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %Class = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.param: %Class = param c, runtime_param0 -// CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc24_22.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc24_22.2: type = converted %int.make_type_32, %.loc24_22.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Class = param runtime_param0 +// CHECK:STDOUT: %c: %Class = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %CallAlias.decl: %CallAlias.type = fn_decl @CallAlias [template = constants.%CallAlias] { // CHECK:STDOUT: %c.patt: %Class = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %Class = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %c.param: %Class = param c, runtime_param0 -// CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc30_27.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc30_27.2: type = converted %int.make_type_32, %.loc30_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Class = param runtime_param0 +// CHECK:STDOUT: %c: %Class = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %CallOnConstBoundMethod.decl: %CallOnConstBoundMethod.type = fn_decl @CallOnConstBoundMethod [template = constants.%CallOnConstBoundMethod] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -174,27 +177,29 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %CallFThroughPointer.decl: %CallFThroughPointer.type = fn_decl @CallFThroughPointer [template = constants.%CallFThroughPointer] { // CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.2 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc43_32: type = ptr_type %Class [template = constants.%.2] -// CHECK:STDOUT: %p.param: %.2 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.2 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc43_38.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc43_38.2: type = converted %int.make_type_32, %.loc43_38.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.2 = param runtime_param0 +// CHECK:STDOUT: %p: %.2 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %CallGThroughPointer.decl: %CallGThroughPointer.type = fn_decl @CallGThroughPointer [template = constants.%CallGThroughPointer] { // CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.2 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc47_32: type = ptr_type %Class [template = constants.%.2] -// CHECK:STDOUT: %p.param: %.2 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.2 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc47_38.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc47_38.2: type = converted %int.make_type_32, %.loc47_38.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.2 = param runtime_param0 +// CHECK:STDOUT: %p: %.2 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {} { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] @@ -217,27 +222,29 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc12: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12: %Class = bind_name self, %self.param.loc12 // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_25.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_25.2: type = converted %int.make_type_32.loc12, %.loc12_25.1 [template = i32] // CHECK:STDOUT: %return.var.loc12: ref i32 = var +// CHECK:STDOUT: %param.loc12: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc12: %Class = bind_name self, %param.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.2 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc13_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc13_23: type = ptr_type %Class [template = constants.%.2] -// CHECK:STDOUT: %self.param: %.2 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.2 = bind_name self, %self.param -// CHECK:STDOUT: %.loc13_8: %.2 = addr_pattern %self // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32, %.loc13_31.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.2 = param runtime_param0 +// CHECK:STDOUT: %self: %.2 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %F.ref: %F.type = name_ref F, %F.decl [template = constants.%F] // CHECK:STDOUT: %A: %F.type = bind_alias A, %F.decl [template = constants.%F] @@ -257,7 +264,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self.loc20: %Class]() -> i32 { +// CHECK:STDOUT: fn @F[%self.param_patt: %Class]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self.loc20 // CHECK:STDOUT: %k.ref: %.3 = name_ref k, @Class.%.loc17_8 [template = @Class.%.loc17_8] @@ -266,9 +273,9 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: return %.loc21_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr %self: %.2]() -> i32; +// CHECK:STDOUT: fn @G[addr %self.param_patt: %.2]() -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%c: %Class) -> i32 { +// CHECK:STDOUT: fn @Call(%c.param_patt: %Class) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class = name_ref c, %c // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] @@ -279,7 +286,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: return %.loc27_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallAlias(%c: %Class) -> i32 { +// CHECK:STDOUT: fn @CallAlias(%c.param_patt: %Class) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class = name_ref c, %c // CHECK:STDOUT: %A.ref: %F.type = name_ref A, @Class.%A [template = constants.%F] @@ -325,7 +332,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: return %.loc40_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallFThroughPointer(%p: %.2) -> i32 { +// CHECK:STDOUT: fn @CallFThroughPointer(%p.param_patt: %.2) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.2 = name_ref p, %p // CHECK:STDOUT: %.loc44_11.1: ref %Class = deref %p.ref @@ -338,7 +345,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: return %.loc44_18.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallGThroughPointer(%p: %.2) -> i32 { +// CHECK:STDOUT: fn @CallGThroughPointer(%p.param_patt: %.2) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.2 = name_ref p, %p // CHECK:STDOUT: %.loc48_11.1: ref %Class = deref %p.ref diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index d8ca7e96216a..c19706f39cf9 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -100,11 +100,12 @@ fn F(a: Outer*) { // CHECK:STDOUT: %Outer.decl: type = class_decl @Outer [template = constants.%Outer] {} {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %a.patt: %.4 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.4 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Outer.ref.loc41: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %.loc41: type = ptr_type %Outer [template = constants.%.4] -// CHECK:STDOUT: %a.param: %.4 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.4 = bind_name a, %a.param +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %a: %.4 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -187,7 +188,7 @@ fn F(a: Outer*) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2(%a: %.4) { +// CHECK:STDOUT: fn @F.2(%a.param_patt: %.4) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Outer.ref.loc42: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 5a66d49a0b0d..eb37299ca693 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -69,22 +69,24 @@ fn G(o: Outer) { // CHECK:STDOUT: %Outer.decl: type = class_decl @Outer [template = constants.%Outer] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %oi.patt: %Inner = binding_pattern oi +// CHECK:STDOUT: %oi.param_patt: %Inner = param_pattern %oi.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] -// CHECK:STDOUT: %oi.param: %Inner = param oi, runtime_param0 -// CHECK:STDOUT: %oi: %Inner = bind_name oi, %oi.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_26.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc17_26.2: type = converted %int.make_type_32, %.loc17_26.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %Inner = param runtime_param0 +// CHECK:STDOUT: %oi: %Inner = bind_name oi, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %o.patt: %Outer = binding_pattern o +// CHECK:STDOUT: %o.param_patt: %Outer = param_pattern %o.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] -// CHECK:STDOUT: %o.param: %Outer = param o, runtime_param0 -// CHECK:STDOUT: %o: %Outer = bind_name o, %o.param +// CHECK:STDOUT: %param: %Outer = param runtime_param0 +// CHECK:STDOUT: %o: %Outer = bind_name o, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -111,7 +113,7 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%oi: %Inner) -> i32 { +// CHECK:STDOUT: fn @F(%oi.param_patt: %Inner) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %oi.ref: %Inner = name_ref oi, %oi // CHECK:STDOUT: %n.ref: %.2 = name_ref n, @Inner.%.loc13_10 [template = @Inner.%.loc13_10] @@ -120,7 +122,7 @@ fn G(o: Outer) { // CHECK:STDOUT: return %.loc18_12.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%o: %Outer) { +// CHECK:STDOUT: fn @G(%o.param_patt: %Outer) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %o.ref: %Outer = name_ref o, %o // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] diff --git a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon index 2bde5713fdf6..1b8f9effd0e5 100644 --- a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon @@ -35,7 +35,7 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:9: error: parameters of generic types must be constant // CHECK:STDERR: class A[T: type]() {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: class A[T: type]() {} @@ -45,7 +45,7 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:9: error: parameters of generic types must be constant // CHECK:STDERR: class A(T: type) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~ class A(T: type) {} // This is testing a use of the invalid type. @@ -64,15 +64,18 @@ fn F(T:! type) { // CHECK:STDOUT: %NotGenericButParams.1: %NotGenericButParams.type = struct_value () [template] // CHECK:STDOUT: %NotGenericButParams.2: type = class_type @NotGenericButParams [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %GenericAndParams.type.1: type = generic_class_type @GenericAndParams.1 [template] // CHECK:STDOUT: %GenericAndParams.1: %GenericAndParams.type.1 = struct_value () [template] // CHECK:STDOUT: %GenericAndParams.2: type = class_type @GenericAndParams.1, @GenericAndParams.1(%T) [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%T) [symbolic] // CHECK:STDOUT: %GenericNoParams.1: type = class_type @GenericNoParams [template] // CHECK:STDOUT: %GenericNoParams.2: type = class_type @GenericNoParams, @GenericNoParams(%T) [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %GenericAndParams.type.2: type = generic_class_type @GenericAndParams.2, @C(%T) [symbolic] // CHECK:STDOUT: %GenericAndParams.3: %GenericAndParams.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %GenericAndParams.4: type = class_type @GenericAndParams.2, @GenericAndParams.2(%T, %U) [symbolic] @@ -106,16 +109,18 @@ fn F(T:! type) { // CHECK:STDOUT: %NotGenericNoParams.decl: type = class_decl @NotGenericNoParams [template = constants.%NotGenericNoParams] {} {} // CHECK:STDOUT: %NotGenericButParams.decl: %NotGenericButParams.type = class_decl @NotGenericButParams [template = constants.%NotGenericButParams.1] {} {} // CHECK:STDOUT: %GenericAndParams.decl: %GenericAndParams.type.1 = class_decl @GenericAndParams.1 [template = constants.%GenericAndParams.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6_24.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_24.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6_24.1, runtime_param [symbolic = %T.patt.loc6_24.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_24.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_24.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc6_24.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc6_24.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_9.1, runtime_param [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_9.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: %NotGenericNoParams.ref: type = name_ref NotGenericNoParams, %NotGenericNoParams.decl [template = constants.%NotGenericNoParams] @@ -163,6 +168,7 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @GenericAndParams.1(%T.loc6_24.1: type) { // CHECK:STDOUT: %T.loc6_24.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_24.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_24.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_24.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -176,6 +182,7 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc8_9.1: type) { // CHECK:STDOUT: %T.loc8_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GenericAndParams.type: type = generic_class_type @GenericAndParams.2, @C(%T.loc8_9.2) [symbolic = %GenericAndParams.type (constants.%GenericAndParams.type.2)] @@ -184,10 +191,11 @@ fn F(T:! type) { // CHECK:STDOUT: class { // CHECK:STDOUT: %GenericNoParams.decl: type = class_decl @GenericNoParams [template = constants.%GenericNoParams.1] {} {} // CHECK:STDOUT: %GenericAndParams.decl: @C.%GenericAndParams.type (%GenericAndParams.type.2) = class_decl @GenericAndParams.2 [symbolic = @C.%GenericAndParams (constants.%GenericAndParams.3)] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %U.patt.loc10_26.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc10_26.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc10_26.1, runtime_param [symbolic = %U.patt.loc10_26.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc10_26.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc10_26.2 (constants.%U)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc10_26.1: type = bind_symbolic_name U, 1, %param [symbolic = %U.loc10_26.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: @@ -211,6 +219,7 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @GenericAndParams.2(@C.%T.loc8_9.1: type, %U.loc10_26.1: type) { // CHECK:STDOUT: %U.loc10_26.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc10_26.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc10_26.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc10_26.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -256,30 +265,36 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.1(constants.%T) { // CHECK:STDOUT: %T.loc6_24.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_24.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericNoParams(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.2(constants.%T, constants.%U) { // CHECK:STDOUT: %U.loc10_26.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc10_26.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(@C.%T.loc8_9.2) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.1(constants.%X) { // CHECK:STDOUT: %T.loc6_24.2 => constants.%X +// CHECK:STDOUT: %T.patt.loc6_24.2 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%X +// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GenericAndParams.type => constants.%GenericAndParams.type.3 @@ -288,6 +303,7 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.2(constants.%X, constants.%X) { // CHECK:STDOUT: %U.loc10_26.2 => constants.%X +// CHECK:STDOUT: %U.patt.loc10_26.2 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -309,9 +325,10 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.1] { // CHECK:STDOUT: %T.patt: type = binding_pattern T +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt, runtime_param // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T: type = bind_name T, %T.param +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T: type = bind_name T, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -332,6 +349,7 @@ fn F(T:! type) { // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } @@ -343,15 +361,17 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.1] { // CHECK:STDOUT: %T.patt: type = binding_pattern T +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt, runtime_param // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T: type = bind_name T, %T.param +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T: type = bind_name T, %param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc10_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc10_6.1, runtime_param [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc10_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_6.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc10_6.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -364,10 +384,11 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc10_6.1: type) { // CHECK:STDOUT: %T.loc10_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc10_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc10_6.1: type) { +// CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.1] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] @@ -378,5 +399,6 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc10_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc10_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index 4d8eabdddae6..945d7f8546eb 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -412,11 +412,12 @@ private class Redecl {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %c.patt: %.1 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %.1 = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Forward.ref: type = name_ref Forward, imports.%import_ref [template = constants.%Forward] // CHECK:STDOUT: %.loc4: type = ptr_type %Forward [template = constants.%.1] -// CHECK:STDOUT: %c.param: %.1 = param c, runtime_param0 -// CHECK:STDOUT: %c: %.1 = bind_name c, %c.param +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %c: %.1 = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Forward.decl: type = class_decl @Forward [template = constants.%Forward] {} {} // CHECK:STDOUT: } @@ -428,7 +429,7 @@ private class Redecl {} // CHECK:STDOUT: .Self = constants.%Forward // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%c: %.1) { +// CHECK:STDOUT: fn @F(%c.param_patt: %.1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -448,15 +449,16 @@ private class Redecl {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %c.patt: = binding_pattern c +// CHECK:STDOUT: %c.param_patt: = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %.loc10: type = ptr_type [template = ] -// CHECK:STDOUT: %c.param: = param c, runtime_param0 -// CHECK:STDOUT: %c: = bind_name c, %c.param +// CHECK:STDOUT: %param: = param runtime_param0 +// CHECK:STDOUT: %c: = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%c: ) { +// CHECK:STDOUT: fn @F(%c.param_patt: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -483,16 +485,17 @@ private class Redecl {} // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %c.patt: = binding_pattern c +// CHECK:STDOUT: %c.param_patt: = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %.loc9: type = ptr_type [template = ] -// CHECK:STDOUT: %c.param: = param c, runtime_param0 -// CHECK:STDOUT: %c: = bind_name c, %c.param +// CHECK:STDOUT: %param: = param runtime_param0 +// CHECK:STDOUT: %c: = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%c: ) { +// CHECK:STDOUT: fn @F(%c.param_patt: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index 36ba919599a7..79be8fe75c47 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -82,10 +82,10 @@ alias D = C; class Foo(a:! C); // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:11: error: redeclaration differs at parameter 1 // CHECK:STDERR: class Foo(b:! D) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~ // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:11: note: previous declaration's corresponding parameter here // CHECK:STDERR: class Foo(a:! C); -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~ // CHECK:STDERR: class Foo(b:! D) {} @@ -186,13 +186,17 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.3: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Bar.type: type = generic_class_type @Bar [template] // CHECK:STDOUT: %Bar.1: %Bar.type = struct_value () [template] // CHECK:STDOUT: %Bar.2: type = class_type @Bar, @Bar(%a) [symbolic] +// CHECK:STDOUT: %a.patt.4: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -206,32 +210,36 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc8: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt.2] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc8, runtime_param [symbolic = constants.%a.patt.2] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc7: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = %a.loc7_11.2 (constants.%a)] +// CHECK:STDOUT: %param.loc7: %C = param runtime_param +// CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %param.loc7 [symbolic = %a.loc7_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc8: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc8: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt.2] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc8, runtime_param [symbolic = constants.%a.patt.2] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc8: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc8: %C = bind_symbolic_name a, 0, %a.param.loc8 [symbolic = constants.%a] +// CHECK:STDOUT: %param.loc8: %C = param runtime_param +// CHECK:STDOUT: %a.loc8: %C = bind_symbolic_name a, 0, %param.loc8 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc10: %Bar.type = class_decl @Bar [template = constants.%Bar.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc11: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt.4] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc11, runtime_param [symbolic = constants.%a.patt.4] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc10: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param.loc10: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc10_11.1: %C = bind_symbolic_name a, 0, %a.param.loc10 [symbolic = %a.loc10_11.2 (constants.%a)] +// CHECK:STDOUT: %param.loc10: %C = param runtime_param +// CHECK:STDOUT: %a.loc10_11.1: %C = bind_symbolic_name a, 0, %param.loc10 [symbolic = %a.loc10_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc11: %Bar.type = class_decl @Bar [template = constants.%Bar.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc11: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt.4] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc11, runtime_param [symbolic = constants.%a.patt.4] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param.loc11: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc11: %C = bind_symbolic_name a, 0, %a.param.loc11 [symbolic = constants.%a] +// CHECK:STDOUT: %param.loc11: %C = param runtime_param +// CHECK:STDOUT: %a.loc11: %C = bind_symbolic_name a, 0, %param.loc11 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -244,6 +252,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(%a.loc7_11.1: %C) { // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc7: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -257,6 +266,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Bar(%a.loc10_11.1: %C) { // CHECK:STDOUT: %a.loc10_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc10_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc10: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc10 (constants.%a.patt.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -270,10 +280,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc7_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { // CHECK:STDOUT: %a.loc10_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc10 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- spacing.carbon @@ -283,10 +295,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -296,18 +310,20 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt.2] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7, runtime_param [symbolic = constants.%a.patt.2] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc6: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_17.1: %C = bind_symbolic_name a, 0, %a.param.loc6 [symbolic = %a.loc6_17.2 (constants.%a)] +// CHECK:STDOUT: %param.loc6: %C = param runtime_param +// CHECK:STDOUT: %a.loc6_17.1: %C = bind_symbolic_name a, 0, %param.loc6 [symbolic = %a.loc6_17.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt.2] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7, runtime_param [symbolic = constants.%a.patt.2] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc7: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = constants.%a] +// CHECK:STDOUT: %param.loc7: %C = param runtime_param +// CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %param.loc7 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -320,6 +336,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(%a.loc6_17.1: %C) { // CHECK:STDOUT: %a.loc6_17.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_17.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc6: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -333,6 +350,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc6_17.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_parens.carbon @@ -342,10 +360,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: %.5: type = class_type @.1, @.1(%a) [symbolic] @@ -358,18 +378,20 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc6_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_11.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc6_11.1, runtime_param [symbolic = %a.patt.loc6_11.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc6_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc14_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc14_11.2 (constants.%a.patt.2)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc14_11.1, runtime_param [symbolic = %a.patt.loc14_11.2 (constants.%a.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc14_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc14_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc14_11.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc14_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -382,12 +404,14 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(%a.loc6_11.1: %C) { // CHECK:STDOUT: %a.loc6_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc6_11.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_11.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%a.loc14_11.1: %C) { // CHECK:STDOUT: %a.loc14_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc14_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc14_11.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc14_11.2 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -401,10 +425,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc6_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { // CHECK:STDOUT: %a.loc14_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc14_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- todo_fail_raw_identifier.carbon @@ -414,10 +440,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -427,18 +455,20 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt.2] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7, runtime_param [symbolic = constants.%a.patt.2] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc6: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0, %a.param.loc6 [symbolic = %a.loc6_11.2 (constants.%a)] +// CHECK:STDOUT: %param.loc6: %C = param runtime_param +// CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0, %param.loc6 [symbolic = %a.loc6_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt.2] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7, runtime_param [symbolic = constants.%a.patt.2] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc7: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = constants.%a] +// CHECK:STDOUT: %param.loc7: %C = param runtime_param +// CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %param.loc7 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -451,6 +481,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(%a.loc6_11.1: %C) { // CHECK:STDOUT: %a.loc6_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc6: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -464,6 +495,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc6_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- two_file.carbon @@ -473,10 +505,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Bar.type: type = generic_class_type @Bar [template] // CHECK:STDOUT: %Bar.1: %Bar.type = struct_value () [template] // CHECK:STDOUT: %Bar.2: type = class_type @Bar, @Bar(%a) [symbolic] @@ -493,18 +527,20 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7_11.1, runtime_param [symbolic = %a.patt.loc7_11.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc7_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = class_decl @Bar [template = constants.%Bar.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc8_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc8_11.2 (constants.%a.patt.2)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc8_11.1, runtime_param [symbolic = %a.patt.loc8_11.2 (constants.%a.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc8_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc8_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc8_11.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc8_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -517,22 +553,26 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(%a.loc7_11.1: %C) { // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc7_11.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Bar(%a.loc8_11.1: %C) { // CHECK:STDOUT: %a.loc8_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc8_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc8_11.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc8_11.2 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc7_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { // CHECK:STDOUT: %a.loc8_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc8_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- two_file.impl.carbon @@ -542,10 +582,13 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.3: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Bar.type: type = generic_class_type @Bar [template] // CHECK:STDOUT: %Bar.1: %Bar.type = struct_value () [template] // CHECK:STDOUT: %Bar.2: type = class_type @Bar, @Bar(%a) [symbolic] @@ -554,8 +597,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+13, loaded [template = constants.%Foo.1] -// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+23, loaded [template = constants.%Bar.1] +// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+15, loaded [template = constants.%Foo.1] +// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+28, loaded [template = constants.%Bar.1] // CHECK:STDOUT: %import_ref.5 = import_ref Main//two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -569,18 +612,20 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc4: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt.1] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc4, runtime_param [symbolic = constants.%a.patt.1] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc4: %C = bind_symbolic_name a, 0, %a.param [symbolic = constants.%a] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc4: %C = bind_symbolic_name a, 0, %param [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = class_decl @Bar [template = constants.%Bar.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc5: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt.3] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc5, runtime_param [symbolic = constants.%a.patt.3] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc5: %C = bind_symbolic_name a, 0, %a.param [symbolic = constants.%a] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc5: %C = bind_symbolic_name a, 0, %param [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -591,6 +636,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(constants.%a: %C) { // CHECK:STDOUT: %a.1: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.1 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -604,6 +650,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Bar(constants.%a: %C) { // CHECK:STDOUT: %a.1: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.1 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -617,10 +664,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.1 => constants.%a +// CHECK:STDOUT: %a.patt.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { // CHECK:STDOUT: %a.1 => constants.%a +// CHECK:STDOUT: %a.patt.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_name_mismatch.carbon @@ -630,11 +679,13 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %b: %C = bind_symbolic_name b, 0 [symbolic] +// CHECK:STDOUT: %b.patt: %C = symbolic_binding_pattern b, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: %.5: type = class_type @.1, @.1(%b) [symbolic] @@ -650,18 +701,20 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7_11.1, runtime_param [symbolic = %a.patt.loc7_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc7_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %b.patt: %C = symbolic_binding_pattern b, 0 +// CHECK:STDOUT: %b.patt.loc15_11.1: %C = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc15_11.2 (constants.%b.patt)] +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt.loc15_11.1, runtime_param [symbolic = %b.patt.loc15_11.2 (constants.%b.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param -// CHECK:STDOUT: %b.loc15_11.1: %C = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc15_11.2 (constants.%b)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %b.loc15_11.1: %C = bind_symbolic_name b, 0, %param [symbolic = %b.loc15_11.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -674,12 +727,14 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(%a.loc7_11.1: %C) { // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc7_11.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%b.loc15_11.1: %C) { // CHECK:STDOUT: %b.loc15_11.2: %C = bind_symbolic_name b, 0 [symbolic = %b.loc15_11.2 (constants.%b)] +// CHECK:STDOUT: %b.patt.loc15_11.2: %C = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc15_11.2 (constants.%b.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -693,10 +748,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc7_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%b) { // CHECK:STDOUT: %b.loc15_11.2 => constants.%b +// CHECK:STDOUT: %b.patt.loc15_11.2 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_alias.carbon @@ -706,10 +763,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: %.5: type = class_type @.1, @.1(%a) [symbolic] @@ -725,18 +784,20 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7_11.1, runtime_param [symbolic = %a.patt.loc7_11.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc7_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc15_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_11.2 (constants.%a.patt.2)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc15_11.1, runtime_param [symbolic = %a.patt.loc15_11.2 (constants.%a.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc15_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc15_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc15_11.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc15_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -749,12 +810,14 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(%a.loc7_11.1: %C) { // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc7_11.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%a.loc15_11.1: %C) { // CHECK:STDOUT: %a.loc15_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc15_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc15_11.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_11.2 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -768,10 +831,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc7_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { // CHECK:STDOUT: %a.loc15_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc15_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduced_alias.carbon @@ -781,10 +846,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: %.5: type = class_type @.1, @.1(%a) [symbolic] @@ -800,18 +867,20 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7_11.1, runtime_param [symbolic = %a.patt.loc7_11.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc7_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc15_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_11.2 (constants.%a.patt.2)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc15_11.1, runtime_param [symbolic = %a.patt.loc15_11.2 (constants.%a.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc15_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc15_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc15_11.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc15_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -824,12 +893,14 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(%a.loc7_11.1: %C) { // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc7_11.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%a.loc15_11.1: %C) { // CHECK:STDOUT: %a.loc15_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc15_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc15_11.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_11.2 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -843,10 +914,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc7_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { // CHECK:STDOUT: %a.loc15_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc15_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- alias_two_file.carbon @@ -856,6 +929,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] @@ -869,11 +943,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc6_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_11.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc6_11.1, runtime_param [symbolic = %a.patt.loc6_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc6_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -886,12 +961,14 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(%a.loc6_11.1: %C) { // CHECK:STDOUT: %a.loc6_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc6_11.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_11.2 (constants.%a.patt)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc6_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- todo_fail_alias_two_file.impl.carbon @@ -901,15 +978,17 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+11, loaded [template = constants.%Foo.1] +// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+13, loaded [template = constants.%Foo.1] // CHECK:STDOUT: %import_ref.3 = import_ref Main//alias_two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -924,11 +1003,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc6: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt.1] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc6, runtime_param [symbolic = constants.%a.patt.1] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6: %C = bind_symbolic_name a, 0, %a.param [symbolic = constants.%a] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc6: %C = bind_symbolic_name a, 0, %param [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -939,6 +1019,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(constants.%a: %C) { // CHECK:STDOUT: %a.1: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.1 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -952,6 +1033,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.1 => constants.%a +// CHECK:STDOUT: %a.patt.1 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_repeat_const.carbon @@ -962,10 +1044,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %.3: type = const_type %C [template] // CHECK:STDOUT: %a: %.3 = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %.3 = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] // CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %a.patt.2: %.3 = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.5: %.type = struct_value () [template] // CHECK:STDOUT: %.6: type = class_type @.1, @.1(%a) [symbolic] @@ -978,21 +1062,23 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { -// CHECK:STDOUT: %a.patt: %.3 = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc6_11.1: %.3 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_11.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %.3 = param_pattern %a.patt.loc6_11.1, runtime_param [symbolic = %a.patt.loc6_11.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc6: type = const_type %C [template = constants.%.3] -// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param -// CHECK:STDOUT: %a.loc6_11.1: %.3 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %.3 = param runtime_param +// CHECK:STDOUT: %a.loc6_11.1: %.3 = bind_symbolic_name a, 0, %param [symbolic = %a.loc6_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.5] { -// CHECK:STDOUT: %a.patt: %.3 = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc18_11.1: %.3 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc18_11.2 (constants.%a.patt.2)] +// CHECK:STDOUT: %a.param_patt: %.3 = param_pattern %a.patt.loc18_11.1, runtime_param [symbolic = %a.patt.loc18_11.2 (constants.%a.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc18_22: type = const_type %C [template = constants.%.3] // CHECK:STDOUT: %.loc18_15: type = const_type %.3 [template = constants.%.3] -// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param -// CHECK:STDOUT: %a.loc18_11.1: %.3 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc18_11.2 (constants.%a)] +// CHECK:STDOUT: %param: %.3 = param runtime_param +// CHECK:STDOUT: %a.loc18_11.1: %.3 = bind_symbolic_name a, 0, %param [symbolic = %a.loc18_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1005,12 +1091,14 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(%a.loc6_11.1: %.3) { // CHECK:STDOUT: %a.loc6_11.2: %.3 = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc6_11.2: %.3 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_11.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%a.loc18_11.1: %.3) { // CHECK:STDOUT: %a.loc18_11.2: %.3 = bind_symbolic_name a, 0 [symbolic = %a.loc18_11.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc18_11.2: %.3 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc18_11.2 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -1024,10 +1112,12 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc6_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { // CHECK:STDOUT: %a.loc18_11.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc18_11.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_self_type.carbon @@ -1054,12 +1144,13 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.6] { // CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.3 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc16_11: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc16_26: type = ptr_type %Base [template = constants.%.3] -// CHECK:STDOUT: %self.param: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.3 = bind_name self, %self.param -// CHECK:STDOUT: %.loc16_11: %.3 = addr_pattern %self +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %self: %.3 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1069,12 +1160,13 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.loc5_8: %.2 = field_decl a, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.3 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc7_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] // CHECK:STDOUT: %.loc7_23: type = ptr_type %Base [template = constants.%.3] -// CHECK:STDOUT: %self.param: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.3 = bind_name self, %self.param -// CHECK:STDOUT: %.loc7_8: %.3 = addr_pattern %self +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %self: %.3 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: @@ -1084,9 +1176,9 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[addr %self: %.3](); +// CHECK:STDOUT: fn @F[addr %self.param_patt: %.3](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @.1[addr %self: %.3]() { +// CHECK:STDOUT: fn @.1[addr %self.param_patt: %.3]() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %.3 = name_ref self, %self // CHECK:STDOUT: %.loc17_4: ref %Base = deref %self.ref diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index 4a7ae2faf65a..628f63919fd5 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -67,31 +67,31 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt.loc17_17: %.1 = binding_pattern self +// CHECK:STDOUT: %self.param_patt.loc17_21: %.1 = param_pattern %self.patt.loc17_17, runtime_param0 +// CHECK:STDOUT: %.loc17_12: auto = addr_pattern %self.param_patt.loc17_21 // CHECK:STDOUT: %self.patt.loc17_30: i32 = binding_pattern r#self +// CHECK:STDOUT: %self.param_patt.loc17_36: i32 = param_pattern %self.patt.loc17_30, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc17_27: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %self.param.loc17_17: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc17_17: %.1 = bind_name self, %self.param.loc17_17 -// CHECK:STDOUT: %.loc17_12: %.1 = addr_pattern %self.loc17_17 // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_38.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] // CHECK:STDOUT: %.loc17_38.2: type = converted %int.make_type_32.loc17, %.loc17_38.1 [template = i32] -// CHECK:STDOUT: %self.param.loc17_30: i32 = param r#self, runtime_param1 -// CHECK:STDOUT: %self.loc17_30: i32 = bind_name r#self, %self.param.loc17_30 +// CHECK:STDOUT: %param.loc17_17: %.1 = param runtime_param0 +// CHECK:STDOUT: %self.loc17_17: %.1 = bind_name self, %param.loc17_17 +// CHECK:STDOUT: %param.loc17_30: i32 = param runtime_param1 +// CHECK:STDOUT: %self.loc17_30: i32 = bind_name r#self, %param.loc17_30 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt.loc21_12: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt.loc21_16: %Class = param_pattern %self.patt.loc21_12, runtime_param0 // CHECK:STDOUT: %self.patt.loc21_24: i32 = binding_pattern r#self +// CHECK:STDOUT: %self.param_patt.loc21_30: i32 = param_pattern %self.patt.loc21_24, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc21_12: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc21_12: %Class = bind_name self, %self.param.loc21_12 // CHECK:STDOUT: %int.make_type_32.loc21_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_32.1: type = value_of_initializer %int.make_type_32.loc21_32 [template = i32] // CHECK:STDOUT: %.loc21_32.2: type = converted %int.make_type_32.loc21_32, %.loc21_32.1 [template = i32] -// CHECK:STDOUT: %self.param.loc21_24: i32 = param r#self, runtime_param1 -// CHECK:STDOUT: %self.loc21_24: i32 = bind_name r#self, %self.param.loc21_24 // CHECK:STDOUT: %int.make_type_32.loc21_41: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc21_46: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_49.1: %.3 = tuple_literal (%int.make_type_32.loc21_41, %int.make_type_32.loc21_46) @@ -101,37 +101,41 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %.loc21_49.5: type = converted %int.make_type_32.loc21_46, %.loc21_49.4 [template = i32] // CHECK:STDOUT: %.loc21_49.6: type = converted %.loc21_49.1, constants.%.4 [template = constants.%.4] // CHECK:STDOUT: %return: ref %.4 = var +// CHECK:STDOUT: %param.loc21_12: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc21_12: %Class = bind_name self, %param.loc21_12 +// CHECK:STDOUT: %param.loc21_24: i32 = param runtime_param1 +// CHECK:STDOUT: %self.loc21_24: i32 = bind_name r#self, %param.loc21_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt.loc17_17: %.1 = binding_pattern self +// CHECK:STDOUT: %self.param_patt.loc17_21: %.1 = param_pattern %self.patt.loc17_17, runtime_param0 +// CHECK:STDOUT: %.loc17_12: auto = addr_pattern %self.param_patt.loc17_21 // CHECK:STDOUT: %self.patt.loc17_30: i32 = binding_pattern r#self +// CHECK:STDOUT: %self.param_patt.loc17_36: i32 = param_pattern %self.patt.loc17_30, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc12_23: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %self.param.loc12_13: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12_13: %.1 = bind_name self, %self.param.loc12_13 -// CHECK:STDOUT: %.loc12_8: %.1 = addr_pattern %self.loc12_13 // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_34.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_34.2: type = converted %int.make_type_32.loc12, %.loc12_34.1 [template = i32] -// CHECK:STDOUT: %self.param.loc12_26: i32 = param r#self, runtime_param1 -// CHECK:STDOUT: %self.loc12_26: i32 = bind_name r#self, %self.param.loc12_26 +// CHECK:STDOUT: %param.loc12_13: %.1 = param runtime_param0 +// CHECK:STDOUT: %self.loc12_13: %.1 = bind_name self, %param.loc12_13 +// CHECK:STDOUT: %param.loc12_26: i32 = param runtime_param1 +// CHECK:STDOUT: %self.loc12_26: i32 = bind_name r#self, %param.loc12_26 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt.loc21_12: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt.loc21_16: %Class = param_pattern %self.patt.loc21_12, runtime_param0 // CHECK:STDOUT: %self.patt.loc21_24: i32 = binding_pattern r#self +// CHECK:STDOUT: %self.param_patt.loc21_30: i32 = param_pattern %self.patt.loc21_24, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc13_8: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13_8: %Class = bind_name self, %self.param.loc13_8 // CHECK:STDOUT: %int.make_type_32.loc13_28: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_28.1: type = value_of_initializer %int.make_type_32.loc13_28 [template = i32] // CHECK:STDOUT: %.loc13_28.2: type = converted %int.make_type_32.loc13_28, %.loc13_28.1 [template = i32] -// CHECK:STDOUT: %self.param.loc13_20: i32 = param r#self, runtime_param1 -// CHECK:STDOUT: %self.loc13_20: i32 = bind_name r#self, %self.param.loc13_20 // CHECK:STDOUT: %int.make_type_32.loc13_37: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc13_42: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_45.1: %.3 = tuple_literal (%int.make_type_32.loc13_37, %int.make_type_32.loc13_42) @@ -141,6 +145,10 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %.loc13_45.5: type = converted %int.make_type_32.loc13_42, %.loc13_45.4 [template = i32] // CHECK:STDOUT: %.loc13_45.6: type = converted %.loc13_45.1, constants.%.4 [template = constants.%.4] // CHECK:STDOUT: %return.var.loc13: ref %.4 = var +// CHECK:STDOUT: %param.loc13_8: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc13_8: %Class = bind_name self, %param.loc13_8 +// CHECK:STDOUT: %param.loc13_20: i32 = param runtime_param1 +// CHECK:STDOUT: %self.loc13_20: i32 = bind_name r#self, %param.loc13_20 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -157,7 +165,7 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[addr %self.loc17_17: %.1](%self.loc17_30: i32) { +// CHECK:STDOUT: fn @F[addr %self.param_patt.loc17_21: %.1](%self.param_patt.loc17_36: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc18_5: %.1 = name_ref self, %self.loc17_17 // CHECK:STDOUT: %.loc18_4: ref %Class = deref %self.ref.loc18_5 @@ -168,7 +176,7 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[%self.loc21_12: %Class](%self.loc21_24: i32) -> %return: %.4 { +// CHECK:STDOUT: fn @G[%self.param_patt.loc21_16: %Class](%self.param_patt.loc21_30: i32) -> %return: %.4 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc22_11: %Class = name_ref self, %self.loc21_12 // CHECK:STDOUT: %n.ref: %.5 = name_ref n, @Class.%.loc14_8 [template = @Class.%.loc14_8] diff --git a/toolchain/check/testdata/class/raw_self_type.carbon b/toolchain/check/testdata/class/raw_self_type.carbon index 4157c460211e..ce12bee9a72f 100644 --- a/toolchain/check/testdata/class/raw_self_type.carbon +++ b/toolchain/check/testdata/class/raw_self_type.carbon @@ -64,14 +64,16 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %MemberNamedSelf.decl: type = class_decl @MemberNamedSelf [template = constants.%MemberNamedSelf] {} {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %x.patt: %MemberNamedSelf = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %MemberNamedSelf = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: %y.patt: %Self = binding_pattern y +// CHECK:STDOUT: %y.param_patt: %Self = param_pattern %y.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc24_25: type = name_ref Self, constants.%MemberNamedSelf [template = constants.%MemberNamedSelf] -// CHECK:STDOUT: %x.param.loc24: %MemberNamedSelf = param x, runtime_param0 -// CHECK:STDOUT: %x.loc24: %MemberNamedSelf = bind_name x, %x.param.loc24 // CHECK:STDOUT: %Self.ref.loc24_34: type = name_ref r#Self, @MemberNamedSelf.%Self.decl [template = constants.%Self] -// CHECK:STDOUT: %y.param.loc24: %Self = param y, runtime_param1 -// CHECK:STDOUT: %y.loc24: %Self = bind_name y, %y.param.loc24 +// CHECK:STDOUT: %param.loc24_22: %MemberNamedSelf = param runtime_param0 +// CHECK:STDOUT: %x.loc24: %MemberNamedSelf = bind_name x, %param.loc24_22 +// CHECK:STDOUT: %param.loc24_31: %Self = param runtime_param1 +// CHECK:STDOUT: %y.loc24: %Self = bind_name y, %param.loc24_31 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -88,14 +90,16 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %Self.decl: type = class_decl @Self [template = constants.%Self] {} {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %x.patt: %MemberNamedSelf = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %MemberNamedSelf = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: %y.patt: %Self = binding_pattern y +// CHECK:STDOUT: %y.param_patt: %Self = param_pattern %y.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc21_11: type = name_ref Self, constants.%MemberNamedSelf [template = constants.%MemberNamedSelf] -// CHECK:STDOUT: %x.param.loc21: %MemberNamedSelf = param x, runtime_param0 -// CHECK:STDOUT: %x.loc21: %MemberNamedSelf = bind_name x, %x.param.loc21 // CHECK:STDOUT: %Self.ref.loc21_20: type = name_ref r#Self, @MemberNamedSelf.%Self.decl [template = constants.%Self] -// CHECK:STDOUT: %y.param.loc21: %Self = param y, runtime_param1 -// CHECK:STDOUT: %y.loc21: %Self = bind_name y, %y.param.loc21 +// CHECK:STDOUT: %param.loc21_8: %MemberNamedSelf = param runtime_param0 +// CHECK:STDOUT: %x.loc21: %MemberNamedSelf = bind_name x, %param.loc21_8 +// CHECK:STDOUT: %param.loc21_17: %Self = param runtime_param1 +// CHECK:STDOUT: %y.loc21: %Self = bind_name y, %param.loc21_17 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -128,7 +132,7 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2(%x.loc24: %MemberNamedSelf, %y.loc24: %Self) { +// CHECK:STDOUT: fn @F.2(%x.param_patt: %MemberNamedSelf, %y.param_patt: %Self) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/redeclaration.carbon b/toolchain/check/testdata/class/redeclaration.carbon index bdd5a0ab6cf4..a300671155fd 100644 --- a/toolchain/check/testdata/class/redeclaration.carbon +++ b/toolchain/check/testdata/class/redeclaration.carbon @@ -55,32 +55,36 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: %Class.decl.loc13: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc17: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc17: %Class = bind_name self, %self.param.loc17 // CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_27.1: type = value_of_initializer %bool.make_type.loc17 [template = bool] // CHECK:STDOUT: %.loc17_27.2: type = converted %bool.make_type.loc17, %.loc17_27.1 [template = bool] -// CHECK:STDOUT: %b.param.loc17: bool = param b, runtime_param1 -// CHECK:STDOUT: %b.loc17: bool = bind_name b, %b.param.loc17 +// CHECK:STDOUT: %param.loc17_12: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc17: %Class = bind_name self, %param.loc17_12 +// CHECK:STDOUT: %param.loc17_24: bool = param runtime_param1 +// CHECK:STDOUT: %b.loc17: bool = bind_name b, %param.loc17_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc14: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc14: %Class = bind_name self, %self.param.loc14 // CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_23.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] // CHECK:STDOUT: %.loc14_23.2: type = converted %bool.make_type.loc14, %.loc14_23.1 [template = bool] -// CHECK:STDOUT: %b.param.loc14: bool = param b, runtime_param1 -// CHECK:STDOUT: %b.loc14: bool = bind_name b, %b.param.loc14 +// CHECK:STDOUT: %param.loc14_8: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc14: %Class = bind_name self, %param.loc14_8 +// CHECK:STDOUT: %param.loc14_20: bool = param runtime_param1 +// CHECK:STDOUT: %b.loc14: bool = bind_name b, %param.loc14_20 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -91,7 +95,7 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self.loc17: %Class](%b.loc17: bool) { +// CHECK:STDOUT: fn @F[%self.param_patt: %Class](%b.param_patt: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index 70fd4874630a..678c75f798e8 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -65,54 +65,58 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc18: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc18: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18: %Class = bind_name self, %self.param.loc18 // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] // CHECK:STDOUT: %.loc18_29.2: type = converted %int.make_type_32.loc18, %.loc18_29.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc18: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc18: %Class = bind_name self, %param.loc18 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.2 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc22_12: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc22: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc22_27: type = ptr_type %Class [template = constants.%.2] -// CHECK:STDOUT: %self.param.loc22: %.2 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc22: %.2 = bind_name self, %self.param.loc22 -// CHECK:STDOUT: %.loc22_12: %.2 = addr_pattern %self.loc22 // CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_35.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] // CHECK:STDOUT: %.loc22_35.2: type = converted %int.make_type_32.loc22, %.loc22_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc22: %.2 = param runtime_param0 +// CHECK:STDOUT: %self.loc22: %.2 = bind_name self, %param.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc12: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12: %Class = bind_name self, %self.param.loc12 // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_25.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_25.2: type = converted %int.make_type_32.loc12, %.loc12_25.1 [template = i32] // CHECK:STDOUT: %return.var.loc12: ref i32 = var +// CHECK:STDOUT: %param.loc12: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc12: %Class = bind_name self, %param.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.2 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc22_12: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc13_23: type = ptr_type %Class [template = constants.%.2] -// CHECK:STDOUT: %self.param.loc13: %.2 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc13: %.2 = bind_name self, %self.param.loc13 -// CHECK:STDOUT: %.loc13_8: %.2 = addr_pattern %self.loc13 // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13, %.loc13_31.1 [template = i32] // CHECK:STDOUT: %return.var.loc13: ref i32 = var +// CHECK:STDOUT: %param.loc13: %.2 = param runtime_param0 +// CHECK:STDOUT: %self.loc13: %.2 = bind_name self, %param.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -129,7 +133,7 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self.loc18: %Class]() -> i32 { +// CHECK:STDOUT: fn @F[%self.param_patt: %Class]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self.loc18 // CHECK:STDOUT: %n.ref: %.3 = name_ref n, @Class.%.loc15_8 [template = @Class.%.loc15_8] @@ -138,7 +142,7 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: return %.loc19_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr %self.loc22: %.2]() -> i32 { +// CHECK:STDOUT: fn @G[addr %self.param_patt: %.2]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %.2 = name_ref self, %self.loc22 // CHECK:STDOUT: %.loc23_11: ref %Class = deref %self.ref diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index 6872434edba7..6b6744207904 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -87,35 +87,38 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} // CHECK:STDOUT: %SelfBase.decl: %SelfBase.type = fn_decl @SelfBase [template = constants.%SelfBase] { // CHECK:STDOUT: %self.patt: %Base = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Base = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Base.ref.loc22: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %self.param.loc22: %Base = param self, runtime_param0 -// CHECK:STDOUT: %self.loc22: %Base = bind_name self, %self.param.loc22 // CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_38.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] // CHECK:STDOUT: %.loc22_38.2: type = converted %int.make_type_32.loc22, %.loc22_38.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc22: %Base = param runtime_param0 +// CHECK:STDOUT: %self.loc22: %Base = bind_name self, %param.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: %AddrSelfBase.decl: %AddrSelfBase.type = fn_decl @AddrSelfBase [template = constants.%AddrSelfBase] { // CHECK:STDOUT: %self.patt: %.7 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.7 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc26_25: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Base.ref.loc26: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc26_40: type = ptr_type %Base [template = constants.%.7] -// CHECK:STDOUT: %self.param.loc26: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc26: %.7 = bind_name self, %self.param.loc26 -// CHECK:STDOUT: %.loc26_25: %.7 = addr_pattern %self.loc26 +// CHECK:STDOUT: %param.loc26: %.7 = param runtime_param0 +// CHECK:STDOUT: %self.loc26: %.7 = bind_name self, %param.loc26 // CHECK:STDOUT: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %p.patt: %.11 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.11 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %.loc30_19: type = ptr_type %Derived [template = constants.%.11] -// CHECK:STDOUT: %p.param: %.11 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.11 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc30_25.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc30_25.2: type = converted %int.make_type_32, %.loc30_25.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.11 = param runtime_param0 +// CHECK:STDOUT: %p: %.11 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -136,23 +139,25 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %.loc16: %.6 = base_decl %Base, element0 [template] // CHECK:STDOUT: %SelfBase.decl: %SelfBase.type = fn_decl @SelfBase [template = constants.%SelfBase] { // CHECK:STDOUT: %self.patt: %Base = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Base = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Base.ref.loc18: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %self.param.loc18: %Base = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18: %Base = bind_name self, %self.param.loc18 // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_32.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] // CHECK:STDOUT: %.loc18_32.2: type = converted %int.make_type_32.loc18, %.loc18_32.1 [template = i32] // CHECK:STDOUT: %return.var.loc18: ref i32 = var +// CHECK:STDOUT: %param.loc18: %Base = param runtime_param0 +// CHECK:STDOUT: %self.loc18: %Base = bind_name self, %param.loc18 // CHECK:STDOUT: } // CHECK:STDOUT: %AddrSelfBase.decl: %AddrSelfBase.type = fn_decl @AddrSelfBase [template = constants.%AddrSelfBase] { // CHECK:STDOUT: %self.patt: %.7 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.7 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc26_25: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Base.ref.loc19: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc19_34: type = ptr_type %Base [template = constants.%.7] -// CHECK:STDOUT: %self.param.loc19: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc19: %.7 = bind_name self, %self.param.loc19 -// CHECK:STDOUT: %.loc19_19: %.7 = addr_pattern %self.loc19 +// CHECK:STDOUT: %.loc19: type = ptr_type %Base [template = constants.%.7] +// CHECK:STDOUT: %param.loc19: %.7 = param runtime_param0 +// CHECK:STDOUT: %self.loc19: %.7 = bind_name self, %param.loc19 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc20: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: @@ -166,7 +171,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SelfBase[%self.loc22: %Base]() -> i32 { +// CHECK:STDOUT: fn @SelfBase[%self.param_patt: %Base]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Base = name_ref self, %self.loc22 // CHECK:STDOUT: %a.ref: %.2 = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] @@ -175,7 +180,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: return %.loc23_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddrSelfBase[addr %self.loc26: %.7]() { +// CHECK:STDOUT: fn @AddrSelfBase[addr %self.param_patt: %.7]() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %.7 = name_ref self, %self.loc26 // CHECK:STDOUT: %.loc27_4: ref %Base = deref %self.ref @@ -186,26 +191,26 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%p: %.11) -> i32 { +// CHECK:STDOUT: fn @Call(%p.param_patt: %.11) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref.loc31: %.11 = name_ref p, %p // CHECK:STDOUT: %.loc31_4.1: ref %Derived = deref %p.ref.loc31 // CHECK:STDOUT: %AddrSelfBase.ref: %AddrSelfBase.type = name_ref AddrSelfBase, @Derived.%AddrSelfBase.decl [template = constants.%AddrSelfBase] // CHECK:STDOUT: %.loc31_7: = bound_method %.loc31_4.1, %AddrSelfBase.ref // CHECK:STDOUT: %.loc31_4.2: %.11 = addr_of %.loc31_4.1 -// CHECK:STDOUT: %.loc31_20.1: ref %Derived = deref %.loc31_4.2 -// CHECK:STDOUT: %.loc31_20.2: ref %Base = class_element_access %.loc31_20.1, element0 -// CHECK:STDOUT: %.loc31_20.3: %.7 = addr_of %.loc31_20.2 -// CHECK:STDOUT: %.loc31_20.4: %.7 = converted %.loc31_4.2, %.loc31_20.3 -// CHECK:STDOUT: %AddrSelfBase.call: init %.1 = call %.loc31_7(%.loc31_20.4) +// CHECK:STDOUT: %.loc31_4.3: ref %Derived = deref %.loc31_4.2 +// CHECK:STDOUT: %.loc31_4.4: ref %Base = class_element_access %.loc31_4.3, element0 +// CHECK:STDOUT: %.loc31_4.5: %.7 = addr_of %.loc31_4.4 +// CHECK:STDOUT: %.loc31_4.6: %.7 = converted %.loc31_4.2, %.loc31_4.5 +// CHECK:STDOUT: %AddrSelfBase.call: init %.1 = call %.loc31_7(%.loc31_4.6) // CHECK:STDOUT: %p.ref.loc32: %.11 = name_ref p, %p -// CHECK:STDOUT: %.loc32_11: ref %Derived = deref %p.ref.loc32 +// CHECK:STDOUT: %.loc32_11.1: ref %Derived = deref %p.ref.loc32 // CHECK:STDOUT: %SelfBase.ref: %SelfBase.type = name_ref SelfBase, @Derived.%SelfBase.decl [template = constants.%SelfBase] -// CHECK:STDOUT: %.loc32_14: = bound_method %.loc32_11, %SelfBase.ref -// CHECK:STDOUT: %.loc32_23.1: ref %Base = class_element_access %.loc32_11, element0 -// CHECK:STDOUT: %.loc32_23.2: ref %Base = converted %.loc32_11, %.loc32_23.1 -// CHECK:STDOUT: %.loc32_23.3: %Base = bind_value %.loc32_23.2 -// CHECK:STDOUT: %SelfBase.call: init i32 = call %.loc32_14(%.loc32_23.3) +// CHECK:STDOUT: %.loc32_14: = bound_method %.loc32_11.1, %SelfBase.ref +// CHECK:STDOUT: %.loc32_11.2: ref %Base = class_element_access %.loc32_11.1, element0 +// CHECK:STDOUT: %.loc32_11.3: ref %Base = converted %.loc32_11.1, %.loc32_11.2 +// CHECK:STDOUT: %.loc32_11.4: %Base = bind_value %.loc32_11.3 +// CHECK:STDOUT: %SelfBase.call: init i32 = call %.loc32_14(%.loc32_11.4) // CHECK:STDOUT: %.loc32_25.1: i32 = value_of_initializer %SelfBase.call // CHECK:STDOUT: %.loc32_25.2: i32 = converted %SelfBase.call, %.loc32_25.1 // CHECK:STDOUT: return %.loc32_25.2 diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index 7dfb5c44ab46..cc364b9c67d2 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -64,28 +64,30 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc21: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc21: %Class = bind_name self, %self.param.loc21 // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_29.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] // CHECK:STDOUT: %.loc21_29.2: type = converted %int.make_type_32.loc21, %.loc21_29.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc21: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc21: %Class = bind_name self, %param.loc21 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %Class = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %self.param.loc12: %Class = param self, runtime_param0 -// CHECK:STDOUT: %self.loc12: %Class = bind_name self, %self.param.loc12 // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_25.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_25.2: type = converted %int.make_type_32.loc12, %.loc12_25.1 [template = i32] // CHECK:STDOUT: %return.var.loc12: ref i32 = var +// CHECK:STDOUT: %param.loc12: %Class = param runtime_param0 +// CHECK:STDOUT: %self.loc12: %Class = bind_name self, %param.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {} { // CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] @@ -105,7 +107,7 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self.loc21: %Class]() -> i32 { +// CHECK:STDOUT: fn @F[%self.param_patt: %Class]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self.loc21 // CHECK:STDOUT: %p.ref: %.3 = name_ref p, @Class.%.loc18_8 [template = @Class.%.loc18_8] diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 7ce731254d97..8c79eb14d1de 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -35,6 +35,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %a: i32 = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt: i32 = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%a) [symbolic] @@ -43,9 +44,11 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.4: i32 = int_literal 1000 [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%.4) [template] // CHECK:STDOUT: %b: %C.3 = bind_symbolic_name b, 0 [symbolic] +// CHECK:STDOUT: %b.patt.1: %C.3 = symbolic_binding_pattern b, 0 [symbolic] // CHECK:STDOUT: %D.type: type = generic_class_type @D [template] // CHECK:STDOUT: %D.1: %D.type = struct_value () [template] // CHECK:STDOUT: %D.2: type = class_type @D, @D(%b) [symbolic] +// CHECK:STDOUT: %b.patt.2: %C.3 = symbolic_binding_pattern b, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -71,36 +74,40 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %a.patt: i32 = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc2_9.1: i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt.loc2_9.1, runtime_param [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc2_13.2: type = converted %int.make_type_32, %.loc2_13.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param -// CHECK:STDOUT: %a.loc2_9.1: i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc2_9.2 (constants.%a)] +// CHECK:STDOUT: %param: i32 = param runtime_param +// CHECK:STDOUT: %a.loc2_9.1: i32 = bind_symbolic_name a, 0, %param [symbolic = %a.loc2_9.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl.loc3: %D.type = class_decl @D [template = constants.%D.1] { -// CHECK:STDOUT: %b.patt: %C.3 = symbolic_binding_pattern b, 0 +// CHECK:STDOUT: %b.patt.loc4: %C.3 = symbolic_binding_pattern b, 0 [symbolic = constants.%b.patt.2] +// CHECK:STDOUT: %b.param_patt: %C.3 = param_pattern %b.patt.loc4, runtime_param [symbolic = constants.%b.patt.2] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc3: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] // CHECK:STDOUT: %.loc3: i32 = int_literal 1000 [template = constants.%.4] // CHECK:STDOUT: %C.loc3: type = class_type @C, @C(constants.%.4) [template = constants.%C.3] -// CHECK:STDOUT: %b.param.loc3: %C.3 = param b, runtime_param -// CHECK:STDOUT: %b.loc3_9.1: %C.3 = bind_symbolic_name b, 0, %b.param.loc3 [symbolic = %b.loc3_9.2 (constants.%b)] +// CHECK:STDOUT: %param.loc3: %C.3 = param runtime_param +// CHECK:STDOUT: %b.loc3_9.1: %C.3 = bind_symbolic_name b, 0, %param.loc3 [symbolic = %b.loc3_9.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl.loc4: %D.type = class_decl @D [template = constants.%D.1] { -// CHECK:STDOUT: %b.patt: %C.3 = symbolic_binding_pattern b, 0 +// CHECK:STDOUT: %b.patt.loc4: %C.3 = symbolic_binding_pattern b, 0 [symbolic = constants.%b.patt.2] +// CHECK:STDOUT: %b.param_patt: %C.3 = param_pattern %b.patt.loc4, runtime_param [symbolic = constants.%b.patt.2] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc4: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] // CHECK:STDOUT: %.loc4_15: i32 = int_literal 1000 [template = constants.%.4] // CHECK:STDOUT: %C.loc4: type = class_type @C, @C(constants.%.4) [template = constants.%C.3] -// CHECK:STDOUT: %b.param.loc4: %C.3 = param b, runtime_param -// CHECK:STDOUT: %b.loc4: %C.3 = bind_symbolic_name b, 0, %b.param.loc4 [symbolic = constants.%b] +// CHECK:STDOUT: %param.loc4: %C.3 = param runtime_param +// CHECK:STDOUT: %b.loc4: %C.3 = bind_symbolic_name b, 0, %param.loc4 [symbolic = constants.%b] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%a.loc2_9.1: i32) { // CHECK:STDOUT: %a.loc2_9.2: i32 = bind_symbolic_name a, 0 [symbolic = %a.loc2_9.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc2_9.2: i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -114,6 +121,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: // CHECK:STDOUT: generic class @D(%b.loc3_9.1: %C.3) { // CHECK:STDOUT: %b.loc3_9.2: %C.3 = bind_symbolic_name b, 0 [symbolic = %b.loc3_9.2 (constants.%b)] +// CHECK:STDOUT: %b.patt.loc3: %C.3 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc3 (constants.%b.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -129,14 +137,17 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%a) { // CHECK:STDOUT: %a.loc2_9.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%.4) { // CHECK:STDOUT: %a.loc2_9.2 => constants.%.4 +// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%b) { // CHECK:STDOUT: %b.loc3_9.2 => constants.%b +// CHECK:STDOUT: %b.patt.loc3 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_int_mismatch.carbon @@ -146,6 +157,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %a: i32 = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt: i32 = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%a) [symbolic] @@ -154,9 +166,11 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.4: i32 = int_literal 1000 [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%.4) [template] // CHECK:STDOUT: %b: %C.3 = bind_symbolic_name b, 0 [symbolic] +// CHECK:STDOUT: %b.patt.1: %C.3 = symbolic_binding_pattern b, 0 [symbolic] // CHECK:STDOUT: %D.type: type = generic_class_type @D [template] // CHECK:STDOUT: %D.1: %D.type = struct_value () [template] // CHECK:STDOUT: %D.2: type = class_type @D, @D(%b) [symbolic] +// CHECK:STDOUT: %b.patt.2: %C.3 = symbolic_binding_pattern b, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.5: %.type = struct_value () [template] // CHECK:STDOUT: %.6: type = class_type @.1, @.1(%b) [symbolic] @@ -185,36 +199,40 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %a.patt: i32 = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc2_9.1: i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt.loc2_9.1, runtime_param [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc2_13.2: type = converted %int.make_type_32, %.loc2_13.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param -// CHECK:STDOUT: %a.loc2_9.1: i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc2_9.2 (constants.%a)] +// CHECK:STDOUT: %param: i32 = param runtime_param +// CHECK:STDOUT: %a.loc2_9.1: i32 = bind_symbolic_name a, 0, %param [symbolic = %a.loc2_9.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = class_decl @D [template = constants.%D.1] { -// CHECK:STDOUT: %b.patt: %C.3 = symbolic_binding_pattern b, 0 +// CHECK:STDOUT: %b.patt.loc3_9.1: %C.3 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc3_9.2 (constants.%b.patt.1)] +// CHECK:STDOUT: %b.param_patt: %C.3 = param_pattern %b.patt.loc3_9.1, runtime_param [symbolic = %b.patt.loc3_9.2 (constants.%b.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] // CHECK:STDOUT: %.loc3: i32 = int_literal 1000 [template = constants.%.4] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.4) [template = constants.%C.3] -// CHECK:STDOUT: %b.param: %C.3 = param b, runtime_param -// CHECK:STDOUT: %b.loc3_9.1: %C.3 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc3_9.2 (constants.%b)] +// CHECK:STDOUT: %param: %C.3 = param runtime_param +// CHECK:STDOUT: %b.loc3_9.1: %C.3 = bind_symbolic_name b, 0, %param [symbolic = %b.loc3_9.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.5] { -// CHECK:STDOUT: %b.patt: %C.3 = symbolic_binding_pattern b, 0 +// CHECK:STDOUT: %b.patt.loc10_9.1: %C.3 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc10_9.2 (constants.%b.patt.2)] +// CHECK:STDOUT: %b.param_patt: %C.3 = param_pattern %b.patt.loc10_9.1, runtime_param [symbolic = %b.patt.loc10_9.2 (constants.%b.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] // CHECK:STDOUT: %.loc10_15: i32 = int_literal 1000 [template = constants.%.4] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.4) [template = constants.%C.3] -// CHECK:STDOUT: %b.param: %C.3 = param b, runtime_param -// CHECK:STDOUT: %b.loc10_9.1: %C.3 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc10_9.2 (constants.%b)] +// CHECK:STDOUT: %param: %C.3 = param runtime_param +// CHECK:STDOUT: %b.loc10_9.1: %C.3 = bind_symbolic_name b, 0, %param [symbolic = %b.loc10_9.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%a.loc2_9.1: i32) { // CHECK:STDOUT: %a.loc2_9.2: i32 = bind_symbolic_name a, 0 [symbolic = %a.loc2_9.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc2_9.2: i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -228,12 +246,14 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: // CHECK:STDOUT: generic class @D(%b.loc3_9.1: %C.3) { // CHECK:STDOUT: %b.loc3_9.2: %C.3 = bind_symbolic_name b, 0 [symbolic = %b.loc3_9.2 (constants.%b)] +// CHECK:STDOUT: %b.patt.loc3_9.2: %C.3 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc3_9.2 (constants.%b.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @.1(%b.loc10_9.1: %C.3) { // CHECK:STDOUT: %b.loc10_9.2: %C.3 = bind_symbolic_name b, 0 [symbolic = %b.loc10_9.2 (constants.%b)] +// CHECK:STDOUT: %b.patt.loc10_9.2: %C.3 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc10_9.2 (constants.%b.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -249,17 +269,21 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%a) { // CHECK:STDOUT: %a.loc2_9.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%.4) { // CHECK:STDOUT: %a.loc2_9.2 => constants.%.4 +// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%b) { // CHECK:STDOUT: %b.loc3_9.2 => constants.%b +// CHECK:STDOUT: %b.patt.loc3_9.2 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%b) { // CHECK:STDOUT: %b.loc10_9.2 => constants.%b +// CHECK:STDOUT: %b.patt.loc10_9.2 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/const/basic.carbon b/toolchain/check/testdata/const/basic.carbon index f197b7ec4649..703a6b039fcf 100644 --- a/toolchain/check/testdata/const/basic.carbon +++ b/toolchain/check/testdata/const/basic.carbon @@ -57,6 +57,7 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_15 [template = i32] @@ -64,8 +65,6 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: %.loc11_9.3: type = const_type i32 [template = constants.%.2] // CHECK:STDOUT: %.loc11_18: type = ptr_type %.2 [template = constants.%.3] // CHECK:STDOUT: %.loc11_19: type = ptr_type %.3 [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32.loc11_31: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32.loc11_31 [template = i32] // CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11_31, %.loc11_25.1 [template = i32] @@ -73,35 +72,38 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: %.loc11_34: type = ptr_type %.2 [template = constants.%.3] // CHECK:STDOUT: %.loc11_35: type = ptr_type %.3 [template = constants.%.4] // CHECK:STDOUT: %return: ref %.4 = var +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %p.patt: %.6 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.6 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc15_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_32.loc15_16 [template = i32] // CHECK:STDOUT: %.loc15_19.2: type = converted %int.make_type_32.loc15_16, %.loc15_19.1 [template = i32] // CHECK:STDOUT: %.loc15_19.3: type = ptr_type i32 [template = constants.%.5] // CHECK:STDOUT: %.loc15_9: type = const_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %p.param: %.6 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.6 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32.loc15_33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_36.1: type = value_of_initializer %int.make_type_32.loc15_33 [template = i32] // CHECK:STDOUT: %.loc15_36.2: type = converted %int.make_type_32.loc15_33, %.loc15_36.1 [template = i32] // CHECK:STDOUT: %.loc15_36.3: type = ptr_type i32 [template = constants.%.5] // CHECK:STDOUT: %.loc15_26: type = const_type %.5 [template = constants.%.6] // CHECK:STDOUT: %return: ref %.6 = var +// CHECK:STDOUT: %param: %.6 = param runtime_param0 +// CHECK:STDOUT: %p: %.6 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @A(%p: %.4) -> %.4 { +// CHECK:STDOUT: fn @A(%p.param_patt: %.4) -> %.4 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: return %p.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%p: %.6) -> %.6 { +// CHECK:STDOUT: fn @B(%p.param_patt: %.6) -> %.6 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.6 = name_ref p, %p // CHECK:STDOUT: return %p.ref diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index 88619f0dd78d..aa6bf82a3f47 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -52,6 +52,7 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc15_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_32.loc15_15 [template = i32] @@ -59,8 +60,6 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: %.loc15_9.3: type = const_type i32 [template = constants.%.2] // CHECK:STDOUT: %.loc15_18: type = ptr_type %.2 [template = constants.%.3] // CHECK:STDOUT: %.loc15_19: type = ptr_type %.3 [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32.loc15_38: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %int.make_type_32.loc15_38 [template = i32] // CHECK:STDOUT: %.loc15_32.2: type = converted %int.make_type_32.loc15_38, %.loc15_32.1 [template = i32] @@ -69,12 +68,14 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: %.loc15_42: type = ptr_type %.2 [template = constants.%.3] // CHECK:STDOUT: %.loc15_43: type = ptr_type %.3 [template = constants.%.4] // CHECK:STDOUT: %return: ref %.4 = var +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%p: %.4) -> %.4 { +// CHECK:STDOUT: fn @F(%p.param_patt: %.4) -> %.4 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: return %p.ref diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index 1456c88880f8..0238274068a5 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -40,6 +40,7 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -67,12 +68,12 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.7) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.11)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.7) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.11)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -83,6 +84,7 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc15_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_32.loc15_22 [template = i32] @@ -91,19 +93,20 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %.loc15_9: type = const_type %.2 [template = constants.%.2] // CHECK:STDOUT: %.loc15_26: type = ptr_type %.2 [template = constants.%.3] // CHECK:STDOUT: %.loc15_27: type = ptr_type %.3 [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32.loc15_33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_36.1: type = value_of_initializer %int.make_type_32.loc15_33 [template = i32] // CHECK:STDOUT: %.loc15_36.2: type = converted %int.make_type_32.loc15_33, %.loc15_36.1 [template = i32] // CHECK:STDOUT: %.loc15_36.3: type = ptr_type i32 [template = constants.%.5] // CHECK:STDOUT: %.loc15_37: type = ptr_type %.5 [template = constants.%.6] // CHECK:STDOUT: %return: ref %.6 = var +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -123,7 +126,7 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p: %.4) -> %.6 { +// CHECK:STDOUT: fn @G(%p.param_patt: %.4) -> %.6 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.6) [template = constants.%ImplicitAs.type.3] @@ -138,19 +141,22 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -161,6 +167,7 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.6) { // CHECK:STDOUT: %Dest => constants.%.6 +// CHECK:STDOUT: %Dest.patt => constants.%.6 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 18a593fd2e5c..7f8a32c12718 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -66,12 +66,12 @@ fn F[T:! type](a: [T; 2]) -> T { return a[0]; } fn G() -> C { // TODO: We succeed at deducing T here but fail to convert. Is this the right behavior? var a: [C; 3] = ({}, {}, {}); - // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+10]]:10: error: cannot implicitly convert from `[C; 3]` to `[C; 2]` + // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+10]]:12: error: cannot implicitly convert from `[C; 3]` to `[C; 2]` // CHECK:STDERR: return F(a); - // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+7]]:10: note: type `[C; 3]` does not implement interface `ImplicitAs` + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+7]]:12: note: type `[C; 3]` does not implement interface `ImplicitAs` // CHECK:STDERR: return F(a); - // CHECK:STDERR: ^~ + // CHECK:STDERR: ^ // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE-11]]:1: note: initializing parameter 1 of function declared here // CHECK:STDERR: fn F[T:! type](a: [T; 2]) -> T { return a[0]; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -104,6 +104,7 @@ fn G() -> C { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: i32 = int_literal 3 [template] // CHECK:STDOUT: %.4: type = array_type %.3, %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -147,18 +148,20 @@ fn G() -> C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6_6.1, runtime_param [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %a.patt: @F.%.loc6_24.2 (%.4) = binding_pattern a +// CHECK:STDOUT: %a.param_patt: @F.%.loc6_24.2 (%.4) = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc6_20: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %.loc6_23: i32 = int_literal 3 [template = constants.%.3] // CHECK:STDOUT: %.loc6_24.1: type = array_type %.loc6_23, %T [symbolic = %.loc6_24.2 (constants.%.4)] -// CHECK:STDOUT: %a.param: @F.%.loc6_24.2 (%.4) = param a, runtime_param0 -// CHECK:STDOUT: %a: @F.%.loc6_24.2 (%.4) = bind_name a, %a.param // CHECK:STDOUT: %T.ref.loc6_30: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = var +// CHECK:STDOUT: %param.loc6_6: type = param runtime_param +// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %param.loc6_6 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc6_16: @F.%.loc6_24.2 (%.4) = param runtime_param0 +// CHECK:STDOUT: %a: @F.%.loc6_24.2 (%.4) = bind_name a, %param.loc6_16 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] @@ -175,11 +178,12 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc6_24.2: type = array_type constants.%.3, @F.%T.loc6_6.2 (%T) [symbolic = %.loc6_24.2 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc6_6.1: type](%a: @F.%.loc6_24.2 (%.4)) -> @F.%T.loc6_6.2 (%T) { +// CHECK:STDOUT: fn[%T.param_patt: type](%a.param_patt: @F.%.loc6_24.2 (%.4)) -> @F.%T.loc6_6.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: @F.%.loc6_24.2 (%.4) = name_ref a, %a // CHECK:STDOUT: %.loc6_43: i32 = int_literal 0 [template = constants.%.7] @@ -227,11 +231,13 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T // CHECK:STDOUT: %.loc6_24.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%C // CHECK:STDOUT: %.loc6_24.2 => constants.%.9 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -247,6 +253,7 @@ fn G() -> C { // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -288,23 +295,25 @@ fn G() -> C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc10_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] // CHECK:STDOUT: %a.patt: = binding_pattern a +// CHECK:STDOUT: %a.param_patt: = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc10_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_32.loc10_10 [template = i32] // CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_32.loc10_10, %.loc10_10.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc10_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N)] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %N.ref.loc10_22: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N)] // CHECK:STDOUT: %.loc10_23: type = array_type %N.ref.loc10_22, %C [template = ] -// CHECK:STDOUT: %a.param: = param a, runtime_param0 -// CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc10_29: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_32.loc10_29 [template = i32] // CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_32.loc10_29, %.loc10_29.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc10_6: i32 = param runtime_param +// CHECK:STDOUT: %N.loc10_6.1: i32 = bind_symbolic_name N, 0, %param.loc10_6 [symbolic = %N.loc10_6.2 (constants.%N)] +// CHECK:STDOUT: %param.loc10_15: = param runtime_param0 +// CHECK:STDOUT: %a: = bind_name a, %param.loc10_15 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl [template = constants.%C] @@ -323,10 +332,11 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc10_6.1: i32) { // CHECK:STDOUT: %N.loc10_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc10_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.loc10_6.1: i32](%a: ) -> i32 { +// CHECK:STDOUT: fn[%N.param_patt: i32](%a.param_patt: ) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc10_42: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N)] // CHECK:STDOUT: return %N.ref.loc10_42 @@ -366,6 +376,7 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc10_6.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_type_and_bound.carbon @@ -375,10 +386,12 @@ fn G() -> C { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -420,24 +433,27 @@ fn G() -> C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 +// CHECK:STDOUT: %T.patt.loc10_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc10_6.1, runtime_param [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.patt.loc10_16.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc10_16.1, runtime_param [symbolic = %N.patt.loc10_16.2 (constants.%N.patt)] // CHECK:STDOUT: %a.patt: = binding_pattern a +// CHECK:STDOUT: %a.param_patt: = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc10_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_20.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc10_20.2: type = converted %int.make_type_32, %.loc10_20.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc10_16.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc10_16.2 (constants.%N)] // CHECK:STDOUT: %T.ref.loc10_29: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc10_16.1 [symbolic = %N.loc10_16.2 (constants.%N)] // CHECK:STDOUT: %.loc10_33: type = array_type %N.ref, %T [template = ] -// CHECK:STDOUT: %a.param: = param a, runtime_param0 -// CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: %T.ref.loc10_39: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: %return: ref @F.%T.loc10_6.2 (%T) = var +// CHECK:STDOUT: %param.loc10_6: type = param runtime_param +// CHECK:STDOUT: %T.loc10_6.1: type = bind_symbolic_name T, 0, %param.loc10_6 [symbolic = %T.loc10_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc10_16: i32 = param runtime_param +// CHECK:STDOUT: %N.loc10_16.1: i32 = bind_symbolic_name N, 1, %param.loc10_16 [symbolic = %N.loc10_16.2 (constants.%N)] +// CHECK:STDOUT: %param.loc10_25: = param runtime_param0 +// CHECK:STDOUT: %a: = bind_name a, %param.loc10_25 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl [template = constants.%C] @@ -456,9 +472,11 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc10_6.1: type, %N.loc10_16.1: i32) { // CHECK:STDOUT: %T.loc10_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc10_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] // CHECK:STDOUT: %N.loc10_16.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc10_16.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc10_16.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc10_6.1: type, %N.loc10_16.1: i32](%a: ) -> @F.%T.loc10_6.2 (%T); +// CHECK:STDOUT: fn[%T.param_patt: type, %N.param_patt: i32](%a.param_patt: ) -> @F.%T.loc10_6.2 (%T); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return: %C { @@ -494,7 +512,9 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc10_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc10_6.2 => constants.%T // CHECK:STDOUT: %N.loc10_16.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc10_16.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_bound_mismatch.carbon @@ -504,6 +524,7 @@ fn G() -> C { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: i32 = int_literal 2 [template] // CHECK:STDOUT: %.4: type = array_type %.3, %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -529,6 +550,7 @@ fn G() -> C { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -554,12 +576,12 @@ fn G() -> C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.17) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.21)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.17) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.21)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -572,18 +594,20 @@ fn G() -> C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6_6.1, runtime_param [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %a.patt: @F.%.loc6_24.2 (%.4) = binding_pattern a +// CHECK:STDOUT: %a.param_patt: @F.%.loc6_24.2 (%.4) = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc6_20: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %.loc6_23: i32 = int_literal 2 [template = constants.%.3] // CHECK:STDOUT: %.loc6_24.1: type = array_type %.loc6_23, %T [symbolic = %.loc6_24.2 (constants.%.4)] -// CHECK:STDOUT: %a.param: @F.%.loc6_24.2 (%.4) = param a, runtime_param0 -// CHECK:STDOUT: %a: @F.%.loc6_24.2 (%.4) = bind_name a, %a.param // CHECK:STDOUT: %T.ref.loc6_30: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = var +// CHECK:STDOUT: %param.loc6_6: type = param runtime_param +// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %param.loc6_6 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc6_16: @F.%.loc6_24.2 (%.4) = param runtime_param0 +// CHECK:STDOUT: %a: @F.%.loc6_24.2 (%.4) = bind_name a, %param.loc6_16 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] @@ -593,6 +617,7 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -619,11 +644,12 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc6_24.2: type = array_type constants.%.3, @F.%T.loc6_6.2 (%T) [symbolic = %.loc6_24.2 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc6_6.1: type](%a: @F.%.loc6_24.2 (%.4)) -> @F.%T.loc6_6.2 (%T) { +// CHECK:STDOUT: fn[%T.param_patt: type](%a.param_patt: @F.%.loc6_24.2 (%.4)) -> @F.%T.loc6_6.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: @F.%.loc6_24.2 (%.4) = name_ref a, %a // CHECK:STDOUT: %.loc6_43: i32 = int_literal 0 [template = constants.%.7] @@ -663,11 +689,11 @@ fn G() -> C { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %a.ref: ref %.10 = name_ref a, %a // CHECK:STDOUT: %.loc21_10: = specific_function %F.ref, @F(constants.%C) [template = constants.%.15] -// CHECK:STDOUT: %.loc21_11.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc21_11: ref %C = temporary_storage // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.14) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc21_11.2: %.19 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%.14) [template = constants.%.20] -// CHECK:STDOUT: %Convert.ref: %.19 = name_ref Convert, %.loc21_11.2 [template = constants.%.20] -// CHECK:STDOUT: %.loc21_11.3: %.14 = converted %a.ref, [template = ] +// CHECK:STDOUT: %.loc21_12.1: %.19 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%.14) [template = constants.%.20] +// CHECK:STDOUT: %Convert.ref: %.19 = name_ref Convert, %.loc21_12.1 [template = constants.%.20] +// CHECK:STDOUT: %.loc21_12.2: %.14 = converted %a.ref, [template = ] // CHECK:STDOUT: %F.call: init %C = call %.loc21_10() [template = ] // CHECK:STDOUT: return %F.call to %return // CHECK:STDOUT: } @@ -677,16 +703,18 @@ fn G() -> C { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T // CHECK:STDOUT: %.loc6_24.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%C // CHECK:STDOUT: %.loc6_24.2 => constants.%.14 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -694,14 +722,17 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -712,6 +743,7 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.14) { // CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -733,6 +765,7 @@ fn G() -> C { // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -776,23 +809,25 @@ fn G() -> C { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc10_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] // CHECK:STDOUT: %a.patt: = binding_pattern a +// CHECK:STDOUT: %a.param_patt: = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc10_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_32.loc10_10 [template = i32] // CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_32.loc10_10, %.loc10_10.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc10_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N)] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %N.ref.loc10_22: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N)] // CHECK:STDOUT: %.loc10_23: type = array_type %N.ref.loc10_22, %C [template = ] -// CHECK:STDOUT: %a.param: = param a, runtime_param0 -// CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc10_29: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_32.loc10_29 [template = i32] // CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_32.loc10_29, %.loc10_29.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc10_6: i32 = param runtime_param +// CHECK:STDOUT: %N.loc10_6.1: i32 = bind_symbolic_name N, 0, %param.loc10_6 [symbolic = %N.loc10_6.2 (constants.%N)] +// CHECK:STDOUT: %param.loc10_15: = param runtime_param0 +// CHECK:STDOUT: %a: = bind_name a, %param.loc10_15 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] @@ -818,10 +853,11 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc10_6.1: i32) { // CHECK:STDOUT: %N.loc10_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc10_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.loc10_6.1: i32](%a: ) -> i32 { +// CHECK:STDOUT: fn[%N.param_patt: i32](%a.param_patt: ) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc10_42: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N)] // CHECK:STDOUT: return %N.ref.loc10_42 @@ -861,5 +897,6 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc10_6.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index 11207e072134..9292babb3854 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -69,6 +69,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] @@ -76,6 +77,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %D: type = class_type @D [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.4: type = ptr_type %.2 [template] @@ -109,41 +111,46 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_9.1, runtime_param [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc7_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc7_6.1, runtime_param [symbolic = %T.patt.loc7_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: %p.patt: @F.%C.loc7_20.2 (%C.2) = binding_pattern p +// CHECK:STDOUT: %p.param_patt: @F.%C.loc7_20.2 (%C.2) = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] // CHECK:STDOUT: %T.ref.loc7_21: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %C.loc7_20.1: type = class_type @C, @C(constants.%T) [symbolic = %C.loc7_20.2 (constants.%C.2)] -// CHECK:STDOUT: %p.param: @F.%C.loc7_20.2 (%C.2) = param p, runtime_param0 -// CHECK:STDOUT: %p: @F.%C.loc7_20.2 (%C.2) = bind_name p, %p.param // CHECK:STDOUT: %T.ref.loc7_28: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %return: ref @F.%T.loc7_6.2 (%T) = var +// CHECK:STDOUT: %param.loc7_6: type = param runtime_param +// CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %param.loc7_6 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc7_16: @F.%C.loc7_20.2 (%C.2) = param runtime_param0 +// CHECK:STDOUT: %p: @F.%C.loc7_20.2 (%C.2) = bind_name p, %param.loc7_16 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %p.patt: %C.3 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %C.3 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] // CHECK:STDOUT: %D.ref.loc9_11: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%D) [template = constants.%C.3] -// CHECK:STDOUT: %p.param: %C.3 = param p, runtime_param0 -// CHECK:STDOUT: %p: %C.3 = bind_name p, %p.param // CHECK:STDOUT: %D.ref.loc9_18: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %return: ref %D = var +// CHECK:STDOUT: %param: %C.3 = param runtime_param0 +// CHECK:STDOUT: %p: %C.3 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc4_9.1: type) { // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -164,12 +171,13 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc7_6.1: type) { // CHECK:STDOUT: %T.loc7_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc7_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: %C.loc7_20.2: type = class_type @C, @C(%T.loc7_6.2) [symbolic = %C.loc7_20.2 (constants.%C.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc7_39.2: = specific_function constants.%F, @F(%T.loc7_6.2) [symbolic = %.loc7_39.2 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc7_6.1: type](%p: @F.%C.loc7_20.2 (%C.2)) -> @F.%T.loc7_6.2 (%T) { +// CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%C.loc7_20.2 (%C.2)) -> @F.%T.loc7_6.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: @F.%C.loc7_20.2 (%C.2) = name_ref p, %p @@ -181,7 +189,7 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p: %C.3) -> %return: %D { +// CHECK:STDOUT: fn @G(%p.param_patt: %C.3) -> %return: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %C.3 = name_ref p, %p @@ -193,16 +201,19 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(@F.%T.loc7_6.2) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T // CHECK:STDOUT: %C.loc7_20.2 => constants.%C.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -211,17 +222,20 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(@F.%T.loc7_6.2) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T // CHECK:STDOUT: %C.loc7_20.2 => constants.%C.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%D) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%D +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%D // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%D) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%D +// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%D // CHECK:STDOUT: %C.loc7_20.2 => constants.%C.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -232,6 +246,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %I.type: type = generic_class_type @I [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %I.1: %I.type = struct_value () [template] @@ -239,6 +254,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.4: type = ptr_type %.2 [template] @@ -272,41 +288,46 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: %I.type = class_decl @I [template = constants.%I.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_9.1, runtime_param [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc7_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc7_6.1, runtime_param [symbolic = %T.patt.loc7_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: %p.patt: @F.%I.loc7_20.2 (%I.2) = binding_pattern p +// CHECK:STDOUT: %p.param_patt: @F.%I.loc7_20.2 (%I.2) = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %I.ref: %I.type = name_ref I, file.%I.decl [template = constants.%I.1] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %I.loc7_20.1: type = class_type @I, @I(constants.%T) [symbolic = %I.loc7_20.2 (constants.%I.2)] -// CHECK:STDOUT: %p.param: @F.%I.loc7_20.2 (%I.2) = param p, runtime_param0 -// CHECK:STDOUT: %p: @F.%I.loc7_20.2 (%I.2) = bind_name p, %p.param // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc7_6: type = param runtime_param +// CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %param.loc7_6 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc7_16: @F.%I.loc7_20.2 (%I.2) = param runtime_param0 +// CHECK:STDOUT: %p: @F.%I.loc7_20.2 (%I.2) = bind_name p, %param.loc7_16 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %p.patt: %I.3 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %I.3 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: %I.type = name_ref I, file.%I.decl [template = constants.%I.1] // CHECK:STDOUT: %C.ref.loc9_11: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %I: type = class_type @I, @I(constants.%C) [template = constants.%I.3] -// CHECK:STDOUT: %p.param: %I.3 = param p, runtime_param0 -// CHECK:STDOUT: %p: %I.3 = bind_name p, %p.param // CHECK:STDOUT: %C.ref.loc9_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param: %I.3 = param runtime_param0 +// CHECK:STDOUT: %p: %I.3 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @I(%T.loc4_9.1: type) { // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -327,12 +348,13 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc7_6.1: type) { // CHECK:STDOUT: %T.loc7_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc7_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: %I.loc7_20.2: type = class_type @I, @I(%T.loc7_6.2) [symbolic = %I.loc7_20.2 (constants.%I.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc7_39.2: = specific_function constants.%F, @F(%T.loc7_6.2) [symbolic = %.loc7_39.2 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc7_6.1: type](%p: @F.%I.loc7_20.2 (%I.2)) -> %return: %C { +// CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%I.loc7_20.2 (%I.2)) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: @F.%I.loc7_20.2 (%I.2) = name_ref p, %p @@ -343,7 +365,7 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p: %I.3) -> %return: %C { +// CHECK:STDOUT: fn @G(%p.param_patt: %I.3) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %I.3 = name_ref p, %p @@ -355,16 +377,19 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%T) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@F.%T.loc7_6.2) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T // CHECK:STDOUT: %I.loc7_20.2 => constants.%I.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -373,17 +398,20 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(@F.%T.loc7_6.2) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T // CHECK:STDOUT: %I.loc7_20.2 => constants.%I.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%C) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%C // CHECK:STDOUT: %I.loc7_20.2 => constants.%I.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -394,11 +422,13 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Outer.type: type = generic_class_type @Outer [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Outer.1: %Outer.type = struct_value () [template] // CHECK:STDOUT: %Outer.2: type = class_type @Outer, @Outer(%T) [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt.1: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %Inner.type.1: type = generic_class_type @Inner, @Outer(%T) [symbolic] // CHECK:STDOUT: %Inner.1: %Inner.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %Inner.2: type = class_type @Inner, @Inner(%T, %U) [symbolic] @@ -406,6 +436,8 @@ fn G() -> i32 { // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %D: type = class_type @D [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %U.patt.2: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %.5: type = tuple_type (type, type) [template] // CHECK:STDOUT: %.6: type = tuple_type (%T, %U) [symbolic] @@ -449,22 +481,22 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Outer.decl: %Outer.type = class_decl @Outer [template = constants.%Outer.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %T.patt.loc13_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_6.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc13_6.1, runtime_param [symbolic = %T.patt.loc13_6.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %U.patt.loc13_16.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc13_16.2 (constants.%U.patt.2)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc13_16.1, runtime_param [symbolic = %U.patt.loc13_16.2 (constants.%U.patt.2)] // CHECK:STDOUT: %p.patt: @F.%Inner.loc13_43.2 (%Inner.2) = binding_pattern p +// CHECK:STDOUT: %p.param_patt: @F.%Inner.loc13_43.2 (%Inner.2) = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc13_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_6.2 (constants.%T)] -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc13_16.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc13_16.2 (constants.%U)] // CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.1] // CHECK:STDOUT: %T.ref.loc13_35: type = name_ref T, %T.loc13_6.1 [symbolic = %T.loc13_6.2 (constants.%T)] // CHECK:STDOUT: %Outer.loc13_34.1: type = class_type @Outer, @Outer(constants.%T) [symbolic = %Outer.loc13_34.2 (constants.%Outer.2)] @@ -472,16 +504,21 @@ fn G() -> i32 { // CHECK:STDOUT: %Inner.ref: @F.%Inner.type (%Inner.type.1) = name_ref Inner, %.loc13_37 [symbolic = %Inner.loc13_37 (constants.%Inner.1)] // CHECK:STDOUT: %U.ref.loc13_44: type = name_ref U, %U.loc13_16.1 [symbolic = %U.loc13_16.2 (constants.%U)] // CHECK:STDOUT: %Inner.loc13_43.1: type = class_type @Inner, @Inner(constants.%T, constants.%U) [symbolic = %Inner.loc13_43.2 (constants.%Inner.2)] -// CHECK:STDOUT: %p.param: @F.%Inner.loc13_43.2 (%Inner.2) = param p, runtime_param0 -// CHECK:STDOUT: %p: @F.%Inner.loc13_43.2 (%Inner.2) = bind_name p, %p.param // CHECK:STDOUT: %T.ref.loc13_52: type = name_ref T, %T.loc13_6.1 [symbolic = %T.loc13_6.2 (constants.%T)] // CHECK:STDOUT: %U.ref.loc13_55: type = name_ref U, %U.loc13_16.1 [symbolic = %U.loc13_16.2 (constants.%U)] // CHECK:STDOUT: %.loc13_56.1: %.5 = tuple_literal (%T.ref.loc13_52, %U.ref.loc13_55) // CHECK:STDOUT: %.loc13_56.2: type = converted %.loc13_56.1, constants.%.6 [symbolic = %.loc13_56.3 (constants.%.6)] // CHECK:STDOUT: %return: ref @F.%.loc13_56.3 (%.6) = var +// CHECK:STDOUT: %param.loc13_6: type = param runtime_param +// CHECK:STDOUT: %T.loc13_6.1: type = bind_symbolic_name T, 0, %param.loc13_6 [symbolic = %T.loc13_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc13_16: type = param runtime_param +// CHECK:STDOUT: %U.loc13_16.1: type = bind_symbolic_name U, 1, %param.loc13_16 [symbolic = %U.loc13_16.2 (constants.%U)] +// CHECK:STDOUT: %param.loc13_26: @F.%Inner.loc13_43.2 (%Inner.2) = param runtime_param0 +// CHECK:STDOUT: %p: @F.%Inner.loc13_43.2 (%Inner.2) = bind_name p, %param.loc13_26 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %p.patt: %Inner.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %Inner.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.1] // CHECK:STDOUT: %C.ref.loc15_15: type = name_ref C, file.%C.decl [template = constants.%C] @@ -490,18 +527,19 @@ fn G() -> i32 { // CHECK:STDOUT: %Inner.ref: %Inner.type.2 = name_ref Inner, %.loc15_17 [template = constants.%Inner.3] // CHECK:STDOUT: %D.ref.loc15_24: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(constants.%C, constants.%D) [template = constants.%Inner.4] -// CHECK:STDOUT: %p.param: %Inner.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %Inner.4 = bind_name p, %p.param // CHECK:STDOUT: %C.ref.loc15_32: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %D.ref.loc15_35: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %.loc15_36.1: %.5 = tuple_literal (%C.ref.loc15_32, %D.ref.loc15_35) // CHECK:STDOUT: %.loc15_36.2: type = converted %.loc15_36.1, constants.%.9 [template = constants.%.9] // CHECK:STDOUT: %return: ref %.9 = var +// CHECK:STDOUT: %param: %Inner.4 = param runtime_param0 +// CHECK:STDOUT: %p: %Inner.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Outer(%T.loc4_13.1: type) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T.loc4_13.2) [symbolic = %Inner.type (constants.%Inner.type.1)] @@ -509,10 +547,11 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Inner.decl: @Outer.%Inner.type (%Inner.type.1) = class_decl @Inner [symbolic = @Outer.%Inner (constants.%Inner.1)] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %U.patt.loc5_15.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc5_15.2 (constants.%U.patt.1)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc5_15.1, runtime_param [symbolic = %U.patt.loc5_15.2 (constants.%U.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc5_15.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc5_15.2 (constants.%U)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc5_15.1: type = bind_symbolic_name U, 1, %param [symbolic = %U.loc5_15.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -524,6 +563,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Inner(@Outer.%T.loc4_13.1: type, %U.loc5_15.1: type) { // CHECK:STDOUT: %U.loc5_15.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc5_15.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc5_15.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc5_15.2 (constants.%U.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -551,7 +591,9 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc13_6.1: type, %U.loc13_16.1: type) { // CHECK:STDOUT: %T.loc13_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc13_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc13_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: %U.loc13_16.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc13_16.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc13_16.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc13_16.2 (constants.%U.patt.2)] // CHECK:STDOUT: %Outer.loc13_34.2: type = class_type @Outer, @Outer(%T.loc13_6.2) [symbolic = %Outer.loc13_34.2 (constants.%Outer.2)] // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T.loc13_6.2) [symbolic = %Inner.type (constants.%Inner.type.1)] // CHECK:STDOUT: %Inner.loc13_37: @F.%Inner.type (%Inner.type.1) = struct_value () [symbolic = %Inner.loc13_37 (constants.%Inner.1)] @@ -561,7 +603,7 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc13_67.2: = specific_function constants.%F, @F(%T.loc13_6.2, %U.loc13_16.2) [symbolic = %.loc13_67.2 (constants.%.8)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc13_6.1: type, %U.loc13_16.1: type](%p: @F.%Inner.loc13_43.2 (%Inner.2)) -> %return: @F.%.loc13_56.3 (%.6) { +// CHECK:STDOUT: fn[%T.param_patt: type, %U.param_patt: type](%p.param_patt: @F.%Inner.loc13_43.2 (%Inner.2)) -> %return: @F.%.loc13_56.3 (%.6) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: @F.%Inner.loc13_43.2 (%Inner.2) = name_ref p, %p @@ -583,7 +625,7 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p: %Inner.4) -> %return: %.9 { +// CHECK:STDOUT: fn @G(%p.param_patt: %Inner.4) -> %return: %.9 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %Inner.4 = name_ref p, %p @@ -595,6 +637,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%T) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Inner.type => constants.%Inner.type.1 @@ -603,25 +646,31 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(constants.%T, constants.%U) { // CHECK:STDOUT: %U.loc5_15.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc5_15.2 => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(@Outer.%T.loc4_13.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(@F.%T.loc13_6.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(@F.%T.loc13_6.2, @F.%U.loc13_16.2) { // CHECK:STDOUT: %U.loc5_15.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc5_15.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc13_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc13_6.2 => constants.%T // CHECK:STDOUT: %U.loc13_16.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc13_16.2 => constants.%U // CHECK:STDOUT: %Outer.loc13_34.2 => constants.%Outer.2 // CHECK:STDOUT: %Inner.type => constants.%Inner.type.1 // CHECK:STDOUT: %Inner.loc13_37 => constants.%Inner.1 @@ -634,7 +683,9 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(@F.%T.loc13_6.2, @F.%U.loc13_16.2) { // CHECK:STDOUT: %T.loc13_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc13_6.2 => constants.%T // CHECK:STDOUT: %U.loc13_16.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc13_16.2 => constants.%U // CHECK:STDOUT: %Outer.loc13_34.2 => constants.%Outer.2 // CHECK:STDOUT: %Inner.type => constants.%Inner.type.1 // CHECK:STDOUT: %Inner.loc13_37 => constants.%Inner.1 @@ -644,6 +695,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%C) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Inner.type => constants.%Inner.type.2 @@ -652,13 +704,16 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner(constants.%C, constants.%D) { // CHECK:STDOUT: %U.loc5_15.2 => constants.%D +// CHECK:STDOUT: %U.patt.loc5_15.2 => constants.%D // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C, constants.%D) { // CHECK:STDOUT: %T.loc13_6.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc13_6.2 => constants.%C // CHECK:STDOUT: %U.loc13_16.2 => constants.%D +// CHECK:STDOUT: %U.patt.loc13_16.2 => constants.%D // CHECK:STDOUT: %Outer.loc13_34.2 => constants.%Outer.3 // CHECK:STDOUT: %Inner.type => constants.%Inner.type.2 // CHECK:STDOUT: %Inner.loc13_37 => constants.%Inner.3 @@ -676,11 +731,13 @@ fn G() -> i32 { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %WithNontype.type: type = generic_class_type @WithNontype [template] // CHECK:STDOUT: %WithNontype.1: %WithNontype.type = struct_value () [template] // CHECK:STDOUT: %WithNontype.2: type = class_type @WithNontype, @WithNontype(%N) [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %N.patt.2: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.4: type = ptr_type %.2 [template] @@ -716,32 +773,35 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %WithNontype.decl: %WithNontype.type = class_decl @WithNontype [template = constants.%WithNontype.1] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc4_19.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_19.1, runtime_param [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_23.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_23.2: type = converted %int.make_type_32, %.loc4_23.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_19.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_19.2 (constants.%N)] +// CHECK:STDOUT: %param: i32 = param runtime_param +// CHECK:STDOUT: %N.loc4_19.1: i32 = bind_symbolic_name N, 0, %param [symbolic = %N.loc4_19.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc6_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc6_6.1, runtime_param [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: %x.patt: @F.%WithNontype.loc6_29.2 (%WithNontype.2) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @F.%WithNontype.loc6_29.2 (%WithNontype.2) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6_10 [template = i32] // CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6_10, %.loc6_10.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc6_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_6.2 (constants.%N)] // CHECK:STDOUT: %WithNontype.ref: %WithNontype.type = name_ref WithNontype, file.%WithNontype.decl [template = constants.%WithNontype.1] // CHECK:STDOUT: %N.ref.loc6_30: i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N)] // CHECK:STDOUT: %WithNontype.loc6_29.1: type = class_type @WithNontype, @WithNontype(constants.%N) [symbolic = %WithNontype.loc6_29.2 (constants.%WithNontype.2)] -// CHECK:STDOUT: %x.param: @F.%WithNontype.loc6_29.2 (%WithNontype.2) = param x, runtime_param0 -// CHECK:STDOUT: %x: @F.%WithNontype.loc6_29.2 (%WithNontype.2) = bind_name x, %x.param // CHECK:STDOUT: %int.make_type_32.loc6_37: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_37.1: type = value_of_initializer %int.make_type_32.loc6_37 [template = i32] // CHECK:STDOUT: %.loc6_37.2: type = converted %int.make_type_32.loc6_37, %.loc6_37.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc6_6: i32 = param runtime_param +// CHECK:STDOUT: %N.loc6_6.1: i32 = bind_symbolic_name N, 0, %param.loc6_6 [symbolic = %N.loc6_6.2 (constants.%N)] +// CHECK:STDOUT: %param.loc6_15: @F.%WithNontype.loc6_29.2 (%WithNontype.2) = param runtime_param0 +// CHECK:STDOUT: %x: @F.%WithNontype.loc6_29.2 (%WithNontype.2) = bind_name x, %param.loc6_15 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -753,6 +813,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic class @WithNontype(%N.loc4_19.1: i32) { // CHECK:STDOUT: %N.loc4_19.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_19.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc4_19.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -768,11 +829,12 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc6_6.1: i32) { // CHECK:STDOUT: %N.loc6_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc6_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: %WithNontype.loc6_29.2: type = class_type @WithNontype, @WithNontype(%N.loc6_6.2) [symbolic = %WithNontype.loc6_29.2 (constants.%WithNontype.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.loc6_6.1: i32](%x: @F.%WithNontype.loc6_29.2 (%WithNontype.2)) -> i32 { +// CHECK:STDOUT: fn[%N.param_patt: i32](%x.param_patt: @F.%WithNontype.loc6_29.2 (%WithNontype.2)) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc6_50: i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N)] // CHECK:STDOUT: return %N.ref.loc6_50 @@ -800,27 +862,32 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @WithNontype(constants.%N) { // CHECK:STDOUT: %N.loc4_19.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%N // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WithNontype(@F.%N.loc6_6.2) { // CHECK:STDOUT: %N.loc4_19.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc6_6.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc6_6.2 => constants.%N // CHECK:STDOUT: %WithNontype.loc6_29.2 => constants.%WithNontype.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WithNontype(constants.%.5) { // CHECK:STDOUT: %N.loc4_19.2 => constants.%.5 +// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%.5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%.5) { // CHECK:STDOUT: %N.loc6_6.2 => constants.%.5 +// CHECK:STDOUT: %N.patt.loc6_6.2 => constants.%.5 // CHECK:STDOUT: %WithNontype.loc6_29.2 => constants.%WithNontype.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/deduce/int_float.carbon b/toolchain/check/testdata/deduce/int_float.carbon index 797e14b7efc7..f2137d695036 100644 --- a/toolchain/check/testdata/deduce/int_float.carbon +++ b/toolchain/check/testdata/deduce/int_float.carbon @@ -43,6 +43,7 @@ fn G(a: f64) -> i32 { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %.2: type = int_type signed, %N [symbolic] @@ -69,7 +70,7 @@ fn G(a: f64) -> i32 { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+16, loaded [template = constants.%Int] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -80,61 +81,65 @@ fn G(a: f64) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc4_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_6.1, runtime_param [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)] // CHECK:STDOUT: %n.patt: @F.%.loc4_26 (%.2) = binding_pattern n +// CHECK:STDOUT: %n.param_patt: @F.%.loc4_26 (%.2) = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_10.1: type = value_of_initializer %int.make_type_32.loc4_10 [template = i32] // CHECK:STDOUT: %.loc4_10.2: type = converted %int.make_type_32.loc4_10, %.loc4_10.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_6.2 (constants.%N)] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %N.ref.loc4: i32 = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)] // CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%N.ref.loc4) [symbolic = %.loc4_26 (constants.%.2)] // CHECK:STDOUT: %.loc4_28.1: type = value_of_initializer %int.make_type_signed [symbolic = %.loc4_26 (constants.%.2)] // CHECK:STDOUT: %.loc4_28.2: type = converted %int.make_type_signed, %.loc4_28.1 [symbolic = %.loc4_26 (constants.%.2)] -// CHECK:STDOUT: %n.param: @F.%.loc4_26 (%.2) = param n, runtime_param0 -// CHECK:STDOUT: %n: @F.%.loc4_26 (%.2) = bind_name n, %n.param // CHECK:STDOUT: %int.make_type_32.loc4_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_34.1: type = value_of_initializer %int.make_type_32.loc4_34 [template = i32] // CHECK:STDOUT: %.loc4_34.2: type = converted %int.make_type_32.loc4_34, %.loc4_34.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc4_6: i32 = param runtime_param +// CHECK:STDOUT: %N.loc4_6.1: i32 = bind_symbolic_name N, 0, %param.loc4_6 [symbolic = %N.loc4_6.2 (constants.%N)] +// CHECK:STDOUT: %param.loc4_15: @F.%.loc4_26 (%.2) = param runtime_param0 +// CHECK:STDOUT: %n: @F.%.loc4_26 (%.2) = bind_name n, %param.loc4_15 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %a.patt: %.4 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.4 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc8_9.1: i32 = int_literal 64 [template = constants.%.3] // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_9.1) [template = constants.%.4] // CHECK:STDOUT: %.loc8_9.2: type = value_of_initializer %int.make_type_signed [template = constants.%.4] // CHECK:STDOUT: %.loc8_9.3: type = converted %int.make_type_signed, %.loc8_9.2 [template = constants.%.4] -// CHECK:STDOUT: %a.param: %.4 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.4 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_17.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc8_17.2: type = converted %int.make_type_32, %.loc8_17.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %a: %.4 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%size: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%size.param_patt: i32) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc4_6.1: i32) { // CHECK:STDOUT: %N.loc4_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_6.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc4_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)] // CHECK:STDOUT: %.loc4_26: type = int_type signed, %N.loc4_6.2 [symbolic = %.loc4_26 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.loc4_6.1: i32](%n: @F.%.loc4_26 (%.2)) -> i32 { +// CHECK:STDOUT: fn[%N.param_patt: i32](%n.param_patt: @F.%.loc4_26 (%.2)) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc5: i32 = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)] // CHECK:STDOUT: return %N.ref.loc5 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%a: %.4) -> i32 { +// CHECK:STDOUT: fn @G(%a.param_patt: %.4) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %a.ref: %.4 = name_ref a, %a @@ -147,11 +152,13 @@ fn G(a: f64) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc4_6.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc4_6.2 => constants.%N // CHECK:STDOUT: %.loc4_26 => constants.%.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%.3) { // CHECK:STDOUT: %N.loc4_6.2 => constants.%.3 +// CHECK:STDOUT: %N.patt.loc4_6.2 => constants.%.3 // CHECK:STDOUT: %.loc4_26 => constants.%.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -164,6 +171,7 @@ fn G(a: f64) -> i32 { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -187,7 +195,7 @@ fn G(a: f64) -> i32 { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -198,60 +206,64 @@ fn G(a: f64) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc8_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc8_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc8_6.1, runtime_param [symbolic = %N.patt.loc8_6.2 (constants.%N.patt)] // CHECK:STDOUT: %n.patt: = binding_pattern n +// CHECK:STDOUT: %n.param_patt: = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc8_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32.loc8_10 [template = i32] // CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_32.loc8_10, %.loc8_10.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc8_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc8_6.2 (constants.%N)] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.2 [template = constants.%Float] // CHECK:STDOUT: %N.ref.loc8: i32 = name_ref N, %N.loc8_6.1 [symbolic = %N.loc8_6.2 (constants.%N)] // CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%N.ref.loc8) // CHECK:STDOUT: %.loc8_30.1: type = value_of_initializer %float.make_type // CHECK:STDOUT: %.loc8_30.2: type = converted %float.make_type, %.loc8_30.1 -// CHECK:STDOUT: %n.param: = param n, runtime_param0 -// CHECK:STDOUT: %n: = bind_name n, %n.param // CHECK:STDOUT: %int.make_type_32.loc8_36: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_36.1: type = value_of_initializer %int.make_type_32.loc8_36 [template = i32] // CHECK:STDOUT: %.loc8_36.2: type = converted %int.make_type_32.loc8_36, %.loc8_36.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc8_6: i32 = param runtime_param +// CHECK:STDOUT: %N.loc8_6.1: i32 = bind_symbolic_name N, 0, %param.loc8_6 [symbolic = %N.loc8_6.2 (constants.%N)] +// CHECK:STDOUT: %param.loc8_15: = param runtime_param0 +// CHECK:STDOUT: %n: = bind_name n, %param.loc8_15 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: f64 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc12_9.1: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_9.1) [template = f64] // CHECK:STDOUT: %.loc12_9.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc12_9.3: type = converted %float.make_type, %.loc12_9.2 [template = f64] -// CHECK:STDOUT: %a.param: f64 = param a, runtime_param0 -// CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_17.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_17.2: type = converted %int.make_type_32, %.loc12_17.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: f64 = param runtime_param0 +// CHECK:STDOUT: %a: f64 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc8_6.1: i32) { // CHECK:STDOUT: %N.loc8_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc8_6.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc8_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc8_6.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.loc8_6.1: i32](%n: ) -> i32 { +// CHECK:STDOUT: fn[%N.param_patt: i32](%n.param_patt: ) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc9: i32 = name_ref N, %N.loc8_6.1 [symbolic = %N.loc8_6.2 (constants.%N)] // CHECK:STDOUT: return %N.ref.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%a: f64) -> i32 { +// CHECK:STDOUT: fn @G(%a.param_patt: f64) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -260,5 +272,6 @@ fn G(a: f64) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc8_6.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc8_6.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 799099c3e40f..8f922cb30c4a 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -60,7 +60,9 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.3: type = tuple_type (type, type) [template] // CHECK:STDOUT: %.4: type = tuple_type (%T, %U) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -102,34 +104,38 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %T.patt.loc7_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc7_6.1, runtime_param [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %U.patt.loc7_16.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc7_16.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc7_16.1, runtime_param [symbolic = %U.patt.loc7_16.2 (constants.%U.patt)] // CHECK:STDOUT: %pair.patt: @F.%.loc7_37.3 (%.4) = binding_pattern pair +// CHECK:STDOUT: %pair.param_patt: @F.%.loc7_37.3 (%.4) = param_pattern %pair.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_6.2 (constants.%T)] -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc7_16.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc7_16.2 (constants.%U)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %U.ref.loc7_36: type = name_ref U, %U.loc7_16.1 [symbolic = %U.loc7_16.2 (constants.%U)] // CHECK:STDOUT: %.loc7_37.1: %.3 = tuple_literal (%T.ref, %U.ref.loc7_36) // CHECK:STDOUT: %.loc7_37.2: type = converted %.loc7_37.1, constants.%.4 [symbolic = %.loc7_37.3 (constants.%.4)] -// CHECK:STDOUT: %pair.param: @F.%.loc7_37.3 (%.4) = param pair, runtime_param0 -// CHECK:STDOUT: %pair: @F.%.loc7_37.3 (%.4) = bind_name pair, %pair.param // CHECK:STDOUT: %U.ref.loc7_43: type = name_ref U, %U.loc7_16.1 [symbolic = %U.loc7_16.2 (constants.%U)] // CHECK:STDOUT: %return: ref @F.%U.loc7_16.2 (%U) = var +// CHECK:STDOUT: %param.loc7_6: type = param runtime_param +// CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %param.loc7_6 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc7_16: type = param runtime_param +// CHECK:STDOUT: %U.loc7_16.1: type = bind_symbolic_name U, 1, %param.loc7_16 [symbolic = %U.loc7_16.2 (constants.%U)] +// CHECK:STDOUT: %param.loc7_26: @F.%.loc7_37.3 (%.4) = param runtime_param0 +// CHECK:STDOUT: %pair: @F.%.loc7_37.3 (%.4) = bind_name pair, %param.loc7_26 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %pair.patt: %.8 = binding_pattern pair +// CHECK:STDOUT: %pair.param_patt: %.8 = param_pattern %pair.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %D.ref.loc9_16: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %.loc9_17.1: %.3 = tuple_literal (%C.ref, %D.ref.loc9_16) // CHECK:STDOUT: %.loc9_17.2: type = converted %.loc9_17.1, constants.%.8 [template = constants.%.8] -// CHECK:STDOUT: %pair.param: %.8 = param pair, runtime_param0 -// CHECK:STDOUT: %pair: %.8 = bind_name pair, %pair.param // CHECK:STDOUT: %D.ref.loc9_23: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %return: ref %D = var +// CHECK:STDOUT: %param: %.8 = param runtime_param0 +// CHECK:STDOUT: %pair: %.8 = bind_name pair, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -149,13 +155,15 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc7_6.1: type, %U.loc7_16.1: type) { // CHECK:STDOUT: %T.loc7_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc7_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)] // CHECK:STDOUT: %U.loc7_16.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc7_16.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc7_16.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc7_16.2 (constants.%U.patt)] // CHECK:STDOUT: %.loc7_37.3: type = tuple_type (@F.%T.loc7_6.2 (%T), @F.%U.loc7_16.2 (%U)) [symbolic = %.loc7_37.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc7_54.2: = specific_function constants.%F, @F(%T.loc7_6.2, %U.loc7_16.2) [symbolic = %.loc7_54.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc7_6.1: type, %U.loc7_16.1: type](%pair: @F.%.loc7_37.3 (%.4)) -> @F.%U.loc7_16.2 (%U) { +// CHECK:STDOUT: fn[%T.param_patt: type, %U.param_patt: type](%pair.param_patt: @F.%.loc7_37.3 (%.4)) -> @F.%U.loc7_16.2 (%U) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %pair.ref: @F.%.loc7_37.3 (%.4) = name_ref pair, %pair @@ -167,7 +175,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%pair: %.8) -> %return: %D { +// CHECK:STDOUT: fn @G(%pair.param_patt: %.8) -> %return: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %pair.ref: %.8 = name_ref pair, %pair @@ -179,7 +187,9 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T // CHECK:STDOUT: %U.loc7_16.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc7_16.2 => constants.%U // CHECK:STDOUT: %.loc7_37.3 => constants.%.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -188,13 +198,17 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(@F.%T.loc7_6.2, @F.%U.loc7_16.2) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T // CHECK:STDOUT: %U.loc7_16.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc7_16.2 => constants.%U // CHECK:STDOUT: %.loc7_37.3 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C, constants.%D) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%C // CHECK:STDOUT: %U.loc7_16.2 => constants.%D +// CHECK:STDOUT: %U.patt.loc7_16.2 => constants.%D // CHECK:STDOUT: %.loc7_37.3 => constants.%.8 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -210,13 +224,16 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %.2: type = tuple_type (type, type) [template] // CHECK:STDOUT: %.3: type = tuple_type (i32, i32) [template] // CHECK:STDOUT: %Pair: %.3 = bind_symbolic_name Pair, 0 [symbolic] +// CHECK:STDOUT: %Pair.patt: %.3 = symbolic_binding_pattern Pair, 0 [symbolic] // CHECK:STDOUT: %HasPair.type: type = generic_class_type @HasPair [template] // CHECK:STDOUT: %HasPair.1: %HasPair.type = struct_value () [template] // CHECK:STDOUT: %HasPair.2: type = class_type @HasPair, @HasPair(%Pair) [symbolic] // CHECK:STDOUT: %.4: type = struct_type {} [template] // CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: %A: i32 = bind_symbolic_name A, 0 [symbolic] +// CHECK:STDOUT: %A.patt: i32 = symbolic_binding_pattern A, 0 [symbolic] // CHECK:STDOUT: %B: i32 = bind_symbolic_name B, 1 [symbolic] +// CHECK:STDOUT: %B.patt: i32 = symbolic_binding_pattern B, 1 [symbolic] // CHECK:STDOUT: %.6: type = ptr_type %.3 [template] // CHECK:STDOUT: %tuple.1: %.3 = tuple_value (%A, %B) [symbolic] // CHECK:STDOUT: %HasPair.3: type = class_type @HasPair, @HasPair(%tuple.1) [symbolic] @@ -256,7 +273,8 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasPair.decl: %HasPair.type = class_decl @HasPair [template = constants.%HasPair.1] { -// CHECK:STDOUT: %Pair.patt: %.3 = symbolic_binding_pattern Pair, 0 +// CHECK:STDOUT: %Pair.patt.loc4_15.1: %.3 = symbolic_binding_pattern Pair, 0 [symbolic = %Pair.patt.loc4_15.2 (constants.%Pair.patt)] +// CHECK:STDOUT: %Pair.param_patt: %.3 = param_pattern %Pair.patt.loc4_15.1, runtime_param [symbolic = %Pair.patt.loc4_15.2 (constants.%Pair.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc4_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc4_28: init type = call constants.%Int32() [template = i32] @@ -266,24 +284,23 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %.loc4_31.4: type = value_of_initializer %int.make_type_32.loc4_28 [template = i32] // CHECK:STDOUT: %.loc4_31.5: type = converted %int.make_type_32.loc4_28, %.loc4_31.4 [template = i32] // CHECK:STDOUT: %.loc4_31.6: type = converted %.loc4_31.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: %Pair.param: %.3 = param Pair, runtime_param -// CHECK:STDOUT: %Pair.loc4_15.1: %.3 = bind_symbolic_name Pair, 0, %Pair.param [symbolic = %Pair.loc4_15.2 (constants.%Pair)] +// CHECK:STDOUT: %param: %.3 = param runtime_param +// CHECK:STDOUT: %Pair.loc4_15.1: %.3 = bind_symbolic_name Pair, 0, %param [symbolic = %Pair.loc4_15.2 (constants.%Pair)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %A.patt: i32 = symbolic_binding_pattern A, 0 -// CHECK:STDOUT: %B.patt: i32 = symbolic_binding_pattern B, 1 +// CHECK:STDOUT: %A.patt.loc6_6.1: i32 = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)] +// CHECK:STDOUT: %A.param_patt: i32 = param_pattern %A.patt.loc6_6.1, runtime_param [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)] +// CHECK:STDOUT: %B.patt.loc6_15.1: i32 = symbolic_binding_pattern B, 1 [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)] +// CHECK:STDOUT: %B.param_patt: i32 = param_pattern %B.patt.loc6_15.1, runtime_param [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)] // CHECK:STDOUT: %h.patt: @F.%HasPair.loc6_34.2 (%HasPair.3) = binding_pattern h +// CHECK:STDOUT: %h.param_patt: @F.%HasPair.loc6_34.2 (%HasPair.3) = param_pattern %h.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6_10 [template = i32] // CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6_10, %.loc6_10.1 [template = i32] -// CHECK:STDOUT: %A.param: i32 = param A, runtime_param -// CHECK:STDOUT: %A.loc6_6.1: i32 = bind_symbolic_name A, 0, %A.param [symbolic = %A.loc6_6.2 (constants.%A)] // CHECK:STDOUT: %int.make_type_32.loc6_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_19.1: type = value_of_initializer %int.make_type_32.loc6_19 [template = i32] // CHECK:STDOUT: %.loc6_19.2: type = converted %int.make_type_32.loc6_19, %.loc6_19.1 [template = i32] -// CHECK:STDOUT: %B.param: i32 = param B, runtime_param -// CHECK:STDOUT: %B.loc6_15.1: i32 = bind_symbolic_name B, 1, %B.param [symbolic = %B.loc6_15.2 (constants.%B)] // CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [template = constants.%HasPair.1] // CHECK:STDOUT: %A.ref: i32 = name_ref A, %A.loc6_6.1 [symbolic = %A.loc6_6.2 (constants.%A)] // CHECK:STDOUT: %B.ref.loc6_39: i32 = name_ref B, %B.loc6_15.1 [symbolic = %B.loc6_15.2 (constants.%B)] @@ -291,15 +308,20 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %tuple.loc6_40.1: %.3 = tuple_value (%A.ref, %B.ref.loc6_39) [symbolic = %tuple.loc6_40.2 (constants.%tuple.1)] // CHECK:STDOUT: %.loc6_34: %.3 = converted %.loc6_40, %tuple.loc6_40.1 [symbolic = %tuple.loc6_40.2 (constants.%tuple.1)] // CHECK:STDOUT: %HasPair.loc6_34.1: type = class_type @HasPair, @HasPair(constants.%tuple.1) [symbolic = %HasPair.loc6_34.2 (constants.%HasPair.3)] -// CHECK:STDOUT: %h.param: @F.%HasPair.loc6_34.2 (%HasPair.3) = param h, runtime_param0 -// CHECK:STDOUT: %h: @F.%HasPair.loc6_34.2 (%HasPair.3) = bind_name h, %h.param // CHECK:STDOUT: %int.make_type_32.loc6_47: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_47.1: type = value_of_initializer %int.make_type_32.loc6_47 [template = i32] // CHECK:STDOUT: %.loc6_47.2: type = converted %int.make_type_32.loc6_47, %.loc6_47.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc6_6: i32 = param runtime_param +// CHECK:STDOUT: %A.loc6_6.1: i32 = bind_symbolic_name A, 0, %param.loc6_6 [symbolic = %A.loc6_6.2 (constants.%A)] +// CHECK:STDOUT: %param.loc6_15: i32 = param runtime_param +// CHECK:STDOUT: %B.loc6_15.1: i32 = bind_symbolic_name B, 1, %param.loc6_15 [symbolic = %B.loc6_15.2 (constants.%B)] +// CHECK:STDOUT: %param.loc6_24: @F.%HasPair.loc6_34.2 (%HasPair.3) = param runtime_param0 +// CHECK:STDOUT: %h: @F.%HasPair.loc6_34.2 (%HasPair.3) = bind_name h, %param.loc6_24 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %h.patt: %HasPair.4 = binding_pattern h +// CHECK:STDOUT: %h.param_patt: %HasPair.4 = param_pattern %h.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [template = constants.%HasPair.1] // CHECK:STDOUT: %.loc8_18: i32 = int_literal 1 [template = constants.%.8] @@ -308,17 +330,18 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %tuple: %.3 = tuple_value (%.loc8_18, %.loc8_21) [template = constants.%tuple.2] // CHECK:STDOUT: %.loc8_16: %.3 = converted %.loc8_22, %tuple [template = constants.%tuple.2] // CHECK:STDOUT: %HasPair: type = class_type @HasPair, @HasPair(constants.%tuple.2) [template = constants.%HasPair.4] -// CHECK:STDOUT: %h.param: %HasPair.4 = param h, runtime_param0 -// CHECK:STDOUT: %h: %HasPair.4 = bind_name h, %h.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_29.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc8_29.2: type = converted %int.make_type_32, %.loc8_29.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %HasPair.4 = param runtime_param0 +// CHECK:STDOUT: %h: %HasPair.4 = bind_name h, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @HasPair(%Pair.loc4_15.1: %.3) { // CHECK:STDOUT: %Pair.loc4_15.2: %.3 = bind_symbolic_name Pair, 0 [symbolic = %Pair.loc4_15.2 (constants.%Pair)] +// CHECK:STDOUT: %Pair.patt.loc4_15.2: %.3 = symbolic_binding_pattern Pair, 0 [symbolic = %Pair.patt.loc4_15.2 (constants.%Pair.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -334,20 +357,22 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%A.loc6_6.1: i32, %B.loc6_15.1: i32) { // CHECK:STDOUT: %A.loc6_6.2: i32 = bind_symbolic_name A, 0 [symbolic = %A.loc6_6.2 (constants.%A)] +// CHECK:STDOUT: %A.patt.loc6_6.2: i32 = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)] // CHECK:STDOUT: %B.loc6_15.2: i32 = bind_symbolic_name B, 1 [symbolic = %B.loc6_15.2 (constants.%B)] +// CHECK:STDOUT: %B.patt.loc6_15.2: i32 = symbolic_binding_pattern B, 1 [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)] // CHECK:STDOUT: %tuple.loc6_40.2: %.3 = tuple_value (%A.loc6_6.2, %B.loc6_15.2) [symbolic = %tuple.loc6_40.2 (constants.%tuple.1)] // CHECK:STDOUT: %HasPair.loc6_34.2: type = class_type @HasPair, @HasPair(%tuple.loc6_40.2) [symbolic = %HasPair.loc6_34.2 (constants.%HasPair.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%A.loc6_6.1: i32, %B.loc6_15.1: i32](%h: @F.%HasPair.loc6_34.2 (%HasPair.3)) -> i32 { +// CHECK:STDOUT: fn[%A.param_patt: i32, %B.param_patt: i32](%h.param_patt: @F.%HasPair.loc6_34.2 (%HasPair.3)) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %B.ref.loc6_60: i32 = name_ref B, %B.loc6_15.1 [symbolic = %B.loc6_15.2 (constants.%B)] // CHECK:STDOUT: return %B.ref.loc6_60 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%h: %HasPair.4) -> i32 { +// CHECK:STDOUT: fn @G(%h.param_patt: %HasPair.4) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %h.ref: %HasPair.4 = name_ref h, %h @@ -360,34 +385,42 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasPair(constants.%Pair) { // CHECK:STDOUT: %Pair.loc4_15.2 => constants.%Pair +// CHECK:STDOUT: %Pair.patt.loc4_15.2 => constants.%Pair // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasPair(constants.%tuple.1) { // CHECK:STDOUT: %Pair.loc4_15.2 => constants.%tuple.1 +// CHECK:STDOUT: %Pair.patt.loc4_15.2 => constants.%tuple.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasPair(@F.%tuple.loc6_40.2) { // CHECK:STDOUT: %Pair.loc4_15.2 => constants.%tuple.1 +// CHECK:STDOUT: %Pair.patt.loc4_15.2 => constants.%tuple.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%A, constants.%B) { // CHECK:STDOUT: %A.loc6_6.2 => constants.%A +// CHECK:STDOUT: %A.patt.loc6_6.2 => constants.%A // CHECK:STDOUT: %B.loc6_15.2 => constants.%B +// CHECK:STDOUT: %B.patt.loc6_15.2 => constants.%B // CHECK:STDOUT: %tuple.loc6_40.2 => constants.%tuple.1 // CHECK:STDOUT: %HasPair.loc6_34.2 => constants.%HasPair.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasPair(constants.%tuple.2) { // CHECK:STDOUT: %Pair.loc4_15.2 => constants.%tuple.2 +// CHECK:STDOUT: %Pair.patt.loc4_15.2 => constants.%tuple.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%.8, constants.%.9) { // CHECK:STDOUT: %A.loc6_6.2 => constants.%.8 +// CHECK:STDOUT: %A.patt.loc6_6.2 => constants.%.8 // CHECK:STDOUT: %B.loc6_15.2 => constants.%.9 +// CHECK:STDOUT: %B.patt.loc6_15.2 => constants.%.9 // CHECK:STDOUT: %tuple.loc6_40.2 => constants.%tuple.2 // CHECK:STDOUT: %HasPair.loc6_34.2 => constants.%HasPair.4 // CHECK:STDOUT: @@ -402,6 +435,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: type = tuple_type (type, type) [template] // CHECK:STDOUT: %.4: type = tuple_type (%T, %T) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -440,31 +474,34 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc7_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc7_6.1, runtime_param [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)] // CHECK:STDOUT: %pair.patt: @F.%.loc7_27.3 (%.4) = binding_pattern pair +// CHECK:STDOUT: %pair.param_patt: @F.%.loc7_27.3 (%.4) = param_pattern %pair.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc7_23: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc7_26: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %.loc7_27.1: %.3 = tuple_literal (%T.ref.loc7_23, %T.ref.loc7_26) // CHECK:STDOUT: %.loc7_27.2: type = converted %.loc7_27.1, constants.%.4 [symbolic = %.loc7_27.3 (constants.%.4)] -// CHECK:STDOUT: %pair.param: @F.%.loc7_27.3 (%.4) = param pair, runtime_param0 -// CHECK:STDOUT: %pair: @F.%.loc7_27.3 (%.4) = bind_name pair, %pair.param // CHECK:STDOUT: %T.ref.loc7_33: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %return: ref @F.%T.loc7_6.2 (%T) = var +// CHECK:STDOUT: %param.loc7_6: type = param runtime_param +// CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %param.loc7_6 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc7_16: @F.%.loc7_27.3 (%.4) = param runtime_param0 +// CHECK:STDOUT: %pair: @F.%.loc7_27.3 (%.4) = bind_name pair, %param.loc7_16 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %pair.patt: %.6 = binding_pattern pair +// CHECK:STDOUT: %pair.param_patt: %.6 = param_pattern %pair.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %D.ref.loc9_16: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %.loc9_17.1: %.3 = tuple_literal (%C.ref, %D.ref.loc9_16) // CHECK:STDOUT: %.loc9_17.2: type = converted %.loc9_17.1, constants.%.6 [template = constants.%.6] -// CHECK:STDOUT: %pair.param: %.6 = param pair, runtime_param0 -// CHECK:STDOUT: %pair: %.6 = bind_name pair, %pair.param // CHECK:STDOUT: %D.ref.loc9_23: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %return: ref %D = var +// CHECK:STDOUT: %param: %.6 = param runtime_param0 +// CHECK:STDOUT: %pair: %.6 = bind_name pair, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -484,12 +521,13 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc7_6.1: type) { // CHECK:STDOUT: %T.loc7_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc7_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc7_27.3: type = tuple_type (@F.%T.loc7_6.2 (%T), @F.%T.loc7_6.2 (%T)) [symbolic = %.loc7_27.3 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc7_6.1: type](%pair: @F.%.loc7_27.3 (%.4)) -> @F.%T.loc7_6.2 (%T); +// CHECK:STDOUT: fn[%T.param_patt: type](%pair.param_patt: @F.%.loc7_27.3 (%.4)) -> @F.%T.loc7_6.2 (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%pair: %.6) -> %return: %D { +// CHECK:STDOUT: fn @G(%pair.param_patt: %.6) -> %return: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %pair.ref: %.6 = name_ref pair, %pair @@ -498,6 +536,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T // CHECK:STDOUT: %.loc7_27.3 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/type_operator.carbon b/toolchain/check/testdata/deduce/type_operator.carbon index 99dc595a0a70..234d352dff3b 100644 --- a/toolchain/check/testdata/deduce/type_operator.carbon +++ b/toolchain/check/testdata/deduce/type_operator.carbon @@ -69,6 +69,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: type = ptr_type %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.4: type = tuple_type () [template] @@ -104,27 +105,30 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6_6.1, runtime_param [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %p.patt: @F.%.loc6_20.2 (%.3) = binding_pattern p +// CHECK:STDOUT: %p.param_patt: @F.%.loc6_20.2 (%.3) = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc6_19: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %.loc6_20.1: type = ptr_type %T [symbolic = %.loc6_20.2 (constants.%.3)] -// CHECK:STDOUT: %p.param: @F.%.loc6_20.2 (%.3) = param p, runtime_param0 -// CHECK:STDOUT: %p: @F.%.loc6_20.2 (%.3) = bind_name p, %p.param // CHECK:STDOUT: %T.ref.loc6_26: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = var +// CHECK:STDOUT: %param.loc6_6: type = param runtime_param +// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %param.loc6_6 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc6_16: @F.%.loc6_20.2 (%.3) = param runtime_param0 +// CHECK:STDOUT: %p: @F.%.loc6_20.2 (%.3) = bind_name p, %param.loc6_16 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %p.patt: %.6 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.6 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8_9: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc8_10: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %p.param: %.6 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.6 = bind_name p, %p.param // CHECK:STDOUT: %C.ref.loc8_16: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param: %.6 = param runtime_param0 +// CHECK:STDOUT: %p: %.6 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -137,12 +141,13 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc6_20.2: type = ptr_type @F.%T.loc6_6.2 (%T) [symbolic = %.loc6_20.2 (constants.%.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc6_37.2: = specific_function constants.%F, @F(%T.loc6_6.2) [symbolic = %.loc6_37.2 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc6_6.1: type](%p: @F.%.loc6_20.2 (%.3)) -> @F.%T.loc6_6.2 (%T) { +// CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%.loc6_20.2 (%.3)) -> @F.%T.loc6_6.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: @F.%.loc6_20.2 (%.3) = name_ref p, %p @@ -154,7 +159,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p: %.6) -> %return: %C { +// CHECK:STDOUT: fn @G(%p.param_patt: %.6) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %.6 = name_ref p, %p @@ -166,6 +171,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T // CHECK:STDOUT: %.loc6_20.2 => constants.%.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -174,11 +180,13 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(@F.%T.loc6_6.2) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T // CHECK:STDOUT: %.loc6_20.2 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%C // CHECK:STDOUT: %.loc6_20.2 => constants.%.6 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -192,6 +200,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: type = const_type %T [symbolic] // CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -229,29 +238,32 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6_6.1, runtime_param [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %p.patt: @F.%.loc6_26.2 (%.4) = binding_pattern p +// CHECK:STDOUT: %p.param_patt: @F.%.loc6_26.2 (%.4) = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %.loc6_19.1: type = const_type %T [symbolic = %.loc6_19.2 (constants.%.3)] // CHECK:STDOUT: %.loc6_26.1: type = ptr_type %.3 [symbolic = %.loc6_26.2 (constants.%.4)] -// CHECK:STDOUT: %p.param: @F.%.loc6_26.2 (%.4) = param p, runtime_param0 -// CHECK:STDOUT: %p: @F.%.loc6_26.2 (%.4) = bind_name p, %p.param // CHECK:STDOUT: %T.ref.loc6_32: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = var +// CHECK:STDOUT: %param.loc6_6: type = param runtime_param +// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %param.loc6_6 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc6_16: @F.%.loc6_26.2 (%.4) = param runtime_param0 +// CHECK:STDOUT: %p: @F.%.loc6_26.2 (%.4) = bind_name p, %param.loc6_16 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %p.patt: %.8 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.8 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc8_9: type = const_type %C [template = constants.%.7] // CHECK:STDOUT: %.loc8_16: type = ptr_type %.7 [template = constants.%.8] -// CHECK:STDOUT: %p.param: %.8 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.8 = bind_name p, %p.param // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param: %.8 = param runtime_param0 +// CHECK:STDOUT: %p: %.8 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -264,13 +276,14 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc6_19.2: type = const_type @F.%T.loc6_6.2 (%T) [symbolic = %.loc6_19.2 (constants.%.3)] // CHECK:STDOUT: %.loc6_26.2: type = ptr_type @F.%.loc6_19.2 (%.3) [symbolic = %.loc6_26.2 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc6_43.2: = specific_function constants.%F, @F(%T.loc6_6.2) [symbolic = %.loc6_43.2 (constants.%.6)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc6_6.1: type](%p: @F.%.loc6_26.2 (%.4)) -> @F.%T.loc6_6.2 (%T) { +// CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%.loc6_26.2 (%.4)) -> @F.%T.loc6_6.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: @F.%.loc6_26.2 (%.4) = name_ref p, %p @@ -282,7 +295,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p: %.8) -> %return: %C { +// CHECK:STDOUT: fn @G(%p.param_patt: %.8) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p @@ -294,6 +307,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T // CHECK:STDOUT: %.loc6_19.2 => constants.%.3 // CHECK:STDOUT: %.loc6_26.2 => constants.%.4 // CHECK:STDOUT: @@ -303,12 +317,14 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(@F.%T.loc6_6.2) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T // CHECK:STDOUT: %.loc6_19.2 => constants.%.3 // CHECK:STDOUT: %.loc6_26.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%C // CHECK:STDOUT: %.loc6_19.2 => constants.%.7 // CHECK:STDOUT: %.loc6_26.2 => constants.%.8 // CHECK:STDOUT: @@ -323,6 +339,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: type = ptr_type %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.4: type = tuple_type () [template] @@ -359,29 +376,32 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6_6.1, runtime_param [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %p.patt: @F.%.loc6_20.2 (%.3) = binding_pattern p +// CHECK:STDOUT: %p.param_patt: @F.%.loc6_20.2 (%.3) = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc6_19: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %.loc6_20.1: type = ptr_type %T [symbolic = %.loc6_20.2 (constants.%.3)] -// CHECK:STDOUT: %p.param: @F.%.loc6_20.2 (%.3) = param p, runtime_param0 -// CHECK:STDOUT: %p: @F.%.loc6_20.2 (%.3) = bind_name p, %p.param // CHECK:STDOUT: %T.ref.loc6_26: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = var +// CHECK:STDOUT: %param.loc6_6: type = param runtime_param +// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %param.loc6_6 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc6_16: @F.%.loc6_20.2 (%.3) = param runtime_param0 +// CHECK:STDOUT: %p: @F.%.loc6_20.2 (%.3) = bind_name p, %param.loc6_16 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %p.patt: %.7 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.7 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc8_9: type = const_type %C [template = constants.%.6] // CHECK:STDOUT: %.loc8_16: type = ptr_type %.6 [template = constants.%.7] -// CHECK:STDOUT: %p.param: %.7 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.7 = bind_name p, %p.param // CHECK:STDOUT: %C.ref.loc8_28: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc8_22: type = const_type %C [template = constants.%.6] // CHECK:STDOUT: %return: ref %.6 = var +// CHECK:STDOUT: %param: %.7 = param runtime_param0 +// CHECK:STDOUT: %p: %.7 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -394,12 +414,13 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc6_20.2: type = ptr_type @F.%T.loc6_6.2 (%T) [symbolic = %.loc6_20.2 (constants.%.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc6_37.2: = specific_function constants.%F, @F(%T.loc6_6.2) [symbolic = %.loc6_37.2 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc6_6.1: type](%p: @F.%.loc6_20.2 (%.3)) -> @F.%T.loc6_6.2 (%T) { +// CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%.loc6_20.2 (%.3)) -> @F.%T.loc6_6.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: @F.%.loc6_20.2 (%.3) = name_ref p, %p @@ -411,7 +432,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p: %.7) -> %return: %.6 { +// CHECK:STDOUT: fn @G(%p.param_patt: %.7) -> %return: %.6 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %.7 = name_ref p, %p @@ -423,6 +444,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T // CHECK:STDOUT: %.loc6_20.2 => constants.%.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -431,11 +453,13 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(@F.%T.loc6_6.2) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T // CHECK:STDOUT: %.loc6_20.2 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%.6) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%.6 +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%.6 // CHECK:STDOUT: %.loc6_20.2 => constants.%.7 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -449,6 +473,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: type = const_type %T [symbolic] // CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -485,29 +510,32 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6_6.1, runtime_param [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %p.patt: @F.%.loc6_26.2 (%.4) = binding_pattern p +// CHECK:STDOUT: %p.param_patt: @F.%.loc6_26.2 (%.4) = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %.loc6_19.1: type = const_type %T [symbolic = %.loc6_19.2 (constants.%.3)] // CHECK:STDOUT: %.loc6_26.1: type = ptr_type %.3 [symbolic = %.loc6_26.2 (constants.%.4)] -// CHECK:STDOUT: %p.param: @F.%.loc6_26.2 (%.4) = param p, runtime_param0 -// CHECK:STDOUT: %p: @F.%.loc6_26.2 (%.4) = bind_name p, %p.param // CHECK:STDOUT: %T.ref.loc6_32: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = var +// CHECK:STDOUT: %param.loc6_6: type = param runtime_param +// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %param.loc6_6 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc6_16: @F.%.loc6_26.2 (%.4) = param runtime_param0 +// CHECK:STDOUT: %p: @F.%.loc6_26.2 (%.4) = bind_name p, %param.loc6_16 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %p.patt: %.7 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.7 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8_9: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc8_10: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %p.param: %.7 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.7 = bind_name p, %p.param // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc8_16: type = const_type %C [template = constants.%.8] // CHECK:STDOUT: %return: ref %.8 = var +// CHECK:STDOUT: %param: %.7 = param runtime_param0 +// CHECK:STDOUT: %p: %.7 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -520,13 +548,14 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc6_19.2: type = const_type @F.%T.loc6_6.2 (%T) [symbolic = %.loc6_19.2 (constants.%.3)] // CHECK:STDOUT: %.loc6_26.2: type = ptr_type @F.%.loc6_19.2 (%.3) [symbolic = %.loc6_26.2 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc6_43.2: = specific_function constants.%F, @F(%T.loc6_6.2) [symbolic = %.loc6_43.2 (constants.%.6)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc6_6.1: type](%p: @F.%.loc6_26.2 (%.4)) -> @F.%T.loc6_6.2 (%T) { +// CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%.loc6_26.2 (%.4)) -> @F.%T.loc6_6.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: @F.%.loc6_26.2 (%.4) = name_ref p, %p @@ -538,7 +567,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p: %.7) -> %return: %.8 { +// CHECK:STDOUT: fn @G(%p.param_patt: %.7) -> %return: %.8 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %.7 = name_ref p, %p @@ -547,6 +576,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T // CHECK:STDOUT: %.loc6_19.2 => constants.%.3 // CHECK:STDOUT: %.loc6_26.2 => constants.%.4 // CHECK:STDOUT: @@ -556,6 +586,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(@F.%T.loc6_6.2) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T // CHECK:STDOUT: %.loc6_19.2 => constants.%.3 // CHECK:STDOUT: %.loc6_26.2 => constants.%.4 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/eval/fail_symbolic.carbon b/toolchain/check/testdata/eval/fail_symbolic.carbon index 260a8f027392..6f9c1f5b3af3 100644 --- a/toolchain/check/testdata/eval/fail_symbolic.carbon +++ b/toolchain/check/testdata/eval/fail_symbolic.carbon @@ -23,6 +23,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } @@ -49,13 +50,14 @@ fn G(N:! i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc12_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc12_6.1, runtime_param [symbolic = %N.patt.loc12_6.2 (constants.%N.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc12_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc12_6.2 (constants.%N)] +// CHECK:STDOUT: %param: i32 = param runtime_param +// CHECK:STDOUT: %N.loc12_6.1: i32 = bind_symbolic_name N, 0, %param [symbolic = %N.loc12_6.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -63,10 +65,11 @@ fn G(N:! i32) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%N.loc12_6.1: i32) { // CHECK:STDOUT: %N.loc12_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc12_6.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc12_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.loc12_6.1: i32) { +// CHECK:STDOUT: fn(%N.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc12_6.1 [symbolic = %N.loc12_6.2 (constants.%N)] @@ -81,5 +84,6 @@ fn G(N:! i32) { // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%N) { // CHECK:STDOUT: %N.loc12_6.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc12_6.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index 13b15d6874c8..5e29f3f78dff 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -19,6 +19,7 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -54,15 +55,17 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc12_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc12_6.1, runtime_param [symbolic = %T.patt.loc12_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_6.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc12_6.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc12_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc12_6.1: type) { // CHECK:STDOUT: %T.loc12_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc12_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc13_12.2: type = ptr_type @F.%T.loc12_6.2 (%T) [symbolic = %.loc13_12.2 (constants.%.2)] @@ -71,7 +74,7 @@ fn F(T:! type) { // CHECK:STDOUT: %.loc14_16.2: type = struct_type {.a: @F.%T.loc12_6.2 (%T)} [symbolic = %.loc14_16.2 (constants.%.8)] // CHECK:STDOUT: %.loc15_15.2: type = array_type constants.%.9, @F.%T.loc12_6.2 (%T) [symbolic = %.loc15_15.2 (constants.%.10)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc12_6.1: type) { +// CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %T.ref.loc13_11: type = name_ref T, %T.loc12_6.1 [symbolic = %T.loc12_6.2 (constants.%T)] // CHECK:STDOUT: %.loc13_12.1: type = ptr_type %T [symbolic = %.loc13_12.2 (constants.%.2)] @@ -96,5 +99,6 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc12_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc12_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index 8a2bf661f109..9df7e519525f 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -51,22 +51,24 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] // CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc11_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_32.loc11_27 [template = i32] // CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc11_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc11_8 +// CHECK:STDOUT: %param.loc11_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc11_16 // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] @@ -82,5 +84,5 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a: i32, %b: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/definition.carbon b/toolchain/check/testdata/function/builtin/definition.carbon index 63ee8f2d5b85..160237e498e5 100644 --- a/toolchain/check/testdata/function/builtin/definition.carbon +++ b/toolchain/check/testdata/function/builtin/definition.carbon @@ -43,26 +43,28 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] // CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc11_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_32.loc11_27 [template = i32] // CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc11_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc11_8 +// CHECK:STDOUT: %param.loc11_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc11_16 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a: i32, %b: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index 8cbb7b66dee1..5b2513fbea0b 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -76,133 +76,145 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl.loc11: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %m.patt: i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: i32 = param_pattern %m.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11_9, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %n.param.loc11: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc11: i32 = bind_name n, %n.param.loc11 // CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32] // CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32.loc11_17, %.loc11_17.1 [template = i32] -// CHECK:STDOUT: %m.param.loc11: i32 = param m, runtime_param1 -// CHECK:STDOUT: %m.loc11: i32 = bind_name m, %m.param.loc11 // CHECK:STDOUT: %int.make_type_32.loc11_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32.loc11_25 [template = i32] // CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11_25, %.loc11_25.1 [template = i32] // CHECK:STDOUT: %return.var.loc11: ref i32 = var +// CHECK:STDOUT: %param.loc11_6: i32 = param runtime_param0 +// CHECK:STDOUT: %n.loc11: i32 = bind_name n, %param.loc11_6 +// CHECK:STDOUT: %param.loc11_14: i32 = param runtime_param1 +// CHECK:STDOUT: %m.loc11: i32 = bind_name m, %param.loc11_14 // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl.loc19: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %m.patt: i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: i32 = param_pattern %m.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc19_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_9.1: type = value_of_initializer %int.make_type_32.loc19_9 [template = i32] // CHECK:STDOUT: %.loc19_9.2: type = converted %int.make_type_32.loc19_9, %.loc19_9.1 [template = i32] -// CHECK:STDOUT: %n.param.loc19: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc19: i32 = bind_name n, %n.param.loc19 // CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] // CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_32.loc19_17, %.loc19_17.1 [template = i32] -// CHECK:STDOUT: %m.param.loc19: i32 = param m, runtime_param1 -// CHECK:STDOUT: %m.loc19: i32 = bind_name m, %m.param.loc19 // CHECK:STDOUT: %int.make_type_32.loc19_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_32.loc19_25 [template = i32] // CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc19_6: i32 = param runtime_param0 +// CHECK:STDOUT: %n.loc19: i32 = bind_name n, %param.loc19_6 +// CHECK:STDOUT: %param.loc19_14: i32 = param runtime_param1 +// CHECK:STDOUT: %m.loc19: i32 = bind_name m, %param.loc19_14 // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl.loc21: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %m.patt: i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: i32 = param_pattern %m.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc21_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_9.1: type = value_of_initializer %int.make_type_32.loc21_9 [template = i32] // CHECK:STDOUT: %.loc21_9.2: type = converted %int.make_type_32.loc21_9, %.loc21_9.1 [template = i32] -// CHECK:STDOUT: %n.param.loc21: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc21: i32 = bind_name n, %n.param.loc21 // CHECK:STDOUT: %int.make_type_32.loc21_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_17.1: type = value_of_initializer %int.make_type_32.loc21_17 [template = i32] // CHECK:STDOUT: %.loc21_17.2: type = converted %int.make_type_32.loc21_17, %.loc21_17.1 [template = i32] -// CHECK:STDOUT: %m.param.loc21: i32 = param m, runtime_param1 -// CHECK:STDOUT: %m.loc21: i32 = bind_name m, %m.param.loc21 // CHECK:STDOUT: %int.make_type_32.loc21_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %int.make_type_32.loc21_25 [template = i32] // CHECK:STDOUT: %.loc21_25.2: type = converted %int.make_type_32.loc21_25, %.loc21_25.1 [template = i32] // CHECK:STDOUT: %return.var.loc21: ref i32 = var +// CHECK:STDOUT: %param.loc21_6: i32 = param runtime_param0 +// CHECK:STDOUT: %n.loc21: i32 = bind_name n, %param.loc21_6 +// CHECK:STDOUT: %param.loc21_14: i32 = param runtime_param1 +// CHECK:STDOUT: %m.loc21: i32 = bind_name m, %param.loc21_14 // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl.loc29: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %m.patt: i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: i32 = param_pattern %m.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc29_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc29_9.1: type = value_of_initializer %int.make_type_32.loc29_9 [template = i32] // CHECK:STDOUT: %.loc29_9.2: type = converted %int.make_type_32.loc29_9, %.loc29_9.1 [template = i32] -// CHECK:STDOUT: %n.param.loc29: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc29: i32 = bind_name n, %n.param.loc29 // CHECK:STDOUT: %int.make_type_32.loc29_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc29_17.1: type = value_of_initializer %int.make_type_32.loc29_17 [template = i32] // CHECK:STDOUT: %.loc29_17.2: type = converted %int.make_type_32.loc29_17, %.loc29_17.1 [template = i32] -// CHECK:STDOUT: %m.param.loc29: i32 = param m, runtime_param1 -// CHECK:STDOUT: %m.loc29: i32 = bind_name m, %m.param.loc29 // CHECK:STDOUT: %int.make_type_32.loc29_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc29_25.1: type = value_of_initializer %int.make_type_32.loc29_25 [template = i32] // CHECK:STDOUT: %.loc29_25.2: type = converted %int.make_type_32.loc29_25, %.loc29_25.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc29_6: i32 = param runtime_param0 +// CHECK:STDOUT: %n.loc29: i32 = bind_name n, %param.loc29_6 +// CHECK:STDOUT: %param.loc29_14: i32 = param runtime_param1 +// CHECK:STDOUT: %m.loc29: i32 = bind_name m, %param.loc29_14 // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl.loc31: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %m.patt: i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: i32 = param_pattern %m.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc31_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc31_9.1: type = value_of_initializer %int.make_type_32.loc31_9 [template = i32] // CHECK:STDOUT: %.loc31_9.2: type = converted %int.make_type_32.loc31_9, %.loc31_9.1 [template = i32] -// CHECK:STDOUT: %n.param.loc31: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc31: i32 = bind_name n, %n.param.loc31 // CHECK:STDOUT: %int.make_type_32.loc31_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc31_17.1: type = value_of_initializer %int.make_type_32.loc31_17 [template = i32] // CHECK:STDOUT: %.loc31_17.2: type = converted %int.make_type_32.loc31_17, %.loc31_17.1 [template = i32] -// CHECK:STDOUT: %m.param.loc31: i32 = param m, runtime_param1 -// CHECK:STDOUT: %m.loc31: i32 = bind_name m, %m.param.loc31 // CHECK:STDOUT: %int.make_type_32.loc31_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc31_25.1: type = value_of_initializer %int.make_type_32.loc31_25 [template = i32] // CHECK:STDOUT: %.loc31_25.2: type = converted %int.make_type_32.loc31_25, %.loc31_25.1 [template = i32] // CHECK:STDOUT: %return.var.loc31: ref i32 = var +// CHECK:STDOUT: %param.loc31_6: i32 = param runtime_param0 +// CHECK:STDOUT: %n.loc31: i32 = bind_name n, %param.loc31_6 +// CHECK:STDOUT: %param.loc31_14: i32 = param runtime_param1 +// CHECK:STDOUT: %m.loc31: i32 = bind_name m, %param.loc31_14 // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl.loc38: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %m.patt: i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: i32 = param_pattern %m.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc38_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc38_9.1: type = value_of_initializer %int.make_type_32.loc38_9 [template = i32] // CHECK:STDOUT: %.loc38_9.2: type = converted %int.make_type_32.loc38_9, %.loc38_9.1 [template = i32] -// CHECK:STDOUT: %n.param.loc38: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc38: i32 = bind_name n, %n.param.loc38 // CHECK:STDOUT: %int.make_type_32.loc38_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc38_17.1: type = value_of_initializer %int.make_type_32.loc38_17 [template = i32] // CHECK:STDOUT: %.loc38_17.2: type = converted %int.make_type_32.loc38_17, %.loc38_17.1 [template = i32] -// CHECK:STDOUT: %m.param.loc38: i32 = param m, runtime_param1 -// CHECK:STDOUT: %m.loc38: i32 = bind_name m, %m.param.loc38 // CHECK:STDOUT: %int.make_type_32.loc38_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc38_25.1: type = value_of_initializer %int.make_type_32.loc38_25 [template = i32] // CHECK:STDOUT: %.loc38_25.2: type = converted %int.make_type_32.loc38_25, %.loc38_25.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc38_6: i32 = param runtime_param0 +// CHECK:STDOUT: %n.loc38: i32 = bind_name n, %param.loc38_6 +// CHECK:STDOUT: %param.loc38_14: i32 = param runtime_param1 +// CHECK:STDOUT: %m.loc38: i32 = bind_name m, %param.loc38_14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @A(%n.loc19: i32, %m.loc19: i32) -> i32 = "int.sadd" { +// CHECK:STDOUT: fn @A(%n.param_patt: i32, %m.param_patt: i32) -> i32 = "int.sadd" { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc19 // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%n.loc29: i32, %m.loc29: i32) -> i32 = "int.sadd" { +// CHECK:STDOUT: fn @B(%n.param_patt: i32, %m.param_patt: i32) -> i32 = "int.sadd" { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc21 // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%n.loc38: i32, %m.loc38: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @C(%n.param_patt: i32, %m.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index 2eb4cb9a3d98..360910bb4eeb 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -89,22 +89,24 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: @F.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.1.%Self (%Self) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: @F.1.%Self (%Self) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @F.1.%Self (%Self) = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12_14: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @F.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %self.param // CHECK:STDOUT: %Self.ref.loc12_27: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_27.1: type = facet_type_access %Self.ref.loc12_27 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_27.2: type = converted %Self.ref.loc12_27, %.loc12_27.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %other.param: @F.1.%Self (%Self) = param other, runtime_param1 -// CHECK:STDOUT: %other: @F.1.%Self (%Self) = bind_name other, %other.param // CHECK:STDOUT: %Self.ref.loc12_36: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_36.1: type = facet_type_access %Self.ref.loc12_36 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_36.2: type = converted %Self.ref.loc12_36, %.loc12_36.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %return: ref @F.1.%Self (%Self) = var +// CHECK:STDOUT: %param.loc12_8: @F.1.%Self (%Self) = param runtime_param0 +// CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %param.loc12_8 +// CHECK:STDOUT: %param.loc12_20: @F.1.%Self (%Self) = param runtime_param1 +// CHECK:STDOUT: %other: @F.1.%Self (%Self) = bind_name other, %param.loc12_20 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc12: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: @@ -117,22 +119,24 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: impl @impl: %.loc15_6.2 as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %self.patt: i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: i32 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: i32 = binding_pattern other +// CHECK:STDOUT: %other.param_patt: i32 = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc16_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_14.1: type = value_of_initializer %int.make_type_32.loc16_14 [template = i32] // CHECK:STDOUT: %.loc16_14.2: type = converted %int.make_type_32.loc16_14, %.loc16_14.1 [template = i32] -// CHECK:STDOUT: %self.param: i32 = param self, runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32.loc16_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_26.1: type = value_of_initializer %int.make_type_32.loc16_26 [template = i32] // CHECK:STDOUT: %.loc16_26.2: type = converted %int.make_type_32.loc16_26, %.loc16_26.1 [template = i32] -// CHECK:STDOUT: %other.param: i32 = param other, runtime_param1 -// CHECK:STDOUT: %other: i32 = bind_name other, %other.param // CHECK:STDOUT: %int.make_type_32.loc16_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_34.1: type = value_of_initializer %int.make_type_32.loc16_34 [template = i32] // CHECK:STDOUT: %.loc16_34.2: type = converted %int.make_type_32.loc16_34, %.loc16_34.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc16_8: i32 = param runtime_param0 +// CHECK:STDOUT: %self: i32 = bind_name self, %param.loc16_8 +// CHECK:STDOUT: %param.loc16_19: i32 = param runtime_param1 +// CHECK:STDOUT: %other: i32 = bind_name other, %param.loc16_19 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15_15: = interface_witness (%F.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -144,12 +148,12 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @F.1.%Self (%Self)](%other: @F.1.%Self (%Self)) -> @F.1.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self)](%other.param_patt: @F.1.%Self (%Self)) -> @F.1.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[%self: i32](%other: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @F.2[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self diff --git a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon index 21824d6d9dac..bea14c39f1e7 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon @@ -59,22 +59,24 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %Op.decl: %Op.type = fn_decl @Op [template = constants.%Op] { // CHECK:STDOUT: %self.patt: @Op.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Op.%Self (%Self) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: @Op.%Self (%Self) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @Op.%Self (%Self) = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc7_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc7_15.1: type = facet_type_access %Self.ref.loc7_15 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc7_15.2: type = converted %Self.ref.loc7_15, %.loc7_15.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @Op.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self: @Op.%Self (%Self) = bind_name self, %self.param // CHECK:STDOUT: %Self.ref.loc7_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc7_28.1: type = facet_type_access %Self.ref.loc7_28 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc7_28.2: type = converted %Self.ref.loc7_28, %.loc7_28.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %other.param: @Op.%Self (%Self) = param other, runtime_param1 -// CHECK:STDOUT: %other: @Op.%Self (%Self) = bind_name other, %other.param // CHECK:STDOUT: %Self.ref.loc7_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc7_37.1: type = facet_type_access %Self.ref.loc7_37 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc7_37.2: type = converted %Self.ref.loc7_37, %.loc7_37.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %return: ref @Op.%Self (%Self) = var +// CHECK:STDOUT: %param.loc7_9: @Op.%Self (%Self) = param runtime_param0 +// CHECK:STDOUT: %self: @Op.%Self (%Self) = bind_name self, %param.loc7_9 +// CHECK:STDOUT: %param.loc7_21: @Op.%Self (%Self) = param runtime_param1 +// CHECK:STDOUT: %other: @Op.%Self (%Self) = bind_name other, %param.loc7_21 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc7: %.2 = assoc_entity element0, %Op.decl [template = constants.%.3] // CHECK:STDOUT: @@ -89,7 +91,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: generic fn @Op(@Add.%Self: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.%Self (%Self)](%other: @Op.%Self (%Self)) -> @Op.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Op.%Self (%Self)](%other.param_patt: @Op.%Self (%Self)) -> @Op.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op(constants.%Self) { @@ -134,9 +136,9 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//default, inst+2, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: type = import_ref Core//default, inst+6, loaded [template = constants.%Add.type] // CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+8, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//default, inst+31, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref Core//default, inst+26, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+26, unloaded +// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//default, inst+33, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref Core//default, inst+28, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+28, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -176,16 +178,18 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: impl @impl: %.loc6_6.2 as %Add.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: i32 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: i32 = binding_pattern other +// CHECK:STDOUT: %other.param_patt: i32 = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc7_15: type = name_ref Self, @impl.%.loc6_6.2 [template = i32] -// CHECK:STDOUT: %self.param: i32 = param self, runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param // CHECK:STDOUT: %Self.ref.loc7_28: type = name_ref Self, @impl.%.loc6_6.2 [template = i32] -// CHECK:STDOUT: %other.param: i32 = param other, runtime_param1 -// CHECK:STDOUT: %other: i32 = bind_name other, %other.param // CHECK:STDOUT: %Self.ref.loc7_37: type = name_ref Self, @impl.%.loc6_6.2 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc7_9: i32 = param runtime_param0 +// CHECK:STDOUT: %self: i32 = bind_name self, %param.loc7_9 +// CHECK:STDOUT: %param.loc7_21: i32 = param runtime_param1 +// CHECK:STDOUT: %other: i32 = bind_name other, %param.loc7_21 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc6_22: = interface_witness (%Op.decl) [template = constants.%.2] // CHECK:STDOUT: @@ -196,12 +200,12 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: i32](%other: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Op.1[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self)](%other: @Op.2.%Self (%Self)) -> @Op.2.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self)](%other.param_patt: @Op.2.%Self (%Self)) -> @Op.2.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon index 5a1d72eae907..0738cd5b40c1 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon @@ -41,28 +41,30 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); // CHECK:STDOUT: } // CHECK:STDOUT: %TestAdd.decl: %TestAdd.type = fn_decl @TestAdd [template = constants.%TestAdd] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_32.loc5_15 [template = i32] // CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_32.loc5_15, %.loc5_15.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc5_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int.make_type_32.loc5_23 [template = i32] // CHECK:STDOUT: %.loc5_23.2: type = converted %int.make_type_32.loc5_23, %.loc5_23.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc5_31: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_31.1: type = value_of_initializer %int.make_type_32.loc5_31 [template = i32] // CHECK:STDOUT: %.loc5_31.2: type = converted %int.make_type_32.loc5_31, %.loc5_31.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc5_12: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc5_12 +// CHECK:STDOUT: %param.loc5_20: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc5_20 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAdd(%a: i32, %b: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @TestAdd(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: --- use.carbon // CHECK:STDOUT: @@ -89,7 +91,7 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); // CHECK:STDOUT: import Core//core // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//core, inst+2, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref Core//core, inst+22, loaded [template = constants.%TestAdd] +// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref Core//core, inst+24, loaded [template = constants.%TestAdd] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -113,7 +115,7 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAdd(%a: i32, %b: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @TestAdd(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index 003fdadd289f..36b3e217857d 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -109,27 +109,30 @@ fn Main() { // CHECK:STDOUT: %Run0.decl: %Run0.type = fn_decl @Run0 [template = constants.%Run0] {} {} // CHECK:STDOUT: %Run1.decl: %Run1.type = fn_decl @Run1 [template = constants.%Run1] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_12.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_12.2: type = converted %int.make_type_32, %.loc12_12.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Run2.decl: %Run2.type = fn_decl @Run2 [template = constants.%Run2] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc13_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_32.loc13_12 [template = i32] // CHECK:STDOUT: %.loc13_12.2: type = converted %int.make_type_32.loc13_12, %.loc13_12.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc13_20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_20.1: type = value_of_initializer %int.make_type_32.loc13_20 [template = i32] // CHECK:STDOUT: %.loc13_20.2: type = converted %int.make_type_32.loc13_20, %.loc13_20.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %param.loc13_9: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc13_9 +// CHECK:STDOUT: %param.loc13_17: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc13_17 // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } @@ -141,12 +144,12 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Run1(%a: i32) { +// CHECK:STDOUT: fn @Run1(%a.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Run2(%a: i32, %b: i32) { +// CHECK:STDOUT: fn @Run2(%a.param_patt: i32, %b.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index eb455843a36d..04ea066d21b8 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -11,12 +11,12 @@ fn G(a: i32) {} fn F() { - // CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `f64` to `i32` + // CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:5: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: G(1.0); - // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:3: note: type `f64` does not implement interface `ImplicitAs` + // CHECK:STDERR: ^~~ + // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:5: note: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: G(1.0); - // CHECK:STDERR: ^~ + // CHECK:STDERR: ^~~ // CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:1: note: initializing parameter 1 of function declared here // CHECK:STDERR: fn G(a: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~ @@ -39,6 +39,7 @@ fn F() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -66,12 +67,12 @@ fn F() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -83,18 +84,20 @@ fn F() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -114,7 +117,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%a: i32) { +// CHECK:STDOUT: fn @G(%a.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -122,11 +125,11 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G] -// CHECK:STDOUT: %.loc23_5: f64 = float_literal 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc23_5.1: f64 = float_literal 1 [template = constants.%.2] // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc23_4.1: %.5 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.6] -// CHECK:STDOUT: %Convert.ref: %.5 = name_ref Convert, %.loc23_4.1 [template = constants.%.6] -// CHECK:STDOUT: %.loc23_4.2: i32 = converted %.loc23_5, [template = ] +// CHECK:STDOUT: %.loc23_5.2: %.5 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.6] +// CHECK:STDOUT: %Convert.ref: %.5 = name_ref Convert, %.loc23_5.2 [template = constants.%.6] +// CHECK:STDOUT: %.loc23_5.3: i32 = converted %.loc23_5.1, [template = ] // CHECK:STDOUT: %G.call: init %.1 = call %G.ref() [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -136,19 +139,22 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -159,6 +165,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index 98c4ae472304..7c9e45e50fa2 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -39,6 +39,7 @@ fn Run() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -66,14 +67,14 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.3: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -95,6 +96,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -112,7 +114,7 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo() -> f64 { // CHECK:STDOUT: !entry: @@ -146,19 +148,22 @@ fn Run() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -169,6 +174,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 2cb5dd50a15b..90aaabc72fd6 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -53,23 +53,24 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Echo.decl: %Echo.type = fn_decl @Echo [template = constants.%Echo] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32] // CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32.loc11_12, %.loc11_12.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc11_20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_20.1: type = value_of_initializer %int.make_type_32.loc11_20 [template = i32] // CHECK:STDOUT: %.loc11_20.2: type = converted %int.make_type_32.loc11_20, %.loc11_20.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Echo(%a: i32) -> i32 { +// CHECK:STDOUT: fn @Echo(%a.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: i32 = name_ref a, %a // CHECK:STDOUT: return %a.ref diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index d5bd2eeba63f..31736395df39 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -58,25 +58,27 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] // CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %param.loc11_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc11_8 +// CHECK:STDOUT: %param.loc11_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc11_16 // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: i32, %b.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon b/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon index 982672b20fbb..412d5d6e265e 100644 --- a/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon @@ -35,19 +35,20 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Echo.decl: %Echo.type = fn_decl @Echo [template = constants.%Echo] { // CHECK:STDOUT: %a.patt: %.1 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.1 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc11_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %a.param: %.1 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.1 = bind_name a, %a.param // CHECK:STDOUT: %.loc11_20.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc11_20.2: type = converted %.loc11_20.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %return: ref %.1 = var +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %a: %.1 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Echo(%a: %.1) -> %.1 { +// CHECK:STDOUT: fn @Echo(%a.param_patt: %.1) -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.1 = name_ref a, %a // CHECK:STDOUT: return %a.ref @@ -56,10 +57,10 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Echo.ref: %Echo.type = name_ref Echo, file.%Echo.decl [template = constants.%Echo] -// CHECK:STDOUT: %.loc16_9: %.1 = struct_literal () +// CHECK:STDOUT: %.loc16_9.1: %.1 = struct_literal () // CHECK:STDOUT: %struct: %.1 = struct_value () [template = constants.%struct] -// CHECK:STDOUT: %.loc16_7: %.1 = converted %.loc16_9, %struct [template = constants.%struct] -// CHECK:STDOUT: %Echo.call: init %.1 = call %Echo.ref(%.loc16_7) +// CHECK:STDOUT: %.loc16_9.2: %.1 = converted %.loc16_9.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %Echo.call: init %.1 = call %Echo.ref(%.loc16_9.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon b/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon index e4d6e6676b9c..d5b6caf398f2 100644 --- a/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon @@ -34,19 +34,20 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Echo.decl: %Echo.type = fn_decl @Echo [template = constants.%Echo] { // CHECK:STDOUT: %a.patt: %.1 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.1 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc11_13.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %a.param: %.1 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.1 = bind_name a, %a.param // CHECK:STDOUT: %.loc11_20.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc11_20.2: type = converted %.loc11_20.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %return: ref %.1 = var +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %a: %.1 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Echo(%a: %.1) -> %.1 { +// CHECK:STDOUT: fn @Echo(%a.param_patt: %.1) -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.1 = name_ref a, %a // CHECK:STDOUT: return %a.ref @@ -55,10 +56,10 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Echo.ref: %Echo.type = name_ref Echo, file.%Echo.decl [template = constants.%Echo] -// CHECK:STDOUT: %.loc16_9: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc16_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template = constants.%tuple] -// CHECK:STDOUT: %.loc16_7: %.1 = converted %.loc16_9, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %Echo.call: init %.1 = call %Echo.ref(%.loc16_7) +// CHECK:STDOUT: %.loc16_9.2: %.1 = converted %.loc16_9.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %Echo.call: init %.1 = call %Echo.ref(%.loc16_9.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon b/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon index 9b454798653e..f6becaee7a44 100644 --- a/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon @@ -35,24 +35,25 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %.1 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.1 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc14_13.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc14_13.2: type = converted %.loc14_13.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %self.param: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.1 = bind_name self, %self.param +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %self: %.1 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%self: %.1); +// CHECK:STDOUT: fn @F(%self.param_patt: %.1); // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc17_6: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc17_6.1: %.1 = tuple_literal () // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template = constants.%tuple] -// CHECK:STDOUT: %.loc17_4: %.1 = converted %.loc17_6, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %F.call: init %.1 = call %F.ref(%.loc17_4) +// CHECK:STDOUT: %.loc17_6.2: %.1 = converted %.loc17_6.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %F.call: init %.1 = call %F.ref(%.loc17_6.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon b/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon index d81ac9db4e45..7f2978f791fa 100644 --- a/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon @@ -34,16 +34,17 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %s.patt: %.1 = binding_pattern s +// CHECK:STDOUT: %s.param_patt: %.1 = param_pattern %s.patt, runtime_param // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc14_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc14_10.2: type = converted %.loc14_10.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %s.param: %.1 = param s, runtime_param -// CHECK:STDOUT: %s: %.1 = bind_name s, %s.param +// CHECK:STDOUT: %param: %.1 = param runtime_param +// CHECK:STDOUT: %s: %.1 = bind_name s, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%base.param: ](); +// CHECK:STDOUT: fn @F[%s.param_patt: %.1](); // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index da9543cf81a4..b25410460fe5 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -51,19 +51,20 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index e2745bad99f1..32ad9cc8e55c 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -52,19 +52,20 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index 8a7fdb9aaade..0fc16d9467a3 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -52,25 +52,27 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] // CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %param.loc11_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc11_8 +// CHECK:STDOUT: %param.loc11_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc11_16 // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: i32, %b.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index fec224cc3c90..0fa24d3754b0 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -53,25 +53,27 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] // CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %param.loc11_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc11_8 +// CHECK:STDOUT: %param.loc11_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc11_16 // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: i32, %b.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon index a2b858d34383..c817565c3de0 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -46,22 +46,24 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %a.patt: = binding_pattern a +// CHECK:STDOUT: %a.param_patt: = param_pattern %a.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32.loc14_9 [template = i32] // CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_32.loc14_9, %.loc14_9.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %int.make_type_32.loc14_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n // CHECK:STDOUT: %.loc14_25: type = ptr_type [template = ] -// CHECK:STDOUT: %a.param: = param a, runtime_param1 -// CHECK:STDOUT: %a: = bind_name a, %a.param +// CHECK:STDOUT: %param.loc14_6: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param.loc14_6 +// CHECK:STDOUT: %param.loc14_14: = param runtime_param1 +// CHECK:STDOUT: %a: = bind_name a, %param.loc14_14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n: i32, %a: ); +// CHECK:STDOUT: fn @F(%n.param_patt: i32, %a.param_patt: ); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index b525f7717651..659ea8c7069c 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -49,22 +49,24 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %n.patt.loc17_6: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt.loc17_7: i32 = param_pattern %n.patt.loc17_6, runtime_param0 // CHECK:STDOUT: %n.patt.loc17_14: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt.loc17_15: i32 = param_pattern %n.patt.loc17_14, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc17_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_9.1: type = value_of_initializer %int.make_type_32.loc17_9 [template = i32] // CHECK:STDOUT: %.loc17_9.2: type = converted %int.make_type_32.loc17_9, %.loc17_9.1 [template = i32] -// CHECK:STDOUT: %n.param.loc17_6: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n.loc17_6: i32 = bind_name n, %n.param.loc17_6 // CHECK:STDOUT: %int.make_type_32.loc17_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_17.1: type = value_of_initializer %int.make_type_32.loc17_17 [template = i32] // CHECK:STDOUT: %.loc17_17.2: type = converted %int.make_type_32.loc17_17, %.loc17_17.1 [template = i32] -// CHECK:STDOUT: %n.param.loc17_14: i32 = param n, runtime_param1 -// CHECK:STDOUT: %n.loc17_14: i32 = bind_name n, %n.param.loc17_14 +// CHECK:STDOUT: %param.loc17_6: i32 = param runtime_param0 +// CHECK:STDOUT: %n.loc17_6: i32 = bind_name n, %param.loc17_6 +// CHECK:STDOUT: %param.loc17_14: i32 = param runtime_param1 +// CHECK:STDOUT: %n.loc17_14: i32 = bind_name n, %param.loc17_14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.loc17_6: i32, %n.loc17_14: i32); +// CHECK:STDOUT: fn @F(%n.param_patt.loc17_7: i32, %n.param_patt.loc17_15: i32); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 546126c756a9..cd2b2ca5d9f7 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -304,32 +304,34 @@ import library "extern_api"; // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_32.loc5_9 [template = i32] // CHECK:STDOUT: %.loc5_9.2: type = converted %int.make_type_32.loc5_9, %.loc5_9.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param0 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc5_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_17.1: type = value_of_initializer %int.make_type_32.loc5_17 [template = i32] // CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_32.loc5_17, %.loc5_17.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %b: i32 = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %c.patt: %.3 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %.3 = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: %.2 = tuple_literal (%int.make_type_32.loc6_10) // CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_32.loc6_10 [template = i32] // CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_32.loc6_10, %.loc6_14.2 [template = i32] // CHECK:STDOUT: %.loc6_14.4: type = converted %.loc6_14.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: %c.param: %.3 = param c, runtime_param0 -// CHECK:STDOUT: %c: %.3 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc6_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_25.1: type = value_of_initializer %int.make_type_32.loc6_25 [template = i32] // CHECK:STDOUT: %.loc6_25.2: type = converted %int.make_type_32.loc6_25, %.loc6_25.1 [template = i32] // CHECK:STDOUT: %.loc6_28: type = struct_type {.c: i32} [template = constants.%.4] // CHECK:STDOUT: %return: ref %.4 = var +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %c: %.3 = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %NS: = namespace [template] { @@ -342,9 +344,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c: %.3) -> %.4; +// CHECK:STDOUT: fn @C(%c.param_patt: %.3) -> %.4; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -399,32 +401,34 @@ import library "extern_api"; // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_44: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_44.1: type = value_of_initializer %int.make_type_32.loc5_44 [template = i32] // CHECK:STDOUT: %.loc5_44.2: type = converted %int.make_type_32.loc5_44, %.loc5_44.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param0 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc5_52: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_52.1: type = value_of_initializer %int.make_type_32.loc5_52 [template = i32] // CHECK:STDOUT: %.loc5_52.2: type = converted %int.make_type_32.loc5_52, %.loc5_52.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %b: i32 = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %c.patt: %.3 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %.3 = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_45: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_49.1: %.2 = tuple_literal (%int.make_type_32.loc6_45) // CHECK:STDOUT: %.loc6_49.2: type = value_of_initializer %int.make_type_32.loc6_45 [template = i32] // CHECK:STDOUT: %.loc6_49.3: type = converted %int.make_type_32.loc6_45, %.loc6_49.2 [template = i32] // CHECK:STDOUT: %.loc6_49.4: type = converted %.loc6_49.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: %c.param: %.3 = param c, runtime_param0 -// CHECK:STDOUT: %c: %.3 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc6_60: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_60.1: type = value_of_initializer %int.make_type_32.loc6_60 [template = i32] // CHECK:STDOUT: %.loc6_60.2: type = converted %int.make_type_32.loc6_60, %.loc6_60.1 [template = i32] // CHECK:STDOUT: %.loc6_63: type = struct_type {.c: i32} [template = constants.%.4] // CHECK:STDOUT: %return: ref %.4 = var +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %c: %.3 = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %NS: = namespace [template] { @@ -437,9 +441,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @B(%b: i32) -> i32; +// CHECK:STDOUT: extern fn @B(%b.param_patt: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @C(%c: %.3) -> %.4; +// CHECK:STDOUT: extern fn @C(%c.param_patt: %.3) -> %.4; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -469,14 +473,14 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+43, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+46, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+49, loaded +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+23, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+45, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+48, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+51, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+50, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+52, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude @@ -536,9 +540,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c: %.4) -> %.3; +// CHECK:STDOUT: fn @C(%c.param_patt: %.4) -> %.3; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -555,10 +559,10 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %.loc8_23: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc8_25: %.4 = tuple_literal (%.loc8_23) +// CHECK:STDOUT: %.loc8_25.1: %.4 = tuple_literal (%.loc8_23) // CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc8_23) [template = constants.%tuple] -// CHECK:STDOUT: %.loc8_21: %.4 = converted %.loc8_25, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc8_21) +// CHECK:STDOUT: %.loc8_25.2: %.4 = converted %.loc8_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc8_25.2) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() @@ -595,14 +599,14 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+43, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+46, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+49, loaded +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+23, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+45, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+48, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+51, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = file.%E.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+50, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+52, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude @@ -638,12 +642,12 @@ import library "extern_api"; // CHECK:STDOUT: %int.make_type_32.loc23_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_16.1: type = value_of_initializer %int.make_type_32.loc23_16 [template = i32] // CHECK:STDOUT: %.loc23_16.2: type = converted %int.make_type_32.loc23_16, %.loc23_16.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param0 -// CHECK:STDOUT: %b.loc23: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc23_24: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_24.1: type = value_of_initializer %int.make_type_32.loc23_24 [template = i32] // CHECK:STDOUT: %.loc23_24.2: type = converted %int.make_type_32.loc23_24, %.loc23_24.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %b: i32 = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} { // CHECK:STDOUT: %int.make_type_32.loc32_17: init type = call constants.%Int32() [template = i32] @@ -651,13 +655,13 @@ import library "extern_api"; // CHECK:STDOUT: %.loc32_21.2: type = value_of_initializer %int.make_type_32.loc32_17 [template = i32] // CHECK:STDOUT: %.loc32_21.3: type = converted %int.make_type_32.loc32_17, %.loc32_21.2 [template = i32] // CHECK:STDOUT: %.loc32_21.4: type = converted %.loc32_21.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: %c.param: %.3 = param c, runtime_param0 -// CHECK:STDOUT: %c.loc32: %.3 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc32_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc32_32.1: type = value_of_initializer %int.make_type_32.loc32_32 [template = i32] // CHECK:STDOUT: %.loc32_32.2: type = converted %int.make_type_32.loc32_32, %.loc32_32.1 [template = i32] // CHECK:STDOUT: %.loc32_35: type = struct_type {.c: i32} [template = constants.%.4] // CHECK:STDOUT: %return.var: ref %.4 = var +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %c: %.3 = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {} @@ -690,9 +694,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b.1: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c.1: %.3) -> %.4; +// CHECK:STDOUT: fn @C(%c.param_patt: %.3) -> %.4; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -709,10 +713,10 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc54_23: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc54_25: %.3 = tuple_literal (%.loc54_23) +// CHECK:STDOUT: %.loc54_25.1: %.3 = tuple_literal (%.loc54_23) // CHECK:STDOUT: %tuple: %.3 = tuple_value (%.loc54_23) [template = constants.%tuple] -// CHECK:STDOUT: %.loc54_21: %.3 = converted %.loc54_25, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.4 = call %C.ref(%.loc54_21) +// CHECK:STDOUT: %.loc54_25.2: %.3 = converted %.loc54_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.4 = call %C.ref(%.loc54_25.2) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() @@ -749,14 +753,14 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//extern_api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+43, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+46, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+49, loaded +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, inst+23, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+45, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+48, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+51, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = file.%E.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, inst+50, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, inst+52, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude @@ -792,12 +796,12 @@ import library "extern_api"; // CHECK:STDOUT: %int.make_type_32.loc7_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_32.loc7_16 [template = i32] // CHECK:STDOUT: %.loc7_16.2: type = converted %int.make_type_32.loc7_16, %.loc7_16.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param0 -// CHECK:STDOUT: %b.loc7: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc7_24: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_24.1: type = value_of_initializer %int.make_type_32.loc7_24 [template = i32] // CHECK:STDOUT: %.loc7_24.2: type = converted %int.make_type_32.loc7_24, %.loc7_24.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %b: i32 = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} { // CHECK:STDOUT: %int.make_type_32.loc8_17: init type = call constants.%Int32() [template = i32] @@ -805,13 +809,13 @@ import library "extern_api"; // CHECK:STDOUT: %.loc8_21.2: type = value_of_initializer %int.make_type_32.loc8_17 [template = i32] // CHECK:STDOUT: %.loc8_21.3: type = converted %int.make_type_32.loc8_17, %.loc8_21.2 [template = i32] // CHECK:STDOUT: %.loc8_21.4: type = converted %.loc8_21.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: %c.param: %.3 = param c, runtime_param0 -// CHECK:STDOUT: %c.loc8: %.3 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc8_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_32.1: type = value_of_initializer %int.make_type_32.loc8_32 [template = i32] // CHECK:STDOUT: %.loc8_32.2: type = converted %int.make_type_32.loc8_32, %.loc8_32.1 [template = i32] // CHECK:STDOUT: %.loc8_35: type = struct_type {.c: i32} [template = constants.%.4] // CHECK:STDOUT: %return.var: ref %.4 = var +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %c: %.3 = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {} @@ -844,9 +848,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @B(%b.1: i32) -> i32; +// CHECK:STDOUT: extern fn @B(%b.param_patt: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @C(%c.1: %.3) -> %.4; +// CHECK:STDOUT: extern fn @C(%c.param_patt: %.3) -> %.4; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -863,10 +867,10 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc14_23: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc14_25: %.3 = tuple_literal (%.loc14_23) +// CHECK:STDOUT: %.loc14_25.1: %.3 = tuple_literal (%.loc14_23) // CHECK:STDOUT: %tuple: %.3 = tuple_value (%.loc14_23) [template = constants.%tuple] -// CHECK:STDOUT: %.loc14_21: %.3 = converted %.loc14_25, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.4 = call %C.ref(%.loc14_21) +// CHECK:STDOUT: %.loc14_25.2: %.3 = converted %.loc14_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.4 = call %C.ref(%.loc14_25.2) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() @@ -902,19 +906,19 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+43, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+46, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+49, loaded +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+23, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+45, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+48, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+51, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+50, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+52, loaded [template = constants.%E] // CHECK:STDOUT: %import_ref.7 = import_ref Main//extern_api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//extern_api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//extern_api, inst+43, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//extern_api, inst+46, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//extern_api, inst+50, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//extern_api, inst+23, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//extern_api, inst+45, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//extern_api, inst+48, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//extern_api, inst+52, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.12 // CHECK:STDOUT: import Core//prelude @@ -974,9 +978,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c: %.4) -> %.3; +// CHECK:STDOUT: fn @C(%c.param_patt: %.4) -> %.3; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -993,10 +997,10 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %.loc54_23: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc54_25: %.4 = tuple_literal (%.loc54_23) +// CHECK:STDOUT: %.loc54_25.1: %.4 = tuple_literal (%.loc54_23) // CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc54_23) [template = constants.%tuple] -// CHECK:STDOUT: %.loc54_21: %.4 = converted %.loc54_25, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc54_21) +// CHECK:STDOUT: %.loc54_25.2: %.4 = converted %.loc54_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc54_25.2) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() @@ -1032,19 +1036,19 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//extern_api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+43, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+46, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+49, loaded +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, inst+23, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+45, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+48, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+51, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, inst+50, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, inst+52, loaded [template = constants.%E] // CHECK:STDOUT: %import_ref.7 = import_ref Main//api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//api, inst+43, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//api, inst+46, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//api, inst+50, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//api, inst+23, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//api, inst+45, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//api, inst+48, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//api, inst+52, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.12 // CHECK:STDOUT: import Core//prelude @@ -1104,9 +1108,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @B(%b: i32) -> i32; +// CHECK:STDOUT: extern fn @B(%b.param_patt: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @C(%c: %.4) -> %.3; +// CHECK:STDOUT: extern fn @C(%c.param_patt: %.4) -> %.3; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -1123,10 +1127,10 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %.loc53_23: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc53_25: %.4 = tuple_literal (%.loc53_23) +// CHECK:STDOUT: %.loc53_25.1: %.4 = tuple_literal (%.loc53_23) // CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc53_23) [template = constants.%tuple] -// CHECK:STDOUT: %.loc53_21: %.4 = converted %.loc53_25, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc53_21) +// CHECK:STDOUT: %.loc53_25.2: %.4 = converted %.loc53_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc53_25.2) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() @@ -1142,14 +1146,14 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+43, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+46, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+49, loaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+23, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+45, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+48, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+51, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref Main//api, inst+50, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//api, inst+52, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -1179,14 +1183,14 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+43, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+46, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+49, loaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, inst+23, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+45, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+48, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+51, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref Main//extern_api, inst+50, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extern_api, inst+52, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon index bdd8be783a2c..0533799d7f50 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon @@ -175,10 +175,11 @@ class C { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -190,5 +191,5 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[%self: %C](); +// CHECK:STDOUT: fn @G[%self.param_patt: %C](); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon index 3243072ed1e3..60ef0a8ccbaf 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon @@ -87,28 +87,31 @@ fn E() {} // CHECK:STDOUT: %A.decl.loc19: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl.loc21: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %x.patt: %.1 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.1 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc21_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc21_10.2: type = converted %.loc21_10.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.param.loc21: %.1 = param x, runtime_param0 -// CHECK:STDOUT: %x.loc21: %.1 = bind_name x, %x.param.loc21 +// CHECK:STDOUT: %param.loc21: %.1 = param runtime_param0 +// CHECK:STDOUT: %x.loc21: %.1 = bind_name x, %param.loc21 // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl.loc29: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %x.patt: %.1 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.1 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc29_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc29_10.2: type = converted %.loc29_10.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.param.loc29: %.1 = param x, runtime_param0 -// CHECK:STDOUT: %x.loc29: %.1 = bind_name x, %x.param.loc29 +// CHECK:STDOUT: %param.loc29: %.1 = param runtime_param0 +// CHECK:STDOUT: %x.loc29: %.1 = bind_name x, %param.loc29 // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %x.patt: %.1 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.1 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc39_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc39_10.2: type = converted %.loc39_10.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.param: %.1 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.1 = bind_name x, %x.param +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %x: %.1 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl.loc41: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %D.decl.loc49: %D.type = fn_decl @D [template = constants.%D] {} {} @@ -118,11 +121,11 @@ fn E() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%x.loc21: %.1); +// CHECK:STDOUT: fn @B(%x.param_patt: %.1); // CHECK:STDOUT: // CHECK:STDOUT: fn @C(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @.1(%x: %.1); +// CHECK:STDOUT: fn @.1(%x.param_patt: %.1); // CHECK:STDOUT: // CHECK:STDOUT: fn @D() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon index a512f7dda073..604662b1c5a6 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon @@ -55,7 +55,7 @@ fn A => 0; // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A(); +// CHECK:STDOUT: fn @A; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_brace_body.carbon // CHECK:STDOUT: @@ -72,7 +72,7 @@ fn A => 0; // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A() { +// CHECK:STDOUT: fn @A { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -92,5 +92,5 @@ fn A => 0; // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A(); +// CHECK:STDOUT: fn @A; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/param_same_name.carbon b/toolchain/check/testdata/function/declaration/param_same_name.carbon index ed0e9875de1b..6a84a15c4143 100644 --- a/toolchain/check/testdata/function/declaration/param_same_name.carbon +++ b/toolchain/check/testdata/function/declaration/param_same_name.carbon @@ -48,27 +48,29 @@ fn G(a: i32); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc13_9.2: type = converted %int.make_type_32, %.loc13_9.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a: i32); +// CHECK:STDOUT: fn @F(%a.param_patt: i32); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%a: i32); +// CHECK:STDOUT: fn @G(%a.param_patt: i32); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 4534e087bfa1..f69853748948 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -156,32 +156,34 @@ fn D() {} // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_32.loc5_9 [template = i32] // CHECK:STDOUT: %.loc5_9.2: type = converted %int.make_type_32.loc5_9, %.loc5_9.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param0 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc5_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_17.1: type = value_of_initializer %int.make_type_32.loc5_17 [template = i32] // CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_32.loc5_17, %.loc5_17.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %b: i32 = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %c.patt: %.3 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %.3 = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: %.2 = tuple_literal (%int.make_type_32.loc6_10) // CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_32.loc6_10 [template = i32] // CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_32.loc6_10, %.loc6_14.2 [template = i32] // CHECK:STDOUT: %.loc6_14.4: type = converted %.loc6_14.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: %c.param: %.3 = param c, runtime_param0 -// CHECK:STDOUT: %c: %.3 = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32.loc6_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_25.1: type = value_of_initializer %int.make_type_32.loc6_25 [template = i32] // CHECK:STDOUT: %.loc6_25.2: type = converted %int.make_type_32.loc6_25, %.loc6_25.1 [template = i32] // CHECK:STDOUT: %.loc6_28: type = struct_type {.c: i32} [template = constants.%.4] // CHECK:STDOUT: %return: ref %.4 = var +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %c: %.3 = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } @@ -193,13 +195,13 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b: i32) -> i32 { +// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: i32 = name_ref b, %b // CHECK:STDOUT: return %b.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c: %.3) -> %.4 { +// CHECK:STDOUT: fn @C(%c.param_patt: %.3) -> %.4 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %.3 = name_ref c, %c // CHECK:STDOUT: %.loc6_47: i32 = int_literal 0 [template = constants.%.5] @@ -264,9 +266,9 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//fns, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, inst+23, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//fns, inst+46, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+58, unloaded +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, inst+24, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//fns, inst+48, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+60, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude @@ -315,9 +317,9 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c: %.4) -> %.3; +// CHECK:STDOUT: fn @C(%c.param_patt: %.4) -> %.3; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -330,10 +332,10 @@ fn D() {} // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %.loc8_23: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc8_25: %.4 = tuple_literal (%.loc8_23) +// CHECK:STDOUT: %.loc8_25.1: %.4 = tuple_literal (%.loc8_23) // CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc8_23) [template = constants.%tuple] -// CHECK:STDOUT: %.loc8_21: %.4 = converted %.loc8_25, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc8_21) +// CHECK:STDOUT: %.loc8_25.2: %.4 = converted %.loc8_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc8_25.2) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -352,9 +354,9 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//fns, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, inst+23, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+46, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+58, unloaded +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, inst+24, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+48, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+60, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude @@ -384,12 +386,12 @@ fn D() {} // CHECK:STDOUT: %int.make_type_32.loc23_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_9.1: type = value_of_initializer %int.make_type_32.loc23_9 [template = i32] // CHECK:STDOUT: %.loc23_9.2: type = converted %int.make_type_32.loc23_9, %.loc23_9.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param0 -// CHECK:STDOUT: %b.loc23: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc23_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_17.1: type = value_of_initializer %int.make_type_32.loc23_17 [template = i32] // CHECK:STDOUT: %.loc23_17.2: type = converted %int.make_type_32.loc23_17, %.loc23_17.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %b: i32 = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -400,7 +402,7 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b.1: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_redecl_then_def.carbon // CHECK:STDOUT: @@ -450,9 +452,9 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//fns, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//fns, inst+23, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+46, unloaded -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//fns, inst+58, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//fns, inst+24, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+48, unloaded +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//fns, inst+60, loaded [template = constants.%D] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon index dcf9c83ae300..e8c028b5cdd8 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon @@ -109,34 +109,38 @@ fn K() -> {} { return {}; } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.decl.loc19: %.type.1 = fn_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %x.patt: %.1 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.1 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc19_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc19_10.2: type = converted %.loc19_10.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.param: %.1 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.1 = bind_name x, %x.param +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %x: %.1 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %.1 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.1 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc21_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc21_10.2: type = converted %.loc21_10.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.param: %.1 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.1 = bind_name x, %x.param +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %x: %.1 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl.loc29: %.type.2 = fn_decl @.2 [template = constants.%.3] {} {} // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { // CHECK:STDOUT: %x.patt: %.1 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.1 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc31_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc31_10.2: type = converted %.loc31_10.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.param: %.1 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.1 = bind_name x, %x.param +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %x: %.1 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl.loc36: %.type.3 = fn_decl @.3 [template = constants.%.4] { // CHECK:STDOUT: %x.patt: = binding_pattern x +// CHECK:STDOUT: %x.param_patt: = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %x.param: = param x, runtime_param0 -// CHECK:STDOUT: %x: = bind_name x, %x.param +// CHECK:STDOUT: %param: = param runtime_param0 +// CHECK:STDOUT: %x: = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %I.decl: %I.type = fn_decl @I [template = constants.%I] {} {} // CHECK:STDOUT: %.decl.loc46: %.type.4 = fn_decl @.4 [template = constants.%.5] {} { @@ -164,21 +168,21 @@ fn K() -> {} { return {}; } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @.1(%x: %.1) { +// CHECK:STDOUT: fn @.1(%x.param_patt: %.1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%x: %.1); +// CHECK:STDOUT: fn @G(%x.param_patt: %.1); // CHECK:STDOUT: // CHECK:STDOUT: fn @.2() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @H(%x: %.1); +// CHECK:STDOUT: fn @H(%x.param_patt: %.1); // CHECK:STDOUT: -// CHECK:STDOUT: fn @.3(%x: ) { +// CHECK:STDOUT: fn @.3(%x.param_patt: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon index 4fc8ebe5c3eb..5a95897fc002 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon @@ -82,10 +82,10 @@ alias D = C; fn Foo(a: C); // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:8: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn Foo(b: D) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:8: note: previous declaration's corresponding parameter here // CHECK:STDERR: fn Foo(a: C); -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~ // CHECK:STDERR: fn Foo(b: D) {} @@ -194,31 +194,35 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc7: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc7: %C = bind_name a, %a.param.loc7 +// CHECK:STDOUT: %param.loc7: %C = param runtime_param0 +// CHECK:STDOUT: %a.loc7: %C = bind_name a, %param.loc7 // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc8: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc8: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc8: %C = bind_name a, %a.param.loc8 +// CHECK:STDOUT: %param.loc8: %C = param runtime_param0 +// CHECK:STDOUT: %a.loc8: %C = bind_name a, %param.loc8 // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc10: %Bar.type = fn_decl @Bar [template = constants.%Bar] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc10: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param.loc10: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc10: %C = bind_name a, %a.param.loc10 +// CHECK:STDOUT: %param.loc10: %C = param runtime_param0 +// CHECK:STDOUT: %a.loc10: %C = bind_name a, %param.loc10 // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc11: %Bar.type = fn_decl @Bar [template = constants.%Bar] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param.loc11: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc11: %C = bind_name a, %a.param.loc11 +// CHECK:STDOUT: %param.loc11: %C = param runtime_param0 +// CHECK:STDOUT: %a.loc11: %C = bind_name a, %param.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -229,12 +233,12 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a.loc8: %C) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Bar(%a.loc11: %C) { +// CHECK:STDOUT: fn @Bar(%a.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -259,17 +263,19 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc6: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc6: %C = bind_name a, %a.param.loc6 +// CHECK:STDOUT: %param.loc6: %C = param runtime_param0 +// CHECK:STDOUT: %a.loc6: %C = bind_name a, %param.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc7: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc7: %C = bind_name a, %a.param.loc7 +// CHECK:STDOUT: %param.loc7: %C = param runtime_param0 +// CHECK:STDOUT: %a.loc7: %C = bind_name a, %param.loc7 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -280,7 +286,7 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo[](%a.loc7: %C) { +// CHECK:STDOUT: fn @Foo[](%a.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -307,17 +313,19 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -328,9 +336,9 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: %C); +// CHECK:STDOUT: fn @Foo(%a.param_patt: %C); // CHECK:STDOUT: -// CHECK:STDOUT: fn @.1(%a: %C) { +// CHECK:STDOUT: fn @.1(%a.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -355,17 +363,19 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc6: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc6: %C = bind_name a, %a.param.loc6 +// CHECK:STDOUT: %param.loc6: %C = param runtime_param0 +// CHECK:STDOUT: %a.loc6: %C = bind_name a, %param.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc7: %C = param a, runtime_param0 -// CHECK:STDOUT: %a.loc7: %C = bind_name a, %a.param.loc7 +// CHECK:STDOUT: %param.loc7: %C = param runtime_param0 +// CHECK:STDOUT: %a.loc7: %C = bind_name a, %param.loc7 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -376,7 +386,7 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a.loc7: %C) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -406,17 +416,19 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -427,9 +439,9 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: %C); +// CHECK:STDOUT: fn @Foo(%a.param_patt: %C); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Bar(%a: %C); +// CHECK:STDOUT: fn @Bar(%a.param_patt: %C); // CHECK:STDOUT: // CHECK:STDOUT: --- two_file.impl.carbon // CHECK:STDOUT: @@ -448,8 +460,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+12, loaded [template = constants.%Foo] -// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+20, loaded [template = constants.%Bar] +// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+13, loaded [template = constants.%Foo] +// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+22, loaded [template = constants.%Bar] // CHECK:STDOUT: %import_ref.5 = import_ref Main//two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -464,17 +476,19 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -483,12 +497,12 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Self = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: %C) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Bar(%a: %C) { +// CHECK:STDOUT: fn @Bar(%a.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -518,17 +532,19 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param0 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %b: %C = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -539,9 +555,9 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: %C); +// CHECK:STDOUT: fn @Foo(%a.param_patt: %C); // CHECK:STDOUT: -// CHECK:STDOUT: fn @.1(%b: %C) { +// CHECK:STDOUT: fn @.1(%b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -571,17 +587,19 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -592,9 +610,9 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: %C); +// CHECK:STDOUT: fn @Foo(%a.param_patt: %C); // CHECK:STDOUT: -// CHECK:STDOUT: fn @.1(%a: %C) { +// CHECK:STDOUT: fn @.1(%a.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -606,9 +624,11 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: %.5: type = ptr_type %.1 [template] @@ -624,18 +644,20 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7_8.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_8.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7_8.1, runtime_param [symbolic = %a.patt.loc7_8.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_8.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_8.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc7_8.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc7_8.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc15_8.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_8.2 (constants.%a.patt.2)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc15_8.1, runtime_param [symbolic = %a.patt.loc15_8.2 (constants.%a.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc15_8.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc15_8.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc15_8.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc15_8.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -648,16 +670,18 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Foo(%a.loc7_8.1: %C) { // CHECK:STDOUT: %a.loc7_8.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_8.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc7_8.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_8.2 (constants.%a.patt.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%a.loc7_8.1: %C](); +// CHECK:STDOUT: fn[%a.param_patt: %C](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(%a.loc15_8.1: %C) { // CHECK:STDOUT: %a.loc15_8.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc15_8.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc15_8.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_8.2 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%a.loc15_8.1: %C]() { +// CHECK:STDOUT: fn[%a.param_patt: %C]() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -665,10 +689,12 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc7_8.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7_8.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { // CHECK:STDOUT: %a.loc15_8.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc15_8.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- todo_fail_alias_in_return.carbon @@ -737,10 +763,11 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -751,7 +778,7 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: %C); +// CHECK:STDOUT: fn @Foo(%a.param_patt: %C); // CHECK:STDOUT: // CHECK:STDOUT: --- todo_fail_alias_two_file.impl.carbon // CHECK:STDOUT: @@ -767,7 +794,7 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+10, loaded [template = constants.%Foo] +// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+11, loaded [template = constants.%Foo] // CHECK:STDOUT: %import_ref.3 = import_ref Main//alias_two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -783,10 +810,11 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %D: type = bind_alias D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -795,7 +823,7 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: %C) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -823,20 +851,22 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.3 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc6: type = const_type %C [template = constants.%.3] -// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.3 = bind_name a, %a.param +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %a: %.3 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.5] { // CHECK:STDOUT: %a.patt: %.3 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.3 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc17_18: type = const_type %C [template = constants.%.3] // CHECK:STDOUT: %.loc17_11: type = const_type %.3 [template = constants.%.3] -// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.3 = bind_name a, %a.param +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %a: %.3 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -847,9 +877,9 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: %.3); +// CHECK:STDOUT: fn @Foo(%a.param_patt: %.3); // CHECK:STDOUT: -// CHECK:STDOUT: fn @.1(%a: %.3) { +// CHECK:STDOUT: fn @.1(%a.param_patt: %.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_one.carbon b/toolchain/check/testdata/function/definition/params_one.carbon index 7492ea2d3ebc..76e18fe53a82 100644 --- a/toolchain/check/testdata/function/definition/params_one.carbon +++ b/toolchain/check/testdata/function/definition/params_one.carbon @@ -43,18 +43,19 @@ fn Foo(a: i32) {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_one_comma.carbon b/toolchain/check/testdata/function/definition/params_one_comma.carbon index 1bdb4ea68fc8..481fe0683faf 100644 --- a/toolchain/check/testdata/function/definition/params_one_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_one_comma.carbon @@ -43,18 +43,19 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_two.carbon b/toolchain/check/testdata/function/definition/params_two.carbon index 6e392ad099e1..7c764ae83954 100644 --- a/toolchain/check/testdata/function/definition/params_two.carbon +++ b/toolchain/check/testdata/function/definition/params_two.carbon @@ -43,24 +43,26 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] // CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %param.loc11_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc11_8 +// CHECK:STDOUT: %param.loc11_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc11_16 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: i32, %b.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_two_comma.carbon b/toolchain/check/testdata/function/definition/params_two_comma.carbon index 5685d05968dc..074f86f843b5 100644 --- a/toolchain/check/testdata/function/definition/params_two_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_two_comma.carbon @@ -43,24 +43,26 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] // CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %param.loc11_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc11_8 +// CHECK:STDOUT: %param.loc11_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc11_16 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: i32, %b.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index be0ae533cdeb..3db22af1270c 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -118,6 +118,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [template] // CHECK:STDOUT: %.2: type = tuple_type () [template] @@ -129,6 +130,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %CallExplicitGenericParam.type: type = fn_type @CallExplicitGenericParam [template] // CHECK:STDOUT: %CallExplicitGenericParam: %CallExplicitGenericParam.type = struct_value () [template] // CHECK:STDOUT: %.5: = specific_function %ExplicitGenericParam, @ExplicitGenericParam(i32) [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.6: type = struct_type {.a: %T} [symbolic] // CHECK:STDOUT: %.7: type = ptr_type %.6 [symbolic] // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.type: type = fn_type @CallExplicitGenericParamWithGenericArg [template] @@ -160,13 +162,14 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ExplicitGenericParam.decl: %ExplicitGenericParam.type = fn_decl @ExplicitGenericParam [template = constants.%ExplicitGenericParam] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_25.1, runtime_param [symbolic = %T.patt.loc4_25.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %.loc4_39.1: type = ptr_type %T [symbolic = %.loc4_39.2 (constants.%.1)] // CHECK:STDOUT: %return: ref @ExplicitGenericParam.%.loc4_39.2 (%.1) = var +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallExplicitGenericParam.decl: %CallExplicitGenericParam.type = fn_decl @CallExplicitGenericParam [template = constants.%CallExplicitGenericParam] {} { // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] @@ -176,25 +179,27 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %return: ref %.4 = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.decl: %CallExplicitGenericParamWithGenericArg.type = fn_decl @CallExplicitGenericParamWithGenericArg [template = constants.%CallExplicitGenericParamWithGenericArg] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc10_43.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_43.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc10_43.1, runtime_param [symbolic = %T.patt.loc10_43.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc10_43.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_43.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc10: type = name_ref T, %T.loc10_43.1 [symbolic = %T.loc10_43.2 (constants.%T)] // CHECK:STDOUT: %.loc10_62.1: type = struct_type {.a: %T} [symbolic = %.loc10_62.2 (constants.%.6)] // CHECK:STDOUT: %.loc10_63.1: type = ptr_type %.6 [symbolic = %.loc10_63.2 (constants.%.7)] // CHECK:STDOUT: %return: ref @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.7) = var +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc10_43.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc10_43.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ExplicitGenericParam(%T.loc4_25.1: type) { // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt.1)] // CHECK:STDOUT: %.loc4_39.2: type = ptr_type @ExplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %.loc4_39.2 (constants.%.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc4_50.2: = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc4_25.2) [symbolic = %.loc4_50.2 (constants.%.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc4_25.1: type) -> @ExplicitGenericParam.%.loc4_39.2 (%.1) { +// CHECK:STDOUT: fn(%T.param_patt: type) -> @ExplicitGenericParam.%.loc4_39.2 (%.1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam] // CHECK:STDOUT: %T.ref.loc4_71: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] @@ -223,13 +228,14 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @CallExplicitGenericParamWithGenericArg(%T.loc10_43.1: type) { // CHECK:STDOUT: %T.loc10_43.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_43.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc10_43.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_43.2 (constants.%T.patt.2)] // CHECK:STDOUT: %.loc10_62.2: type = struct_type {.a: @CallExplicitGenericParamWithGenericArg.%T.loc10_43.2 (%T)} [symbolic = %.loc10_62.2 (constants.%.6)] // CHECK:STDOUT: %.loc10_63.2: type = ptr_type @CallExplicitGenericParamWithGenericArg.%.loc10_62.2 (%.6) [symbolic = %.loc10_63.2 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc11_10.2: = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%.loc10_62.2) [symbolic = %.loc11_10.2 (constants.%.8)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc10_43.1: type) -> @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.7) { +// CHECK:STDOUT: fn(%T.param_patt: type) -> @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.7) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam] // CHECK:STDOUT: %T.ref.loc11: type = name_ref T, %T.loc10_43.1 [symbolic = %T.loc10_43.2 (constants.%T)] @@ -244,6 +250,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%T) { // CHECK:STDOUT: %T.loc4_25.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T // CHECK:STDOUT: %.loc4_39.2 => constants.%.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -252,11 +259,13 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ExplicitGenericParam(@ExplicitGenericParam.%T.loc4_25.2) { // CHECK:STDOUT: %T.loc4_25.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T // CHECK:STDOUT: %.loc4_39.2 => constants.%.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ExplicitGenericParam(i32) { // CHECK:STDOUT: %T.loc4_25.2 => i32 +// CHECK:STDOUT: %T.patt.loc4_25.2 => i32 // CHECK:STDOUT: %.loc4_39.2 => constants.%.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -265,12 +274,14 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: specific @CallExplicitGenericParamWithGenericArg(constants.%T) { // CHECK:STDOUT: %T.loc10_43.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc10_43.2 => constants.%T // CHECK:STDOUT: %.loc10_62.2 => constants.%.6 // CHECK:STDOUT: %.loc10_63.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%.6) { // CHECK:STDOUT: %T.loc4_25.2 => constants.%.6 +// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%.6 // CHECK:STDOUT: %.loc4_39.2 => constants.%.7 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -279,6 +290,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ExplicitGenericParam(@CallExplicitGenericParamWithGenericArg.%.loc10_62.2) { // CHECK:STDOUT: %T.loc4_25.2 => constants.%.6 +// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%.6 // CHECK:STDOUT: %.loc4_39.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -289,6 +301,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: type = ptr_type %T [symbolic] // CHECK:STDOUT: %ExplicitAndAlsoDeduced.type: type = fn_type @ExplicitAndAlsoDeduced [template] // CHECK:STDOUT: %.4: type = tuple_type () [template] @@ -325,31 +338,34 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %ExplicitAndAlsoDeduced.decl: %ExplicitAndAlsoDeduced.type = fn_decl @ExplicitAndAlsoDeduced [template = constants.%ExplicitAndAlsoDeduced] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6_27.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_27.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6_27.1, runtime_param [symbolic = %T.patt.loc6_27.2 (constants.%T.patt)] // CHECK:STDOUT: %x.patt: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_27.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_27.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc6_40: type = name_ref T, %T.loc6_27.1 [symbolic = %T.loc6_27.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc6_46: type = name_ref T, %T.loc6_27.1 [symbolic = %T.loc6_27.2 (constants.%T)] // CHECK:STDOUT: %.loc6_47.1: type = ptr_type %T [symbolic = %.loc6_47.2 (constants.%.3)] // CHECK:STDOUT: %return: ref @ExplicitAndAlsoDeduced.%.loc6_47.2 (%.3) = var +// CHECK:STDOUT: %param.loc6_27: type = param runtime_param +// CHECK:STDOUT: %T.loc6_27.1: type = bind_symbolic_name T, 0, %param.loc6_27 [symbolic = %T.loc6_27.2 (constants.%T)] +// CHECK:STDOUT: %param.loc6_37: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = bind_name x, %param.loc6_37 // CHECK:STDOUT: } // CHECK:STDOUT: %CallExplicitAndAlsoDeduced.decl: %CallExplicitAndAlsoDeduced.type = fn_decl @CallExplicitAndAlsoDeduced [template = constants.%CallExplicitAndAlsoDeduced] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc9_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_34.1: type = value_of_initializer %int.make_type_32.loc9_34 [template = i32] // CHECK:STDOUT: %.loc9_34.2: type = converted %int.make_type_32.loc9_34, %.loc9_34.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %int.make_type_32.loc9_42: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_45.1: type = value_of_initializer %int.make_type_32.loc9_42 [template = i32] // CHECK:STDOUT: %.loc9_45.2: type = converted %int.make_type_32.loc9_42, %.loc9_45.1 [template = i32] // CHECK:STDOUT: %.loc9_45.3: type = ptr_type i32 [template = constants.%.5] // CHECK:STDOUT: %return: ref %.5 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -362,14 +378,15 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ExplicitAndAlsoDeduced(%T.loc6_27.1: type) { // CHECK:STDOUT: %T.loc6_27.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_27.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_27.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_27.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc6_47.2: type = ptr_type @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) [symbolic = %.loc6_47.2 (constants.%.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc6_27.1: type, %x: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T)) -> @ExplicitAndAlsoDeduced.%.loc6_47.2 (%.3); +// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T)) -> @ExplicitAndAlsoDeduced.%.loc6_47.2 (%.3); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallExplicitAndAlsoDeduced(%n: i32) -> %.5 { +// CHECK:STDOUT: fn @CallExplicitAndAlsoDeduced(%n.param_patt: i32) -> %.5 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ExplicitAndAlsoDeduced.ref: %ExplicitAndAlsoDeduced.type = name_ref ExplicitAndAlsoDeduced, file.%ExplicitAndAlsoDeduced.decl [template = constants.%ExplicitAndAlsoDeduced] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] @@ -379,6 +396,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(constants.%T) { // CHECK:STDOUT: %T.loc6_27.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_27.2 => constants.%T // CHECK:STDOUT: %.loc6_47.2 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -386,6 +404,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %ImplicitGenericParam.type: type = fn_type @ImplicitGenericParam [template] // CHECK:STDOUT: %.2: type = tuple_type () [template] @@ -422,42 +441,46 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ImplicitGenericParam.decl: %ImplicitGenericParam.type = fn_decl @ImplicitGenericParam [template = constants.%ImplicitGenericParam] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_25.1, runtime_param [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)] // CHECK:STDOUT: %x.patt: @ImplicitGenericParam.%T.loc4_25.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @ImplicitGenericParam.%T.loc4_25.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @ImplicitGenericParam.%T.loc4_25.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @ImplicitGenericParam.%T.loc4_25.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %.loc4_45.1: type = ptr_type %T [symbolic = %.loc4_45.2 (constants.%.1)] // CHECK:STDOUT: %return: ref @ImplicitGenericParam.%.loc4_45.2 (%.1) = var +// CHECK:STDOUT: %param.loc4_25: type = param runtime_param +// CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %param.loc4_25 [symbolic = %T.loc4_25.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_35: @ImplicitGenericParam.%T.loc4_25.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @ImplicitGenericParam.%T.loc4_25.2 (%T) = bind_name x, %param.loc4_35 // CHECK:STDOUT: } // CHECK:STDOUT: %CallImplicitGenericParam.decl: %CallImplicitGenericParam.type = fn_decl @CallImplicitGenericParam [template = constants.%CallImplicitGenericParam] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc6_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_32.1: type = value_of_initializer %int.make_type_32.loc6_32 [template = i32] // CHECK:STDOUT: %.loc6_32.2: type = converted %int.make_type_32.loc6_32, %.loc6_32.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %int.make_type_32.loc6_40: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_43.1: type = value_of_initializer %int.make_type_32.loc6_40 [template = i32] // CHECK:STDOUT: %.loc6_43.2: type = converted %int.make_type_32.loc6_40, %.loc6_43.1 [template = i32] // CHECK:STDOUT: %.loc6_43.3: type = ptr_type i32 [template = constants.%.4] // CHECK:STDOUT: %return: ref %.4 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ImplicitGenericParam(%T.loc4_25.1: type) { // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc4_45.2: type = ptr_type @ImplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %.loc4_45.2 (constants.%.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc4_56.2: = specific_function constants.%ImplicitGenericParam, @ImplicitGenericParam(%T.loc4_25.2) [symbolic = %.loc4_56.2 (constants.%.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc4_25.1: type](%x: @ImplicitGenericParam.%T.loc4_25.2 (%T)) -> @ImplicitGenericParam.%.loc4_45.2 (%.1) { +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @ImplicitGenericParam.%T.loc4_25.2 (%T)) -> @ImplicitGenericParam.%.loc4_45.2 (%.1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ImplicitGenericParam.ref: %ImplicitGenericParam.type = name_ref ImplicitGenericParam, file.%ImplicitGenericParam.decl [template = constants.%ImplicitGenericParam] // CHECK:STDOUT: %x.ref: @ImplicitGenericParam.%T.loc4_25.2 (%T) = name_ref x, %x @@ -471,7 +494,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallImplicitGenericParam(%n: i32) -> %.4 { +// CHECK:STDOUT: fn @CallImplicitGenericParam(%n.param_patt: i32) -> %.4 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ImplicitGenericParam.ref: %ImplicitGenericParam.type = name_ref ImplicitGenericParam, file.%ImplicitGenericParam.decl [template = constants.%ImplicitGenericParam] // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n @@ -484,6 +507,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitGenericParam(constants.%T) { // CHECK:STDOUT: %T.loc4_25.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T // CHECK:STDOUT: %.loc4_45.2 => constants.%.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -492,11 +516,13 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitGenericParam(@ImplicitGenericParam.%T.loc4_25.2) { // CHECK:STDOUT: %T.loc4_25.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T // CHECK:STDOUT: %.loc4_45.2 => constants.%.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitGenericParam(i32) { // CHECK:STDOUT: %T.loc4_25.2 => i32 +// CHECK:STDOUT: %T.patt.loc4_25.2 => i32 // CHECK:STDOUT: %.loc4_45.2 => constants.%.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -507,6 +533,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] @@ -548,19 +575,21 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TupleParam.decl: %TupleParam.type = fn_decl @TupleParam [template = constants.%TupleParam] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_15.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_15.1, runtime_param [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)] // CHECK:STDOUT: %x.patt: @TupleParam.%.loc4_35.5 (%.3) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @TupleParam.%.loc4_35.5 (%.3) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_15.2 (constants.%T)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_15.1 [symbolic = %T.loc4_15.2 (constants.%T)] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_35.1: %.2 = tuple_literal (%T.ref, %int.make_type_32) // CHECK:STDOUT: %.loc4_35.2: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_35.3: type = converted %int.make_type_32, %.loc4_35.2 [template = i32] // CHECK:STDOUT: %.loc4_35.4: type = converted %.loc4_35.1, constants.%.3 [symbolic = %.loc4_35.5 (constants.%.3)] -// CHECK:STDOUT: %x.param: @TupleParam.%.loc4_35.5 (%.3) = param x, runtime_param0 -// CHECK:STDOUT: %x: @TupleParam.%.loc4_35.5 (%.3) = bind_name x, %x.param +// CHECK:STDOUT: %param.loc4_15: type = param runtime_param +// CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %param.loc4_15 [symbolic = %T.loc4_15.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_25: @TupleParam.%.loc4_35.5 (%.3) = param runtime_param0 +// CHECK:STDOUT: %x: @TupleParam.%.loc4_35.5 (%.3) = bind_name x, %param.loc4_25 // CHECK:STDOUT: } // CHECK:STDOUT: %CallTupleParam.decl: %CallTupleParam.type = fn_decl @CallTupleParam [template = constants.%CallTupleParam] {} {} // CHECK:STDOUT: } @@ -569,11 +598,12 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @TupleParam(%T.loc4_15.1: type) { // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_15.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_15.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc4_35.5: type = tuple_type (@TupleParam.%T.loc4_15.2 (%T), i32) [symbolic = %.loc4_35.5 (constants.%.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc4_15.1: type](%x: @TupleParam.%.loc4_35.5 (%.3)) { +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @TupleParam.%.loc4_35.5 (%.3)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -584,21 +614,23 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %TupleParam.ref: %TupleParam.type = name_ref TupleParam, file.%TupleParam.decl [template = constants.%TupleParam] // CHECK:STDOUT: %.loc7_15: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %.loc7_18: i32 = int_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %.loc7_19: %.7 = tuple_literal (%.loc7_15, %.loc7_18) +// CHECK:STDOUT: %.loc7_19.1: %.7 = tuple_literal (%.loc7_15, %.loc7_18) // CHECK:STDOUT: %.loc7_3: = specific_function %TupleParam.ref, @TupleParam(i32) [template = constants.%.8] // CHECK:STDOUT: %tuple: %.7 = tuple_value (%.loc7_15, %.loc7_18) [template = constants.%tuple] -// CHECK:STDOUT: %.loc7_13: %.7 = converted %.loc7_19, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %TupleParam.call: init %.1 = call %.loc7_3(%.loc7_13) +// CHECK:STDOUT: %.loc7_19.2: %.7 = converted %.loc7_19.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %TupleParam.call: init %.1 = call %.loc7_3(%.loc7_19.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TupleParam(constants.%T) { // CHECK:STDOUT: %T.loc4_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T // CHECK:STDOUT: %.loc4_35.5 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TupleParam(i32) { // CHECK:STDOUT: %T.loc4_15.2 => i32 +// CHECK:STDOUT: %T.patt.loc4_15.2 => i32 // CHECK:STDOUT: %.loc4_35.5 => constants.%.7 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -608,6 +640,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] @@ -645,18 +678,20 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %StructParam.decl: %StructParam.type = fn_decl @StructParam [template = constants.%StructParam] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_16.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_16.1, runtime_param [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)] // CHECK:STDOUT: %x.patt: @StructParam.%.loc4_44.2 (%.2) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @StructParam.%.loc4_44.2 (%.2) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_16.2 (constants.%T)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.1 [symbolic = %T.loc4_16.2 (constants.%T)] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_41.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_41.2: type = converted %int.make_type_32, %.loc4_41.1 [template = i32] // CHECK:STDOUT: %.loc4_44.1: type = struct_type {.a: %T, .b: i32} [symbolic = %.loc4_44.2 (constants.%.2)] -// CHECK:STDOUT: %x.param: @StructParam.%.loc4_44.2 (%.2) = param x, runtime_param0 -// CHECK:STDOUT: %x: @StructParam.%.loc4_44.2 (%.2) = bind_name x, %x.param +// CHECK:STDOUT: %param.loc4_16: type = param runtime_param +// CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %param.loc4_16 [symbolic = %T.loc4_16.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_26: @StructParam.%.loc4_44.2 (%.2) = param runtime_param0 +// CHECK:STDOUT: %x: @StructParam.%.loc4_44.2 (%.2) = bind_name x, %param.loc4_26 // CHECK:STDOUT: } // CHECK:STDOUT: %CallStructParam.decl: %CallStructParam.type = fn_decl @CallStructParam [template = constants.%CallStructParam] {} {} // CHECK:STDOUT: } @@ -665,11 +700,12 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @StructParam(%T.loc4_16.1: type) { // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc4_44.2: type = struct_type {.a: @StructParam.%T.loc4_16.2 (%T), .b: i32} [symbolic = %.loc4_44.2 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc4_16.1: type](%x: @StructParam.%.loc4_44.2 (%.2)) { +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @StructParam.%.loc4_44.2 (%.2)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -686,6 +722,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: specific @StructParam(constants.%T) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T // CHECK:STDOUT: %.loc4_44.2 => constants.%.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -693,7 +730,9 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %ImplicitNotDeducible.type: type = fn_type @ImplicitNotDeducible [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %ImplicitNotDeducible: %ImplicitNotDeducible.type = struct_value () [template] @@ -723,28 +762,33 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ImplicitNotDeducible.decl: %ImplicitNotDeducible.type = fn_decl @ImplicitNotDeducible [template = constants.%ImplicitNotDeducible] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %T.patt.loc6_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_25.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6_25.1, runtime_param [symbolic = %T.patt.loc6_25.2 (constants.%T.patt)] +// CHECK:STDOUT: %U.patt.loc6_35.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc6_35.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc6_35.1, runtime_param [symbolic = %U.patt.loc6_35.2 (constants.%U.patt)] // CHECK:STDOUT: %x.patt: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_25.2 (constants.%T)] -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc6_35.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc6_35.2 (constants.%U)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_25.1 [symbolic = %T.loc6_25.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc6_35.1 [symbolic = %U.loc6_35.2 (constants.%U)] // CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%U.loc6_35.2 (%U) = var +// CHECK:STDOUT: %param.loc6_25: type = param runtime_param +// CHECK:STDOUT: %T.loc6_25.1: type = bind_symbolic_name T, 0, %param.loc6_25 [symbolic = %T.loc6_25.2 (constants.%T)] +// CHECK:STDOUT: %param.loc6_35: type = param runtime_param +// CHECK:STDOUT: %U.loc6_35.1: type = bind_symbolic_name U, 1, %param.loc6_35 [symbolic = %U.loc6_35.2 (constants.%U)] +// CHECK:STDOUT: %param.loc6_45: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = bind_name x, %param.loc6_45 // CHECK:STDOUT: } // CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [template = constants.%CallImplicitNotDeducible] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ImplicitNotDeducible(%T.loc6_25.1: type, %U.loc6_35.1: type) { // CHECK:STDOUT: %T.loc6_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_25.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_25.2 (constants.%T.patt)] // CHECK:STDOUT: %U.loc6_35.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc6_35.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc6_35.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc6_35.2 (constants.%U.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc6_25.1: type, %U.loc6_35.1: type](%x: @ImplicitNotDeducible.%T.loc6_25.2 (%T)) -> @ImplicitNotDeducible.%U.loc6_35.2 (%U); +// CHECK:STDOUT: fn[%T.param_patt: type, %U.param_patt: type](%x.param_patt: @ImplicitNotDeducible.%T.loc6_25.2 (%T)) -> @ImplicitNotDeducible.%U.loc6_35.2 (%U); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallImplicitNotDeducible() { @@ -756,13 +800,16 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitNotDeducible(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc6_25.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_25.2 => constants.%T // CHECK:STDOUT: %U.loc6_35.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc6_35.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduce_inconsistent.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %ImplicitNotDeducible.type: type = fn_type @ImplicitNotDeducible [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %ImplicitNotDeducible: %ImplicitNotDeducible.type = struct_value () [template] @@ -794,28 +841,32 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ImplicitNotDeducible.decl: %ImplicitNotDeducible.type = fn_decl @ImplicitNotDeducible [template = constants.%ImplicitNotDeducible] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_25.1, runtime_param [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)] // CHECK:STDOUT: %x.patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: %y.patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = binding_pattern y +// CHECK:STDOUT: %y.param_patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = param_pattern %y.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] -// CHECK:STDOUT: %y.param: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = param y, runtime_param1 -// CHECK:STDOUT: %y: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = bind_name y, %y.param // CHECK:STDOUT: %T.ref.loc4_50: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%T.loc4_25.2 (%T) = var +// CHECK:STDOUT: %param.loc4_25: type = param runtime_param +// CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %param.loc4_25 [symbolic = %T.loc4_25.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_35: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = bind_name x, %param.loc4_35 +// CHECK:STDOUT: %param.loc4_41: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = param runtime_param1 +// CHECK:STDOUT: %y: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = bind_name y, %param.loc4_41 // CHECK:STDOUT: } // CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [template = constants.%CallImplicitNotDeducible] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ImplicitNotDeducible(%T.loc4_25.1: type) { // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc4_25.1: type](%x: @ImplicitNotDeducible.%T.loc4_25.2 (%T), %y: @ImplicitNotDeducible.%T.loc4_25.2 (%T)) -> @ImplicitNotDeducible.%T.loc4_25.2 (%T); +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T), %y.param_patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T)) -> @ImplicitNotDeducible.%T.loc4_25.2 (%T); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallImplicitNotDeducible() { @@ -829,5 +880,6 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitNotDeducible(constants.%T) { // CHECK:STDOUT: %T.loc4_25.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon index d7258e78235a..ce58a080bc4e 100644 --- a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon @@ -20,6 +20,7 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } @@ -46,22 +47,24 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc14_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc14_6.1, runtime_param [symbolic = %N.patt.loc14_6.2 (constants.%N.patt)] // CHECK:STDOUT: %a.patt: = binding_pattern a +// CHECK:STDOUT: %a.param_patt: = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc14_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14_10 [template = i32] // CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14_10, %.loc14_10.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc14_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_6.2 (constants.%N)] // CHECK:STDOUT: %int.make_type_32.loc14_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N)] // CHECK:STDOUT: %.loc14_19.1: type = value_of_initializer %int.make_type_32.loc14_19 [template = i32] // CHECK:STDOUT: %.loc14_19.2: type = converted %int.make_type_32.loc14_19, %.loc14_19.1 [template = i32] // CHECK:STDOUT: %.loc14_25: type = array_type %N.ref, i32 [template = ] // CHECK:STDOUT: %.loc14_26: type = ptr_type [template = ] -// CHECK:STDOUT: %a.param: = param a, runtime_param0 -// CHECK:STDOUT: %a: = bind_name a, %a.param +// CHECK:STDOUT: %param.loc14_6: i32 = param runtime_param +// CHECK:STDOUT: %N.loc14_6.1: i32 = bind_symbolic_name N, 0, %param.loc14_6 [symbolic = %N.loc14_6.2 (constants.%N)] +// CHECK:STDOUT: %param.loc14_15: = param runtime_param0 +// CHECK:STDOUT: %a: = bind_name a, %param.loc14_15 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -69,11 +72,13 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc14_6.1: i32) { // CHECK:STDOUT: %N.loc14_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_6.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc14_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.loc14_6.1: i32, %a: ); +// CHECK:STDOUT: fn(%N.param_patt: i32, %a.param_patt: ); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc14_6.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc14_6.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/no_prelude/call.carbon b/toolchain/check/testdata/function/generic/no_prelude/call.carbon index 5b5111908e15..e9cf7caa57c7 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/call.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/call.carbon @@ -56,12 +56,15 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Function.type: type = fn_type @Function [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Function: %Function.type = struct_value () [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [template] // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [template] // CHECK:STDOUT: %.2: = specific_function %Function, @Function(%T) [symbolic] +// CHECK:STDOUT: %T.patt.3: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: type = ptr_type %T [symbolic] // CHECK:STDOUT: %CallGenericPtr.type: type = fn_type @CallGenericPtr [template] // CHECK:STDOUT: %CallGenericPtr: %CallGenericPtr.type = struct_value () [template] @@ -84,52 +87,59 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: .CallSpecific = %CallSpecific.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Function.decl: %Function.type = fn_decl @Function [template = constants.%Function] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: %x.patt: @Function.%T.loc4_13.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Function.%T.loc4_13.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_26: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @Function.%T.loc4_13.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @Function.%T.loc4_13.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc4_32: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %return: ref @Function.%T.loc4_13.2 (%T) = var +// CHECK:STDOUT: %param.loc4_13: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param.loc4_13 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_23: @Function.%T.loc4_13.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @Function.%T.loc4_13.2 (%T) = bind_name x, %param.loc4_23 // CHECK:STDOUT: } // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [template = constants.%CallGeneric] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_16.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_16.1, runtime_param [symbolic = %T.patt.loc8_16.2 (constants.%T.patt.2)] // CHECK:STDOUT: %x.patt: @CallGeneric.%T.loc8_16.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @CallGeneric.%T.loc8_16.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc8_29: type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @CallGeneric.%T.loc8_16.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @CallGeneric.%T.loc8_16.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc8_35: type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %return: ref @CallGeneric.%T.loc8_16.2 (%T) = var +// CHECK:STDOUT: %param.loc8_16: type = param runtime_param +// CHECK:STDOUT: %T.loc8_16.1: type = bind_symbolic_name T, 0, %param.loc8_16 [symbolic = %T.loc8_16.2 (constants.%T)] +// CHECK:STDOUT: %param.loc8_26: @CallGeneric.%T.loc8_16.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @CallGeneric.%T.loc8_16.2 (%T) = bind_name x, %param.loc8_26 // CHECK:STDOUT: } // CHECK:STDOUT: %CallGenericPtr.decl: %CallGenericPtr.type = fn_decl @CallGenericPtr [template = constants.%CallGenericPtr] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc12_19.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_19.2 (constants.%T.patt.3)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc12_19.1, runtime_param [symbolic = %T.patt.loc12_19.2 (constants.%T.patt.3)] // CHECK:STDOUT: %x.patt: @CallGenericPtr.%.loc12_33.2 (%.3) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @CallGenericPtr.%.loc12_33.2 (%.3) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_19.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc12_32: type = name_ref T, %T.loc12_19.1 [symbolic = %T.loc12_19.2 (constants.%T)] // CHECK:STDOUT: %.loc12_33.1: type = ptr_type %T [symbolic = %.loc12_33.2 (constants.%.3)] -// CHECK:STDOUT: %x.param: @CallGenericPtr.%.loc12_33.2 (%.3) = param x, runtime_param0 -// CHECK:STDOUT: %x: @CallGenericPtr.%.loc12_33.2 (%.3) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc12_39: type = name_ref T, %T.loc12_19.1 [symbolic = %T.loc12_19.2 (constants.%T)] // CHECK:STDOUT: %.loc12_40: type = ptr_type %T [symbolic = %.loc12_33.2 (constants.%.3)] // CHECK:STDOUT: %return: ref @CallGenericPtr.%.loc12_33.2 (%.3) = var +// CHECK:STDOUT: %param.loc12_19: type = param runtime_param +// CHECK:STDOUT: %T.loc12_19.1: type = bind_symbolic_name T, 0, %param.loc12_19 [symbolic = %T.loc12_19.2 (constants.%T)] +// CHECK:STDOUT: %param.loc12_29: @CallGenericPtr.%.loc12_33.2 (%.3) = param runtime_param0 +// CHECK:STDOUT: %x: @CallGenericPtr.%.loc12_33.2 (%.3) = bind_name x, %param.loc12_29 // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %CallSpecific.decl: %CallSpecific.type = fn_decl @CallSpecific [template = constants.%CallSpecific] { // CHECK:STDOUT: %x.patt: %C = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %x.param: %C = param x, runtime_param0 -// CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: %C.ref.loc18_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %x: %C = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -142,10 +152,11 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Function(%T.loc4_13.1: type) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc4_13.1: type, %x: @Function.%T.loc4_13.2 (%T)) -> @Function.%T.loc4_13.2 (%T) { +// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @Function.%T.loc4_13.2 (%T)) -> @Function.%T.loc4_13.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @Function.%T.loc4_13.2 (%T) = name_ref x, %x // CHECK:STDOUT: return %x.ref @@ -154,11 +165,12 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @CallGeneric(%T.loc8_16.1: type) { // CHECK:STDOUT: %T.loc8_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_16.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc9_10.2: = specific_function constants.%Function, @Function(%T.loc8_16.2) [symbolic = %.loc9_10.2 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc8_16.1: type, %x: @CallGeneric.%T.loc8_16.2 (%T)) -> @CallGeneric.%T.loc8_16.2 (%T) { +// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGeneric.%T.loc8_16.2 (%T)) -> @CallGeneric.%T.loc8_16.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [template = constants.%Function] // CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] @@ -173,12 +185,13 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @CallGenericPtr(%T.loc12_19.1: type) { // CHECK:STDOUT: %T.loc12_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_19.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc12_19.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_19.2 (constants.%T.patt.3)] // CHECK:STDOUT: %.loc12_33.2: type = ptr_type @CallGenericPtr.%T.loc12_19.2 (%T) [symbolic = %.loc12_33.2 (constants.%.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc13_10.2: = specific_function constants.%Function, @Function(%.loc12_33.2) [symbolic = %.loc13_10.2 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc12_19.1: type, %x: @CallGenericPtr.%.loc12_33.2 (%.3)) -> @CallGenericPtr.%.loc12_33.2 (%.3) { +// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGenericPtr.%.loc12_33.2 (%.3)) -> @CallGenericPtr.%.loc12_33.2 (%.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [template = constants.%Function] // CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc12_19.1 [symbolic = %T.loc12_19.2 (constants.%T)] @@ -192,7 +205,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallSpecific(%x: %C) -> %return: %C { +// CHECK:STDOUT: fn @CallSpecific(%x.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [template = constants.%Function] // CHECK:STDOUT: %C.ref.loc19: type = name_ref C, file.%C.decl [template = constants.%C] @@ -205,35 +218,42 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(constants.%T) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGeneric(constants.%T) { // CHECK:STDOUT: %T.loc8_16.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(@CallGeneric.%T.loc8_16.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGenericPtr(constants.%T) { // CHECK:STDOUT: %T.loc12_19.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc12_19.2 => constants.%T // CHECK:STDOUT: %.loc12_33.2 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(constants.%.3) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%.3 +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(@CallGenericPtr.%.loc12_33.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%.3 +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(constants.%C) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -242,12 +262,15 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Function.type: type = fn_type @Function [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Function: %Function.type = struct_value () [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [template] // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [template] // CHECK:STDOUT: %.2: = specific_function %Function, @Function(%T) [symbolic] +// CHECK:STDOUT: %T.patt.3: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: type = ptr_type %T [symbolic] // CHECK:STDOUT: %CallGenericPtr.type: type = fn_type @CallGenericPtr [template] // CHECK:STDOUT: %CallGenericPtr: %CallGenericPtr.type = struct_value () [template] @@ -270,52 +293,59 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: .CallSpecific = %CallSpecific.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Function.decl: %Function.type = fn_decl @Function [template = constants.%Function] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: %x.patt: @Function.%T.loc4_13.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Function.%T.loc4_13.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_26: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @Function.%T.loc4_13.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @Function.%T.loc4_13.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc4_32: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %return: ref @Function.%T.loc4_13.2 (%T) = var +// CHECK:STDOUT: %param.loc4_13: type = param runtime_param +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param.loc4_13 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_23: @Function.%T.loc4_13.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @Function.%T.loc4_13.2 (%T) = bind_name x, %param.loc4_23 // CHECK:STDOUT: } // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [template = constants.%CallGeneric] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_16.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_16.1, runtime_param [symbolic = %T.patt.loc8_16.2 (constants.%T.patt.2)] // CHECK:STDOUT: %x.patt: @CallGeneric.%T.loc8_16.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @CallGeneric.%T.loc8_16.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc8_29: type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @CallGeneric.%T.loc8_16.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @CallGeneric.%T.loc8_16.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc8_35: type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %return: ref @CallGeneric.%T.loc8_16.2 (%T) = var +// CHECK:STDOUT: %param.loc8_16: type = param runtime_param +// CHECK:STDOUT: %T.loc8_16.1: type = bind_symbolic_name T, 0, %param.loc8_16 [symbolic = %T.loc8_16.2 (constants.%T)] +// CHECK:STDOUT: %param.loc8_26: @CallGeneric.%T.loc8_16.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @CallGeneric.%T.loc8_16.2 (%T) = bind_name x, %param.loc8_26 // CHECK:STDOUT: } // CHECK:STDOUT: %CallGenericPtr.decl: %CallGenericPtr.type = fn_decl @CallGenericPtr [template = constants.%CallGenericPtr] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc12_19.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_19.2 (constants.%T.patt.3)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc12_19.1, runtime_param [symbolic = %T.patt.loc12_19.2 (constants.%T.patt.3)] // CHECK:STDOUT: %x.patt: @CallGenericPtr.%.loc12_33.2 (%.3) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @CallGenericPtr.%.loc12_33.2 (%.3) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_19.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc12_32: type = name_ref T, %T.loc12_19.1 [symbolic = %T.loc12_19.2 (constants.%T)] // CHECK:STDOUT: %.loc12_33.1: type = ptr_type %T [symbolic = %.loc12_33.2 (constants.%.3)] -// CHECK:STDOUT: %x.param: @CallGenericPtr.%.loc12_33.2 (%.3) = param x, runtime_param0 -// CHECK:STDOUT: %x: @CallGenericPtr.%.loc12_33.2 (%.3) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc12_39: type = name_ref T, %T.loc12_19.1 [symbolic = %T.loc12_19.2 (constants.%T)] // CHECK:STDOUT: %.loc12_40: type = ptr_type %T [symbolic = %.loc12_33.2 (constants.%.3)] // CHECK:STDOUT: %return: ref @CallGenericPtr.%.loc12_33.2 (%.3) = var +// CHECK:STDOUT: %param.loc12_19: type = param runtime_param +// CHECK:STDOUT: %T.loc12_19.1: type = bind_symbolic_name T, 0, %param.loc12_19 [symbolic = %T.loc12_19.2 (constants.%T)] +// CHECK:STDOUT: %param.loc12_29: @CallGenericPtr.%.loc12_33.2 (%.3) = param runtime_param0 +// CHECK:STDOUT: %x: @CallGenericPtr.%.loc12_33.2 (%.3) = bind_name x, %param.loc12_29 // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %CallSpecific.decl: %CallSpecific.type = fn_decl @CallSpecific [template = constants.%CallSpecific] { // CHECK:STDOUT: %x.patt: %C = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %x.param: %C = param x, runtime_param0 -// CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: %C.ref.loc18_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %x: %C = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -328,10 +358,11 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Function(%T.loc4_13.1: type) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc4_13.1: type](%x: @Function.%T.loc4_13.2 (%T)) -> @Function.%T.loc4_13.2 (%T) { +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @Function.%T.loc4_13.2 (%T)) -> @Function.%T.loc4_13.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @Function.%T.loc4_13.2 (%T) = name_ref x, %x // CHECK:STDOUT: return %x.ref @@ -340,11 +371,12 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @CallGeneric(%T.loc8_16.1: type) { // CHECK:STDOUT: %T.loc8_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_16.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc9_10.2: = specific_function constants.%Function, @Function(%T.loc8_16.2) [symbolic = %.loc9_10.2 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc8_16.1: type, %x: @CallGeneric.%T.loc8_16.2 (%T)) -> @CallGeneric.%T.loc8_16.2 (%T) { +// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGeneric.%T.loc8_16.2 (%T)) -> @CallGeneric.%T.loc8_16.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [template = constants.%Function] // CHECK:STDOUT: %x.ref: @CallGeneric.%T.loc8_16.2 (%T) = name_ref x, %x @@ -358,12 +390,13 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @CallGenericPtr(%T.loc12_19.1: type) { // CHECK:STDOUT: %T.loc12_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_19.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc12_19.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_19.2 (constants.%T.patt.3)] // CHECK:STDOUT: %.loc12_33.2: type = ptr_type @CallGenericPtr.%T.loc12_19.2 (%T) [symbolic = %.loc12_33.2 (constants.%.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc13_10.2: = specific_function constants.%Function, @Function(%.loc12_33.2) [symbolic = %.loc13_10.2 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc12_19.1: type, %x: @CallGenericPtr.%.loc12_33.2 (%.3)) -> @CallGenericPtr.%.loc12_33.2 (%.3) { +// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGenericPtr.%.loc12_33.2 (%.3)) -> @CallGenericPtr.%.loc12_33.2 (%.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [template = constants.%Function] // CHECK:STDOUT: %x.ref: @CallGenericPtr.%.loc12_33.2 (%.3) = name_ref x, %x @@ -375,7 +408,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallSpecific(%x: %C) -> %return: %C { +// CHECK:STDOUT: fn @CallSpecific(%x.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [template = constants.%Function] // CHECK:STDOUT: %x.ref: %C = name_ref x, %x @@ -387,35 +420,42 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(constants.%T) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGeneric(constants.%T) { // CHECK:STDOUT: %T.loc8_16.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(@CallGeneric.%T.loc8_16.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGenericPtr(constants.%T) { // CHECK:STDOUT: %T.loc12_19.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc12_19.2 => constants.%T // CHECK:STDOUT: %.loc12_33.2 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(constants.%.3) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%.3 +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(@CallGenericPtr.%.loc12_33.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%.3 +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(constants.%C) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon index 57a9ebb4a154..c16b77706f9e 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon @@ -20,7 +20,9 @@ fn F(T:! type, U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -32,24 +34,28 @@ fn F(T:! type, U:! type) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %T.patt.loc11_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_6.1, runtime_param [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %U.patt.loc11_16.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc11_16.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc11_16.1, runtime_param [symbolic = %U.patt.loc11_16.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_6.2 (constants.%T)] -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc11_16.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc11_16.2 (constants.%U)] +// CHECK:STDOUT: %param.loc11_6: type = param runtime_param +// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %param.loc11_6 [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc11_16: type = param runtime_param +// CHECK:STDOUT: %U.loc11_16.1: type = bind_symbolic_name U, 1, %param.loc11_16 [symbolic = %U.loc11_16.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc11_6.1: type, %U.loc11_16.1: type) { // CHECK:STDOUT: %T.loc11_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: %U.loc11_16.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc11_16.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc11_16.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc11_16.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc12_11.2: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %.loc12_11.2 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc11_6.1: type, %U.loc11_16.1: type) { +// CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %.loc12_11.1: type = ptr_type %T [symbolic = %.loc12_11.2 (constants.%.2)] @@ -67,6 +73,8 @@ fn F(T:! type, U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc11_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_6.2 => constants.%T // CHECK:STDOUT: %U.loc11_16.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc11_16.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon b/toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon index 37f06558ddbf..0c7473b94cc0 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon @@ -14,6 +14,7 @@ fn F(T:! type); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -24,20 +25,23 @@ fn F(T:! type); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_6.1, runtime_param [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc11_6.1: type) { // CHECK:STDOUT: %T.loc11_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc11_6.1: type); +// CHECK:STDOUT: fn(%T.param_patt: type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc11_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon b/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon index bfdb8e2671e3..46c79415ffde 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon @@ -16,6 +16,7 @@ fn F(T:! type, p: T**) -> T* { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %.2: type = ptr_type %.1 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -28,30 +29,33 @@ fn F(T:! type, p: T**) -> T* { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_6.1, runtime_param [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: %p.patt: @F.%.loc11_21.2 (%.2) = binding_pattern p +// CHECK:STDOUT: %p.param_patt: @F.%.loc11_21.2 (%.2) = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc11_19: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %.loc11_20.1: type = ptr_type %T [symbolic = %.loc11_20.2 (constants.%.1)] // CHECK:STDOUT: %.loc11_21.1: type = ptr_type %.1 [symbolic = %.loc11_21.2 (constants.%.2)] -// CHECK:STDOUT: %p.param: @F.%.loc11_21.2 (%.2) = param p, runtime_param0 -// CHECK:STDOUT: %p: @F.%.loc11_21.2 (%.2) = bind_name p, %p.param // CHECK:STDOUT: %T.ref.loc11_27: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %.loc11_28: type = ptr_type %T [symbolic = %.loc11_20.2 (constants.%.1)] // CHECK:STDOUT: %return: ref @F.%.loc11_20.2 (%.1) = var +// CHECK:STDOUT: %param.loc11_6: type = param runtime_param +// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %param.loc11_6 [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc11_16: @F.%.loc11_21.2 (%.2) = param runtime_param0 +// CHECK:STDOUT: %p: @F.%.loc11_21.2 (%.2) = bind_name p, %param.loc11_16 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc11_6.1: type) { // CHECK:STDOUT: %T.loc11_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: %.loc11_20.2: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %.loc11_20.2 (constants.%.1)] // CHECK:STDOUT: %.loc11_21.2: type = ptr_type @F.%.loc11_20.2 (%.1) [symbolic = %.loc11_21.2 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc11_6.1: type, %p: @F.%.loc11_21.2 (%.2)) -> @F.%.loc11_20.2 (%.1) { +// CHECK:STDOUT: fn(%T.param_patt: type, %p.param_patt: @F.%.loc11_21.2 (%.2)) -> @F.%.loc11_20.2 (%.1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: @F.%.loc11_21.2 (%.2) = name_ref p, %p // CHECK:STDOUT: %.loc12_10.1: ref @F.%.loc11_20.2 (%.1) = deref %p.ref @@ -62,6 +66,7 @@ fn F(T:! type, p: T**) -> T* { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc11_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_6.2 => constants.%T // CHECK:STDOUT: %.loc11_20.2 => constants.%.1 // CHECK:STDOUT: %.loc11_21.2 => constants.%.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon b/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon index a88715ac3660..f9d3131d1912 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon @@ -17,6 +17,7 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -28,20 +29,22 @@ fn F(T:! type) { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_6.1, runtime_param [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc11_6.1: type) { // CHECK:STDOUT: %T.loc11_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc12_11.2: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %.loc12_11.2 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc11_6.1: type) { +// CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %T.ref.loc12: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %.loc12_11.1: type = ptr_type %T [symbolic = %.loc12_11.2 (constants.%.2)] @@ -59,5 +62,6 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc11_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon b/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon index 0380d296b65e..b8ad546cac40 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon @@ -17,6 +17,7 @@ fn F(T:! type, n: T) -> T { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -27,25 +28,28 @@ fn F(T:! type, n: T) -> T { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_6.1, runtime_param [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: %n.patt: @F.%T.loc11_6.2 (%T) = binding_pattern n +// CHECK:STDOUT: %n.param_patt: @F.%T.loc11_6.2 (%T) = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc11_19: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] -// CHECK:STDOUT: %n.param: @F.%T.loc11_6.2 (%T) = param n, runtime_param0 -// CHECK:STDOUT: %n: @F.%T.loc11_6.2 (%T) = bind_name n, %n.param // CHECK:STDOUT: %T.ref.loc11_25: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %return: ref @F.%T.loc11_6.2 (%T) = var +// CHECK:STDOUT: %param.loc11_6: type = param runtime_param +// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %param.loc11_6 [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc11_16: @F.%T.loc11_6.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %n: @F.%T.loc11_6.2 (%T) = bind_name n, %param.loc11_16 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc11_6.1: type) { // CHECK:STDOUT: %T.loc11_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc11_6.1: type, %n: @F.%T.loc11_6.2 (%T)) -> @F.%T.loc11_6.2 (%T) { +// CHECK:STDOUT: fn(%T.param_patt: type, %n.param_patt: @F.%T.loc11_6.2 (%T)) -> @F.%T.loc11_6.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %T.ref.loc12: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %n.ref: @F.%T.loc11_6.2 (%T) = name_ref n, %n @@ -57,5 +61,6 @@ fn F(T:! type, n: T) -> T { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc11_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index e890c7eaa3f4..31d843fe4884 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -50,10 +50,10 @@ fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:6: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F(U:! type, T:! type) -> T* { -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_reorder.carbon:[[@LINE-5]]:6: note: previous declaration's corresponding parameter here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fn F(U:! type, T:! type) -> T* { // CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:10: error: 1 argument(s) passed to function expecting 2 argument(s). @@ -74,10 +74,10 @@ fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: fail_rename.carbon:[[@LINE+7]]:6: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F(U:! type, T:! type) -> U* { -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_rename.carbon:[[@LINE-5]]:6: note: previous declaration's corresponding parameter here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fn F(U:! type, T:! type) -> U* { // CHECK:STDERR: fail_rename.carbon:[[@LINE+6]]:10: error: 1 argument(s) passed to function expecting 2 argument(s). @@ -93,10 +93,12 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.2: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: = specific_function %F, @F(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -120,33 +122,36 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6: type = symbolic_binding_pattern T, 0 [symbolic = constants.%T.patt.2] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6, runtime_param [symbolic = constants.%T.patt.2] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param.loc4: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_6.1: type = bind_symbolic_name T, 0, %T.param.loc4 [symbolic = %T.loc4_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4: type = name_ref T, %T.loc4_6.1 [symbolic = %T.loc4_6.2 (constants.%T)] // CHECK:STDOUT: %.loc4_20.1: type = ptr_type %T [symbolic = %.loc4_20.2 (constants.%.1)] // CHECK:STDOUT: %return.var.loc4: ref @F.%.loc4_20.2 (%.1) = var +// CHECK:STDOUT: %param.loc4: type = param runtime_param +// CHECK:STDOUT: %T.loc4_6.1: type = bind_symbolic_name T, 0, %param.loc4 [symbolic = %T.loc4_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl.loc6: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6: type = symbolic_binding_pattern T, 0 [symbolic = constants.%T.patt.2] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6, runtime_param [symbolic = constants.%T.patt.2] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param.loc6: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6: type = bind_symbolic_name T, 0, %T.param.loc6 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref.loc6: type = name_ref T, %T.loc6 [symbolic = constants.%T] // CHECK:STDOUT: %.loc6: type = ptr_type %T [symbolic = constants.%.1] // CHECK:STDOUT: %return: ref %.1 = var +// CHECK:STDOUT: %param.loc6: type = param runtime_param +// CHECK:STDOUT: %T.loc6: type = bind_symbolic_name T, 0, %param.loc6 [symbolic = constants.%T] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc4_6.1: type) { // CHECK:STDOUT: %T.loc4_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4 (constants.%T.patt.1)] // CHECK:STDOUT: %.loc4_20.2: type = ptr_type @F.%T.loc4_6.2 (%T) [symbolic = %.loc4_20.2 (constants.%.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc7_10.2: = specific_function constants.%F, @F(%T.loc4_6.2) [symbolic = %.loc7_10.2 (constants.%.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc6: type) -> %.1 { +// CHECK:STDOUT: fn(%T.param_patt: type) -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl.loc4 [template = constants.%F] // CHECK:STDOUT: %T.ref.loc7: type = name_ref T, %T.loc6 [symbolic = %T.loc4_6.2 (constants.%T)] @@ -160,6 +165,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc4_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4 => constants.%T // CHECK:STDOUT: %.loc4_20.2 => constants.%.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -168,6 +174,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(@F.%T.loc4_6.2) { // CHECK:STDOUT: %T.loc4_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4 => constants.%T // CHECK:STDOUT: %.loc4_20.2 => constants.%.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -175,11 +182,15 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt.1: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.2: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %U.patt.2: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.3: type = ptr_type %U [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.4: %.type = struct_value () [template] @@ -205,47 +216,55 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %T.patt.loc4_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_6.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_6.1, runtime_param [symbolic = %T.patt.loc4_6.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %U.patt.loc4_16.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc4_16.2 (constants.%U.patt.1)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc4_16.1, runtime_param [symbolic = %U.patt.loc4_16.2 (constants.%U.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_6.2 (constants.%T)] -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc4_16.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc4_16.2 (constants.%U)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_6.1 [symbolic = %T.loc4_6.2 (constants.%T)] // CHECK:STDOUT: %.loc4_30.1: type = ptr_type %T [symbolic = %.loc4_30.2 (constants.%.1)] // CHECK:STDOUT: %return: ref @F.%.loc4_30.2 (%.1) = var +// CHECK:STDOUT: %param.loc4_6: type = param runtime_param +// CHECK:STDOUT: %T.loc4_6.1: type = bind_symbolic_name T, 0, %param.loc4_6 [symbolic = %T.loc4_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_16: type = param runtime_param +// CHECK:STDOUT: %U.loc4_16.1: type = bind_symbolic_name U, 1, %param.loc4_16 [symbolic = %U.loc4_16.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %T.patt.loc13_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_6.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc13_6.1, runtime_param [symbolic = %T.patt.loc13_6.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %U.patt.loc13_16.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc13_16.2 (constants.%U.patt.2)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc13_16.1, runtime_param [symbolic = %U.patt.loc13_16.2 (constants.%U.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc13_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_6.2 (constants.%T)] -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc13_16.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc13_16.2 (constants.%U)] // CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc13_16.1 [symbolic = %U.loc13_16.2 (constants.%U)] // CHECK:STDOUT: %.loc13_30.1: type = ptr_type %U [symbolic = %.loc13_30.2 (constants.%.3)] // CHECK:STDOUT: %return: ref @.1.%.loc13_30.2 (%.3) = var +// CHECK:STDOUT: %param.loc13_6: type = param runtime_param +// CHECK:STDOUT: %T.loc13_6.1: type = bind_symbolic_name T, 0, %param.loc13_6 [symbolic = %T.loc13_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc13_16: type = param runtime_param +// CHECK:STDOUT: %U.loc13_16.1: type = bind_symbolic_name U, 1, %param.loc13_16 [symbolic = %U.loc13_16.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc4_6.1: type, %U.loc4_16.1: type) { // CHECK:STDOUT: %T.loc4_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_6.2 (constants.%T.patt.1)] // CHECK:STDOUT: %U.loc4_16.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc4_16.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc4_16.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc4_16.2 (constants.%U.patt.1)] // CHECK:STDOUT: %.loc4_30.2: type = ptr_type @F.%T.loc4_6.2 (%T) [symbolic = %.loc4_30.2 (constants.%.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc4_6.1: type, %U.loc4_16.1: type) -> @F.%.loc4_30.2 (%.1); +// CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) -> @F.%.loc4_30.2 (%.1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(%T.loc13_6.1: type, %U.loc13_16.1: type) { // CHECK:STDOUT: %T.loc13_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc13_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc13_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: %U.loc13_16.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc13_16.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc13_16.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc13_16.2 (constants.%U.patt.2)] // CHECK:STDOUT: %.loc13_30.2: type = ptr_type @.1.%U.loc13_16.2 (%U) [symbolic = %.loc13_30.2 (constants.%.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc13_6.1: type, %U.loc13_16.1: type) -> @.1.%.loc13_30.2 (%.3) { +// CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) -> @.1.%.loc13_30.2 (%.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc13_6.1 [symbolic = %T.loc13_6.2 (constants.%T)] @@ -255,13 +274,17 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc4_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_6.2 => constants.%T // CHECK:STDOUT: %U.loc4_16.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc4_16.2 => constants.%U // CHECK:STDOUT: %.loc4_30.2 => constants.%.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc13_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc13_6.2 => constants.%T // CHECK:STDOUT: %U.loc13_16.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc13_16.2 => constants.%U // CHECK:STDOUT: %.loc13_30.2 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -269,13 +292,17 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %U.1: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt.1: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.1: type = ptr_type %T.1 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.2: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %U.2: type = bind_symbolic_name U, 0 [symbolic] +// CHECK:STDOUT: %U.patt.2: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %T.2: type = bind_symbolic_name T, 1 [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %.3: type = ptr_type %T.2 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.4: %.type = struct_value () [template] @@ -301,47 +328,55 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %T.patt.loc4_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_6.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_6.1, runtime_param [symbolic = %T.patt.loc4_6.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %U.patt.loc4_16.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc4_16.2 (constants.%U.patt.1)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc4_16.1, runtime_param [symbolic = %U.patt.loc4_16.2 (constants.%U.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_6.2 (constants.%T.1)] -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc4_16.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc4_16.2 (constants.%U.1)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_6.1 [symbolic = %T.loc4_6.2 (constants.%T.1)] // CHECK:STDOUT: %.loc4_30.1: type = ptr_type %T.1 [symbolic = %.loc4_30.2 (constants.%.1)] // CHECK:STDOUT: %return: ref @F.%.loc4_30.2 (%.1) = var +// CHECK:STDOUT: %param.loc4_6: type = param runtime_param +// CHECK:STDOUT: %T.loc4_6.1: type = bind_symbolic_name T, 0, %param.loc4_6 [symbolic = %T.loc4_6.2 (constants.%T.1)] +// CHECK:STDOUT: %param.loc4_16: type = param runtime_param +// CHECK:STDOUT: %U.loc4_16.1: type = bind_symbolic_name U, 1, %param.loc4_16 [symbolic = %U.loc4_16.2 (constants.%U.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 1 +// CHECK:STDOUT: %U.patt.loc13_6.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc13_6.2 (constants.%U.patt.2)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc13_6.1, runtime_param [symbolic = %U.patt.loc13_6.2 (constants.%U.patt.2)] +// CHECK:STDOUT: %T.patt.loc13_16.1: type = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc13_16.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc13_16.1, runtime_param [symbolic = %T.patt.loc13_16.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc13_6.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc13_6.2 (constants.%U.2)] -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc13_16.1: type = bind_symbolic_name T, 1, %T.param [symbolic = %T.loc13_16.2 (constants.%T.2)] // CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc13_16.1 [symbolic = %T.loc13_16.2 (constants.%T.2)] // CHECK:STDOUT: %.loc13_30.1: type = ptr_type %T.2 [symbolic = %.loc13_30.2 (constants.%.3)] // CHECK:STDOUT: %return: ref @.1.%.loc13_30.2 (%.3) = var +// CHECK:STDOUT: %param.loc13_6: type = param runtime_param +// CHECK:STDOUT: %U.loc13_6.1: type = bind_symbolic_name U, 0, %param.loc13_6 [symbolic = %U.loc13_6.2 (constants.%U.2)] +// CHECK:STDOUT: %param.loc13_16: type = param runtime_param +// CHECK:STDOUT: %T.loc13_16.1: type = bind_symbolic_name T, 1, %param.loc13_16 [symbolic = %T.loc13_16.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc4_6.1: type, %U.loc4_16.1: type) { // CHECK:STDOUT: %T.loc4_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_6.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc4_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_6.2 (constants.%T.patt.1)] // CHECK:STDOUT: %U.loc4_16.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc4_16.2 (constants.%U.1)] +// CHECK:STDOUT: %U.patt.loc4_16.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc4_16.2 (constants.%U.patt.1)] // CHECK:STDOUT: %.loc4_30.2: type = ptr_type @F.%T.loc4_6.2 (%T.1) [symbolic = %.loc4_30.2 (constants.%.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc4_6.1: type, %U.loc4_16.1: type) -> @F.%.loc4_30.2 (%.1); +// CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) -> @F.%.loc4_30.2 (%.1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(%U.loc13_6.1: type, %T.loc13_16.1: type) { // CHECK:STDOUT: %U.loc13_6.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc13_6.2 (constants.%U.2)] +// CHECK:STDOUT: %U.patt.loc13_6.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc13_6.2 (constants.%U.patt.2)] // CHECK:STDOUT: %T.loc13_16.2: type = bind_symbolic_name T, 1 [symbolic = %T.loc13_16.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt.loc13_16.2: type = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc13_16.2 (constants.%T.patt.2)] // CHECK:STDOUT: %.loc13_30.2: type = ptr_type @.1.%T.loc13_16.2 (%T.2) [symbolic = %.loc13_30.2 (constants.%.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.loc13_6.1: type, %T.loc13_16.1: type) -> @.1.%.loc13_30.2 (%.3) { +// CHECK:STDOUT: fn(%U.param_patt: type, %T.param_patt: type) -> @.1.%.loc13_30.2 (%.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %T.ref.loc21: type = name_ref T, %T.loc13_16.1 [symbolic = %T.loc13_16.2 (constants.%T.2)] @@ -351,13 +386,17 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.1, constants.%U.1) { // CHECK:STDOUT: %T.loc4_6.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc4_6.2 => constants.%T.1 // CHECK:STDOUT: %U.loc4_16.2 => constants.%U.1 +// CHECK:STDOUT: %U.patt.loc4_16.2 => constants.%U.1 // CHECK:STDOUT: %.loc4_30.2 => constants.%.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%U.2, constants.%T.2) { // CHECK:STDOUT: %U.loc13_6.2 => constants.%U.2 +// CHECK:STDOUT: %U.patt.loc13_6.2 => constants.%U.2 // CHECK:STDOUT: %T.loc13_16.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt.loc13_16.2 => constants.%T.2 // CHECK:STDOUT: %.loc13_30.2 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -365,13 +404,17 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %U.1: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt.1: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.1: type = ptr_type %T.1 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.2: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %U.2: type = bind_symbolic_name U, 0 [symbolic] +// CHECK:STDOUT: %U.patt.2: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %T.2: type = bind_symbolic_name T, 1 [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %.3: type = ptr_type %U.2 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.4: %.type = struct_value () [template] @@ -397,47 +440,55 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %T.patt.loc4_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_6.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_6.1, runtime_param [symbolic = %T.patt.loc4_6.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %U.patt.loc4_16.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc4_16.2 (constants.%U.patt.1)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc4_16.1, runtime_param [symbolic = %U.patt.loc4_16.2 (constants.%U.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_6.2 (constants.%T.1)] -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc4_16.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc4_16.2 (constants.%U.1)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_6.1 [symbolic = %T.loc4_6.2 (constants.%T.1)] // CHECK:STDOUT: %.loc4_30.1: type = ptr_type %T.1 [symbolic = %.loc4_30.2 (constants.%.1)] // CHECK:STDOUT: %return: ref @F.%.loc4_30.2 (%.1) = var +// CHECK:STDOUT: %param.loc4_6: type = param runtime_param +// CHECK:STDOUT: %T.loc4_6.1: type = bind_symbolic_name T, 0, %param.loc4_6 [symbolic = %T.loc4_6.2 (constants.%T.1)] +// CHECK:STDOUT: %param.loc4_16: type = param runtime_param +// CHECK:STDOUT: %U.loc4_16.1: type = bind_symbolic_name U, 1, %param.loc4_16 [symbolic = %U.loc4_16.2 (constants.%U.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 1 +// CHECK:STDOUT: %U.patt.loc13_6.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc13_6.2 (constants.%U.patt.2)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc13_6.1, runtime_param [symbolic = %U.patt.loc13_6.2 (constants.%U.patt.2)] +// CHECK:STDOUT: %T.patt.loc13_16.1: type = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc13_16.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc13_16.1, runtime_param [symbolic = %T.patt.loc13_16.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc13_6.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc13_6.2 (constants.%U.2)] -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc13_16.1: type = bind_symbolic_name T, 1, %T.param [symbolic = %T.loc13_16.2 (constants.%T.2)] // CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc13_6.1 [symbolic = %U.loc13_6.2 (constants.%U.2)] // CHECK:STDOUT: %.loc13_30.1: type = ptr_type %U.2 [symbolic = %.loc13_30.2 (constants.%.3)] // CHECK:STDOUT: %return: ref @.1.%.loc13_30.2 (%.3) = var +// CHECK:STDOUT: %param.loc13_6: type = param runtime_param +// CHECK:STDOUT: %U.loc13_6.1: type = bind_symbolic_name U, 0, %param.loc13_6 [symbolic = %U.loc13_6.2 (constants.%U.2)] +// CHECK:STDOUT: %param.loc13_16: type = param runtime_param +// CHECK:STDOUT: %T.loc13_16.1: type = bind_symbolic_name T, 1, %param.loc13_16 [symbolic = %T.loc13_16.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc4_6.1: type, %U.loc4_16.1: type) { // CHECK:STDOUT: %T.loc4_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_6.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc4_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_6.2 (constants.%T.patt.1)] // CHECK:STDOUT: %U.loc4_16.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc4_16.2 (constants.%U.1)] +// CHECK:STDOUT: %U.patt.loc4_16.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc4_16.2 (constants.%U.patt.1)] // CHECK:STDOUT: %.loc4_30.2: type = ptr_type @F.%T.loc4_6.2 (%T.1) [symbolic = %.loc4_30.2 (constants.%.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc4_6.1: type, %U.loc4_16.1: type) -> @F.%.loc4_30.2 (%.1); +// CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) -> @F.%.loc4_30.2 (%.1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(%U.loc13_6.1: type, %T.loc13_16.1: type) { // CHECK:STDOUT: %U.loc13_6.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc13_6.2 (constants.%U.2)] +// CHECK:STDOUT: %U.patt.loc13_6.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc13_6.2 (constants.%U.patt.2)] // CHECK:STDOUT: %T.loc13_16.2: type = bind_symbolic_name T, 1 [symbolic = %T.loc13_16.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt.loc13_16.2: type = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc13_16.2 (constants.%T.patt.2)] // CHECK:STDOUT: %.loc13_30.2: type = ptr_type @.1.%U.loc13_6.2 (%U.2) [symbolic = %.loc13_30.2 (constants.%.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.loc13_6.1: type, %T.loc13_16.1: type) -> @.1.%.loc13_30.2 (%.3) { +// CHECK:STDOUT: fn(%U.param_patt: type, %T.param_patt: type) -> @.1.%.loc13_30.2 (%.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc13_16.1 [symbolic = %T.loc13_16.2 (constants.%T.2)] @@ -447,13 +498,17 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.1, constants.%U.1) { // CHECK:STDOUT: %T.loc4_6.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc4_6.2 => constants.%T.1 // CHECK:STDOUT: %U.loc4_16.2 => constants.%U.1 +// CHECK:STDOUT: %U.patt.loc4_16.2 => constants.%U.1 // CHECK:STDOUT: %.loc4_30.2 => constants.%.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%U.2, constants.%T.2) { // CHECK:STDOUT: %U.loc13_6.2 => constants.%U.2 +// CHECK:STDOUT: %U.patt.loc13_6.2 => constants.%U.2 // CHECK:STDOUT: %T.loc13_16.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt.loc13_16.2 => constants.%T.2 // CHECK:STDOUT: %.loc13_30.2 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index b493b6726e63..a7169ff03c27 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -34,6 +34,7 @@ fn CallNegative() { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %ErrorIfNIsZero.type: type = fn_type @ErrorIfNIsZero [template] // CHECK:STDOUT: %ErrorIfNIsZero: %ErrorIfNIsZero.type = struct_value () [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] @@ -59,7 +60,7 @@ fn CallNegative() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+16, loaded [template = constants.%Int] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -70,13 +71,14 @@ fn CallNegative() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ErrorIfNIsZero.decl: %ErrorIfNIsZero.type = fn_decl @ErrorIfNIsZero [template = constants.%ErrorIfNIsZero] { -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 +// CHECK:STDOUT: %N.patt.loc4_19.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_19.1, runtime_param [symbolic = %N.patt.loc4_19.2 (constants.%N.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_23.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_23.2: type = converted %int.make_type_32, %.loc4_23.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = param N, runtime_param -// CHECK:STDOUT: %N.loc4_19.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_19.2 (constants.%N)] +// CHECK:STDOUT: %param: i32 = param runtime_param +// CHECK:STDOUT: %N.loc4_19.1: i32 = bind_symbolic_name N, 0, %param [symbolic = %N.loc4_19.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallNegative.decl: %CallNegative.type = fn_decl @CallNegative [template = constants.%CallNegative] {} {} // CHECK:STDOUT: } @@ -85,11 +87,12 @@ fn CallNegative() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ErrorIfNIsZero(%N.loc4_19.1: i32) { // CHECK:STDOUT: %N.loc4_19.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_19.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc4_19.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc12_18: type = int_type signed, %N.loc4_19.2 [symbolic = %.loc12_18 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.loc4_19.1: i32) { +// CHECK:STDOUT: fn(%N.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] @@ -103,7 +106,7 @@ fn CallNegative() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%size: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%size.param_patt: i32) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: fn @CallNegative() { // CHECK:STDOUT: !entry: @@ -116,10 +119,12 @@ fn CallNegative() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ErrorIfNIsZero(constants.%N) { // CHECK:STDOUT: %N.loc4_19.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ErrorIfNIsZero(constants.%.3) { // CHECK:STDOUT: %N.loc4_19.2 => constants.%.3 +// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc12_18 => diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index 22da7e024d39..81d71b48e013 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -24,6 +24,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Wrap.type: type = generic_class_type @Wrap [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Wrap.1: %Wrap.type = struct_value () [template] @@ -85,10 +86,11 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Wrap.decl: %Wrap.type = class_decl @Wrap [template = constants.%Wrap.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_12.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_12.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_12.1, runtime_param [symbolic = %T.patt.loc11_12.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_12.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_12.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_12.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_12.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} @@ -96,6 +98,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: generic class @Wrap(%T.loc11_12.1: type) { // CHECK:STDOUT: %T.loc11_12.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_12.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_12.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_12.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Wrap(%T.loc11_12.2) [symbolic = %Make.type (constants.%Make.type.1)] @@ -197,6 +200,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%T) { // CHECK:STDOUT: %T.loc11_12.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_12.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.1 @@ -214,10 +218,12 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(@Wrap.%T.loc11_12.2) { // CHECK:STDOUT: %T.loc11_12.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_12.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(@Make.%T) { // CHECK:STDOUT: %T.loc11_12.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_12.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Make(@Make.%T) { @@ -226,6 +232,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(i32) { // CHECK:STDOUT: %T.loc11_12.2 => i32 +// CHECK:STDOUT: %T.patt.loc11_12.2 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.2 @@ -243,6 +250,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%.1) { // CHECK:STDOUT: %T.loc11_12.2 => constants.%.1 +// CHECK:STDOUT: %T.patt.loc11_12.2 => constants.%.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.3 @@ -260,6 +268,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%C) { // CHECK:STDOUT: %T.loc11_12.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc11_12.2 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.4 diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index b8d13c6ecd00..b84529998fd5 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -54,6 +54,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Defined.type: type = fn_type @Defined [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Defined: %Defined.type = struct_value () [template] @@ -88,16 +89,18 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Defined.decl: %Defined.type = fn_decl @Defined [template = constants.%Defined] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_12.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_12.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_12.1, runtime_param [symbolic = %T.patt.loc4_12.2 (constants.%T.patt)] // CHECK:STDOUT: %x.patt: @Defined.%T.loc4_12.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Defined.%T.loc4_12.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_12.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_25: type = name_ref T, %T.loc4_12.1 [symbolic = %T.loc4_12.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @Defined.%T.loc4_12.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @Defined.%T.loc4_12.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc4_31: type = name_ref T, %T.loc4_12.1 [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %return: ref @Defined.%T.loc4_12.2 (%T) = var +// CHECK:STDOUT: %param.loc4_12: type = param runtime_param +// CHECK:STDOUT: %T.loc4_12.1: type = bind_symbolic_name T, 0, %param.loc4_12 [symbolic = %T.loc4_12.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_22: @Defined.%T.loc4_12.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @Defined.%T.loc4_12.2 (%T) = bind_name x, %param.loc4_22 // CHECK:STDOUT: } // CHECK:STDOUT: %CallDefined.decl: %CallDefined.type = fn_decl @CallDefined [template = constants.%CallDefined] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -109,10 +112,11 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Defined(%T.loc4_12.1: type) { // CHECK:STDOUT: %T.loc4_12.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_12.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_12.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_12.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc4_12.1: type](%x: @Defined.%T.loc4_12.2 (%T)) -> @Defined.%T.loc4_12.2 (%T) { +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @Defined.%T.loc4_12.2 (%T)) -> @Defined.%T.loc4_12.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @Defined.%T.loc4_12.2 (%T) = name_ref x, %x // CHECK:STDOUT: return %x.ref @@ -134,10 +138,12 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Defined(constants.%T) { // CHECK:STDOUT: %T.loc4_12.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_12.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Defined(i32) { // CHECK:STDOUT: %T.loc4_12.2 => i32 +// CHECK:STDOUT: %T.patt.loc4_12.2 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -146,6 +152,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Defined.type: type = fn_type @Defined [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Defined: %Defined.type = struct_value () [template] @@ -155,6 +162,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %CallDefined: %CallDefined.type = struct_value () [template] // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // CHECK:STDOUT: %.3: = specific_function %Defined, @Defined(i32) [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -180,16 +188,18 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Defined.decl.loc4: %Defined.type = fn_decl @Defined [template = constants.%Defined] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc10: type = symbolic_binding_pattern T, 0 [symbolic = constants.%T.patt.2] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc10, runtime_param [symbolic = constants.%T.patt.2] // CHECK:STDOUT: %x.patt: %T = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %T = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param.loc4: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_12.1: type = bind_symbolic_name T, 0, %T.param.loc4 [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_25: type = name_ref T, %T.loc4_12.1 [symbolic = %T.loc4_12.2 (constants.%T)] -// CHECK:STDOUT: %x.param.loc4: @Defined.%T.loc4_12.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x.loc4: @Defined.%T.loc4_12.2 (%T) = bind_name x, %x.param.loc4 // CHECK:STDOUT: %T.ref.loc4_31: type = name_ref T, %T.loc4_12.1 [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %return.var.loc4: ref @Defined.%T.loc4_12.2 (%T) = var +// CHECK:STDOUT: %param.loc4_12: type = param runtime_param +// CHECK:STDOUT: %T.loc4_12.1: type = bind_symbolic_name T, 0, %param.loc4_12 [symbolic = %T.loc4_12.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_22: @Defined.%T.loc4_12.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x.loc4: @Defined.%T.loc4_12.2 (%T) = bind_name x, %param.loc4_22 // CHECK:STDOUT: } // CHECK:STDOUT: %CallDefined.decl: %CallDefined.type = fn_decl @CallDefined [template = constants.%CallDefined] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -198,25 +208,28 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Defined.decl.loc10: %Defined.type = fn_decl @Defined [template = constants.%Defined] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc10: type = symbolic_binding_pattern T, 0 [symbolic = constants.%T.patt.2] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc10, runtime_param [symbolic = constants.%T.patt.2] // CHECK:STDOUT: %x.patt: %T = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %T = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param.loc10: type = param T, runtime_param -// CHECK:STDOUT: %T.loc10: type = bind_symbolic_name T, 0, %T.param.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref.loc10_25: type = name_ref T, %T.loc10 [symbolic = constants.%T] -// CHECK:STDOUT: %x.param.loc10: %T = param x, runtime_param0 -// CHECK:STDOUT: %x.loc10: %T = bind_name x, %x.param.loc10 // CHECK:STDOUT: %T.ref.loc10_31: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %return: ref %T = var +// CHECK:STDOUT: %param.loc10_12: type = param runtime_param +// CHECK:STDOUT: %T.loc10: type = bind_symbolic_name T, 0, %param.loc10_12 [symbolic = constants.%T] +// CHECK:STDOUT: %param.loc10_22: %T = param runtime_param0 +// CHECK:STDOUT: %x.loc10: %T = bind_name x, %param.loc10_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Defined(%T.loc4_12.1: type) { // CHECK:STDOUT: %T.loc4_12.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_12.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc10: type](%x.loc10: %T) -> %T { +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: %T) -> %T { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @Defined.%T.loc4_12.2 (%T) = name_ref x, %x.loc10 // CHECK:STDOUT: return %x.ref @@ -238,10 +251,12 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Defined(constants.%T) { // CHECK:STDOUT: %T.loc4_12.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Defined(i32) { // CHECK:STDOUT: %T.loc4_12.2 => i32 +// CHECK:STDOUT: %T.patt.loc4 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -250,6 +265,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Undefined.type: type = fn_type @Undefined [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Undefined: %Undefined.type = struct_value () [template] @@ -284,16 +300,18 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Undefined.decl: %Undefined.type = fn_decl @Undefined [template = constants.%Undefined] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_14.1, runtime_param [symbolic = %T.patt.loc4_14.2 (constants.%T.patt)] // CHECK:STDOUT: %x.patt: @Undefined.%T.loc4_14.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Undefined.%T.loc4_14.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_14.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_27: type = name_ref T, %T.loc4_14.1 [symbolic = %T.loc4_14.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @Undefined.%T.loc4_14.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @Undefined.%T.loc4_14.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %T.ref.loc4_33: type = name_ref T, %T.loc4_14.1 [symbolic = %T.loc4_14.2 (constants.%T)] // CHECK:STDOUT: %return: ref @Undefined.%T.loc4_14.2 (%T) = var +// CHECK:STDOUT: %param.loc4_14: type = param runtime_param +// CHECK:STDOUT: %T.loc4_14.1: type = bind_symbolic_name T, 0, %param.loc4_14 [symbolic = %T.loc4_14.2 (constants.%T)] +// CHECK:STDOUT: %param.loc4_24: @Undefined.%T.loc4_14.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @Undefined.%T.loc4_14.2 (%T) = bind_name x, %param.loc4_24 // CHECK:STDOUT: } // CHECK:STDOUT: %CallUndefined.decl: %CallUndefined.type = fn_decl @CallUndefined [template = constants.%CallUndefined] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -305,8 +323,9 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Undefined(%T.loc4_14.1: type) { // CHECK:STDOUT: %T.loc4_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_14.2 (constants.%T.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.loc4_14.1: type](%x: @Undefined.%T.loc4_14.2 (%T)) -> @Undefined.%T.loc4_14.2 (%T); +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @Undefined.%T.loc4_14.2 (%T)) -> @Undefined.%T.loc4_14.2 (%T); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -324,9 +343,11 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Undefined(constants.%T) { // CHECK:STDOUT: %T.loc4_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_14.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Undefined(i32) { // CHECK:STDOUT: %T.loc4_14.2 => i32 +// CHECK:STDOUT: %T.patt.loc4_14.2 => i32 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if/else.carbon b/toolchain/check/testdata/if/else.carbon index e814bb56a049..60a845f275c1 100644 --- a/toolchain/check/testdata/if/else.carbon +++ b/toolchain/check/testdata/if/else.carbon @@ -66,12 +66,13 @@ fn If(b: bool) { // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {} // CHECK:STDOUT: %If.decl: %If.type = fn_decl @If [template = constants.%If] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc15_10.2: type = converted %bool.make_type, %.loc15_10.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -92,7 +93,7 @@ fn If(b: bool) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @If(%b: bool) { +// CHECK:STDOUT: fn @If(%b.param_patt: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index bea37e524b9e..46c4a47754ca 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -84,42 +84,45 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %If1.decl: %If1.type = fn_decl @If1 [template = constants.%If1] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type, %.loc11_11.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_20.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_20.2: type = converted %int.make_type_32, %.loc11_20.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %If2.decl: %If2.type = fn_decl @If2 [template = constants.%If2] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc22_11.2: type = converted %bool.make_type, %.loc22_11.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_20.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc22_20.2: type = converted %int.make_type_32, %.loc22_20.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %If3.decl: %If3.type = fn_decl @If3 [template = constants.%If3] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc33_11.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc33_11.2: type = converted %bool.make_type, %.loc33_11.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc33_20.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc33_20.2: type = converted %int.make_type_32, %.loc33_20.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -127,7 +130,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @If1(%b: bool) -> i32 { +// CHECK:STDOUT: fn @If1(%b.param_patt: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else @@ -142,7 +145,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: !if.done: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @If2(%b: bool) -> i32 { +// CHECK:STDOUT: fn @If2(%b.param_patt: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else @@ -157,7 +160,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: !if.done: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @If3(%b: bool) -> i32 { +// CHECK:STDOUT: fn @If3(%b.param_patt: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index a77410f2ad20..f3b604c54e9c 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -57,16 +57,17 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %VarScope.decl: %VarScope.type = fn_decl @VarScope [template = constants.%VarScope] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_16.2: type = converted %bool.make_type, %.loc11_16.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11, %.loc11_25.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -74,7 +75,7 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @VarScope(%b: bool) -> i32 { +// CHECK:STDOUT: fn @VarScope(%b.param_patt: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else diff --git a/toolchain/check/testdata/if/no_else.carbon b/toolchain/check/testdata/if/no_else.carbon index 2f3918b7fab8..fad00900e88b 100644 --- a/toolchain/check/testdata/if/no_else.carbon +++ b/toolchain/check/testdata/if/no_else.carbon @@ -59,12 +59,13 @@ fn If(b: bool) { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: %If.decl: %If.type = fn_decl @If [template = constants.%If] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc14_10.2: type = converted %bool.make_type, %.loc14_10.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -80,7 +81,7 @@ fn If(b: bool) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @If(%b: bool) { +// CHECK:STDOUT: fn @If(%b.param_patt: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index 676a78819970..309045a2c2a9 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -56,16 +56,17 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %If.decl: %If.type = fn_decl @If [template = constants.%If] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_10.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_10.2: type = converted %bool.make_type, %.loc11_10.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32, %.loc11_19.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -73,7 +74,7 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @If(%b: bool) -> i32 { +// CHECK:STDOUT: fn @If(%b.param_patt: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index 56292c2003f3..899a4b62e120 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -56,28 +56,31 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param1 // CHECK:STDOUT: %m.patt: i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: i32 = param_pattern %m.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type, %.loc11_9.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc11_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_32.loc11_18 [template = i32] // CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_32.loc11_18, %.loc11_18.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param1 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param // CHECK:STDOUT: %int.make_type_32.loc11_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_26.1: type = value_of_initializer %int.make_type_32.loc11_26 [template = i32] // CHECK:STDOUT: %.loc11_26.2: type = converted %int.make_type_32.loc11_26, %.loc11_26.1 [template = i32] -// CHECK:STDOUT: %m.param: i32 = param m, runtime_param2 -// CHECK:STDOUT: %m: i32 = bind_name m, %m.param // CHECK:STDOUT: %int.make_type_32.loc11_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_34.1: type = value_of_initializer %int.make_type_32.loc11_34 [template = i32] // CHECK:STDOUT: %.loc11_34.2: type = converted %int.make_type_32.loc11_34, %.loc11_34.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc11_6: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param.loc11_6 +// CHECK:STDOUT: %param.loc11_15: i32 = param runtime_param1 +// CHECK:STDOUT: %n: i32 = bind_name n, %param.loc11_15 +// CHECK:STDOUT: %param.loc11_23: i32 = param runtime_param2 +// CHECK:STDOUT: %m: i32 = bind_name m, %param.loc11_23 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -85,7 +88,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%b: bool, %n: i32, %m: i32) -> i32 { +// CHECK:STDOUT: fn @F(%b.param_patt: bool, %n.param_patt: i32, %m.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_16: i32 = int_literal 1 [template = constants.%.2] diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index fb55a037b666..b8f31e746005 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -114,13 +114,14 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %PartiallyConstant.decl: %PartiallyConstant.type = fn_decl @PartiallyConstant [template = constants.%PartiallyConstant] { // CHECK:STDOUT: %t.patt: type = binding_pattern t +// CHECK:STDOUT: %t.param_patt: type = param_pattern %t.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %t.param: type = param t, runtime_param0 -// CHECK:STDOUT: %t: type = bind_name t, %t.param // CHECK:STDOUT: %int.make_type_32.loc28: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc28_34.1: type = value_of_initializer %int.make_type_32.loc28 [template = i32] // CHECK:STDOUT: %.loc28_34.2: type = converted %int.make_type_32.loc28, %.loc28_34.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: type = param runtime_param0 +// CHECK:STDOUT: %t: type = bind_name t, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -240,7 +241,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: return %.loc25_10.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @PartiallyConstant(%t: type) -> i32 { +// CHECK:STDOUT: fn @PartiallyConstant(%t.param_patt: type) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc29_13: bool = bool_literal true [template = constants.%.4] // CHECK:STDOUT: if %.loc29_13 br !if.expr.then.loc29 else br !if.expr.else.loc29 diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index eca2fba1217c..b7e3caa8aedf 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -72,16 +72,17 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc14_9.2: type = converted %bool.make_type, %.loc14_9.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_18.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_18.2: type = converted %int.make_type_32, %.loc14_18.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -101,7 +102,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%b: bool) -> i32 { +// CHECK:STDOUT: fn @F(%b.param_patt: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index fbffdd15bd13..8b319be8f93d 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -69,7 +69,7 @@ class C { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -91,12 +91,12 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .n = .inst+48.loc37_8 +// CHECK:STDOUT: .n = .inst+50.loc37_8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index 46a24958482f..cfb52f4a6579 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -77,18 +77,19 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ConditionIsNonConstant.decl: %ConditionIsNonConstant.type = fn_decl @ConditionIsNonConstant [template = constants.%ConditionIsNonConstant] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc4_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc4_30.2: type = converted %bool.make_type, %.loc4_30.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConditionIsNonConstant(%b: bool) { +// CHECK:STDOUT: fn @ConditionIsNonConstant(%b.param_patt: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else @@ -152,13 +153,14 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ChosenBranchIsNonConstant.decl: %ChosenBranchIsNonConstant.type = fn_decl @ChosenBranchIsNonConstant [template = constants.%ChosenBranchIsNonConstant] { // CHECK:STDOUT: %t.patt: type = binding_pattern t +// CHECK:STDOUT: %t.param_patt: type = param_pattern %t.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %t.param: type = param t, runtime_param0 -// CHECK:STDOUT: %t: type = bind_name t, %t.param +// CHECK:STDOUT: %param: type = param runtime_param0 +// CHECK:STDOUT: %t: type = bind_name t, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ChosenBranchIsNonConstant(%t: type) { +// CHECK:STDOUT: fn @ChosenBranchIsNonConstant(%t.param_patt: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc9_13: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: if %.loc9_13 br !if.expr.then.loc9 else br !if.expr.else.loc9 diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index 59a340efb135..759fa7e3defc 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -53,28 +53,31 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: bool = binding_pattern a +// CHECK:STDOUT: %a.param_patt: bool = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: bool = binding_pattern c +// CHECK:STDOUT: %c.param_patt: bool = param_pattern %c.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc11_9: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type.loc11_9 [template = bool] // CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type.loc11_9, %.loc11_9.1 [template = bool] -// CHECK:STDOUT: %a.param: bool = param a, runtime_param0 -// CHECK:STDOUT: %a: bool = bind_name a, %a.param // CHECK:STDOUT: %bool.make_type.loc11_18: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %bool.make_type.loc11_18 [template = bool] // CHECK:STDOUT: %.loc11_18.2: type = converted %bool.make_type.loc11_18, %.loc11_18.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param1 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type.loc11_27: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %bool.make_type.loc11_27 [template = bool] // CHECK:STDOUT: %.loc11_27.2: type = converted %bool.make_type.loc11_27, %.loc11_27.1 [template = bool] -// CHECK:STDOUT: %c.param: bool = param c, runtime_param2 -// CHECK:STDOUT: %c: bool = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_36.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_36.2: type = converted %int.make_type_32, %.loc11_36.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc11_6: bool = param runtime_param0 +// CHECK:STDOUT: %a: bool = bind_name a, %param.loc11_6 +// CHECK:STDOUT: %param.loc11_15: bool = param runtime_param1 +// CHECK:STDOUT: %b: bool = bind_name b, %param.loc11_15 +// CHECK:STDOUT: %param.loc11_24: bool = param runtime_param2 +// CHECK:STDOUT: %c: bool = bind_name c, %param.loc11_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -82,7 +85,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a: bool, %b: bool, %c: bool) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: bool, %b.param_patt: bool, %c.param_patt: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: bool = name_ref a, %a // CHECK:STDOUT: if %a.ref br !if.expr.then.loc12_10 else br !if.expr.else.loc12_10 diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 60a8bd4491b0..b675433a5504 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -60,6 +60,7 @@ fn F(cond: bool) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %s.patt: %.2 = binding_pattern s +// CHECK:STDOUT: %s.param_patt: %.2 = param_pattern %s.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] @@ -68,27 +69,28 @@ fn F(cond: bool) { // CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_32.loc11_23 [template = i32] // CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_32.loc11_23, %.loc11_23.1 [template = i32] // CHECK:STDOUT: %.loc11_26: type = struct_type {.a: i32, .b: i32} [template = constants.%.2] -// CHECK:STDOUT: %s.param: %.2 = param s, runtime_param0 -// CHECK:STDOUT: %s: %.2 = bind_name s, %s.param +// CHECK:STDOUT: %param: %.2 = param runtime_param0 +// CHECK:STDOUT: %s: %.2 = bind_name s, %param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %cond.patt: bool = binding_pattern cond +// CHECK:STDOUT: %cond.param_patt: bool = param_pattern %cond.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc13_12.2: type = converted %bool.make_type, %.loc13_12.1 [template = bool] -// CHECK:STDOUT: %cond.param: bool = param cond, runtime_param0 -// CHECK:STDOUT: %cond: bool = bind_name cond, %cond.param +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %cond: bool = bind_name cond, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%s: %.2); +// CHECK:STDOUT: fn @G(%s.param_patt: %.2); // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%cond: bool) { +// CHECK:STDOUT: fn @F(%cond.param_patt: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc14_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %int.make_type_32.loc14_15 [template = i32] diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index c331d3d1c6c1..e2ae4cea81af 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -100,41 +100,45 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: } // CHECK:STDOUT: %NonInstanceCall.decl: %NonInstanceCall.type = fn_decl @NonInstanceCall [template = constants.%NonInstanceCall] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_23.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc21_23.2: type = converted %int.make_type_32, %.loc21_23.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [template = constants.%InstanceCall] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc25_20.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc25_20.2: type = converted %int.make_type_32, %.loc25_20.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %NonInstanceCallIndirect.decl: %NonInstanceCallIndirect.type = fn_decl @NonInstanceCallIndirect [template = constants.%NonInstanceCallIndirect] { // CHECK:STDOUT: %p.patt: %.7 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.7 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc29_34.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc29_34.2: type = converted %int.make_type_32, %.loc29_34.1 [template = i32] // CHECK:STDOUT: %.loc29_34.3: type = ptr_type i32 [template = constants.%.7] -// CHECK:STDOUT: %p.param: %.7 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.7 = bind_name p, %p.param +// CHECK:STDOUT: %param: %.7 = param runtime_param0 +// CHECK:STDOUT: %p: %.7 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %InstanceCallIndirect.decl: %InstanceCallIndirect.type = fn_decl @InstanceCallIndirect [template = constants.%InstanceCallIndirect] { // CHECK:STDOUT: %p.patt: %.7 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.7 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc33_31.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc33_31.2: type = converted %int.make_type_32, %.loc33_31.1 [template = i32] // CHECK:STDOUT: %.loc33_31.3: type = ptr_type i32 [template = constants.%.7] -// CHECK:STDOUT: %p.param: %.7 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.7 = bind_name p, %p.param +// CHECK:STDOUT: %param: %.7 = param runtime_param0 +// CHECK:STDOUT: %p: %.7 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -144,12 +148,13 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %.loc12: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] { // CHECK:STDOUT: %self.patt: @G.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @G.1.%Self (%Self) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: %Simple.type = name_ref Self, @Simple.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc13_14.1: type = facet_type_access %Self.ref [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc13_14.2: type = converted %Self.ref, %.loc13_14.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @G.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self: @G.1.%Self (%Self) = bind_name self, %self.param +// CHECK:STDOUT: %param: @G.1.%Self (%Self) = param runtime_param0 +// CHECK:STDOUT: %self: @G.1.%Self (%Self) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc13: %.4 = assoc_entity element1, %G.decl [template = constants.%.5] // CHECK:STDOUT: @@ -164,12 +169,13 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] { // CHECK:STDOUT: %self.patt: i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: i32 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc18_14.2: type = converted %int.make_type_32, %.loc18_14.1 [template = i32] -// CHECK:STDOUT: %self.param: i32 = param self, runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %self: i32 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16_20: = interface_witness (%F.decl, %G.decl) [template = constants.%.6] // CHECK:STDOUT: @@ -187,16 +193,16 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: generic fn @G.1(@Simple.%Self: %Simple.type) { // CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @G.1.%Self (%Self)](); +// CHECK:STDOUT: fn[%self.param_patt: @G.1.%Self (%Self)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G.2[%self: i32](); +// CHECK:STDOUT: fn @G.2[%self.param_patt: i32](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @NonInstanceCall(%n: i32) { +// CHECK:STDOUT: fn @NonInstanceCall(%n.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] @@ -206,7 +212,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @InstanceCall(%n: i32) { +// CHECK:STDOUT: fn @InstanceCall(%n.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] @@ -217,7 +223,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @NonInstanceCallIndirect(%p: %.7) { +// CHECK:STDOUT: fn @NonInstanceCallIndirect(%p.param_patt: %.7) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.7 = name_ref p, %p // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] @@ -228,7 +234,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @InstanceCallIndirect(%p: %.7) { +// CHECK:STDOUT: fn @InstanceCallIndirect(%p.param_patt: %.7) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.7 = name_ref p, %p // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] diff --git a/toolchain/check/testdata/impl/extend_impl.carbon b/toolchain/check/testdata/impl/extend_impl.carbon index 75fbb2f0b5c6..1052d9f8a0ee 100644 --- a/toolchain/check/testdata/impl/extend_impl.carbon +++ b/toolchain/check/testdata/impl/extend_impl.carbon @@ -69,10 +69,11 @@ fn G(c: C) { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %C = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %c.param: %C = param c, runtime_param0 -// CHECK:STDOUT: %c: %C = bind_name c, %c.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %c: %C = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -118,7 +119,7 @@ fn G(c: C) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%c: %C) { +// CHECK:STDOUT: fn @G(%c.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %F.ref.loc22: %.2 = name_ref F, @HasF.%.loc12 [template = constants.%.3] diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index 4bbc15983412..abd775d538c2 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -72,12 +72,13 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [template = constants.%InstanceCall] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_20.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc22_20.2: type = converted %int.make_type_32, %.loc22_20.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -85,12 +86,13 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] { // CHECK:STDOUT: %self.patt: @G.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @G.1.%Self (%Self) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: %Simple.type = name_ref Self, @Simple.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref, %.loc12_14.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @G.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self: @G.1.%Self (%Self) = bind_name self, %self.param +// CHECK:STDOUT: %param: @G.1.%Self (%Self) = param runtime_param0 +// CHECK:STDOUT: %self: @G.1.%Self (%Self) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc12: %.2 = assoc_entity element0, %G.decl [template = constants.%.3] // CHECK:STDOUT: @@ -103,10 +105,11 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: impl @impl: %.loc15_6.2 as %Simple.ref { // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] { // CHECK:STDOUT: %self.patt: = binding_pattern self +// CHECK:STDOUT: %self.param_patt: = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Undeclared.ref: = name_ref Undeclared, [template = ] -// CHECK:STDOUT: %self.param: = param self, runtime_param0 -// CHECK:STDOUT: %self: = bind_name self, %self.param +// CHECK:STDOUT: %param: = param runtime_param0 +// CHECK:STDOUT: %self: = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15_20: = interface_witness () [template = ] // CHECK:STDOUT: @@ -118,14 +121,14 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: generic fn @G.1(@Simple.%Self: %Simple.type) { // CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @G.1.%Self (%Self)](); +// CHECK:STDOUT: fn[%self.param_patt: @G.1.%Self (%Self)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G.2[%self: ](); +// CHECK:STDOUT: fn @G.2[%self.param_patt: ](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @InstanceCall(%n: i32) { +// CHECK:STDOUT: fn @InstanceCall(%n.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index f1a1c7986d0b..a02708bf9ffe 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -25,6 +25,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %GenericInterface.type.1: type = generic_interface_type @GenericInterface [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %GenericInterface: %GenericInterface.type.1 = struct_value () [template] @@ -35,6 +36,7 @@ class C { // CHECK:STDOUT: %.2: type = assoc_entity_type %GenericInterface.type.2, %F.type.1 [symbolic] // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @GenericInterface.%F.decl [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %.4: = interface_witness (%F.2) [symbolic] @@ -63,16 +65,18 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %GenericInterface.decl: %GenericInterface.type.1 = interface_decl @GenericInterface [template = constants.%GenericInterface] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_28.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_28.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_28.1, runtime_param [symbolic = %T.patt.loc11_28.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_28.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_28.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_28.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_28.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @GenericInterface(%T.loc11_28.1: type) { // CHECK:STDOUT: %T.loc11_28.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_28.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_28.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_28.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GenericInterface.type: type = interface_type @GenericInterface, @GenericInterface(%T.loc11_28.2) [symbolic = %GenericInterface.type (constants.%GenericInterface.type.2)] @@ -86,10 +90,11 @@ class C { // CHECK:STDOUT: %Self.1: @GenericInterface.%GenericInterface.type (%GenericInterface.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: %F.decl: @GenericInterface.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = @GenericInterface.%F (constants.%F.1)] { // CHECK:STDOUT: %x.patt: @F.1.%T (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @F.1.%T (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, @GenericInterface.%T.loc11_28.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %x.param: @F.1.%T (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @F.1.%T (%T) = bind_name x, %x.param +// CHECK:STDOUT: %param: @F.1.%T (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @F.1.%T (%T) = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc12_13.1: @GenericInterface.%.loc12_13.2 (%.2) = assoc_entity element0, %F.decl [symbolic = %.loc12_13.3 (constants.%.3)] // CHECK:STDOUT: @@ -102,6 +107,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl(%T.loc19_23.1: type) { // CHECK:STDOUT: %T.loc19_23.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc19_23.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc19_23.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_23.2 (constants.%T.patt.2)] // CHECK:STDOUT: %GenericInterface.type.loc19_52.2: type = interface_type @GenericInterface, @GenericInterface(%T.loc19_23.2) [symbolic = %GenericInterface.type.loc19_52.2 (constants.%GenericInterface.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -112,10 +118,11 @@ class C { // CHECK:STDOUT: impl: %Self.ref as %GenericInterface.type.loc19_52.1 { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] { // CHECK:STDOUT: %x.patt: @F.2.%T (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @F.2.%T (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, @impl.%T.loc19_23.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %x.param: @F.2.%T (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @F.2.%T (%T) = bind_name x, %x.param +// CHECK:STDOUT: %param: @F.2.%T (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @F.2.%T (%T) = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19_56.1: = interface_witness (%F.decl) [symbolic = %.loc19_56.2 (constants.%.4)] // CHECK:STDOUT: @@ -127,14 +134,15 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc19_23.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_23.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc19_23.1, runtime_param [symbolic = %T.patt.loc19_23.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc19_23.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc19_23.2 (constants.%T)] // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.1 = name_ref GenericInterface, file.%GenericInterface.decl [template = constants.%GenericInterface] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc19_23.1 [symbolic = %T.loc19_23.2 (constants.%T)] // CHECK:STDOUT: %GenericInterface.type.loc19_52.1: type = interface_type @GenericInterface, @GenericInterface(constants.%T) [symbolic = %GenericInterface.type.loc19_52.2 (constants.%GenericInterface.type.2)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc19_23.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc19_23.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: @@ -146,7 +154,7 @@ class C { // CHECK:STDOUT: generic fn @F.1(@GenericInterface.%T.loc11_28.1: type, @GenericInterface.%Self.1: @GenericInterface.%GenericInterface.type (%GenericInterface.type.2)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x: @F.1.%T (%T)); +// CHECK:STDOUT: fn(%x.param_patt: @F.1.%T (%T)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.2(@impl.%T.loc19_23.1: type) { @@ -154,7 +162,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x: @F.2.%T (%T)) { +// CHECK:STDOUT: fn(%x.param_patt: @F.2.%T (%T)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -162,6 +170,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericInterface(constants.%T) { // CHECK:STDOUT: %T.loc11_28.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_28.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GenericInterface.type => constants.%GenericInterface.type.2 @@ -178,14 +187,17 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericInterface(@GenericInterface.%T.loc11_28.2) { // CHECK:STDOUT: %T.loc11_28.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_28.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericInterface(@impl.%T.loc19_23.2) { // CHECK:STDOUT: %T.loc11_28.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_28.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc19_23.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc19_23.2 => constants.%T // CHECK:STDOUT: %GenericInterface.type.loc19_52.2 => constants.%GenericInterface.type.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -204,6 +216,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@impl.%T.loc19_23.2) { // CHECK:STDOUT: %T.loc19_23.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc19_23.2 => constants.%T // CHECK:STDOUT: %GenericInterface.type.loc19_52.2 => constants.%GenericInterface.type.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index fdd784eb0177..e053fc0d246a 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -135,10 +135,10 @@ class FDifferentParamType { impl as J { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F[self: bool](b: Self) -> bool; - // CHECK:STDERR: ^ + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: note: previous declaration's corresponding parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } - // CHECK:STDERR: ^ + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn F[self: bool](b: Self) -> bool; } @@ -148,10 +148,10 @@ class FDifferentImplicitParamType { impl as J { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: redeclaration differs at implicit parameter 1 // CHECK:STDERR: fn F[self: Self](b: bool) -> bool; - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-59]]:20: note: previous declaration's corresponding implicit parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fn F[self: Self](b: bool) -> bool; } @@ -175,10 +175,10 @@ class FDifferentParamName { impl as J { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F[self: bool](not_b: bool) -> bool; - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-86]]:32: note: previous declaration's corresponding parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } - // CHECK:STDERR: ^ + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn F[self: bool](not_b: bool) -> bool; } @@ -192,10 +192,10 @@ class SelfNestedBadParam { impl as SelfNested { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> [SelfNestedBadParam; 4]; - // CHECK:STDERR: ^ + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-8]]:8: note: previous declaration's corresponding parameter here // CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4]; - // CHECK:STDERR: ^ + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> [SelfNestedBadParam; 4]; } @@ -378,22 +378,24 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.2] // CHECK:STDOUT: %F.decl: %F.type.5 = fn_decl @F.5 [template = constants.%F.6] { // CHECK:STDOUT: %self.patt: bool = binding_pattern self +// CHECK:STDOUT: %self.param_patt: bool = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc93_26: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc93_26.1: type = value_of_initializer %bool.make_type.loc93_26 [template = bool] // CHECK:STDOUT: %.loc93_26.2: type = converted %bool.make_type.loc93_26, %.loc93_26.1 [template = bool] -// CHECK:STDOUT: %self.param: bool = param self, runtime_param0 -// CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %bool.make_type.loc93_35: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc93_35.1: type = value_of_initializer %bool.make_type.loc93_35 [template = bool] // CHECK:STDOUT: %.loc93_35.2: type = converted %bool.make_type.loc93_35, %.loc93_35.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param1 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type.loc93_44: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc93_44.1: type = value_of_initializer %bool.make_type.loc93_44 [template = bool] // CHECK:STDOUT: %.loc93_44.2: type = converted %bool.make_type.loc93_44, %.loc93_44.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc93_20: bool = param runtime_param0 +// CHECK:STDOUT: %self: bool = bind_name self, %param.loc93_20 +// CHECK:STDOUT: %param.loc93_32: bool = param runtime_param1 +// CHECK:STDOUT: %b: bool = bind_name b, %param.loc93_32 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc93: %.6 = assoc_entity element0, %F.decl [template = constants.%.7] // CHECK:STDOUT: @@ -407,6 +409,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self: %SelfNested.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.3] // CHECK:STDOUT: %F.decl: %F.type.13 = fn_decl @F.13 [template = constants.%F.14] { // CHECK:STDOUT: %x.patt: @F.13.%.loc188_38.1 (%.11) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @F.13.%.loc188_38.1 (%.11) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc188_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_16.2: type = facet_type_access %Self.ref.loc188_12 [symbolic = %Self (constants.%Self.3)] @@ -421,14 +424,14 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.loc188_37.2: type = struct_type {.x: %Self.3, .y: i32} [symbolic = %.loc188_37.1 (constants.%.9)] // CHECK:STDOUT: %.loc188_38.2: %.10 = tuple_literal (%.loc188_16.4, %.loc188_37.2) // CHECK:STDOUT: %.loc188_38.3: type = converted %.loc188_38.2, constants.%.11 [symbolic = %.loc188_38.1 (constants.%.11)] -// CHECK:STDOUT: %x.param: @F.13.%.loc188_38.1 (%.11) = param x, runtime_param0 -// CHECK:STDOUT: %x: @F.13.%.loc188_38.1 (%.11) = bind_name x, %x.param // CHECK:STDOUT: %Self.ref.loc188_45: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_51: i32 = int_literal 4 [template = constants.%.12] // CHECK:STDOUT: %.loc188_45.1: type = facet_type_access %Self.ref.loc188_45 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_45.2: type = converted %Self.ref.loc188_45, %.loc188_45.1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_52.2: type = array_type %.loc188_51, %Self.3 [symbolic = %.loc188_52.1 (constants.%.13)] // CHECK:STDOUT: %return: ref @F.13.%.loc188_52.1 (%.13) = var +// CHECK:STDOUT: %param: @F.13.%.loc188_38.1 (%.11) = param runtime_param0 +// CHECK:STDOUT: %x: @F.13.%.loc188_38.1 (%.11) = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc188: %.14 = assoc_entity element0, %F.decl [template = constants.%.15] // CHECK:STDOUT: @@ -467,12 +470,13 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @impl.4: %Self.ref as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.3] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc62_13.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc62_13.2: type = converted %bool.make_type, %.loc62_13.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc54: = interface_witness () [template = ] // CHECK:STDOUT: @@ -484,10 +488,11 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @impl.5: %Self.ref as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.4] { // CHECK:STDOUT: %self.patt: %FExtraImplicitParam = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %FExtraImplicitParam = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam] -// CHECK:STDOUT: %self.param: %FExtraImplicitParam = param self, runtime_param0 -// CHECK:STDOUT: %self: %FExtraImplicitParam = bind_name self, %self.param +// CHECK:STDOUT: %param: %FExtraImplicitParam = param runtime_param0 +// CHECK:STDOUT: %self: %FExtraImplicitParam = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc67: = interface_witness () [template = ] // CHECK:STDOUT: @@ -513,16 +518,17 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @impl.7: %Self.ref as %J.ref { // CHECK:STDOUT: %F.decl: %F.type.6 = fn_decl @F.6 [template = constants.%F.7] { // CHECK:STDOUT: %self.patt: bool = binding_pattern self +// CHECK:STDOUT: %self.param_patt: bool = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc104_16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc104_16.1: type = value_of_initializer %bool.make_type.loc104_16 [template = bool] // CHECK:STDOUT: %.loc104_16.2: type = converted %bool.make_type.loc104_16, %.loc104_16.1 [template = bool] -// CHECK:STDOUT: %self.param: bool = param self, runtime_param0 -// CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %bool.make_type.loc104_27: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc104_27.1: type = value_of_initializer %bool.make_type.loc104_27 [template = bool] // CHECK:STDOUT: %.loc104_27.2: type = converted %bool.make_type.loc104_27, %.loc104_27.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %self: bool = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc96: = interface_witness () [template = ] // CHECK:STDOUT: @@ -534,16 +540,17 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @impl.8: %Self.ref as %J.ref { // CHECK:STDOUT: %F.decl: %F.type.7 = fn_decl @F.7 [template = constants.%F.8] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc117_13: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc117_13.1: type = value_of_initializer %bool.make_type.loc117_13 [template = bool] // CHECK:STDOUT: %.loc117_13.2: type = converted %bool.make_type.loc117_13, %.loc117_13.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type.loc117_22: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc117_22.1: type = value_of_initializer %bool.make_type.loc117_22 [template = bool] // CHECK:STDOUT: %.loc117_22.2: type = converted %bool.make_type.loc117_22, %.loc117_22.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc109: = interface_witness () [template = ] // CHECK:STDOUT: @@ -555,18 +562,20 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @impl.9: %Self.ref as %J.ref { // CHECK:STDOUT: %F.decl: %F.type.8 = fn_decl @F.8 [template = constants.%F.9] { // CHECK:STDOUT: %self.patt: bool = binding_pattern self +// CHECK:STDOUT: %self.param_patt: bool = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc130_16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc130_16.1: type = value_of_initializer %bool.make_type.loc130_16 [template = bool] // CHECK:STDOUT: %.loc130_16.2: type = converted %bool.make_type.loc130_16, %.loc130_16.1 [template = bool] -// CHECK:STDOUT: %self.param: bool = param self, runtime_param0 -// CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %bool.make_type.loc130_25: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc130_25.1: type = value_of_initializer %bool.make_type.loc130_25 [template = bool] // CHECK:STDOUT: %.loc130_25.2: type = converted %bool.make_type.loc130_25, %.loc130_25.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param1 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param +// CHECK:STDOUT: %param.loc130_10: bool = param runtime_param0 +// CHECK:STDOUT: %self: bool = bind_name self, %param.loc130_10 +// CHECK:STDOUT: %param.loc130_22: bool = param runtime_param1 +// CHECK:STDOUT: %b: bool = bind_name b, %param.loc130_22 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc122: = interface_witness () [template = ] // CHECK:STDOUT: @@ -578,20 +587,22 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @impl.10: %Self.ref as %J.ref { // CHECK:STDOUT: %F.decl: %F.type.9 = fn_decl @F.9 [template = constants.%F.10] { // CHECK:STDOUT: %self.patt: bool = binding_pattern self +// CHECK:STDOUT: %self.param_patt: bool = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %FDifferentParamType = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %FDifferentParamType = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc143_16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc143_16.1: type = value_of_initializer %bool.make_type.loc143_16 [template = bool] // CHECK:STDOUT: %.loc143_16.2: type = converted %bool.make_type.loc143_16, %.loc143_16.1 [template = bool] -// CHECK:STDOUT: %self.param: bool = param self, runtime_param0 -// CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [template = constants.%FDifferentParamType] -// CHECK:STDOUT: %b.param: %FDifferentParamType = param b, runtime_param1 -// CHECK:STDOUT: %b: %FDifferentParamType = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type.loc143_34: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc143_34.1: type = value_of_initializer %bool.make_type.loc143_34 [template = bool] // CHECK:STDOUT: %.loc143_34.2: type = converted %bool.make_type.loc143_34, %.loc143_34.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc143_10: bool = param runtime_param0 +// CHECK:STDOUT: %self: bool = bind_name self, %param.loc143_10 +// CHECK:STDOUT: %param.loc143_22: %FDifferentParamType = param runtime_param1 +// CHECK:STDOUT: %b: %FDifferentParamType = bind_name b, %param.loc143_22 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc135: = interface_witness () [template = ] // CHECK:STDOUT: @@ -603,20 +614,22 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @impl.11: %Self.ref as %J.ref { // CHECK:STDOUT: %F.decl: %F.type.10 = fn_decl @F.10 [template = constants.%F.11] { // CHECK:STDOUT: %self.patt: %FDifferentImplicitParamType = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %FDifferentImplicitParamType = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] -// CHECK:STDOUT: %self.param: %FDifferentImplicitParamType = param self, runtime_param0 -// CHECK:STDOUT: %self: %FDifferentImplicitParamType = bind_name self, %self.param // CHECK:STDOUT: %bool.make_type.loc156_25: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc156_25.1: type = value_of_initializer %bool.make_type.loc156_25 [template = bool] // CHECK:STDOUT: %.loc156_25.2: type = converted %bool.make_type.loc156_25, %.loc156_25.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param1 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type.loc156_34: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc156_34.1: type = value_of_initializer %bool.make_type.loc156_34 [template = bool] // CHECK:STDOUT: %.loc156_34.2: type = converted %bool.make_type.loc156_34, %.loc156_34.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc156_10: %FDifferentImplicitParamType = param runtime_param0 +// CHECK:STDOUT: %self: %FDifferentImplicitParamType = bind_name self, %param.loc156_10 +// CHECK:STDOUT: %param.loc156_22: bool = param runtime_param1 +// CHECK:STDOUT: %b: bool = bind_name b, %param.loc156_22 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc148: = interface_witness () [template = ] // CHECK:STDOUT: @@ -628,20 +641,22 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @impl.12: %Self.ref as %J.ref { // CHECK:STDOUT: %F.decl: %F.type.11 = fn_decl @F.11 [template = constants.%F.12] { // CHECK:STDOUT: %self.patt: bool = binding_pattern self +// CHECK:STDOUT: %self.param_patt: bool = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc169_16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc169_16.1: type = value_of_initializer %bool.make_type.loc169_16 [template = bool] // CHECK:STDOUT: %.loc169_16.2: type = converted %bool.make_type.loc169_16, %.loc169_16.1 [template = bool] -// CHECK:STDOUT: %self.param: bool = param self, runtime_param0 -// CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %bool.make_type.loc169_25: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc169_25.1: type = value_of_initializer %bool.make_type.loc169_25 [template = bool] // CHECK:STDOUT: %.loc169_25.2: type = converted %bool.make_type.loc169_25, %.loc169_25.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param1 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [template = constants.%FDifferentReturnType] // CHECK:STDOUT: %return: ref %FDifferentReturnType = var +// CHECK:STDOUT: %param.loc169_10: bool = param runtime_param0 +// CHECK:STDOUT: %self: bool = bind_name self, %param.loc169_10 +// CHECK:STDOUT: %param.loc169_22: bool = param runtime_param1 +// CHECK:STDOUT: %b: bool = bind_name b, %param.loc169_22 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc161: = interface_witness () [template = ] // CHECK:STDOUT: @@ -653,22 +668,24 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @impl.13: %Self.ref as %J.ref { // CHECK:STDOUT: %F.decl: %F.type.12 = fn_decl @F.12 [template = constants.%F.13] { // CHECK:STDOUT: %self.patt: bool = binding_pattern self +// CHECK:STDOUT: %self.param_patt: bool = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %not_b.patt: bool = binding_pattern not_b +// CHECK:STDOUT: %not_b.param_patt: bool = param_pattern %not_b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc183_16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc183_16.1: type = value_of_initializer %bool.make_type.loc183_16 [template = bool] // CHECK:STDOUT: %.loc183_16.2: type = converted %bool.make_type.loc183_16, %.loc183_16.1 [template = bool] -// CHECK:STDOUT: %self.param: bool = param self, runtime_param0 -// CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %bool.make_type.loc183_29: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc183_29.1: type = value_of_initializer %bool.make_type.loc183_29 [template = bool] // CHECK:STDOUT: %.loc183_29.2: type = converted %bool.make_type.loc183_29, %.loc183_29.1 [template = bool] -// CHECK:STDOUT: %not_b.param: bool = param not_b, runtime_param1 -// CHECK:STDOUT: %not_b: bool = bind_name not_b, %not_b.param // CHECK:STDOUT: %bool.make_type.loc183_38: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc183_38.1: type = value_of_initializer %bool.make_type.loc183_38 [template = bool] // CHECK:STDOUT: %.loc183_38.2: type = converted %bool.make_type.loc183_38, %.loc183_38.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc183_10: bool = param runtime_param0 +// CHECK:STDOUT: %self: bool = bind_name self, %param.loc183_10 +// CHECK:STDOUT: %param.loc183_22: bool = param runtime_param1 +// CHECK:STDOUT: %not_b: bool = bind_name not_b, %param.loc183_22 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc175: = interface_witness () [template = ] // CHECK:STDOUT: @@ -680,6 +697,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @impl.14: %Self.ref as %SelfNested.ref { // CHECK:STDOUT: %F.decl: %F.type.14 = fn_decl @F.14 [template = constants.%F.15] { // CHECK:STDOUT: %x.patt: %.18 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.18 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] // CHECK:STDOUT: %.loc200_32: type = ptr_type %SelfNestedBadParam [template = constants.%.16] @@ -692,12 +710,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.loc200_52: type = struct_type {.x: i32, .y: i32} [template = constants.%.17] // CHECK:STDOUT: %.loc200_53.1: %.10 = tuple_literal (%.loc200_32, %.loc200_52) // CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%.18 [template = constants.%.18] -// CHECK:STDOUT: %x.param: %.18 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.18 = bind_name x, %x.param // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_60: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] // CHECK:STDOUT: %.loc200_80: i32 = int_literal 4 [template = constants.%.12] // CHECK:STDOUT: %.loc200_81: type = array_type %.loc200_80, %SelfNestedBadParam [template = constants.%.19] // CHECK:STDOUT: %return: ref %.19 = var +// CHECK:STDOUT: %param: %.18 = param runtime_param0 +// CHECK:STDOUT: %x: %.18 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc192: = interface_witness () [template = ] // CHECK:STDOUT: @@ -709,6 +727,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @impl.15: %Self.ref as %SelfNested.ref { // CHECK:STDOUT: %F.decl: %F.type.15 = fn_decl @F.15 [template = constants.%F.16] { // CHECK:STDOUT: %x.patt: %.24 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.24 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %.loc212_37: type = ptr_type %SelfNestedBadReturnType [template = constants.%.22] @@ -719,12 +738,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.loc212_77: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template = constants.%.23] // CHECK:STDOUT: %.loc212_78.1: %.10 = tuple_literal (%.loc212_37, %.loc212_77) // CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%.24 [template = constants.%.24] -// CHECK:STDOUT: %x.param: %.24 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.24 = bind_name x, %x.param // CHECK:STDOUT: %SelfNestedBadParam.ref: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] // CHECK:STDOUT: %.loc212_105: i32 = int_literal 4 [template = constants.%.12] // CHECK:STDOUT: %.loc212_106: type = array_type %.loc212_105, %SelfNestedBadParam [template = constants.%.19] // CHECK:STDOUT: %return: ref %.19 = var +// CHECK:STDOUT: %param: %.24 = param runtime_param0 +// CHECK:STDOUT: %x: %.24 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc205: = interface_witness () [template = ] // CHECK:STDOUT: @@ -909,30 +928,30 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2(%b: bool); +// CHECK:STDOUT: fn @F.2(%b.param_patt: bool); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.3[%self: %FExtraImplicitParam](); +// CHECK:STDOUT: fn @F.3[%self.param_patt: %FExtraImplicitParam](); // CHECK:STDOUT: // CHECK:STDOUT: fn @F.4() -> bool; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.5(@J.%Self: %J.type) { // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: bool](%b: bool) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: bool](%b.param_patt: bool) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.6[%self: bool]() -> bool; +// CHECK:STDOUT: fn @F.6[%self.param_patt: bool]() -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.7(%b: bool) -> bool; +// CHECK:STDOUT: fn @F.7(%b.param_patt: bool) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.8[%self: bool](%b: bool); +// CHECK:STDOUT: fn @F.8[%self.param_patt: bool](%b.param_patt: bool); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.9[%self: bool](%b: %FDifferentParamType) -> bool; +// CHECK:STDOUT: fn @F.9[%self.param_patt: bool](%b.param_patt: %FDifferentParamType) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.10[%self: %FDifferentImplicitParamType](%b: bool) -> bool; +// CHECK:STDOUT: fn @F.10[%self.param_patt: %FDifferentImplicitParamType](%b.param_patt: bool) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.11[%self: bool](%b: bool) -> %FDifferentReturnType; +// CHECK:STDOUT: fn @F.11[%self.param_patt: bool](%b.param_patt: bool) -> %FDifferentReturnType; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.12[%self: bool](%not_b: bool) -> bool; +// CHECK:STDOUT: fn @F.12[%self.param_patt: bool](%not_b.param_patt: bool) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: @@ -943,12 +962,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.loc188_38.1: type = tuple_type (@F.13.%.loc188_16.1 (%.8), @F.13.%.loc188_37.1 (%.9)) [symbolic = %.loc188_38.1 (constants.%.11)] // CHECK:STDOUT: %.loc188_52.1: type = array_type constants.%.12, @F.13.%Self (%Self.3) [symbolic = %.loc188_52.1 (constants.%.13)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x: @F.13.%.loc188_38.1 (%.11)) -> @F.13.%.loc188_52.1 (%.13); +// CHECK:STDOUT: fn(%x.param_patt: @F.13.%.loc188_38.1 (%.11)) -> @F.13.%.loc188_52.1 (%.13); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.14(%x: %.18) -> %.19; +// CHECK:STDOUT: fn @F.14(%x.param_patt: %.18) -> %.19; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.15(%x: %.24) -> %.19; +// CHECK:STDOUT: fn @F.15(%x.param_patt: %.24) -> %.19; // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self.1) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index d760b5379289..11d765d826e7 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -32,6 +32,7 @@ impl i32 as false {} // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -59,12 +60,12 @@ impl i32 as false {} // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -86,6 +87,7 @@ impl i32 as false {} // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -115,19 +117,22 @@ impl i32 as false {} // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -138,6 +143,7 @@ impl i32 as false {} // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon index fa4418cff1ba..893149314d71 100644 --- a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon @@ -38,6 +38,7 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.3: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -65,12 +66,12 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -114,6 +115,7 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -143,19 +145,22 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.2) { @@ -166,6 +171,7 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.1) { // CHECK:STDOUT: %Dest => constants.%.1 +// CHECK:STDOUT: %Dest.patt => constants.%.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/impl/impl_forall.carbon b/toolchain/check/testdata/impl/impl_forall.carbon index 08abbb5d52a7..a3b113da4ca3 100644 --- a/toolchain/check/testdata/impl/impl_forall.carbon +++ b/toolchain/check/testdata/impl/impl_forall.carbon @@ -27,6 +27,7 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: %.2: type = assoc_entity_type %Simple.type, %F.type.1 [template] // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @Simple.%F.decl [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %.4: = interface_witness (%F.2) [symbolic] @@ -53,12 +54,13 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%Simple.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc15_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc15_14.1, runtime_param [symbolic = %T.patt.loc15_14.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc15_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc15_14.2 (constants.%T)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc15_14.1 [symbolic = %T.loc15_14.2 (constants.%T)] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc15_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc15_14.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -75,6 +77,7 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl(%T.loc15_14.1: type) { // CHECK:STDOUT: %T.loc15_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc15_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_14.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc15_14.2) [symbolic = %F.type (constants.%F.type.2)] @@ -109,6 +112,7 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc15_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc15_14.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 @@ -122,5 +126,6 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@impl.%T.loc15_14.2) { // CHECK:STDOUT: %T.loc15_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc15_14.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/alias.carbon b/toolchain/check/testdata/impl/lookup/alias.carbon index 96214f8449ab..dba0cf8d1706 100644 --- a/toolchain/check/testdata/impl/lookup/alias.carbon +++ b/toolchain/check/testdata/impl/lookup/alias.carbon @@ -75,10 +75,11 @@ fn G(c: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %C = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %c.param: %C = param c, runtime_param0 -// CHECK:STDOUT: %c: %C = bind_name c, %c.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %c: %C = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -123,7 +124,7 @@ fn G(c: C) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%c: %C) { +// CHECK:STDOUT: fn @G(%c.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %G.ref.loc24: %.2 = name_ref G, @C.%G [template = constants.%.3] diff --git a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon index 22b9c7060b41..4b819f0d8723 100644 --- a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon @@ -71,10 +71,11 @@ fn F(c: C) { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %C = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc19: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %c.param: %C = param c, runtime_param0 -// CHECK:STDOUT: %c: %C = bind_name c, %c.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %c: %C = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -105,7 +106,7 @@ fn F(c: C) { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2(%c: %C) { +// CHECK:STDOUT: fn @F.2(%c.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %F.ref.loc24: %.2 = name_ref F, @C.%F [template = constants.%.3] diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index ad7110b91cd4..30c412cbcf66 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -132,6 +132,7 @@ fn G(x: A) { // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type, %F.type.1 [template] // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %.4: = interface_witness (%F.2) [symbolic] @@ -166,20 +167,22 @@ fn G(x: A) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%HasF.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_14.1, runtime_param [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %.5 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.5 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc12_10.1: %.5 = struct_literal () // CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%.5 [template = constants.%.5] -// CHECK:STDOUT: %x.param: %.5 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.5 = bind_name x, %x.param +// CHECK:STDOUT: %param: %.5 = param runtime_param0 +// CHECK:STDOUT: %x: %.5 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -196,6 +199,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl(%T.loc8_14.1: type) { // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)] @@ -226,7 +230,7 @@ fn G(x: A) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%x: %.5) { +// CHECK:STDOUT: fn @G(%x.param_patt: %.5) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %.5 = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] @@ -241,6 +245,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 @@ -254,10 +259,12 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@impl.%T.loc8_14.2) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%.5) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%.5 +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%.5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.3 @@ -280,6 +287,7 @@ fn G(x: A) { // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type, %F.type.1 [template] // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %.4: = interface_witness (%F.2) [symbolic] @@ -314,23 +322,25 @@ fn G(x: A) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%HasF.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_14.1, runtime_param [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %.5 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.5 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc12_10.1: %.5 = struct_literal () // CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%.5 [template = constants.%.5] -// CHECK:STDOUT: %x.param: %.5 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.5 = bind_name x, %x.param // CHECK:STDOUT: %.loc12_17.1: %.5 = struct_literal () // CHECK:STDOUT: %.loc12_17.2: type = converted %.loc12_17.1, constants.%.5 [template = constants.%.5] // CHECK:STDOUT: %return: ref %.5 = var +// CHECK:STDOUT: %param: %.5 = param runtime_param0 +// CHECK:STDOUT: %x: %.5 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -338,16 +348,17 @@ fn G(x: A) { // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: @F.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.1.%Self (%Self) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc5_14: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc5_14.1: type = facet_type_access %Self.ref.loc5_14 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref.loc5_14, %.loc5_14.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @F.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %self.param // CHECK:STDOUT: %Self.ref.loc5_25: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc5_25.1: type = facet_type_access %Self.ref.loc5_25 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc5_25.2: type = converted %Self.ref.loc5_25, %.loc5_25.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %return: ref @F.1.%Self (%Self) = var +// CHECK:STDOUT: %param: @F.1.%Self (%Self) = param runtime_param0 +// CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc5: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: @@ -359,6 +370,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl(%T.loc8_14.1: type) { // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)] @@ -368,12 +380,13 @@ fn G(x: A) { // CHECK:STDOUT: impl: %T.ref as %HasF.ref { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] { // CHECK:STDOUT: %self.patt: @F.2.%T (%T) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.2.%T (%T) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %self.param: @F.2.%T (%T) = param self, runtime_param0 -// CHECK:STDOUT: %self: @F.2.%T (%T) = bind_name self, %self.param // CHECK:STDOUT: %T.ref: type = name_ref T, @impl.%T.loc8_14.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %return: ref @F.2.%T (%T) = var +// CHECK:STDOUT: %param: @F.2.%T (%T) = param runtime_param0 +// CHECK:STDOUT: %self: @F.2.%T (%T) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_34.1: = interface_witness (%F.decl) [symbolic = %.loc8_34.2 (constants.%.4)] // CHECK:STDOUT: @@ -386,7 +399,7 @@ fn G(x: A) { // CHECK:STDOUT: generic fn @F.1(@HasF.%Self: %HasF.type) { // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @F.1.%Self (%Self)]() -> @F.1.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self)]() -> @F.1.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.2(@impl.%T.loc8_14.1: type) { @@ -394,14 +407,14 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @F.2.%T (%T)]() -> @F.2.%T (%T) { +// CHECK:STDOUT: fn[%self.param_patt: @F.2.%T (%T)]() -> @F.2.%T (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @F.2.%T (%T) = name_ref self, %self // CHECK:STDOUT: return %self.ref // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%x: %.5) -> %.5 { +// CHECK:STDOUT: fn @G(%x.param_patt: %.5) -> %.5 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %.5 = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] @@ -423,6 +436,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 @@ -440,10 +454,12 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@impl.%T.loc8_14.2) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%.5) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%.5 +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%.5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.3 @@ -468,11 +484,13 @@ fn G(x: A) { // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type, %F.type.1 [template] // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%T) [symbolic] // CHECK:STDOUT: %.4: type = struct_type {} [template] // CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %.6: = interface_witness (%F.2) [symbolic] @@ -509,30 +527,33 @@ fn G(x: A) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%HasF.type] {} {} // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_9.1, runtime_param [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_9.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc10_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_14.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc10_14.1, runtime_param [symbolic = %T.patt.loc10_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc10_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_14.2 (constants.%T)] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc10_14.1 [symbolic = %T.loc10_14.2 (constants.%T)] // CHECK:STDOUT: %C.loc10_25.1: type = class_type @C, @C(constants.%T) [symbolic = %C.loc10_25.2 (constants.%C.2)] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc10_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc10_14.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %C.3 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C.3 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] // CHECK:STDOUT: %.loc14_12: %.4 = struct_literal () // CHECK:STDOUT: %.loc14_10: type = converted %.loc14_12, constants.%.4 [template = constants.%.4] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.4) [template = constants.%C.3] -// CHECK:STDOUT: %x.param: %C.3 = param x, runtime_param0 -// CHECK:STDOUT: %x: %C.3 = bind_name x, %x.param +// CHECK:STDOUT: %param: %C.3 = param runtime_param0 +// CHECK:STDOUT: %x: %C.3 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -549,6 +570,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl(%T.loc10_14.1: type) { // CHECK:STDOUT: %T.loc10_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc10_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: %C.loc10_25.2: type = class_type @C, @C(%T.loc10_14.2) [symbolic = %C.loc10_25.2 (constants.%C.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -568,6 +590,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc8_9.1: type) { // CHECK:STDOUT: %T.loc8_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -593,7 +616,7 @@ fn G(x: A) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%x: %C.3) { +// CHECK:STDOUT: fn @G(%x.param_patt: %C.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %C.3 = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] @@ -608,14 +631,17 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc10_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%T // CHECK:STDOUT: %C.loc10_25.2 => constants.%C.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -630,17 +656,20 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@impl.%T.loc10_14.2) { // CHECK:STDOUT: %T.loc10_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%T // CHECK:STDOUT: %C.loc10_25.2 => constants.%C.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%.4) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%.4 +// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%.4) { // CHECK:STDOUT: %T.loc10_14.2 => constants.%.4 +// CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%.4 // CHECK:STDOUT: %C.loc10_25.2 => constants.%C.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -657,6 +686,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %HasF.type.1: type = generic_interface_type @HasF [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %HasF: %HasF.type.1 = struct_value () [template] @@ -666,6 +696,7 @@ fn G(x: A) { // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type.2, %F.type.1 [symbolic] // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.4: type = struct_type {} [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] @@ -704,34 +735,38 @@ fn G(x: A) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: %HasF.type.1 = interface_decl @HasF [template = constants.%HasF] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_16.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_16.1, runtime_param [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_16.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_16.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_14.1, runtime_param [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %.loc8_25.1: %.4 = struct_literal () // CHECK:STDOUT: %.loc8_25.2: type = converted %.loc8_25.1, constants.%.4 [template = constants.%.4] // CHECK:STDOUT: %HasF.ref: %HasF.type.1 = name_ref HasF, file.%HasF.decl [template = constants.%HasF] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %HasF.type.loc8_34.1: type = interface_type @HasF, @HasF(constants.%T) [symbolic = %HasF.type.loc8_34.2 (constants.%HasF.type.2)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %.4 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.4 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc12_10.1: %.4 = struct_literal () // CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%.4 [template = constants.%.4] -// CHECK:STDOUT: %x.param: %.4 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.4 = bind_name x, %x.param +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %x: %.4 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @HasF(%T.loc4_16.1: type) { // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type: type = interface_type @HasF, @HasF(%T.loc4_16.2) [symbolic = %HasF.type (constants.%HasF.type.2)] @@ -755,6 +790,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl(%T.loc8_14.1: type) { // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: %HasF.type.loc8_34.2: type = interface_type @HasF, @HasF(%T.loc8_14.2) [symbolic = %HasF.type.loc8_34.2 (constants.%HasF.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -786,7 +822,7 @@ fn G(x: A) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%x: %.4) { +// CHECK:STDOUT: fn @G(%x.param_patt: %.4) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %.4 = name_ref x, %x // CHECK:STDOUT: %HasF.ref: %HasF.type.1 = name_ref HasF, file.%HasF.decl [template = constants.%HasF] @@ -803,6 +839,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%T) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type => constants.%HasF.type.2 @@ -817,14 +854,17 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(@HasF.%T.loc4_16.2) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: %HasF.type.loc8_34.2 => constants.%HasF.type.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -839,11 +879,13 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@impl.%T.loc8_14.2) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: %HasF.type.loc8_34.2 => constants.%HasF.type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%.4) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%.4 +// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type => constants.%HasF.type.3 @@ -856,6 +898,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%.4) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%.4 +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%.4 // CHECK:STDOUT: %HasF.type.loc8_34.2 => constants.%HasF.type.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -879,7 +922,9 @@ fn G(x: A) { // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type, %F.type.1 [template] // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T, %U) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %.4: = interface_witness (%F.2) [symbolic] @@ -910,23 +955,26 @@ fn G(x: A) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%HasF.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %T.patt.loc9_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc9_14.1, runtime_param [symbolic = %T.patt.loc9_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %U.patt.loc9_24.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc9_24.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc9_24.1, runtime_param [symbolic = %U.patt.loc9_24.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc9_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc9_14.2 (constants.%T)] -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc9_24.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc9_24.2 (constants.%U)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc9_14.1 [symbolic = %T.loc9_14.2 (constants.%T)] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] +// CHECK:STDOUT: %param.loc9_14: type = param runtime_param +// CHECK:STDOUT: %T.loc9_14.1: type = bind_symbolic_name T, 0, %param.loc9_14 [symbolic = %T.loc9_14.2 (constants.%T)] +// CHECK:STDOUT: %param.loc9_24: type = param runtime_param +// CHECK:STDOUT: %U.loc9_24.1: type = bind_symbolic_name U, 1, %param.loc9_24 [symbolic = %U.loc9_24.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %.5 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.5 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc13_10.1: %.5 = struct_literal () // CHECK:STDOUT: %.loc13_10.2: type = converted %.loc13_10.1, constants.%.5 [template = constants.%.5] -// CHECK:STDOUT: %x.param: %.5 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.5 = bind_name x, %x.param +// CHECK:STDOUT: %param: %.5 = param runtime_param0 +// CHECK:STDOUT: %x: %.5 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -943,7 +991,9 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl(%T.loc9_14.1: type, %U.loc9_24.1: type) { // CHECK:STDOUT: %T.loc9_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc9_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc9_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_14.2 (constants.%T.patt)] // CHECK:STDOUT: %U.loc9_24.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc9_24.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc9_24.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc9_24.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc9_14.2, %U.loc9_24.2) [symbolic = %F.type (constants.%F.type.2)] @@ -974,7 +1024,7 @@ fn G(x: A) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%x: %.5) { +// CHECK:STDOUT: fn @G(%x.param_patt: %.5) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %.5 = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type] @@ -986,7 +1036,9 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc9_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc9_14.2 => constants.%T // CHECK:STDOUT: %U.loc9_24.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc9_24.2 => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 @@ -1000,13 +1052,16 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@impl.%T.loc9_14.2, @impl.%U.loc9_24.2) { // CHECK:STDOUT: %T.loc9_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc9_14.2 => constants.%T // CHECK:STDOUT: %U.loc9_24.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc9_24.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_inconsistent_deduction.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %HasF.type.1: type = generic_interface_type @HasF [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %HasF: %HasF.type.1 = struct_value () [template] @@ -1016,6 +1071,7 @@ fn G(x: A) { // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type.2, %F.type.1 [symbolic] // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %.4: = interface_witness (%F.2) [symbolic] @@ -1056,34 +1112,38 @@ fn G(x: A) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: %HasF.type.1 = interface_decl @HasF [template = constants.%HasF] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_16.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_16.1, runtime_param [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_16.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_16.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_14.1, runtime_param [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc8_24: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %HasF.ref: %HasF.type.1 = name_ref HasF, file.%HasF.decl [template = constants.%HasF] // CHECK:STDOUT: %T.ref.loc8_34: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %HasF.type.loc8_33.1: type = interface_type @HasF, @HasF(constants.%T) [symbolic = %HasF.type.loc8_33.2 (constants.%HasF.type.2)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %A = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %A = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %x.param: %A = param x, runtime_param0 -// CHECK:STDOUT: %x: %A = bind_name x, %x.param +// CHECK:STDOUT: %param: %A = param runtime_param0 +// CHECK:STDOUT: %x: %A = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @HasF(%T.loc4_16.1: type) { // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type: type = interface_type @HasF, @HasF(%T.loc4_16.2) [symbolic = %HasF.type (constants.%HasF.type.2)] @@ -1107,6 +1167,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl(%T.loc8_14.1: type) { // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: %HasF.type.loc8_33.2: type = interface_type @HasF, @HasF(%T.loc8_14.2) [symbolic = %HasF.type.loc8_33.2 (constants.%HasF.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -1152,7 +1213,7 @@ fn G(x: A) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%x: %A) { +// CHECK:STDOUT: fn @G(%x.param_patt: %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %A = name_ref x, %x // CHECK:STDOUT: %HasF.ref: %HasF.type.1 = name_ref HasF, file.%HasF.decl [template = constants.%HasF] @@ -1165,6 +1226,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%T) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type => constants.%HasF.type.2 @@ -1179,14 +1241,17 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(@HasF.%T.loc4_16.2) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: %HasF.type.loc8_33.2 => constants.%HasF.type.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -1201,11 +1266,13 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@impl.%T.loc8_14.2) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: %HasF.type.loc8_33.2 => constants.%HasF.type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%B) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%B +// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type => constants.%HasF.type.3 diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index bf1d0e166ef0..10f6cfc991d3 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -176,11 +176,12 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %Impl.import = import Impl // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %C = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Impl.ref.loc4: = name_ref Impl, imports.%Impl [template = imports.%Impl] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.8 [template = constants.%C] -// CHECK:STDOUT: %c.param: %C = param c, runtime_param0 -// CHECK:STDOUT: %c: %C = bind_name c, %c.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %c: %C = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -201,7 +202,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: .Self = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%c: %C) { +// CHECK:STDOUT: fn @G(%c.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %Impl.ref.loc5: = name_ref Impl, imports.%Impl [template = imports.%Impl] diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index 74f0bf0b1c06..c53969421760 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -75,14 +75,15 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %C.decl.loc17: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %C = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc11 [template = constants.%C] -// CHECK:STDOUT: %c.param: %C = param c, runtime_param0 -// CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_15.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc23_15.2: type = converted %int.make_type_32, %.loc23_15.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %c: %C = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -90,16 +91,17 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: @F.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.1.%Self (%Self) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc14_14.1: type = facet_type_access %Self.ref [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc14_14.2: type = converted %Self.ref, %.loc14_14.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @F.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_25.2: type = converted %int.make_type_32, %.loc14_25.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: @F.1.%Self (%Self) = param runtime_param0 +// CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: @@ -112,14 +114,15 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: impl @impl: %Self.ref as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_27.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc19_27.2: type = converted %int.make_type_32, %.loc19_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc18: = interface_witness (%F.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -145,12 +148,12 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @F.1.%Self (%Self)]() -> i32; +// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self)]() -> i32; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[%self: %C]() -> i32; +// CHECK:STDOUT: fn @F.2[%self.param_patt: %C]() -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.3(%c: %C) -> i32 { +// CHECK:STDOUT: fn @F.3(%c.param_patt: %C) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %F.ref: %.2 = name_ref F, @I.%.loc14 [template = constants.%.3] diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon index e6a16057b2d0..1e9849561f04 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon @@ -36,6 +36,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %A.type: type = generic_class_type @A [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %A.1: %A.type = struct_value () [template] @@ -44,6 +45,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %.3: type = struct_type {.n: %T} [symbolic] // CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %I.type.1: type = generic_interface_type @I [template] // CHECK:STDOUT: %I: %I.type.1 = struct_value () [template] // CHECK:STDOUT: %I.type.2: type = interface_type @I, @I(%U) [symbolic] @@ -53,6 +55,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %.5: type = assoc_entity_type %I.type.2, %F.type.1 [symbolic] // CHECK:STDOUT: %.6: %.5 = assoc_entity element0, @I.%F.decl [symbolic] // CHECK:STDOUT: %V: type = bind_symbolic_name V, 0 [symbolic] +// CHECK:STDOUT: %V.patt: type = symbolic_binding_pattern V, 0 [symbolic] // CHECK:STDOUT: %A.3: type = class_type @A, @A(%V) [symbolic] // CHECK:STDOUT: %I.type.3: type = interface_type @I, @I(%V) [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%V) [symbolic] @@ -67,6 +70,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %.12: = complete_type_witness %.11 [symbolic] // CHECK:STDOUT: %.13: type = ptr_type %.11 [symbolic] // CHECK:STDOUT: %W: type = bind_symbolic_name W, 0 [symbolic] +// CHECK:STDOUT: %W.patt: type = symbolic_binding_pattern W, 0 [symbolic] // CHECK:STDOUT: %A.4: type = class_type @A, @A(%W) [symbolic] // CHECK:STDOUT: %TestGeneric.type: type = fn_type @TestGeneric [template] // CHECK:STDOUT: %TestGeneric: %TestGeneric.type = struct_value () [template] @@ -110,60 +114,67 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: .TestSpecific = %TestSpecific.decl // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc2_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_9.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc2_9.1, runtime_param [symbolic = %T.patt.loc2_9.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc2_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc2_9.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc2_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc2_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %I.decl: %I.type.1 = interface_decl @I [template = constants.%I] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 +// CHECK:STDOUT: %U.patt.loc6_13.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc6_13.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc6_13.1, runtime_param [symbolic = %U.patt.loc6_13.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc6_13.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc6_13.2 (constants.%U)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc6_13.1: type = bind_symbolic_name U, 0, %param [symbolic = %U.loc6_13.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %V.patt: type = symbolic_binding_pattern V, 0 +// CHECK:STDOUT: %V.patt.loc10_14.1: type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc10_14.2 (constants.%V.patt)] +// CHECK:STDOUT: %V.param_patt: type = param_pattern %V.patt.loc10_14.1, runtime_param [symbolic = %V.patt.loc10_14.2 (constants.%V.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %V.param: type = param V, runtime_param -// CHECK:STDOUT: %V.loc10_14.1: type = bind_symbolic_name V, 0, %V.param [symbolic = %V.loc10_14.2 (constants.%V)] // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.1] // CHECK:STDOUT: %V.ref.loc10_26: type = name_ref V, %V.loc10_14.1 [symbolic = %V.loc10_14.2 (constants.%V)] // CHECK:STDOUT: %A.loc10_25.1: type = class_type @A, @A(constants.%V) [symbolic = %A.loc10_25.2 (constants.%A.3)] // CHECK:STDOUT: %I.ref: %I.type.1 = name_ref I, file.%I.decl [template = constants.%I] // CHECK:STDOUT: %V.ref.loc10_34: type = name_ref V, %V.loc10_14.1 [symbolic = %V.loc10_14.2 (constants.%V)] // CHECK:STDOUT: %I.type.loc10_33.1: type = interface_type @I, @I(constants.%V) [symbolic = %I.type.loc10_33.2 (constants.%I.type.3)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %V.loc10_14.1: type = bind_symbolic_name V, 0, %param [symbolic = %V.loc10_14.2 (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: %TestGeneric.decl: %TestGeneric.type = fn_decl @TestGeneric [template = constants.%TestGeneric] { -// CHECK:STDOUT: %W.patt: type = symbolic_binding_pattern W, 0 +// CHECK:STDOUT: %W.patt.loc16_16.1: type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc16_16.2 (constants.%W.patt)] +// CHECK:STDOUT: %W.param_patt: type = param_pattern %W.patt.loc16_16.1, runtime_param [symbolic = %W.patt.loc16_16.2 (constants.%W.patt)] // CHECK:STDOUT: %a.patt: @TestGeneric.%A.loc16_30.2 (%A.4) = binding_pattern a +// CHECK:STDOUT: %a.param_patt: @TestGeneric.%A.loc16_30.2 (%A.4) = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %W.param: type = param W, runtime_param -// CHECK:STDOUT: %W.loc16_16.1: type = bind_symbolic_name W, 0, %W.param [symbolic = %W.loc16_16.2 (constants.%W)] // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.1] // CHECK:STDOUT: %W.ref.loc16_31: type = name_ref W, %W.loc16_16.1 [symbolic = %W.loc16_16.2 (constants.%W)] // CHECK:STDOUT: %A.loc16_30.1: type = class_type @A, @A(constants.%W) [symbolic = %A.loc16_30.2 (constants.%A.4)] -// CHECK:STDOUT: %a.param: @TestGeneric.%A.loc16_30.2 (%A.4) = param a, runtime_param0 -// CHECK:STDOUT: %a: @TestGeneric.%A.loc16_30.2 (%A.4) = bind_name a, %a.param // CHECK:STDOUT: %W.ref.loc16_38: type = name_ref W, %W.loc16_16.1 [symbolic = %W.loc16_16.2 (constants.%W)] // CHECK:STDOUT: %return: ref @TestGeneric.%W.loc16_16.2 (%W) = var +// CHECK:STDOUT: %param.loc16_16: type = param runtime_param +// CHECK:STDOUT: %W.loc16_16.1: type = bind_symbolic_name W, 0, %param.loc16_16 [symbolic = %W.loc16_16.2 (constants.%W)] +// CHECK:STDOUT: %param.loc16_26: @TestGeneric.%A.loc16_30.2 (%A.4) = param runtime_param0 +// CHECK:STDOUT: %a: @TestGeneric.%A.loc16_30.2 (%A.4) = bind_name a, %param.loc16_26 // CHECK:STDOUT: } // CHECK:STDOUT: %TestSpecific.decl: %TestSpecific.type = fn_decl @TestSpecific [template = constants.%TestSpecific] { // CHECK:STDOUT: %a.patt: %A.5 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %A.5 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.1] // CHECK:STDOUT: %.loc20_23: %.21 = struct_literal () // CHECK:STDOUT: %.loc20_21: type = converted %.loc20_23, constants.%.21 [template = constants.%.21] // CHECK:STDOUT: %A: type = class_type @A, @A(constants.%.21) [template = constants.%A.5] -// CHECK:STDOUT: %a.param: %A.5 = param a, runtime_param0 -// CHECK:STDOUT: %a: %A.5 = bind_name a, %a.param // CHECK:STDOUT: %.loc20_31.1: %.21 = struct_literal () // CHECK:STDOUT: %.loc20_31.2: type = converted %.loc20_31.1, constants.%.21 [template = constants.%.21] // CHECK:STDOUT: %return: ref %.21 = var +// CHECK:STDOUT: %param: %A.5 = param runtime_param0 +// CHECK:STDOUT: %a: %A.5 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(%U.loc6_13.1: type) { // CHECK:STDOUT: %U.loc6_13.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc6_13.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc6_13.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc6_13.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type: type = interface_type @I, @I(%U.loc6_13.2) [symbolic = %I.type (constants.%I.type.2)] @@ -177,15 +188,16 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: %F.decl: @I.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = @I.%F (constants.%F.1)] { // CHECK:STDOUT: %self.patt: @F.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.1.%Self (%Self) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc7_14.1: @F.1.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%U) [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.ref: @F.1.%I.type (%I.type.2) = name_ref Self, %.loc7_14.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc7_14.2: type = facet_type_access %Self.ref [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc7_14.3: type = converted %Self.ref, %.loc7_14.2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @F.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %self.param // CHECK:STDOUT: %U.ref: type = name_ref U, @I.%U.loc6_13.1 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %return: ref @F.1.%U (%U) = var +// CHECK:STDOUT: %param: @F.1.%Self (%Self) = param runtime_param0 +// CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc7_26.1: @I.%.loc7_26.2 (%.5) = assoc_entity element0, %F.decl [symbolic = %.loc7_26.3 (constants.%.6)] // CHECK:STDOUT: @@ -198,6 +210,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl(%V.loc10_14.1: type) { // CHECK:STDOUT: %V.loc10_14.2: type = bind_symbolic_name V, 0 [symbolic = %V.loc10_14.2 (constants.%V)] +// CHECK:STDOUT: %V.patt.loc10_14.2: type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc10_14.2 (constants.%V.patt)] // CHECK:STDOUT: %A.loc10_25.2: type = class_type @A, @A(%V.loc10_14.2) [symbolic = %A.loc10_25.2 (constants.%A.3)] // CHECK:STDOUT: %I.type.loc10_33.2: type = interface_type @I, @I(%V.loc10_14.2) [symbolic = %I.type.loc10_33.2 (constants.%I.type.3)] // CHECK:STDOUT: @@ -209,12 +222,13 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: impl: %A.loc10_25.1 as %I.type.loc10_33.1 { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] { // CHECK:STDOUT: %self.patt: @F.2.%A (%A.3) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.2.%A (%A.3) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%A.loc10_25.1 [symbolic = %A (constants.%A.3)] -// CHECK:STDOUT: %self.param: @F.2.%A (%A.3) = param self, runtime_param0 -// CHECK:STDOUT: %self: @F.2.%A (%A.3) = bind_name self, %self.param // CHECK:STDOUT: %V.ref: type = name_ref V, @impl.%V.loc10_14.1 [symbolic = %V (constants.%V)] // CHECK:STDOUT: %return: ref @F.2.%V (%V) = var +// CHECK:STDOUT: %param: @F.2.%A (%A.3) = param runtime_param0 +// CHECK:STDOUT: %self: @F.2.%A (%A.3) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc10_37.1: = interface_witness (%F.decl) [symbolic = %.loc10_37.2 (constants.%.9)] // CHECK:STDOUT: @@ -226,6 +240,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: generic class @A(%T.loc2_9.1: type) { // CHECK:STDOUT: %T.loc2_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc2_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc2_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_9.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %A: type = class_type @A, @A(%T.loc2_9.2) [symbolic = %A (constants.%A.2)] @@ -249,7 +264,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %I.type: type = interface_type @I, @I(%U) [symbolic = %I.type (constants.%I.type.2)] // CHECK:STDOUT: %Self: %I.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @F.1.%Self (%Self)]() -> @F.1.%U (%U); +// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self)]() -> @F.1.%U (%U); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.2(@impl.%V.loc10_14.1: type) { @@ -259,7 +274,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc12_16.3: type = unbound_element_type @F.2.%A (%A.3), @F.2.%V (%V) [symbolic = %.loc12_16.3 (constants.%.10)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @F.2.%A (%A.3)]() -> @F.2.%V (%V) { +// CHECK:STDOUT: fn[%self.param_patt: @F.2.%A (%A.3)]() -> @F.2.%V (%V) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @F.2.%A (%A.3) = name_ref self, %self // CHECK:STDOUT: %n.ref: @F.2.%.loc12_16.3 (%.10) = name_ref n, @A.%.loc3_8.1 [template = @A.%.loc3_8.1] @@ -271,6 +286,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @TestGeneric(%W.loc16_16.1: type) { // CHECK:STDOUT: %W.loc16_16.2: type = bind_symbolic_name W, 0 [symbolic = %W.loc16_16.2 (constants.%W)] +// CHECK:STDOUT: %W.patt.loc16_16.2: type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc16_16.2 (constants.%W.patt)] // CHECK:STDOUT: %A.loc16_30.2: type = class_type @A, @A(%W.loc16_16.2) [symbolic = %A.loc16_30.2 (constants.%A.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -281,7 +297,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %F.type.loc17_11: type = fn_type @F.2, @impl(%W.loc16_16.2) [symbolic = %F.type.loc17_11 (constants.%F.type.5)] // CHECK:STDOUT: %F: @TestGeneric.%F.type.loc17_11 (%F.type.5) = struct_value () [symbolic = %F (constants.%F.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%W.loc16_16.1: type](%a: @TestGeneric.%A.loc16_30.2 (%A.4)) -> @TestGeneric.%W.loc16_16.2 (%W) { +// CHECK:STDOUT: fn[%W.param_patt: type](%a.param_patt: @TestGeneric.%A.loc16_30.2 (%A.4)) -> @TestGeneric.%W.loc16_16.2 (%W) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: @TestGeneric.%A.loc16_30.2 (%A.4) = name_ref a, %a // CHECK:STDOUT: %I.ref: %I.type.1 = name_ref I, file.%I.decl [template = constants.%I] @@ -299,7 +315,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestSpecific(%a: %A.5) -> %.21 { +// CHECK:STDOUT: fn @TestSpecific(%a.param_patt: %A.5) -> %.21 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A.5 = name_ref a, %a // CHECK:STDOUT: %I.ref: %I.type.1 = name_ref I, file.%I.decl [template = constants.%I] @@ -321,18 +337,22 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%T) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A(@A.%T.loc2_9.2) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%U) { // CHECK:STDOUT: %U.loc6_13.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@F.1.%U) { // CHECK:STDOUT: %U.loc6_13.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%U, constants.%Self) { @@ -343,10 +363,12 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@I.%U.loc6_13.2) { // CHECK:STDOUT: %U.loc6_13.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%V) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%V +// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%V // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %A => constants.%A.3 @@ -357,6 +379,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%V) { // CHECK:STDOUT: %U.loc6_13.2 => constants.%V +// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%V // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type => constants.%I.type.3 @@ -369,14 +392,17 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @A(@impl.%V.loc10_14.2) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%V +// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@impl.%V.loc10_14.2) { // CHECK:STDOUT: %U.loc6_13.2 => constants.%V +// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%V) { // CHECK:STDOUT: %V.loc10_14.2 => constants.%V +// CHECK:STDOUT: %V.patt.loc10_14.2 => constants.%V // CHECK:STDOUT: %A.loc10_25.2 => constants.%A.3 // CHECK:STDOUT: %I.type.loc10_33.2 => constants.%I.type.3 // CHECK:STDOUT: @@ -388,6 +414,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @A(@F.2.%V) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%V +// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%V) { @@ -403,12 +430,14 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@impl.%V.loc10_14.2) { // CHECK:STDOUT: %V.loc10_14.2 => constants.%V +// CHECK:STDOUT: %V.patt.loc10_14.2 => constants.%V // CHECK:STDOUT: %A.loc10_25.2 => constants.%A.3 // CHECK:STDOUT: %I.type.loc10_33.2 => constants.%I.type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%W) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%W +// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%W // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %A => constants.%A.4 @@ -419,15 +448,18 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @A(@TestGeneric.%W.loc16_16.2) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%W +// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%W // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TestGeneric(constants.%W) { // CHECK:STDOUT: %W.loc16_16.2 => constants.%W +// CHECK:STDOUT: %W.patt.loc16_16.2 => constants.%W // CHECK:STDOUT: %A.loc16_30.2 => constants.%A.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%W) { // CHECK:STDOUT: %U.loc6_13.2 => constants.%W +// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%W // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type => constants.%I.type.4 @@ -440,6 +472,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%W) { // CHECK:STDOUT: %V.loc10_14.2 => constants.%W +// CHECK:STDOUT: %V.patt.loc10_14.2 => constants.%W // CHECK:STDOUT: %A.loc10_25.2 => constants.%A.4 // CHECK:STDOUT: %I.type.loc10_33.2 => constants.%I.type.4 // CHECK:STDOUT: @@ -459,16 +492,19 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@TestGeneric.%W.loc16_16.2) { // CHECK:STDOUT: %U.loc6_13.2 => constants.%W +// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%W // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@TestGeneric.%W.loc16_16.2) { // CHECK:STDOUT: %V.loc10_14.2 => constants.%W +// CHECK:STDOUT: %V.patt.loc10_14.2 => constants.%W // CHECK:STDOUT: %A.loc10_25.2 => constants.%A.4 // CHECK:STDOUT: %I.type.loc10_33.2 => constants.%I.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%.21) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%.21 +// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%.21 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %A => constants.%A.5 @@ -479,6 +515,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%.21) { // CHECK:STDOUT: %U.loc6_13.2 => constants.%.21 +// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%.21 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type => constants.%I.type.5 @@ -491,6 +528,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%.21) { // CHECK:STDOUT: %V.loc10_14.2 => constants.%.21 +// CHECK:STDOUT: %V.patt.loc10_14.2 => constants.%.21 // CHECK:STDOUT: %A.loc10_25.2 => constants.%A.5 // CHECK:STDOUT: %I.type.loc10_33.2 => constants.%I.type.5 // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index ed78c1746620..9abfcdf61928 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -149,11 +149,12 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %Impl.import = import Impl // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %C = param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Impl.ref.loc4: = name_ref Impl, imports.%Impl [template = imports.%Impl] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.8 [template = constants.%C] -// CHECK:STDOUT: %c.param: %C = param c, runtime_param0 -// CHECK:STDOUT: %c: %C = bind_name c, %c.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %c: %C = bind_name c, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -174,7 +175,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: .Self = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%c: %C) { +// CHECK:STDOUT: fn @G(%c.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %Impl.ref.loc5: = name_ref Impl, imports.%Impl [template = imports.%Impl] diff --git a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon index 06cb6dc9c119..d9d920b54f07 100644 --- a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon +++ b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon @@ -77,11 +77,19 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %L.type: type = interface_type @L [template] // CHECK:STDOUT: %Self.5: %L.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %T.1: %I.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: %I.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %T.2: %J.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.2: %J.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %T.3: %K.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.3: %K.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %T.4: %L.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.4: %L.type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.5: %I.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: = interface_witness () [template] +// CHECK:STDOUT: %T.patt.6: %J.type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.7: %K.type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.8: %L.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -98,92 +106,100 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %K.decl: type = interface_decl @K [template = constants.%K.type] {} {} // CHECK:STDOUT: %L.decl: type = interface_decl @L [template = constants.%L.type] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] { -// CHECK:STDOUT: %T.patt: %I.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: %I.type = param_pattern %T.patt.loc11_14.1, runtime_param [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %T.param: %I.type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_14.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_14.2 (constants.%T.1)] // CHECK:STDOUT: %T.ref: %I.type = name_ref T, %T.loc11_14.1 [symbolic = %T.loc11_14.2 (constants.%T.1)] // CHECK:STDOUT: %.loc11_21.1: type = facet_type_access %T.ref [symbolic = %T.loc11_14.2 (constants.%T.1)] // CHECK:STDOUT: %.loc11_21.2: type = converted %T.ref, %.loc11_21.1 [symbolic = %T.loc11_14.2 (constants.%T.1)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %param: %I.type = param runtime_param +// CHECK:STDOUT: %T.loc11_14.1: %I.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_14.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 [template] { -// CHECK:STDOUT: %T.patt: %J.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc12_14.1: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: %J.type = param_pattern %T.patt.loc12_14.1, runtime_param [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] -// CHECK:STDOUT: %T.param: %J.type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_14.1: %J.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_14.2 (constants.%T.2)] // CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc12_14.1 [symbolic = %T.loc12_14.2 (constants.%T.2)] // CHECK:STDOUT: %.loc12_21.1: type = facet_type_access %T.ref [symbolic = %T.loc12_14.2 (constants.%T.2)] // CHECK:STDOUT: %.loc12_21.2: type = converted %T.ref, %.loc12_21.1 [symbolic = %T.loc12_14.2 (constants.%T.2)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %param: %J.type = param runtime_param +// CHECK:STDOUT: %T.loc12_14.1: %J.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc12_14.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.3 [template] { -// CHECK:STDOUT: %T.patt: %K.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc13_14.1: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] +// CHECK:STDOUT: %T.param_patt: %K.type = param_pattern %T.patt.loc13_14.1, runtime_param [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: } { // CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [template = constants.%K.type] -// CHECK:STDOUT: %T.param: %K.type = param T, runtime_param -// CHECK:STDOUT: %T.loc13_14.1: %K.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_14.2 (constants.%T.3)] // CHECK:STDOUT: %T.ref: %K.type = name_ref T, %T.loc13_14.1 [symbolic = %T.loc13_14.2 (constants.%T.3)] // CHECK:STDOUT: %.loc13_21.1: type = facet_type_access %T.ref [symbolic = %T.loc13_14.2 (constants.%T.3)] // CHECK:STDOUT: %.loc13_21.2: type = converted %T.ref, %.loc13_21.1 [symbolic = %T.loc13_14.2 (constants.%T.3)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %param: %K.type = param runtime_param +// CHECK:STDOUT: %T.loc13_14.1: %K.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc13_14.2 (constants.%T.3)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.4 [template] { -// CHECK:STDOUT: %T.patt: %L.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc14_14.1: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] +// CHECK:STDOUT: %T.param_patt: %L.type = param_pattern %T.patt.loc14_14.1, runtime_param [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] // CHECK:STDOUT: } { // CHECK:STDOUT: %L.ref: type = name_ref L, file.%L.decl [template = constants.%L.type] -// CHECK:STDOUT: %T.param: %L.type = param T, runtime_param -// CHECK:STDOUT: %T.loc14_14.1: %L.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc14_14.2 (constants.%T.4)] // CHECK:STDOUT: %T.ref: %L.type = name_ref T, %T.loc14_14.1 [symbolic = %T.loc14_14.2 (constants.%T.4)] // CHECK:STDOUT: %.loc14_21.1: type = facet_type_access %T.ref [symbolic = %T.loc14_14.2 (constants.%T.4)] // CHECK:STDOUT: %.loc14_21.2: type = converted %T.ref, %.loc14_21.1 [symbolic = %T.loc14_14.2 (constants.%T.4)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %param: %L.type = param runtime_param +// CHECK:STDOUT: %T.loc14_14.1: %L.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc14_14.2 (constants.%T.4)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.5 [template] { -// CHECK:STDOUT: %T.patt: %I.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc18_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc18_14.2 (constants.%T.patt.5)] +// CHECK:STDOUT: %T.param_patt: %I.type = param_pattern %T.patt.loc18_14.1, runtime_param [symbolic = %T.patt.loc18_14.2 (constants.%T.patt.5)] // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %T.param: %I.type = param T, runtime_param -// CHECK:STDOUT: %T.loc18_14.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc18_14.2 (constants.%T.1)] // CHECK:STDOUT: %T.ref: %I.type = name_ref T, %T.loc18_14.1 [symbolic = %T.loc18_14.2 (constants.%T.1)] // CHECK:STDOUT: %.loc18_21.1: type = facet_type_access %T.ref [symbolic = %T.loc18_14.2 (constants.%T.1)] // CHECK:STDOUT: %.loc18_21.2: type = converted %T.ref, %.loc18_21.1 [symbolic = %T.loc18_14.2 (constants.%T.1)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %param: %I.type = param runtime_param +// CHECK:STDOUT: %T.loc18_14.1: %I.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc18_14.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.6 [template] { -// CHECK:STDOUT: %T.patt: %J.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc19_14.1: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_14.2 (constants.%T.patt.6)] +// CHECK:STDOUT: %T.param_patt: %J.type = param_pattern %T.patt.loc19_14.1, runtime_param [symbolic = %T.patt.loc19_14.2 (constants.%T.patt.6)] // CHECK:STDOUT: } { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] -// CHECK:STDOUT: %T.param: %J.type = param T, runtime_param -// CHECK:STDOUT: %T.loc19_14.1: %J.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc19_14.2 (constants.%T.2)] // CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc19_14.1 [symbolic = %T.loc19_14.2 (constants.%T.2)] // CHECK:STDOUT: %.loc19_21.1: type = facet_type_access %T.ref [symbolic = %T.loc19_14.2 (constants.%T.2)] // CHECK:STDOUT: %.loc19_21.2: type = converted %T.ref, %.loc19_21.1 [symbolic = %T.loc19_14.2 (constants.%T.2)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %param: %J.type = param runtime_param +// CHECK:STDOUT: %T.loc19_14.1: %J.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc19_14.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.7 [template] { -// CHECK:STDOUT: %T.patt: %K.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc20_14.1: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt.7)] +// CHECK:STDOUT: %T.param_patt: %K.type = param_pattern %T.patt.loc20_14.1, runtime_param [symbolic = %T.patt.loc20_14.2 (constants.%T.patt.7)] // CHECK:STDOUT: } { // CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [template = constants.%K.type] -// CHECK:STDOUT: %T.param: %K.type = param T, runtime_param -// CHECK:STDOUT: %T.loc20_14.1: %K.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc20_14.2 (constants.%T.3)] // CHECK:STDOUT: %T.ref: %K.type = name_ref T, %T.loc20_14.1 [symbolic = %T.loc20_14.2 (constants.%T.3)] // CHECK:STDOUT: %.loc20_21.1: type = facet_type_access %T.ref [symbolic = %T.loc20_14.2 (constants.%T.3)] // CHECK:STDOUT: %.loc20_21.2: type = converted %T.ref, %.loc20_21.1 [symbolic = %T.loc20_14.2 (constants.%T.3)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %param: %K.type = param runtime_param +// CHECK:STDOUT: %T.loc20_14.1: %K.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc20_14.2 (constants.%T.3)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.8 [template] { -// CHECK:STDOUT: %T.patt: %L.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc21_14.1: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt.8)] +// CHECK:STDOUT: %T.param_patt: %L.type = param_pattern %T.patt.loc21_14.1, runtime_param [symbolic = %T.patt.loc21_14.2 (constants.%T.patt.8)] // CHECK:STDOUT: } { // CHECK:STDOUT: %L.ref: type = name_ref L, file.%L.decl [template = constants.%L.type] -// CHECK:STDOUT: %T.param: %L.type = param T, runtime_param -// CHECK:STDOUT: %T.loc21_14.1: %L.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc21_14.2 (constants.%T.4)] // CHECK:STDOUT: %T.ref: %L.type = name_ref T, %T.loc21_14.1 [symbolic = %T.loc21_14.2 (constants.%T.4)] // CHECK:STDOUT: %.loc21_21.1: type = facet_type_access %T.ref [symbolic = %T.loc21_14.2 (constants.%T.4)] // CHECK:STDOUT: %.loc21_21.2: type = converted %T.ref, %.loc21_21.1 [symbolic = %T.loc21_14.2 (constants.%T.4)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %param: %L.type = param runtime_param +// CHECK:STDOUT: %T.loc21_14.1: %L.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc21_14.2 (constants.%T.4)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -229,30 +245,35 @@ impl (C, C).0 as I {} // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.1(%T.loc11_14.1: %I.type) { // CHECK:STDOUT: %T.loc11_14.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc11_14.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc11_14.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc11_21.2 as %Interface.ref; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(%T.loc12_14.1: %J.type) { // CHECK:STDOUT: %T.loc12_14.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt.loc12_14.2: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc12_21.2 as %Interface.ref; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(%T.loc13_14.1: %K.type) { // CHECK:STDOUT: %T.loc13_14.2: %K.type = bind_symbolic_name T, 0 [symbolic = %T.loc13_14.2 (constants.%T.3)] +// CHECK:STDOUT: %T.patt.loc13_14.2: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc13_21.2 as %Interface.ref; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.4(%T.loc14_14.1: %L.type) { // CHECK:STDOUT: %T.loc14_14.2: %L.type = bind_symbolic_name T, 0 [symbolic = %T.loc14_14.2 (constants.%T.4)] +// CHECK:STDOUT: %T.patt.loc14_14.2: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc14_21.2 as %Interface.ref; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(%T.loc18_14.1: %I.type) { // CHECK:STDOUT: %T.loc18_14.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc18_14.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc18_14.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc18_14.2 (constants.%T.patt.5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -266,6 +287,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(%T.loc19_14.1: %J.type) { // CHECK:STDOUT: %T.loc19_14.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc19_14.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt.loc19_14.2: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_14.2 (constants.%T.patt.6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -279,6 +301,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.7(%T.loc20_14.1: %K.type) { // CHECK:STDOUT: %T.loc20_14.2: %K.type = bind_symbolic_name T, 0 [symbolic = %T.loc20_14.2 (constants.%T.3)] +// CHECK:STDOUT: %T.patt.loc20_14.2: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt.7)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -292,6 +315,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(%T.loc21_14.1: %L.type) { // CHECK:STDOUT: %T.loc21_14.2: %L.type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T.4)] +// CHECK:STDOUT: %T.patt.loc21_14.2: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt.8)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -305,34 +329,42 @@ impl (C, C).0 as I {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.1(constants.%T.1) { // CHECK:STDOUT: %T.loc11_14.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T.2) { // CHECK:STDOUT: %T.loc12_14.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt.loc12_14.2 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.3(constants.%T.3) { // CHECK:STDOUT: %T.loc13_14.2 => constants.%T.3 +// CHECK:STDOUT: %T.patt.loc13_14.2 => constants.%T.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.4(constants.%T.4) { // CHECK:STDOUT: %T.loc14_14.2 => constants.%T.4 +// CHECK:STDOUT: %T.patt.loc14_14.2 => constants.%T.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.5(constants.%T.1) { // CHECK:STDOUT: %T.loc18_14.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc18_14.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.6(constants.%T.2) { // CHECK:STDOUT: %T.loc19_14.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt.loc19_14.2 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.7(constants.%T.3) { // CHECK:STDOUT: %T.loc20_14.2 => constants.%T.3 +// CHECK:STDOUT: %T.patt.loc20_14.2 => constants.%T.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.8(constants.%T.4) { // CHECK:STDOUT: %T.loc21_14.2 => constants.%T.4 +// CHECK:STDOUT: %T.patt.loc21_14.2 => constants.%T.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_same_self_and_interface_redefined.carbon @@ -343,8 +375,10 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %J.type: type = interface_type @J [template] // CHECK:STDOUT: %Self.2: %J.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %T: %I.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: %I.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: = interface_witness () [template] +// CHECK:STDOUT: %T.patt.2: %I.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -355,26 +389,28 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%J.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %T.patt: %I.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc7_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_14.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: %I.type = param_pattern %T.patt.loc7_14.1, runtime_param [symbolic = %T.patt.loc7_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %T.param.loc7: %I.type = param T, runtime_param -// CHECK:STDOUT: %T.loc7_14.1: %I.type = bind_symbolic_name T, 0, %T.param.loc7 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc7: %I.type = name_ref T, %T.loc7_14.1 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: %.loc7_21.1: type = facet_type_access %T.ref.loc7 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: %.loc7_21.2: type = converted %T.ref.loc7, %.loc7_21.1 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: %J.ref.loc7: type = name_ref J, file.%J.decl [template = constants.%J.type] +// CHECK:STDOUT: %param.loc7: %I.type = param runtime_param +// CHECK:STDOUT: %T.loc7_14.1: %I.type = bind_symbolic_name T, 0, %param.loc7 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %T.patt: %I.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc7_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_14.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: %I.type = param_pattern %T.patt.loc7_14.1, runtime_param [symbolic = %T.patt.loc7_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref.loc14: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %T.param.loc14: %I.type = param T, runtime_param -// CHECK:STDOUT: %T.loc14: %I.type = bind_symbolic_name T, 0, %T.param.loc14 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref.loc14: %I.type = name_ref T, %T.loc14 [symbolic = constants.%T] // CHECK:STDOUT: %.loc14_21.1: type = facet_type_access %T.ref.loc14 [symbolic = constants.%T] // CHECK:STDOUT: %.loc14_21.2: type = converted %T.ref.loc14, %.loc14_21.1 [symbolic = constants.%T] // CHECK:STDOUT: %J.ref.loc14: type = name_ref J, file.%J.decl [template = constants.%J.type] +// CHECK:STDOUT: %param.loc14: %I.type = param runtime_param +// CHECK:STDOUT: %T.loc14: %I.type = bind_symbolic_name T, 0, %param.loc14 [symbolic = constants.%T] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -396,17 +432,19 @@ impl (C, C).0 as I {} // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl(%T.loc7_14.1: %I.type) { // CHECK:STDOUT: %T.loc7_14.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc7_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc7_14.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc7_21.2 as %J.ref.loc7 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = .inst+21.loc7_28 +// CHECK:STDOUT: witness = .inst+24.loc7_28 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc7_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc7_14.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- same_type_different_spelling.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon index 1b29cf865279..0c284f90811f 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon @@ -44,11 +44,14 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %I.type.1: type = generic_interface_type @I [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %I: %I.type.1 = struct_value () [template] // CHECK:STDOUT: %I.type.2: type = interface_type @I, @I(%T) [symbolic] // CHECK:STDOUT: %Self: %I.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.3: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.4: type = ptr_type %T [symbolic] // CHECK:STDOUT: %I.type.3: type = interface_type @I, @I(%.4) [symbolic] // CHECK:STDOUT: %.5: = interface_witness () [template] @@ -61,36 +64,40 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %I.decl: %I.type.1 = interface_decl @I [template = constants.%I] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc5_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc5_13.1, runtime_param [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc5_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc5_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc5_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc5_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.1 [template] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc7_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_14.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc7_14.1, runtime_param [symbolic = %T.patt.loc7_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc7_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %I.ref: %I.type.1 = name_ref I, file.%I.decl [template = constants.%I] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_14.1 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: %I.type.loc7_30.1: type = interface_type @I, @I(constants.%T) [symbolic = %I.type.loc7_30.2 (constants.%I.type.2)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc7_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 [template] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.3)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_14.1, runtime_param [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %I.ref: %I.type.1 = name_ref I, file.%I.decl [template = constants.%I] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %.loc8_32.1: type = ptr_type %T [symbolic = %.loc8_32.2 (constants.%.4)] // CHECK:STDOUT: %I.type.loc8_30.1: type = interface_type @I, @I(constants.%.4) [symbolic = %I.type.loc8_30.2 (constants.%I.type.3)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(%T.loc5_13.1: type) { // CHECK:STDOUT: %T.loc5_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc5_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type: type = interface_type @I, @I(%T.loc5_13.2) [symbolic = %I.type (constants.%I.type.2)] @@ -107,6 +114,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.1(%T.loc7_14.1: type) { // CHECK:STDOUT: %T.loc7_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc7_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc7_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: %I.type.loc7_30.2: type = interface_type @I, @I(%T.loc7_14.2) [symbolic = %I.type.loc7_30.2 (constants.%I.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc7_30.1; @@ -114,6 +122,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(%T.loc8_14.1: type) { // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: %.loc8_32.2: type = ptr_type @impl.2.%T.loc8_14.2 (%T) [symbolic = %.loc8_32.2 (constants.%.4)] // CHECK:STDOUT: %I.type.loc8_30.2: type = interface_type @I, @I(%.loc8_32.2) [symbolic = %I.type.loc8_30.2 (constants.%I.type.3)] // CHECK:STDOUT: @@ -136,23 +145,28 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%T) { // CHECK:STDOUT: %T.loc5_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@I.%T.loc5_13.2) { // CHECK:STDOUT: %T.loc5_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@impl.1.%T.loc7_14.2) { // CHECK:STDOUT: %T.loc5_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.1(constants.%T) { // CHECK:STDOUT: %T.loc7_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc7_14.2 => constants.%T // CHECK:STDOUT: %I.type.loc7_30.2 => constants.%I.type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%.4) { // CHECK:STDOUT: %T.loc5_13.2 => constants.%.4 +// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type => constants.%I.type.3 @@ -161,10 +175,12 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@impl.2.%.loc8_32.2) { // CHECK:STDOUT: %T.loc5_13.2 => constants.%.4 +// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T // CHECK:STDOUT: %.loc8_32.2 => constants.%.4 // CHECK:STDOUT: %I.type.loc8_30.2 => constants.%I.type.3 // CHECK:STDOUT: } @@ -178,25 +194,27 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %I: %I.type.1 = struct_value () [template] // CHECK:STDOUT: %I.type.2: type = interface_type @I, @I(%T) [symbolic] // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %Self.2: %I.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %.4: type = ptr_type %T [symbolic] // CHECK:STDOUT: %I.type.3: type = interface_type @I, @I(%.4) [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.5: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//import_generic, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: %I.type.1 = import_ref Main//import_generic, inst+10, loaded [template = constants.%I] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst+16, unloaded +// CHECK:STDOUT: %import_ref.2: %I.type.1 = import_ref Main//import_generic, inst+12, loaded [template = constants.%I] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst+19, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Main//import_generic, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5: type = import_ref Main//import_generic, inst+23, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, inst+26, loaded [symbolic = @impl.1.%I.type.1 (constants.%I.type.2)] -// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, inst+33, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, inst+38, loaded [symbolic = @impl.2.%I.type (constants.%I.type.3)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//import_generic, inst+44, unloaded +// CHECK:STDOUT: %import_ref.5: type = import_ref Main//import_generic, inst+28, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, inst+31, loaded [symbolic = @impl.1.%I.type.1 (constants.%I.type.2)] +// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, inst+41, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, inst+46, loaded [symbolic = @impl.2.%I.type (constants.%I.type.3)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//import_generic, inst+53, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -207,17 +225,18 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: impl_decl @impl.1 [template] {} { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %I.ref: %I.type.1 = name_ref I, imports.%import_ref.2 [template = constants.%I] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = constants.%T] // CHECK:STDOUT: %I.type.loc4: type = interface_type @I, @I(constants.%T) [symbolic = constants.%I.type.2] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4: type = bind_symbolic_name T, 0, %param [symbolic = constants.%T] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type: type = interface_type @I, @I(%T) [symbolic = %I.type (constants.%I.type.2)] @@ -232,6 +251,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.1(constants.%T: type) { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T, 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.1)] // CHECK:STDOUT: %I.type.1: type = interface_type @I, @I(%T.1) [symbolic = %I.type.1 (constants.%I.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -246,6 +266,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.1)] // CHECK:STDOUT: %.1: type = ptr_type @impl.2.%T (%T) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %I.type: type = interface_type @I, @I(%.1) [symbolic = %I.type (constants.%I.type.3)] // CHECK:STDOUT: @@ -264,6 +285,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type => constants.%I.type.2 @@ -272,27 +294,33 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@I.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@impl.1.%T.1) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.1(constants.%T) { // CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %I.type.1 => constants.%I.type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%.4) { // CHECK:STDOUT: %T => constants.%.4 +// CHECK:STDOUT: %T.patt => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@impl.2.%.1) { // CHECK:STDOUT: %T => constants.%.4 +// CHECK:STDOUT: %T.patt => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %.1 => constants.%.4 // CHECK:STDOUT: %I.type => constants.%I.type.3 // CHECK:STDOUT: } @@ -306,24 +334,26 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %I: %I.type.1 = struct_value () [template] // CHECK:STDOUT: %I.type.2: type = interface_type @I, @I(%T) [symbolic] // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %Self.2: %I.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %.4: type = ptr_type %T [symbolic] // CHECK:STDOUT: %I.type.3: type = interface_type @I, @I(%.4) [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//import_generic, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: %I.type.1 = import_ref Main//import_generic, inst+10, loaded [template = constants.%I] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst+16, unloaded +// CHECK:STDOUT: %import_ref.2: %I.type.1 = import_ref Main//import_generic, inst+12, loaded [template = constants.%I] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst+19, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Main//import_generic, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5: type = import_ref Main//import_generic, inst+23, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, inst+26, loaded [symbolic = @impl.1.%I.type (constants.%I.type.2)] -// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, inst+33, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, inst+38, loaded [symbolic = @impl.2.%I.type.1 (constants.%I.type.3)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//import_generic, inst+44, unloaded +// CHECK:STDOUT: %import_ref.5: type = import_ref Main//import_generic, inst+28, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, inst+31, loaded [symbolic = @impl.1.%I.type (constants.%I.type.2)] +// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, inst+41, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, inst+46, loaded [symbolic = @impl.2.%I.type.1 (constants.%I.type.3)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//import_generic, inst+53, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -334,18 +364,19 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: impl_decl @impl.2 [template] {} { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %I.ref: %I.type.1 = name_ref I, imports.%import_ref.2 [template = constants.%I] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11 [symbolic = constants.%T] // CHECK:STDOUT: %.loc11: type = ptr_type %T [symbolic = constants.%.4] // CHECK:STDOUT: %I.type.loc11: type = interface_type @I, @I(constants.%.4) [symbolic = constants.%I.type.3] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T, 0, %param [symbolic = constants.%T] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type: type = interface_type @I, @I(%T) [symbolic = %I.type (constants.%I.type.2)] @@ -360,6 +391,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.1(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.1)] // CHECK:STDOUT: %I.type: type = interface_type @I, @I(%T) [symbolic = %I.type (constants.%I.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.5 as imports.%import_ref.6; @@ -367,6 +399,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%T: type) { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T, 0 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.1)] // CHECK:STDOUT: %.1: type = ptr_type @impl.2.%T.1 (%T) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %I.type.1: type = interface_type @I, @I(%.1) [symbolic = %I.type.1 (constants.%I.type.3)] // CHECK:STDOUT: @@ -385,31 +418,38 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@I.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@impl.1.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.1(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %I.type => constants.%I.type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%.4) { // CHECK:STDOUT: %T => constants.%.4 +// CHECK:STDOUT: %T.patt => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@impl.2.%.1) { // CHECK:STDOUT: %T => constants.%.4 +// CHECK:STDOUT: %T.patt => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T) { // CHECK:STDOUT: %T.1 => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %.1 => constants.%.4 // CHECK:STDOUT: %I.type.1 => constants.%I.type.3 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/import_self.carbon b/toolchain/check/testdata/impl/no_prelude/import_self.carbon index 004024c9a6e6..dea4b2f8dbb1 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_self.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_self.carbon @@ -53,22 +53,24 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %Op.decl: %Op.type = fn_decl @Op [template = constants.%Op] { // CHECK:STDOUT: %self.patt: @Op.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Op.%Self (%Self) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: @Op.%Self (%Self) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @Op.%Self (%Self) = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc5_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc5_15.1: type = facet_type_access %Self.ref.loc5_15 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc5_15.2: type = converted %Self.ref.loc5_15, %.loc5_15.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @Op.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self: @Op.%Self (%Self) = bind_name self, %self.param // CHECK:STDOUT: %Self.ref.loc5_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc5_28.1: type = facet_type_access %Self.ref.loc5_28 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc5_28.2: type = converted %Self.ref.loc5_28, %.loc5_28.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %other.param: @Op.%Self (%Self) = param other, runtime_param1 -// CHECK:STDOUT: %other: @Op.%Self (%Self) = bind_name other, %other.param // CHECK:STDOUT: %Self.ref.loc5_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc5_37.1: type = facet_type_access %Self.ref.loc5_37 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc5_37.2: type = converted %Self.ref.loc5_37, %.loc5_37.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %return: ref @Op.%Self (%Self) = var +// CHECK:STDOUT: %param.loc5_9: @Op.%Self (%Self) = param runtime_param0 +// CHECK:STDOUT: %self: @Op.%Self (%Self) = bind_name self, %param.loc5_9 +// CHECK:STDOUT: %param.loc5_21: @Op.%Self (%Self) = param runtime_param1 +// CHECK:STDOUT: %other: @Op.%Self (%Self) = bind_name other, %param.loc5_21 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc5: %.2 = assoc_entity element0, %Op.decl [template = constants.%.3] // CHECK:STDOUT: @@ -81,7 +83,7 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: generic fn @Op(@Add.%Self: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.%Self (%Self)](%other: @Op.%Self (%Self)) -> @Op.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Op.%Self (%Self)](%other.param_patt: @Op.%Self (%Self)) -> @Op.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op(constants.%Self) { @@ -109,9 +111,9 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+1, loaded [template = constants.%Add.type] // CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.3 = import_ref Main//a, inst+27, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Main//a, inst+21, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3: %.3 = import_ref Main//a, inst+29, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Main//a, inst+23, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+23, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -127,19 +129,21 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %x.patt: %.1 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.1 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: %y.patt: %.1 = binding_pattern y +// CHECK:STDOUT: %y.param_patt: %.1 = param_pattern %y.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc10_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_10.2: type = converted %.loc10_10.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.param: %.1 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.1 = bind_name x, %x.param // CHECK:STDOUT: %.loc10_17.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %y.param: %.1 = param y, runtime_param1 -// CHECK:STDOUT: %y: %.1 = bind_name y, %y.param // CHECK:STDOUT: %.loc10_24.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_24.2: type = converted %.loc10_24.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %return: ref %.1 = var +// CHECK:STDOUT: %param.loc10_6: %.1 = param runtime_param0 +// CHECK:STDOUT: %x: %.1 = bind_name x, %param.loc10_6 +// CHECK:STDOUT: %param.loc10_13: %.1 = param runtime_param1 +// CHECK:STDOUT: %y: %.1 = bind_name y, %param.loc10_13 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -153,16 +157,18 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: impl @impl: %.loc6_7.2 as %Add.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %.1 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.1 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %.1 = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %.1 = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc7_15: type = name_ref Self, @impl.%.loc6_7.2 [template = constants.%.1] -// CHECK:STDOUT: %self.param: %.1 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.1 = bind_name self, %self.param // CHECK:STDOUT: %Self.ref.loc7_28: type = name_ref Self, @impl.%.loc6_7.2 [template = constants.%.1] -// CHECK:STDOUT: %other.param: %.1 = param other, runtime_param1 -// CHECK:STDOUT: %other: %.1 = bind_name other, %other.param // CHECK:STDOUT: %Self.ref.loc7_37: type = name_ref Self, @impl.%.loc6_7.2 [template = constants.%.1] // CHECK:STDOUT: %return: ref %.1 = var +// CHECK:STDOUT: %param.loc7_9: %.1 = param runtime_param0 +// CHECK:STDOUT: %self: %.1 = bind_name self, %param.loc7_9 +// CHECK:STDOUT: %param.loc7_21: %.1 = param runtime_param1 +// CHECK:STDOUT: %other: %.1 = bind_name other, %param.loc7_21 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc6_16: = interface_witness (%Op.decl) [template = constants.%.2] // CHECK:STDOUT: @@ -171,7 +177,7 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: witness = %.loc6_16 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %.1](%other: %.1) -> %.1 { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %.1](%other.param_patt: %.1) -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc7_52: %.1 = tuple_literal () // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template = constants.%tuple] @@ -182,10 +188,10 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: generic fn @Op.2(constants.%Self: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self)](%other: @Op.2.%Self (%Self)) -> @Op.2.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self)](%other.param_patt: @Op.2.%Self (%Self)) -> @Op.2.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%x: %.1, %y: %.1) -> %.1 { +// CHECK:STDOUT: fn @F(%x.param_patt: %.1, %y.param_patt: %.1) -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %.1 = name_ref x, %x // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%Add.type] diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index 7aedda26a511..3314d5190167 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -82,6 +82,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Action.type.1: type = generic_interface_type @Action [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Action: %Action.type.1 = struct_value () [template] @@ -118,10 +119,11 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Action.decl: %Action.type.1 = interface_decl @Action [template = constants.%Action] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_18.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_18.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_18.1, runtime_param [symbolic = %T.patt.loc4_18.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_18.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_18.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_18.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_18.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} @@ -134,15 +136,17 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: %A = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %A = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %a.param: %A = param a, runtime_param0 -// CHECK:STDOUT: %a: %A = bind_name a, %a.param +// CHECK:STDOUT: %param: %A = param runtime_param0 +// CHECK:STDOUT: %a: %A = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Action(%T.loc4_18.1: type) { // CHECK:STDOUT: %T.loc4_18.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_18.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_18.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_18.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Action.type: type = interface_type @Action, @Action(%T.loc4_18.2) [symbolic = %Action.type (constants.%Action.type.2)] @@ -204,7 +208,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a: %A) { +// CHECK:STDOUT: fn @F(%a.param_patt: %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Action.ref: %Action.type.1 = name_ref Action, file.%Action.decl [template = constants.%Action] @@ -219,16 +223,19 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(constants.%T) { // CHECK:STDOUT: %T.loc4_18.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_18.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%T, constants.%Self) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(@Action.%T.loc4_18.2) { // CHECK:STDOUT: %T.loc4_18.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_18.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(constants.%B) { // CHECK:STDOUT: %T.loc4_18.2 => constants.%B +// CHECK:STDOUT: %T.patt.loc4_18.2 => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Action.type => constants.%Action.type.3 @@ -253,6 +260,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %Action.type.2: type = interface_type @Action, @Action(%T) [symbolic] // CHECK:STDOUT: %Self.1: @Action.%Action.type (%Action.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Action.type.3: type = interface_type @Action, @Action(%B) [template] // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %Self.2: %Action.type.2 = bind_symbolic_name Self, 1 [symbolic] @@ -274,23 +282,23 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Action.type.1 = import_ref Main//action, inst+5, loaded [template = constants.%Action] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, inst+25, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//action, inst+30, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//action, inst+33, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//action, inst+31, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+11, unloaded -// CHECK:STDOUT: %import_ref.8: @Action.%.1 (%.4) = import_ref Main//action, inst+17, loaded [symbolic = @Action.%.2 (constants.%.9)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//action, inst+13, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+26, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//action, inst+36, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//action, inst+39, loaded [template = constants.%Action.type.3] -// CHECK:STDOUT: %import_ref.13: = import_ref Main//action, inst+49, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+42, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, inst+13, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//action, inst+13, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//action, inst+13, unloaded +// CHECK:STDOUT: %import_ref.1: %Action.type.1 = import_ref Main//action, inst+7, loaded [template = constants.%Action] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, inst+28, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//action, inst+33, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//action, inst+36, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+60, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//action, inst+34, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+14, unloaded +// CHECK:STDOUT: %import_ref.8: @Action.%.1 (%.4) = import_ref Main//action, inst+20, loaded [symbolic = @Action.%.2 (constants.%.9)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//action, inst+16, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+29, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//action, inst+39, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//action, inst+42, loaded [template = constants.%Action.type.3] +// CHECK:STDOUT: %import_ref.13: = import_ref Main//action, inst+52, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+45, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, inst+16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//action, inst+16, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//action, inst+16, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -306,15 +314,17 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %a.patt: %A = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %A = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] -// CHECK:STDOUT: %a.param: %A = param a, runtime_param0 -// CHECK:STDOUT: %a: %A = bind_name a, %a.param +// CHECK:STDOUT: %param: %A = param runtime_param0 +// CHECK:STDOUT: %a: %A = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Action(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Action.type: type = interface_type @Action, @Action(%T) [symbolic = %Action.type (constants.%Action.type.2)] @@ -353,7 +363,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%a: %A) { +// CHECK:STDOUT: fn @G(%a.param_patt: %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Action.ref: %Action.type.1 = name_ref Action, imports.%import_ref.1 [template = constants.%Action] @@ -370,10 +380,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(constants.%B) { // CHECK:STDOUT: %T => constants.%B +// CHECK:STDOUT: %T.patt => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Action.type => constants.%Action.type.3 @@ -386,6 +398,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(@Action.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%T, constants.%Self.1) {} @@ -402,6 +415,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %Action.type.2: type = interface_type @Action, @Action(%T) [symbolic] // CHECK:STDOUT: %Self.1: @Action.%Action.type (%Action.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Action.type.3: type = interface_type @Action, @Action(%B) [template] // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %Self.2: %Action.type.2 = bind_symbolic_name Self, 1 [symbolic] @@ -426,24 +440,24 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Action.type.1 = import_ref Main//action, inst+5, loaded [template = constants.%Action] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, inst+25, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//action, inst+30, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//action, inst+33, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//action, inst+31, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+11, unloaded -// CHECK:STDOUT: %import_ref.8: @Action.%.1 (%.4) = import_ref Main//action, inst+17, loaded [symbolic = @Action.%.2 (constants.%.11)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//action, inst+13, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+26, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//action, inst+36, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//action, inst+39, loaded [template = constants.%Action.type.3] -// CHECK:STDOUT: %import_ref.13 = import_ref Main//action, inst+49, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+42, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, inst+13, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//action, inst+13, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//action, inst+34, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//action, inst+13, unloaded +// CHECK:STDOUT: %import_ref.1: %Action.type.1 = import_ref Main//action, inst+7, loaded [template = constants.%Action] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, inst+28, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//action, inst+33, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//action, inst+36, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+60, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//action, inst+34, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+14, unloaded +// CHECK:STDOUT: %import_ref.8: @Action.%.1 (%.4) = import_ref Main//action, inst+20, loaded [symbolic = @Action.%.2 (constants.%.11)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//action, inst+16, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+29, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//action, inst+39, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//action, inst+42, loaded [template = constants.%Action.type.3] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//action, inst+52, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+45, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, inst+16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//action, inst+16, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//action, inst+37, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//action, inst+16, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -459,15 +473,17 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %a.patt: %A = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %A = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] -// CHECK:STDOUT: %a.param: %A = param a, runtime_param0 -// CHECK:STDOUT: %a: %A = bind_name a, %a.param +// CHECK:STDOUT: %param: %A = param runtime_param0 +// CHECK:STDOUT: %a: %A = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Action(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Action.type: type = interface_type @Action, @Action(%T) [symbolic = %Action.type (constants.%Action.type.2)] @@ -511,7 +527,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%a: %A) { +// CHECK:STDOUT: fn @G(%a.param_patt: %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Action.ref: %Action.type.1 = name_ref Action, imports.%import_ref.1 [template = constants.%Action] @@ -524,10 +540,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(constants.%B) { // CHECK:STDOUT: %T => constants.%B +// CHECK:STDOUT: %T.patt => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Action.type => constants.%Action.type.3 @@ -540,12 +558,14 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(@Action.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op(constants.%T, constants.%Self.1) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(constants.%C) { // CHECK:STDOUT: %T => constants.%C +// CHECK:STDOUT: %T.patt => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Action.type => constants.%Action.type.4 @@ -560,6 +580,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Factory.type.1: type = generic_interface_type @Factory [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Factory: %Factory.type.1 = struct_value () [template] @@ -590,10 +611,11 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Factory.decl: %Factory.type.1 = interface_decl @Factory [template = constants.%Factory] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_19.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_19.1, runtime_param [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_19.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_19.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} @@ -607,6 +629,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Factory(%T.loc4_19.1: type) { // CHECK:STDOUT: %T.loc4_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_19.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_19.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Factory.type: type = interface_type @Factory, @Factory(%T.loc4_19.2) [symbolic = %Factory.type (constants.%Factory.type.2)] @@ -667,6 +690,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(constants.%T) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Make.1(constants.%T, constants.%Self) { @@ -675,10 +699,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(@Factory.%T.loc4_19.2) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(constants.%B) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%B +// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Factory.type => constants.%Factory.type.3 @@ -705,6 +731,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %Factory.type.2: type = interface_type @Factory, @Factory(%T) [symbolic] // CHECK:STDOUT: %Self.1: @Factory.%Factory.type (%Factory.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Factory.type.3: type = interface_type @Factory, @Factory(%B) [template] // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %Self.2: %Factory.type.2 = bind_symbolic_name Self, 1 [symbolic] @@ -726,21 +753,21 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, inst+5, loaded [template = constants.%Factory] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+28, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//factory, inst+33, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//factory, inst+34, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+11, unloaded -// CHECK:STDOUT: %import_ref.6: @Factory.%.1 (%.4) = import_ref Main//factory, inst+20, loaded [symbolic = @Factory.%.2 (constants.%.9)] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//factory, inst+15, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+29, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//factory, inst+36, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//factory, inst+39, loaded [template = constants.%Factory.type.3] -// CHECK:STDOUT: %import_ref.11: = import_ref Main//factory, inst+51, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+44, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//factory, inst+15, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, inst+15, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, inst+15, unloaded +// CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, inst+7, loaded [template = constants.%Factory] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+31, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//factory, inst+36, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//factory, inst+37, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+14, unloaded +// CHECK:STDOUT: %import_ref.6: @Factory.%.1 (%.4) = import_ref Main//factory, inst+23, loaded [symbolic = @Factory.%.2 (constants.%.9)] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//factory, inst+18, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+32, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//factory, inst+39, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//factory, inst+42, loaded [template = constants.%Factory.type.3] +// CHECK:STDOUT: %import_ref.11: = import_ref Main//factory, inst+54, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+47, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//factory, inst+18, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, inst+18, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, inst+18, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -754,17 +781,19 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %MakeB.decl: %MakeB.type = fn_decl @MakeB [template = constants.%MakeB] { // CHECK:STDOUT: %a.patt: %A = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %A = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] -// CHECK:STDOUT: %a.param: %A = param a, runtime_param0 -// CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: %B.ref.loc4: type = name_ref B, imports.%import_ref.3 [template = constants.%B] // CHECK:STDOUT: %return: ref %B = var +// CHECK:STDOUT: %param: %A = param runtime_param0 +// CHECK:STDOUT: %a: %A = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Factory(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Factory.type: type = interface_type @Factory, @Factory(%T) [symbolic = %Factory.type (constants.%Factory.type.2)] @@ -804,7 +833,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: fn() -> @Make.1.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @MakeB(%a: %A) -> %return: %B { +// CHECK:STDOUT: fn @MakeB(%a.param_patt: %A) -> %return: %B { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Factory.ref: %Factory.type.1 = name_ref Factory, imports.%import_ref.1 [template = constants.%Factory] @@ -822,10 +851,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(constants.%B) { // CHECK:STDOUT: %T => constants.%B +// CHECK:STDOUT: %T.patt => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Factory.type => constants.%Factory.type.3 @@ -838,6 +869,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(@Factory.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Make.1(constants.%T, constants.%Self.1) { @@ -856,6 +888,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %Factory.type.2: type = interface_type @Factory, @Factory(%T) [symbolic] // CHECK:STDOUT: %Self.1: @Factory.%Factory.type (%Factory.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Factory.type.3: type = interface_type @Factory, @Factory(%B) [template] // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %Self.2: %Factory.type.2 = bind_symbolic_name Self, 1 [symbolic] @@ -880,21 +913,21 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, inst+5, loaded [template = constants.%Factory] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+28, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//factory, inst+33, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//factory, inst+34, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+11, unloaded -// CHECK:STDOUT: %import_ref.6: @Factory.%.1 (%.4) = import_ref Main//factory, inst+20, loaded [symbolic = @Factory.%.2 (constants.%.11)] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//factory, inst+15, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+29, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//factory, inst+36, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//factory, inst+39, loaded [template = constants.%Factory.type.3] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//factory, inst+51, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+44, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//factory, inst+15, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, inst+15, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, inst+15, unloaded +// CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, inst+7, loaded [template = constants.%Factory] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+31, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//factory, inst+36, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//factory, inst+37, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+14, unloaded +// CHECK:STDOUT: %import_ref.6: @Factory.%.1 (%.4) = import_ref Main//factory, inst+23, loaded [symbolic = @Factory.%.2 (constants.%.11)] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//factory, inst+18, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+32, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//factory, inst+39, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//factory, inst+42, loaded [template = constants.%Factory.type.3] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//factory, inst+54, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+47, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//factory, inst+18, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, inst+18, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, inst+18, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -910,17 +943,19 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %MakeC.decl: %MakeC.type = fn_decl @MakeC [template = constants.%MakeC] { // CHECK:STDOUT: %a.patt: %A = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %A = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] -// CHECK:STDOUT: %a.param: %A = param a, runtime_param0 -// CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param: %A = param runtime_param0 +// CHECK:STDOUT: %a: %A = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Factory(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Factory.type: type = interface_type @Factory, @Factory(%T) [symbolic = %Factory.type (constants.%Factory.type.2)] @@ -967,7 +1002,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: fn() -> @Make.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @MakeC(%a: %A) -> %return: %C { +// CHECK:STDOUT: fn @MakeC(%a.param_patt: %A) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Factory.ref: %Factory.type.1 = name_ref Factory, imports.%import_ref.1 [template = constants.%Factory] @@ -980,10 +1015,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(constants.%B) { // CHECK:STDOUT: %T => constants.%B +// CHECK:STDOUT: %T.patt => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Factory.type => constants.%Factory.type.3 @@ -996,6 +1033,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(@Factory.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Make(constants.%T, constants.%Self.1) { @@ -1004,6 +1042,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(constants.%C) { // CHECK:STDOUT: %T => constants.%C +// CHECK:STDOUT: %T.patt => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Factory.type => constants.%Factory.type.4 diff --git a/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon b/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon index c0d37dd357af..8cc8d17a9994 100644 --- a/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon +++ b/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon @@ -116,22 +116,24 @@ impl D as SelfNested { // CHECK:STDOUT: %Self: %UseSelf.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1] // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: @F.1.%Self (%Self.1) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.1.%Self (%Self.1) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %x.patt: @F.1.%Self (%Self.1) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @F.1.%Self (%Self.1) = param_pattern %x.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12_14: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = %Self (constants.%Self.1)] -// CHECK:STDOUT: %self.param: @F.1.%Self (%Self.1) = param self, runtime_param0 -// CHECK:STDOUT: %self: @F.1.%Self (%Self.1) = bind_name self, %self.param // CHECK:STDOUT: %Self.ref.loc12_23: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: %.loc12_23.1: type = facet_type_access %Self.ref.loc12_23 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: %.loc12_23.2: type = converted %Self.ref.loc12_23, %.loc12_23.1 [symbolic = %Self (constants.%Self.1)] -// CHECK:STDOUT: %x.param: @F.1.%Self (%Self.1) = param x, runtime_param1 -// CHECK:STDOUT: %x: @F.1.%Self (%Self.1) = bind_name x, %x.param // CHECK:STDOUT: %Self.ref.loc12_32: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: %.loc12_32.1: type = facet_type_access %Self.ref.loc12_32 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: %.loc12_32.2: type = converted %Self.ref.loc12_32, %.loc12_32.1 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: %return: ref @F.1.%Self (%Self.1) = var +// CHECK:STDOUT: %param.loc12_8: @F.1.%Self (%Self.1) = param runtime_param0 +// CHECK:STDOUT: %self: @F.1.%Self (%Self.1) = bind_name self, %param.loc12_8 +// CHECK:STDOUT: %param.loc12_20: @F.1.%Self (%Self.1) = param runtime_param1 +// CHECK:STDOUT: %x: @F.1.%Self (%Self.1) = bind_name x, %param.loc12_20 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc12: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: @@ -145,6 +147,7 @@ impl D as SelfNested { // CHECK:STDOUT: %Self: %SelfNested.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.2] // CHECK:STDOUT: %F.decl: %F.type.4 = fn_decl @F.4 [template = constants.%F.4] { // CHECK:STDOUT: %x.patt: @F.4.%.loc28_37.1 (%.12) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @F.4.%.loc28_37.1 (%.12) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc28_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.loc28_16.2: type = facet_type_access %Self.ref.loc28_12 [symbolic = %Self (constants.%Self.2)] @@ -158,8 +161,8 @@ impl D as SelfNested { // CHECK:STDOUT: %.loc28_36.2: type = struct_type {.x: %Self.2, .y: %.1} [symbolic = %.loc28_36.1 (constants.%.10)] // CHECK:STDOUT: %.loc28_37.2: %.11 = tuple_literal (%.loc28_16.4, %.loc28_36.2) // CHECK:STDOUT: %.loc28_37.3: type = converted %.loc28_37.2, constants.%.12 [symbolic = %.loc28_37.1 (constants.%.12)] -// CHECK:STDOUT: %x.param: @F.4.%.loc28_37.1 (%.12) = param x, runtime_param0 -// CHECK:STDOUT: %x: @F.4.%.loc28_37.1 (%.12) = bind_name x, %x.param +// CHECK:STDOUT: %param: @F.4.%.loc28_37.1 (%.12) = param runtime_param0 +// CHECK:STDOUT: %x: @F.4.%.loc28_37.1 (%.12) = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc28: %.13 = assoc_entity element0, %F.decl [template = constants.%.14] // CHECK:STDOUT: @@ -172,16 +175,18 @@ impl D as SelfNested { // CHECK:STDOUT: impl @impl.1: %C.ref as %UseSelf.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %x.patt: %C = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C = param_pattern %x.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc20_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc20_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %x.param: %C = param x, runtime_param1 -// CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: %C.ref.loc20_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc20_8: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc20_8 +// CHECK:STDOUT: %param.loc20_17: %C = param runtime_param1 +// CHECK:STDOUT: %x: %C = bind_name x, %param.loc20_17 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19: = interface_witness (%F.decl) [template = constants.%.6] // CHECK:STDOUT: @@ -193,16 +198,18 @@ impl D as SelfNested { // CHECK:STDOUT: impl @impl.2: %D.ref as %UseSelf.ref { // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] { // CHECK:STDOUT: %self.patt: %D = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %D = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %x.patt: %D = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %D = param_pattern %x.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc24_14: type = name_ref Self, @impl.2.%D.ref [template = constants.%D] -// CHECK:STDOUT: %self.param: %D = param self, runtime_param0 -// CHECK:STDOUT: %self: %D = bind_name self, %self.param // CHECK:STDOUT: %Self.ref.loc24_23: type = name_ref Self, @impl.2.%D.ref [template = constants.%D] -// CHECK:STDOUT: %x.param: %D = param x, runtime_param1 -// CHECK:STDOUT: %x: %D = bind_name x, %x.param // CHECK:STDOUT: %Self.ref.loc24_32: type = name_ref Self, @impl.2.%D.ref [template = constants.%D] // CHECK:STDOUT: %return: ref %D = var +// CHECK:STDOUT: %param.loc24_8: %D = param runtime_param0 +// CHECK:STDOUT: %self: %D = bind_name self, %param.loc24_8 +// CHECK:STDOUT: %param.loc24_20: %D = param runtime_param1 +// CHECK:STDOUT: %x: %D = bind_name x, %param.loc24_20 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc23: = interface_witness (%F.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -214,6 +221,7 @@ impl D as SelfNested { // CHECK:STDOUT: impl @impl.3: %C.ref as %SelfNested.ref { // CHECK:STDOUT: %F.decl: %F.type.5 = fn_decl @F.5 [template = constants.%F.5] { // CHECK:STDOUT: %x.patt: %.17 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.17 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc32_12: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc32_13: type = ptr_type %C [template = constants.%.15] @@ -223,8 +231,8 @@ impl D as SelfNested { // CHECK:STDOUT: %.loc32_30: type = struct_type {.x: %C, .y: %.1} [template = constants.%.16] // CHECK:STDOUT: %.loc32_31.1: %.11 = tuple_literal (%.loc32_13, %.loc32_30) // CHECK:STDOUT: %.loc32_31.2: type = converted %.loc32_31.1, constants.%.17 [template = constants.%.17] -// CHECK:STDOUT: %x.param: %.17 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.17 = bind_name x, %x.param +// CHECK:STDOUT: %param: %.17 = param runtime_param0 +// CHECK:STDOUT: %x: %.17 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc31: = interface_witness (%F.decl) [template = constants.%.18] // CHECK:STDOUT: @@ -236,6 +244,7 @@ impl D as SelfNested { // CHECK:STDOUT: impl @impl.4: %D.ref as %SelfNested.ref { // CHECK:STDOUT: %F.decl: %F.type.6 = fn_decl @F.6 [template = constants.%F.6] { // CHECK:STDOUT: %x.patt: %.21 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.21 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc36_12: type = name_ref Self, @impl.4.%D.ref [template = constants.%D] // CHECK:STDOUT: %.loc36_16: type = ptr_type %D [template = constants.%.19] @@ -245,8 +254,8 @@ impl D as SelfNested { // CHECK:STDOUT: %.loc36_36: type = struct_type {.x: %D, .y: %.1} [template = constants.%.20] // CHECK:STDOUT: %.loc36_37.1: %.11 = tuple_literal (%.loc36_16, %.loc36_36) // CHECK:STDOUT: %.loc36_37.2: type = converted %.loc36_37.1, constants.%.21 [template = constants.%.21] -// CHECK:STDOUT: %x.param: %.21 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.21 = bind_name x, %x.param +// CHECK:STDOUT: %param: %.21 = param runtime_param0 +// CHECK:STDOUT: %x: %.21 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc35: = interface_witness (%F.decl) [template = constants.%.22] // CHECK:STDOUT: @@ -272,10 +281,10 @@ impl D as SelfNested { // CHECK:STDOUT: generic fn @F.1(@UseSelf.%Self: %UseSelf.type) { // CHECK:STDOUT: %Self: %UseSelf.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @F.1.%Self (%Self.1)](%x: @F.1.%Self (%Self.1)) -> @F.1.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self.1)](%x.param_patt: @F.1.%Self (%Self.1)) -> @F.1.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[%self: %C](%x: %C) -> %return: %C { +// CHECK:STDOUT: fn @F.2[%self.param_patt: %C](%x.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc20_38.1: %.4 = struct_literal () // CHECK:STDOUT: %.loc20_38.2: init %C = class_init (), %return [template = constants.%struct.1] @@ -283,7 +292,7 @@ impl D as SelfNested { // CHECK:STDOUT: return %.loc20_39 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.3[%self: %D](%x: %D) -> %return: %D { +// CHECK:STDOUT: fn @F.3[%self.param_patt: %D](%x.param_patt: %D) -> %return: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc24_47.1: %.4 = struct_literal () // CHECK:STDOUT: %.loc24_47.2: init %D = class_init (), %return [template = constants.%struct.2] @@ -297,12 +306,12 @@ impl D as SelfNested { // CHECK:STDOUT: %.loc28_36.1: type = struct_type {.x: @F.4.%Self (%Self.2), .y: %.1} [symbolic = %.loc28_36.1 (constants.%.10)] // CHECK:STDOUT: %.loc28_37.1: type = tuple_type (@F.4.%.loc28_16.1 (%.9), @F.4.%.loc28_36.1 (%.10)) [symbolic = %.loc28_37.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x: @F.4.%.loc28_37.1 (%.12)); +// CHECK:STDOUT: fn(%x.param_patt: @F.4.%.loc28_37.1 (%.12)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.5(%x: %.17); +// CHECK:STDOUT: fn @F.5(%x.param_patt: %.17); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.6(%x: %.21); +// CHECK:STDOUT: fn @F.6(%x.param_patt: %.21); // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self.1) { // CHECK:STDOUT: %Self => constants.%Self.1 diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index d9afcbfa8582..cbd41b5fd9d4 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -85,25 +85,27 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %b.patt: %.3 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %.3 = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] // CHECK:STDOUT: %.loc13_16: type = array_type %.loc13_15, i32 [template = constants.%.3] -// CHECK:STDOUT: %b.param: %.3 = param b, runtime_param0 -// CHECK:STDOUT: %b: %.3 = bind_name b, %b.param +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %b: %.3 = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %ValueBinding.decl: %ValueBinding.type = fn_decl @ValueBinding [template = constants.%ValueBinding] { // CHECK:STDOUT: %b.patt: %.3 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %.3 = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_26: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc21_21.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] // CHECK:STDOUT: %.loc21_21.2: type = converted %int.make_type_32.loc21, %.loc21_21.1 [template = i32] // CHECK:STDOUT: %.loc21_27: type = array_type %.loc21_26, i32 [template = constants.%.3] -// CHECK:STDOUT: %b.param: %.3 = param b, runtime_param0 -// CHECK:STDOUT: %b: %.3 = bind_name b, %b.param +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %b: %.3 = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -111,7 +113,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %.3; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%b: %.3) { +// CHECK:STDOUT: fn @G(%b.param_patt: %.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_16: i32 = int_literal 3 [template = constants.%.2] @@ -155,7 +157,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ValueBinding(%b: %.3) { +// CHECK:STDOUT: fn @ValueBinding(%b.param_patt: %.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_16: i32 = int_literal 3 [template = constants.%.2] diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index 9f1d3c34f24d..981aaeeb8a14 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -36,6 +36,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -63,12 +64,12 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.9) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.13)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.9) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.13)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -94,6 +95,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -118,7 +120,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -145,14 +147,17 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -163,6 +168,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 19bdeb0b714d..cdb6dc049174 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -86,14 +86,15 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %b.patt: %.3 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %.3 = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] // CHECK:STDOUT: %.loc13_16: type = array_type %.loc13_15, i32 [template = constants.%.3] -// CHECK:STDOUT: %b.param: %.3 = param b, runtime_param0 -// CHECK:STDOUT: %b: %.3 = bind_name b, %b.param +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %b: %.3 = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -101,7 +102,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %.3; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%b: %.3) { +// CHECK:STDOUT: fn @G(%b.param_patt: %.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_14.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 425641bc7019..fed5d28e2079 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -52,11 +52,11 @@ var d: i32 = c[-10]; // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+77, loaded [template = constants.%Negate.type] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+79, unloaded -// CHECK:STDOUT: %import_ref.4: %.10 = import_ref Core//prelude/operators/arithmetic, inst+96, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+91, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+91, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+82, loaded [template = constants.%Negate.type] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+84, unloaded +// CHECK:STDOUT: %import_ref.4: %.10 = import_ref Core//prelude/operators/arithmetic, inst+102, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+97, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+97, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -92,7 +92,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: generic fn @Op(constants.%Self: %Negate.type) { // CHECK:STDOUT: %Self: %Negate.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.%Self (%Self)]() -> @Op.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Op.%Self (%Self)]() -> @Op.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon index 584f1b362cce..6298e8f98499 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -30,6 +30,7 @@ interface I { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.3: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -57,12 +58,12 @@ interface I { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -92,6 +93,7 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -114,19 +116,22 @@ interface I { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.2) { @@ -137,6 +142,7 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon index 1d7fb9c535b0..93d667600a00 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon @@ -69,22 +69,24 @@ interface Interface { // CHECK:STDOUT: %.loc16: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc21_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_19.1: type = value_of_initializer %int.make_type_32.loc21_19 [template = i32] // CHECK:STDOUT: %.loc21_19.2: type = converted %int.make_type_32.loc21_19, %.loc21_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc21_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_27.1: type = value_of_initializer %int.make_type_32.loc21_27 [template = i32] // CHECK:STDOUT: %.loc21_27.2: type = converted %int.make_type_32.loc21_27, %.loc21_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc21_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_35.1: type = value_of_initializer %int.make_type_32.loc21_35 [template = i32] // CHECK:STDOUT: %.loc21_35.2: type = converted %int.make_type_32.loc21_35, %.loc21_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc21_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc21_16 +// CHECK:STDOUT: %param.loc21_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc21_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc21: %.4 = assoc_entity element1, %G.decl [template = constants.%.5] // CHECK:STDOUT: @@ -108,7 +110,7 @@ interface Interface { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(@Interface.%Self: %Interface.type) { // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a: i32, %b: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self) {} diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 7b60adde0b84..4f9ad8317369 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -110,22 +110,24 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %.decl.loc23: %.type.1 = fn_decl @.1 [template = constants.%.6] {} {} // CHECK:STDOUT: %.decl.loc31: %.type.2 = fn_decl @.2 [template = constants.%.7] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc31_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc31_19.1: type = value_of_initializer %int.make_type_32.loc31_19 [template = i32] // CHECK:STDOUT: %.loc31_19.2: type = converted %int.make_type_32.loc31_19, %.loc31_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc31_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc31_27.1: type = value_of_initializer %int.make_type_32.loc31_27 [template = i32] // CHECK:STDOUT: %.loc31_27.2: type = converted %int.make_type_32.loc31_27, %.loc31_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc31_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc31_35.1: type = value_of_initializer %int.make_type_32.loc31_35 [template = i32] // CHECK:STDOUT: %.loc31_35.2: type = converted %int.make_type_32.loc31_35, %.loc31_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc31_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc31_16 +// CHECK:STDOUT: %param.loc31_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc31_24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -135,22 +137,24 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %.loc7: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc13_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_19.1: type = value_of_initializer %int.make_type_32.loc13_19 [template = i32] // CHECK:STDOUT: %.loc13_19.2: type = converted %int.make_type_32.loc13_19, %.loc13_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc13_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_27.1: type = value_of_initializer %int.make_type_32.loc13_27 [template = i32] // CHECK:STDOUT: %.loc13_27.2: type = converted %int.make_type_32.loc13_27, %.loc13_27.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc13_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_35.1: type = value_of_initializer %int.make_type_32.loc13_35 [template = i32] // CHECK:STDOUT: %.loc13_35.2: type = converted %int.make_type_32.loc13_35, %.loc13_35.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc13_16: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc13_16 +// CHECK:STDOUT: %param.loc13_24: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc13_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc13: %.4 = assoc_entity element1, %G.decl [template = constants.%.5] // CHECK:STDOUT: @@ -170,7 +174,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(@Interface.%Self: %Interface.type) { // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a: i32, %b: i32) -> i32; +// CHECK:STDOUT: fn(%a.param_patt: i32, %b.param_patt: i32) -> i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(@Interface.%Self: %Interface.type) { @@ -184,7 +188,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.2(@Interface.%Self: %Interface.type) { // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a: i32, %b: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self) {} @@ -203,11 +207,13 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %C.1: type = class_type @C [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%Self) [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt.1: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F, @C(%Self) [symbolic] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %U.patt.2: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -233,20 +239,23 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%Interface.type] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [symbolic = constants.%F] { // CHECK:STDOUT: %self.patt: %C.2 = binding_pattern self -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %self.param_patt: %C.2 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %U.patt.loc20: type = symbolic_binding_pattern U, 1 [symbolic = constants.%U.patt.2] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc20, runtime_param [symbolic = constants.%U.patt.2] // CHECK:STDOUT: %u.patt: %U = binding_pattern u +// CHECK:STDOUT: %u.param_patt: %U = param_pattern %u.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc20: type = specific_constant constants.%C.2, @C(constants.%Self) [symbolic = constants.%C.2] // CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, %.loc20 [symbolic = constants.%C.2] -// CHECK:STDOUT: %self.param.loc20: %C.2 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc20: %C.2 = bind_name self, %self.param.loc20 -// CHECK:STDOUT: %U.param.loc20: type = param U, runtime_param -// CHECK:STDOUT: %U.loc20: type = bind_symbolic_name U, 1, %U.param.loc20 [symbolic = constants.%U] // CHECK:STDOUT: %U.ref.loc20_43: type = name_ref U, %U.loc20 [symbolic = constants.%U] -// CHECK:STDOUT: %u.param.loc20: %U = param u, runtime_param1 -// CHECK:STDOUT: %u.loc20: %U = bind_name u, %u.param.loc20 // CHECK:STDOUT: %U.ref.loc20_49: type = name_ref U, %U.loc20 [symbolic = constants.%U] // CHECK:STDOUT: %return: ref %U = var +// CHECK:STDOUT: %param.loc20_18: %C.2 = param runtime_param0 +// CHECK:STDOUT: %self.loc20: %C.2 = bind_name self, %param.loc20_18 +// CHECK:STDOUT: %param.loc20_30: type = param runtime_param +// CHECK:STDOUT: %U.loc20: type = bind_symbolic_name U, 1, %param.loc20_30 [symbolic = constants.%U] +// CHECK:STDOUT: %param.loc20_40: %U = param runtime_param1 +// CHECK:STDOUT: %u.loc20: %U = bind_name u, %param.loc20_40 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -269,20 +278,23 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: class { // CHECK:STDOUT: %F.decl: @C.%F.type (%F.type) = fn_decl @F [symbolic = @C.%F (constants.%F)] { // CHECK:STDOUT: %self.patt: %C.2 = binding_pattern self -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %self.param_patt: %C.2 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %U.patt.loc20: type = symbolic_binding_pattern U, 1 [symbolic = constants.%U.patt.2] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc20, runtime_param [symbolic = constants.%U.patt.2] // CHECK:STDOUT: %u.patt: %U = binding_pattern u +// CHECK:STDOUT: %u.param_patt: %U = param_pattern %u.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc14: type = specific_constant constants.%C.2, @C(constants.%Self) [symbolic = %C (constants.%C.2)] // CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, %.loc14 [symbolic = %C (constants.%C.2)] -// CHECK:STDOUT: %self.param.loc14: @F.%C (%C.2) = param self, runtime_param0 -// CHECK:STDOUT: %self.loc14: @F.%C (%C.2) = bind_name self, %self.param.loc14 -// CHECK:STDOUT: %U.param.loc14: type = param U, runtime_param -// CHECK:STDOUT: %U.loc14_22.2: type = bind_symbolic_name U, 1, %U.param.loc14 [symbolic = %U.loc14_22.1 (constants.%U)] // CHECK:STDOUT: %U.ref.loc14_35: type = name_ref U, %U.loc14_22.2 [symbolic = %U.loc14_22.1 (constants.%U)] -// CHECK:STDOUT: %u.param.loc14: @F.%U.loc14_22.1 (%U) = param u, runtime_param1 -// CHECK:STDOUT: %u.loc14: @F.%U.loc14_22.1 (%U) = bind_name u, %u.param.loc14 // CHECK:STDOUT: %U.ref.loc14_41: type = name_ref U, %U.loc14_22.2 [symbolic = %U.loc14_22.1 (constants.%U)] // CHECK:STDOUT: %return.var.loc14: ref @F.%U.loc14_22.1 (%U) = var +// CHECK:STDOUT: %param.loc14_10: @F.%C (%C.2) = param runtime_param0 +// CHECK:STDOUT: %self.loc14: @F.%C (%C.2) = bind_name self, %param.loc14_10 +// CHECK:STDOUT: %param.loc14_22: type = param runtime_param +// CHECK:STDOUT: %U.loc14_22.2: type = bind_symbolic_name U, 1, %param.loc14_22 [symbolic = %U.loc14_22.1 (constants.%U)] +// CHECK:STDOUT: %param.loc14_32: @F.%U.loc14_22.1 (%U) = param runtime_param1 +// CHECK:STDOUT: %u.loc14: @F.%U.loc14_22.1 (%U) = bind_name u, %param.loc14_32 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -296,10 +308,11 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %Self: %Interface.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C.2)] // CHECK:STDOUT: %U.loc14_22.1: type = bind_symbolic_name U, 1 [symbolic = %U.loc14_22.1 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc14: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc14 (constants.%U.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.loc20: %C.2](%U.loc20: type, %u.loc20: %U) -> %U { +// CHECK:STDOUT: fn[%self.param_patt: %C.2](%U.param_patt: type, %u.param_patt: %U) -> %U { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %u.ref: @F.%U.loc14_22.1 (%U) = name_ref u, %u.loc20 // CHECK:STDOUT: return %u.ref @@ -319,6 +332,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %U.loc14_22.1 => constants.%U +// CHECK:STDOUT: %U.patt.loc14 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(@C.%Self) {} diff --git a/toolchain/check/testdata/interface/no_prelude/as_type.carbon b/toolchain/check/testdata/interface/no_prelude/as_type.carbon index d8fb98b849bd..41e51f847fc8 100644 --- a/toolchain/check/testdata/interface/no_prelude/as_type.carbon +++ b/toolchain/check/testdata/interface/no_prelude/as_type.carbon @@ -30,10 +30,11 @@ fn F(e: Empty) {} // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%Empty.type] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %e.patt: %Empty.type = binding_pattern e +// CHECK:STDOUT: %e.param_patt: %Empty.type = param_pattern %e.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] -// CHECK:STDOUT: %e.param: %Empty.type = param e, runtime_param0 -// CHECK:STDOUT: %e: %Empty.type = bind_name e, %e.param +// CHECK:STDOUT: %param: %Empty.type = param runtime_param0 +// CHECK:STDOUT: %e: %Empty.type = bind_name e, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -45,7 +46,7 @@ fn F(e: Empty) {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%e: %Empty.type) { +// CHECK:STDOUT: fn @F(%e.param_patt: %Empty.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon b/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon index 2de913cf642d..35906e8dc856 100644 --- a/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon +++ b/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon @@ -20,6 +20,7 @@ fn F(T:! Empty) { // CHECK:STDOUT: %Empty.type: type = interface_type @Empty [template] // CHECK:STDOUT: %Self: %Empty.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %T: %Empty.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: %Empty.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -32,11 +33,12 @@ fn F(T:! Empty) { // CHECK:STDOUT: } // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%Empty.type] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: %Empty.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc13_6.1: %Empty.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: %Empty.type = param_pattern %T.patt.loc13_6.1, runtime_param [symbolic = %T.patt.loc13_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] -// CHECK:STDOUT: %T.param: %Empty.type = param T, runtime_param -// CHECK:STDOUT: %T.loc13_6.1: %Empty.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_6.2 (constants.%T)] +// CHECK:STDOUT: %param: %Empty.type = param runtime_param +// CHECK:STDOUT: %T.loc13_6.1: %Empty.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc13_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -50,10 +52,11 @@ fn F(T:! Empty) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc13_6.1: %Empty.type) { // CHECK:STDOUT: %T.loc13_6.2: %Empty.type = bind_symbolic_name T, 0 [symbolic = %T.loc13_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc13_6.2: %Empty.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc13_6.1: %Empty.type) { +// CHECK:STDOUT: fn(%T.param_patt: %Empty.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %T.ref: %Empty.type = name_ref T, %T.loc13_6.1 [symbolic = %T.loc13_6.2 (constants.%T)] // CHECK:STDOUT: %.loc14_10.1: type = facet_type_access %T.ref [symbolic = %T.loc13_6.2 (constants.%T)] @@ -66,5 +69,6 @@ fn F(T:! Empty) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc13_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc13_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon b/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon index 8df253eb9378..3d2abe5c3e3f 100644 --- a/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon @@ -27,16 +27,19 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %I.type.1: type = generic_interface_type @I [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %I: %I.type.1 = struct_value () [template] // CHECK:STDOUT: %I.type.2: type = interface_type @I, @I(%T) [symbolic] // CHECK:STDOUT: %Self: %I.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 2 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 2 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F, @I(%T) [symbolic] // CHECK:STDOUT: %F: %F.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = assoc_entity_type %I.type.2, %F.type.1 [symbolic] // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @I.%F.decl [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] @@ -56,22 +59,25 @@ fn H() { // CHECK:STDOUT: .H = %H.decl // CHECK:STDOUT: } // CHECK:STDOUT: %I.decl: %I.type.1 = interface_decl @I [template = constants.%I] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_13.1, runtime_param [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc15_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_6.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc15_6.1, runtime_param [symbolic = %T.patt.loc15_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc15_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc15_6.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc15_6.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc15_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(%T.loc11_13.1: type) { // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type: type = interface_type @I, @I(%T.loc11_13.2) [symbolic = %I.type (constants.%I.type.2)] @@ -84,12 +90,13 @@ fn H() { // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: %F.decl: @I.%F.type (%F.type.1) = fn_decl @F [symbolic = @I.%F (constants.%F)] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 2 +// CHECK:STDOUT: %U.patt.loc12_8.2: type = symbolic_binding_pattern U, 2 [symbolic = %U.patt.loc12_8.1 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc12_8.2, runtime_param [symbolic = %U.patt.loc12_8.1 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc12_8.1: type = bind_symbolic_name U, 2, %U.param [symbolic = %U.loc12_8.2 (constants.%U)] -// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc12_8.1 [symbolic = %U.loc12_8.2 (constants.%U)] -// CHECK:STDOUT: %return: ref @F.%U.loc12_8.2 (%U) = var +// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc12_8.2 [symbolic = %U.loc12_8.1 (constants.%U)] +// CHECK:STDOUT: %return: ref @F.%U.loc12_8.1 (%U) = var +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc12_8.2: type = bind_symbolic_name U, 2, %param [symbolic = %U.loc12_8.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc12_22.1: @I.%.loc12_22.2 (%.2) = assoc_entity element0, %F.decl [symbolic = %.loc12_22.3 (constants.%.3)] // CHECK:STDOUT: @@ -100,14 +107,16 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(@I.%T.loc11_13.1: type, @I.%Self.1: @I.%I.type (%I.type.2), %U.loc12_8.1: type) { -// CHECK:STDOUT: %U.loc12_8.2: type = bind_symbolic_name U, 2 [symbolic = %U.loc12_8.2 (constants.%U)] +// CHECK:STDOUT: generic fn @F(@I.%T.loc11_13.1: type, @I.%Self.1: @I.%I.type (%I.type.2), %U.loc12_8.2: type) { +// CHECK:STDOUT: %U.loc12_8.1: type = bind_symbolic_name U, 2 [symbolic = %U.loc12_8.1 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc12_8.1: type = symbolic_binding_pattern U, 2 [symbolic = %U.patt.loc12_8.1 (constants.%U.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.loc12_8.1: type) -> @F.%U.loc12_8.2 (%U); +// CHECK:STDOUT: fn(%U.param_patt: type) -> @F.%U.loc12_8.1 (%U); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%T.loc15_6.1: type) { // CHECK:STDOUT: %T.loc15_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc15_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type.loc19_4.2: type = interface_type @I, @I(%T.loc15_6.2) [symbolic = %I.type.loc19_4.2 (constants.%I.type.2)] @@ -115,7 +124,7 @@ fn H() { // CHECK:STDOUT: %.loc19_7.2: type = assoc_entity_type @G.%I.type.loc19_4.2 (%I.type.2), @G.%F.type (%F.type.1) [symbolic = %.loc19_7.2 (constants.%.2)] // CHECK:STDOUT: %.loc19_7.3: @G.%.loc19_7.2 (%.2) = assoc_entity element0, @I.%F.decl [symbolic = %.loc19_7.3 (constants.%.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc15_6.1: type) { +// CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %I.ref: %I.type.1 = name_ref I, file.%I.decl [template = constants.%I] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc15_6.1 [symbolic = %T.loc15_6.2 (constants.%T)] @@ -138,6 +147,7 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type => constants.%I.type.2 @@ -149,23 +159,28 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%Self, constants.%U) { -// CHECK:STDOUT: %U.loc12_8.2 => constants.%U +// CHECK:STDOUT: %U.loc12_8.1 => constants.%U +// CHECK:STDOUT: %U.patt.loc12_8.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@I.%T.loc11_13.2) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T.loc15_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc15_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@G.%T.loc15_6.2) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%.4) { // CHECK:STDOUT: %T.loc15_6.2 => constants.%.4 +// CHECK:STDOUT: %T.patt.loc15_6.2 => constants.%.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type.loc19_4.2 => constants.%I.type.3 @@ -176,5 +191,6 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%.4) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%.4 +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/export_name.carbon b/toolchain/check/testdata/interface/no_prelude/export_name.carbon index f8a652453621..c019e8112fb1 100644 --- a/toolchain/check/testdata/interface/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/interface/no_prelude/export_name.carbon @@ -109,10 +109,11 @@ fn UseEmpty(i: I) {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %UseEmpty.decl: %UseEmpty.type = fn_decl @UseEmpty [template = constants.%UseEmpty] { // CHECK:STDOUT: %i.patt: %I.type = binding_pattern i +// CHECK:STDOUT: %i.param_patt: %I.type = param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.1 [template = constants.%I.type] -// CHECK:STDOUT: %i.param: %I.type = param i, runtime_param0 -// CHECK:STDOUT: %i: %I.type = bind_name i, %i.param +// CHECK:STDOUT: %param: %I.type = param runtime_param0 +// CHECK:STDOUT: %i: %I.type = bind_name i, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -122,7 +123,7 @@ fn UseEmpty(i: I) {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseEmpty(%i: %I.type) { +// CHECK:STDOUT: fn @UseEmpty(%i.param_patt: %I.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon index 6561fc3dfcc1..7be7c18e170f 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon @@ -21,7 +21,9 @@ interface I { // CHECK:STDOUT: %I.type: type = interface_type @I [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %T: type = bind_symbolic_name T [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file {} diff --git a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon index f6c7189e025e..c875b3d01b54 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon @@ -151,12 +151,13 @@ interface Class { } // CHECK:STDOUT: %Self: %.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.2] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: @F.%Self (%Self.2) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.%Self (%Self.2) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: %.type = name_ref Self, @.1.%Self [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.loc14_14.1: type = facet_type_access %Self.ref [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.loc14_14.2: type = converted %Self.ref, %.loc14_14.1 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %self.param: @F.%Self (%Self.2) = param self, runtime_param0 -// CHECK:STDOUT: %self: @F.%Self (%Self.2) = bind_name self, %self.param +// CHECK:STDOUT: %param: @F.%Self (%Self.2) = param runtime_param0 +// CHECK:STDOUT: %self: @F.%Self (%Self.2) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: @@ -169,7 +170,7 @@ interface Class { } // CHECK:STDOUT: generic fn @F(@.1.%Self: %.type) { // CHECK:STDOUT: %Self: %.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @F.%Self (%Self.2)](); +// CHECK:STDOUT: fn[%self.param_patt: @F.%Self (%Self.2)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self.2) { diff --git a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon index 200b4a5c8e21..978a7dcbf9dd 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon @@ -31,10 +31,10 @@ interface Generic {} interface DifferentParams(T:! type); // CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+6]]:27: error: redeclaration differs at parameter 1 // CHECK:STDERR: interface DifferentParams(T:! ()) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:27: note: previous declaration's corresponding parameter here // CHECK:STDERR: interface DifferentParams(T:! type); -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~~ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: --- fail_generic_redeclaration.carbon @@ -42,18 +42,22 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %NotGeneric.type: type = interface_type @NotGeneric [template] // CHECK:STDOUT: %T.1: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type.1: type = generic_interface_type @.1 [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: %.type.1 = struct_value () [template] // CHECK:STDOUT: %.type.2: type = interface_type @.1, @.1(%T.1) [symbolic] // CHECK:STDOUT: %Self.1: %.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Generic.type: type = generic_interface_type @Generic [template] // CHECK:STDOUT: %Generic: %Generic.type = struct_value () [template] // CHECK:STDOUT: %.type.3: type = interface_type @.2 [template] // CHECK:STDOUT: %Self.2: %.type.3 = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %T.patt.3: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %DifferentParams.type: type = generic_interface_type @DifferentParams [template] // CHECK:STDOUT: %DifferentParams: %DifferentParams.type = struct_value () [template] // CHECK:STDOUT: %T.2: %.1 = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.4: %.1 = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type.4: type = generic_interface_type @.3 [template] // CHECK:STDOUT: %.3: %.type.4 = struct_value () [template] // CHECK:STDOUT: %.type.5: type = interface_type @.3, @.3(%T.2) [symbolic] @@ -68,31 +72,35 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: } // CHECK:STDOUT: %NotGeneric.decl: type = interface_decl @NotGeneric [template = constants.%NotGeneric.type] {} {} // CHECK:STDOUT: %.decl.loc19: %.type.1 = interface_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc19_22.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_22.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc19_22.1, runtime_param [symbolic = %T.patt.loc19_22.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc19_22.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc19_22.2 (constants.%T.1)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc19_22.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc19_22.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %Generic.decl: %Generic.type = interface_decl @Generic [template = constants.%Generic] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc21_19.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_19.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc21_19.1, runtime_param [symbolic = %T.patt.loc21_19.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc21_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc21_19.2 (constants.%T.1)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc21_19.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc21_19.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl.loc29: type = interface_decl @.2 [template = constants.%.type.3] {} {} // CHECK:STDOUT: %DifferentParams.decl: %DifferentParams.type = interface_decl @DifferentParams [template = constants.%DifferentParams] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc31_27.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc31_27.2 (constants.%T.patt.3)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc31_27.1, runtime_param [symbolic = %T.patt.loc31_27.2 (constants.%T.patt.3)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc31_27.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc31_27.2 (constants.%T.1)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc31_27.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc31_27.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl.loc38: %.type.4 = interface_decl @.3 [template = constants.%.3] { -// CHECK:STDOUT: %T.patt: %.1 = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc38_27.1: %.1 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc38_27.2 (constants.%T.patt.4)] +// CHECK:STDOUT: %T.param_patt: %.1 = param_pattern %T.patt.loc38_27.1, runtime_param [symbolic = %T.patt.loc38_27.2 (constants.%T.patt.4)] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc38_32.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc38_32.2: type = converted %.loc38_32.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %T.param: %.1 = param T, runtime_param -// CHECK:STDOUT: %T.loc38_27.1: %.1 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc38_27.2 (constants.%T.2)] +// CHECK:STDOUT: %param: %.1 = param runtime_param +// CHECK:STDOUT: %T.loc38_27.1: %.1 = bind_symbolic_name T, 0, %param [symbolic = %T.loc38_27.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -100,6 +108,7 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: // CHECK:STDOUT: generic interface @.1(%T.loc19_22.1: type) { // CHECK:STDOUT: %T.loc19_22.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc19_22.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc19_22.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_22.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.type: type = interface_type @.1, @.1(%T.loc19_22.2) [symbolic = %.type (constants.%.type.2)] @@ -116,6 +125,7 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Generic(%T.loc21_19.1: type) { // CHECK:STDOUT: %T.loc21_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_19.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc21_19.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_19.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } @@ -130,12 +140,14 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: // CHECK:STDOUT: generic interface @DifferentParams(%T.loc31_27.1: type) { // CHECK:STDOUT: %T.loc31_27.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc31_27.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc31_27.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc31_27.2 (constants.%T.patt.3)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @.3(%T.loc38_27.1: %.1) { // CHECK:STDOUT: %T.loc38_27.2: %.1 = bind_symbolic_name T, 0 [symbolic = %T.loc38_27.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt.loc38_27.2: %.1 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc38_27.2 (constants.%T.patt.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.type: type = interface_type @.3, @.3(%T.loc38_27.2) [symbolic = %.type (constants.%.type.5)] @@ -152,25 +164,31 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T.1) { // CHECK:STDOUT: %T.loc19_22.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc19_22.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(@.1.%T.loc19_22.2) { // CHECK:STDOUT: %T.loc19_22.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc19_22.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T.1) { // CHECK:STDOUT: %T.loc21_19.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc21_19.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @DifferentParams(constants.%T.1) { // CHECK:STDOUT: %T.loc31_27.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc31_27.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.3(constants.%T.2) { // CHECK:STDOUT: %T.loc38_27.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt.loc38_27.2 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.3(@.3.%T.loc38_27.2) { // CHECK:STDOUT: %T.loc38_27.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt.loc38_27.2 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon index 6e9098b7ab97..d8660bcd1dbb 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon @@ -36,8 +36,10 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: %.2: type = assoc_entity_type %Interface.type, %F.type [template] // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @Interface.%F.decl [template] // CHECK:STDOUT: %T: %Interface.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: %Interface.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %CallStatic.type: type = fn_type @CallStatic [template] // CHECK:STDOUT: %CallStatic: %CallStatic.type = struct_value () [template] +// CHECK:STDOUT: %T.patt.2: %Interface.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %CallFacet.type: type = fn_type @CallFacet [template] // CHECK:STDOUT: %CallFacet: %CallFacet.type = struct_value () [template] // CHECK:STDOUT: } @@ -50,24 +52,27 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: } // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%Interface.type] {} {} // CHECK:STDOUT: %CallStatic.decl: %CallStatic.type = fn_decl @CallStatic [template = constants.%CallStatic] { -// CHECK:STDOUT: %T.patt: %Interface.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc13_15.1: %Interface.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_15.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: %Interface.type = param_pattern %T.patt.loc13_15.1, runtime_param [symbolic = %T.patt.loc13_15.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.param: %Interface.type = param T, runtime_param -// CHECK:STDOUT: %T.loc13_15.1: %Interface.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_15.2 (constants.%T)] +// CHECK:STDOUT: %param: %Interface.type = param runtime_param +// CHECK:STDOUT: %T.loc13_15.1: %Interface.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc13_15.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallFacet.decl: %CallFacet.type = fn_decl @CallFacet [template = constants.%CallFacet] { -// CHECK:STDOUT: %T.patt: %Interface.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc21_14.1: %Interface.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: %Interface.type = param_pattern %T.patt.loc21_14.1, runtime_param [symbolic = %T.patt.loc21_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: %x.patt: @CallFacet.%T.loc21_14.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @CallFacet.%T.loc21_14.2 (%T) = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.param: %Interface.type = param T, runtime_param -// CHECK:STDOUT: %T.loc21_14.1: %Interface.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc21_14.2 (constants.%T)] // CHECK:STDOUT: %T.ref: %Interface.type = name_ref T, %T.loc21_14.1 [symbolic = %T.loc21_14.2 (constants.%T)] // CHECK:STDOUT: %.loc21_32.1: type = facet_type_access %T.ref [symbolic = %T.loc21_14.2 (constants.%T)] // CHECK:STDOUT: %.loc21_32.2: type = converted %T.ref, %.loc21_32.1 [symbolic = %T.loc21_14.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @CallFacet.%T.loc21_14.2 (%T) = param x, runtime_param0 -// CHECK:STDOUT: %x: @CallFacet.%T.loc21_14.2 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %param.loc21_14: %Interface.type = param runtime_param +// CHECK:STDOUT: %T.loc21_14.1: %Interface.type = bind_symbolic_name T, 0, %param.loc21_14 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: %param.loc21_29: @CallFacet.%T.loc21_14.2 (%T) = param runtime_param0 +// CHECK:STDOUT: %x: @CallFacet.%T.loc21_14.2 (%T) = bind_name x, %param.loc21_29 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -89,10 +94,11 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @CallStatic(%T.loc13_15.1: %Interface.type) { // CHECK:STDOUT: %T.loc13_15.2: %Interface.type = bind_symbolic_name T, 0 [symbolic = %T.loc13_15.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc13_15.2: %Interface.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_15.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc13_15.1: %Interface.type) { +// CHECK:STDOUT: fn(%T.param_patt: %Interface.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %T.ref: %Interface.type = name_ref T, %T.loc13_15.1 [symbolic = %T.loc13_15.2 (constants.%T)] // CHECK:STDOUT: %F.ref: %.2 = name_ref F, @Interface.%.loc11 [template = constants.%.3] @@ -102,10 +108,11 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @CallFacet(%T.loc21_14.1: %Interface.type) { // CHECK:STDOUT: %T.loc21_14.2: %Interface.type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc21_14.2: %Interface.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc21_14.1: %Interface.type, %x: @CallFacet.%T.loc21_14.2 (%T)) { +// CHECK:STDOUT: fn(%T.param_patt: %Interface.type, %x.param_patt: @CallFacet.%T.loc21_14.2 (%T)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @CallFacet.%T.loc21_14.2 (%T) = name_ref x, %x // CHECK:STDOUT: return @@ -116,9 +123,11 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: // CHECK:STDOUT: specific @CallStatic(constants.%T) { // CHECK:STDOUT: %T.loc13_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc13_15.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallFacet(constants.%T) { // CHECK:STDOUT: %T.loc21_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc21_14.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon index 4264016a6ff7..f0faf87e48ec 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon @@ -25,6 +25,7 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %I.type.1: type = generic_interface_type @I [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %I: %I.type.1 = struct_value () [template] @@ -34,6 +35,7 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = assoc_entity_type %I.type.2, %F.type [symbolic] // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @I.%F.decl [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1, @I(%T) [symbolic] // CHECK:STDOUT: %.4: %.type = struct_value () [symbolic] // CHECK:STDOUT: } @@ -43,32 +45,35 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } // CHECK:STDOUT: %I.decl: %I.type.1 = interface_decl @I [template = constants.%I] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc11_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_13.1, runtime_param [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [symbolic = constants.%.4] { // CHECK:STDOUT: %self.patt: @.1.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @.1.%Self (%Self) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc22_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc22_6.2 (constants.%T)] +// CHECK:STDOUT: %param.loc22_6: type = param runtime_param +// CHECK:STDOUT: %T.loc22_6.1: type = bind_symbolic_name T, 0, %param.loc22_6 [symbolic = %T.loc22_6.2 (constants.%T)] // CHECK:STDOUT: %.loc22_24.1: @.1.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.ref.loc22_24: @.1.%I.type (%I.type.2) = name_ref Self, %.loc22_24.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc22_24.2: type = facet_type_access %Self.ref.loc22_24 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc22_24.3: type = converted %Self.ref.loc22_24, %.loc22_24.2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @.1.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self: @.1.%Self (%Self) = bind_name self, %self.param // CHECK:STDOUT: %.loc22_35.1: @.1.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.ref.loc22_35: @.1.%I.type (%I.type.2) = name_ref Self, %.loc22_35.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc22_35.2: type = facet_type_access %Self.ref.loc22_35 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc22_35.3: type = converted %Self.ref.loc22_35, %.loc22_35.2 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %return: ref @.1.%Self (%Self) = var +// CHECK:STDOUT: %param.loc22_18: @.1.%Self (%Self) = param runtime_param0 +// CHECK:STDOUT: %self: @.1.%Self (%Self) = bind_name self, %param.loc22_18 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(%T.loc11_13.1: type) { // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type: type = interface_type @I, @I(%T.loc11_13.2) [symbolic = %I.type (constants.%I.type.2)] @@ -82,18 +87,19 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: %F.decl: @I.%F.type (%F.type) = fn_decl @F [symbolic = @I.%F (constants.%F)] { // CHECK:STDOUT: %self.patt: @F.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.%Self (%Self) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc13_14.1: @F.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.ref.loc13_14: @F.%I.type (%I.type.2) = name_ref Self, %.loc13_14.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc13_14.2: type = facet_type_access %Self.ref.loc13_14 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc13_14.3: type = converted %Self.ref.loc13_14, %.loc13_14.2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @F.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self: @F.%Self (%Self) = bind_name self, %self.param // CHECK:STDOUT: %.loc13_25.1: @F.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.ref.loc13_25: @F.%I.type (%I.type.2) = name_ref Self, %.loc13_25.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc13_25.2: type = facet_type_access %Self.ref.loc13_25 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc13_25.3: type = converted %Self.ref.loc13_25, %.loc13_25.2 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %return: ref @F.%Self (%Self) = var +// CHECK:STDOUT: %param: @F.%Self (%Self) = param runtime_param0 +// CHECK:STDOUT: %self: @F.%Self (%Self) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc13_29.1: @I.%.loc13_29.2 (%.2) = assoc_entity element0, %F.decl [symbolic = %.loc13_29.3 (constants.%.3)] // CHECK:STDOUT: @@ -109,17 +115,18 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %I.type: type = interface_type @I, @I(%T) [symbolic = %I.type (constants.%I.type.2)] // CHECK:STDOUT: %Self: %I.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @F.%Self (%Self)]() -> @F.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @F.%Self (%Self)]() -> @F.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(%T.loc22_6.1: type, @I.%Self.1: @I.%I.type (%I.type.2)) { // CHECK:STDOUT: %T.loc22_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc22_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.2)] // CHECK:STDOUT: %I.type: type = interface_type @I, @I(%T.loc22_6.2) [symbolic = %I.type (constants.%I.type.2)] // CHECK:STDOUT: %Self: %I.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @.1.%Self (%Self)]() -> @.1.%Self (%Self) { +// CHECK:STDOUT: fn[%self.param_patt: @.1.%Self (%Self)]() -> @.1.%Self (%Self) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @.1.%Self (%Self) = name_ref self, %self // CHECK:STDOUT: return %self.ref @@ -128,6 +135,7 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type => constants.%I.type.2 @@ -140,6 +148,7 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@F.%T) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%Self) { @@ -150,14 +159,17 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@I.%T.loc11_13.2) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(@.1.%T.loc22_6.2) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%Self) { // CHECK:STDOUT: %T.loc22_6.2 => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %I.type => constants.%I.type.2 // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index c24967ec32cc..56798e572d8b 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -49,12 +49,9 @@ class B {} fn F(T:! Generic(A)); fn G(T:! Generic(B)) { // TODO: Include generic arguments in the type name. - // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE+6]]:3: error: package `Core` implicitly referenced here, but not found + // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE+3]]:3: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE-6]]:6: note: initializing generic parameter `T` declared here - // CHECK:STDERR: fn F(T:! Generic(A)); - // CHECK:STDERR: ^ F(T); } @@ -62,6 +59,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Simple.type.1: type = generic_interface_type @Simple [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Simple: %Simple.type.1 = struct_value () [template] @@ -70,6 +68,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %X: type = class_type @X [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %WithAssocFn.type.1: type = generic_interface_type @WithAssocFn [template] // CHECK:STDOUT: %WithAssocFn: %WithAssocFn.type.1 = struct_value () [template] // CHECK:STDOUT: %WithAssocFn.type.2: type = interface_type @WithAssocFn, @WithAssocFn(%T.1) [symbolic] @@ -91,12 +90,16 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %.9: = interface_witness (%F.2) [template] // CHECK:STDOUT: %.10: type = ptr_type %.2 [template] // CHECK:STDOUT: %struct: %X = struct_value () [template] +// CHECK:STDOUT: %T.patt.3: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %N: %T.1 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: %T.1 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %WithImplicitArgs.type: type = generic_interface_type @WithImplicitArgs [template] // CHECK:STDOUT: %WithImplicitArgs: %WithImplicitArgs.type = struct_value () [template] // CHECK:STDOUT: %T.2: %Simple.type.3 = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.4: %Simple.type.3 = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Receive.type: type = fn_type @Receive [template] // CHECK:STDOUT: %Receive: %Receive.type = struct_value () [template] +// CHECK:STDOUT: %T.patt.5: %Simple.type.3 = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Pass.type: type = fn_type @Pass [template] // CHECK:STDOUT: %Pass: %Pass.type = struct_value () [template] // CHECK:STDOUT: %.11: = specific_function %Receive, @Receive(%T.2) [symbolic] @@ -113,51 +116,58 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: .Pass = %Pass.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Simple.decl: %Simple.type.1 = interface_decl @Simple [template = constants.%Simple] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_18.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_18.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_18.1, runtime_param [symbolic = %T.patt.loc4_18.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_18.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_18.2 (constants.%T.1)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_18.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_18.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: %WithAssocFn.decl: %WithAssocFn.type.1 = interface_decl @WithAssocFn [template = constants.%WithAssocFn] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_23.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_23.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_23.1, runtime_param [symbolic = %T.patt.loc8_23.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_23.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_23.2 (constants.%T.1)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc8_23.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_23.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %WithImplicitArgs.decl: %WithImplicitArgs.type = interface_decl @WithImplicitArgs [template = constants.%WithImplicitArgs] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 -// CHECK:STDOUT: %N.patt: @WithImplicitArgs.%T.loc22_28.2 (%T.1) = symbolic_binding_pattern N, 1 +// CHECK:STDOUT: %T.patt.loc22_28.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc22_28.2 (constants.%T.patt.3)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc22_28.1, runtime_param [symbolic = %T.patt.loc22_28.2 (constants.%T.patt.3)] +// CHECK:STDOUT: %N.patt.loc22_38.1: @WithImplicitArgs.%T.loc22_28.2 (%T.1) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc22_38.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: @WithImplicitArgs.%T.loc22_28.2 (%T.1) = param_pattern %N.patt.loc22_38.1, runtime_param [symbolic = %N.patt.loc22_38.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc22_28.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc22_28.2 (constants.%T.1)] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc22_28.1 [symbolic = %T.loc22_28.2 (constants.%T.1)] -// CHECK:STDOUT: %N.param: @WithImplicitArgs.%T.loc22_28.2 (%T.1) = param N, runtime_param -// CHECK:STDOUT: %N.loc22_38.1: @WithImplicitArgs.%T.loc22_28.2 (%T.1) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc22_38.2 (constants.%N)] +// CHECK:STDOUT: %param.loc22_28: type = param runtime_param +// CHECK:STDOUT: %T.loc22_28.1: type = bind_symbolic_name T, 0, %param.loc22_28 [symbolic = %T.loc22_28.2 (constants.%T.1)] +// CHECK:STDOUT: %param.loc22_38: @WithImplicitArgs.%T.loc22_28.2 (%T.1) = param runtime_param +// CHECK:STDOUT: %N.loc22_38.1: @WithImplicitArgs.%T.loc22_28.2 (%T.1) = bind_symbolic_name N, 1, %param.loc22_38 [symbolic = %N.loc22_38.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %Receive.decl: %Receive.type = fn_decl @Receive [template = constants.%Receive] { -// CHECK:STDOUT: %T.patt: %Simple.type.3 = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc24_12.1: %Simple.type.3 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc24_12.2 (constants.%T.patt.4)] +// CHECK:STDOUT: %T.param_patt: %Simple.type.3 = param_pattern %T.patt.loc24_12.1, runtime_param [symbolic = %T.patt.loc24_12.2 (constants.%T.patt.4)] // CHECK:STDOUT: } { // CHECK:STDOUT: %Simple.ref: %Simple.type.1 = name_ref Simple, file.%Simple.decl [template = constants.%Simple] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Simple.type: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%Simple.type.3] -// CHECK:STDOUT: %T.param: %Simple.type.3 = param T, runtime_param -// CHECK:STDOUT: %T.loc24_12.1: %Simple.type.3 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc24_12.2 (constants.%T.2)] +// CHECK:STDOUT: %param: %Simple.type.3 = param runtime_param +// CHECK:STDOUT: %T.loc24_12.1: %Simple.type.3 = bind_symbolic_name T, 0, %param [symbolic = %T.loc24_12.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %Pass.decl: %Pass.type = fn_decl @Pass [template = constants.%Pass] { -// CHECK:STDOUT: %T.patt: %Simple.type.3 = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc25_9.1: %Simple.type.3 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_9.2 (constants.%T.patt.5)] +// CHECK:STDOUT: %T.param_patt: %Simple.type.3 = param_pattern %T.patt.loc25_9.1, runtime_param [symbolic = %T.patt.loc25_9.2 (constants.%T.patt.5)] // CHECK:STDOUT: } { // CHECK:STDOUT: %Simple.ref: %Simple.type.1 = name_ref Simple, file.%Simple.decl [template = constants.%Simple] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Simple.type: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%Simple.type.3] -// CHECK:STDOUT: %T.param: %Simple.type.3 = param T, runtime_param -// CHECK:STDOUT: %T.loc25_9.1: %Simple.type.3 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc25_9.2 (constants.%T.2)] +// CHECK:STDOUT: %param: %Simple.type.3 = param runtime_param +// CHECK:STDOUT: %T.loc25_9.1: %Simple.type.3 = bind_symbolic_name T, 0, %param [symbolic = %T.loc25_9.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Simple(%T.loc4_18.1: type) { // CHECK:STDOUT: %T.loc4_18.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_18.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc4_18.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_18.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Simple.type: type = interface_type @Simple, @Simple(%T.loc4_18.2) [symbolic = %Simple.type (constants.%Simple.type.2)] @@ -174,6 +184,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @WithAssocFn(%T.loc8_23.1: type) { // CHECK:STDOUT: %T.loc8_23.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_23.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc8_23.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_23.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %WithAssocFn.type: type = interface_type @WithAssocFn, @WithAssocFn(%T.loc8_23.2) [symbolic = %WithAssocFn.type (constants.%WithAssocFn.type.2)] @@ -200,7 +211,9 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @WithImplicitArgs(%T.loc22_28.1: type, %N.loc22_38.1: @WithImplicitArgs.%T.loc22_28.2 (%T.1)) { // CHECK:STDOUT: %T.loc22_28.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc22_28.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc22_28.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc22_28.2 (constants.%T.patt.3)] // CHECK:STDOUT: %N.loc22_38.2: %T.1 = bind_symbolic_name N, 1 [symbolic = %N.loc22_38.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc22_38.2: %T.1 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc22_38.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } @@ -265,10 +278,11 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Receive(%T.loc24_12.1: %Simple.type.3) { // CHECK:STDOUT: %T.loc24_12.2: %Simple.type.3 = bind_symbolic_name T, 0 [symbolic = %T.loc24_12.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt.loc24_12.2: %Simple.type.3 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc24_12.2 (constants.%T.patt.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc24_12.1: %Simple.type.3) { +// CHECK:STDOUT: fn(%T.param_patt: %Simple.type.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -276,11 +290,12 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Pass(%T.loc25_9.1: %Simple.type.3) { // CHECK:STDOUT: %T.loc25_9.2: %Simple.type.3 = bind_symbolic_name T, 0 [symbolic = %T.loc25_9.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt.loc25_9.2: %Simple.type.3 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_9.2 (constants.%T.patt.5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc26_3.2: = specific_function constants.%Receive, @Receive(%T.loc25_9.2) [symbolic = %.loc26_3.2 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc25_9.1: %Simple.type.3) { +// CHECK:STDOUT: fn(%T.param_patt: %Simple.type.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Receive.ref: %Receive.type = name_ref Receive, file.%Receive.decl [template = constants.%Receive] // CHECK:STDOUT: %T.ref: %Simple.type.3 = name_ref T, %T.loc25_9.1 [symbolic = %T.loc25_9.2 (constants.%T.2)] @@ -292,24 +307,29 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Simple(constants.%T.1) { // CHECK:STDOUT: %T.loc4_18.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc4_18.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Simple(@Simple.%T.loc4_18.2) { // CHECK:STDOUT: %T.loc4_18.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc4_18.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WithAssocFn(constants.%T.1) { // CHECK:STDOUT: %T.loc8_23.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc8_23.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T.1, constants.%Self.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @WithAssocFn(@WithAssocFn.%T.loc8_23.2) { // CHECK:STDOUT: %T.loc8_23.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc8_23.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Simple(constants.%C) { // CHECK:STDOUT: %T.loc4_18.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc4_18.2 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Simple.type => constants.%Simple.type.3 @@ -318,6 +338,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @WithAssocFn(constants.%C) { // CHECK:STDOUT: %T.loc8_23.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc8_23.2 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %WithAssocFn.type => constants.%WithAssocFn.type.3 @@ -332,27 +353,33 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @WithImplicitArgs(constants.%T.1, constants.%N) { // CHECK:STDOUT: %T.loc22_28.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc22_28.2 => constants.%T.1 // CHECK:STDOUT: %N.loc22_38.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc22_38.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Receive(constants.%T.2) { // CHECK:STDOUT: %T.loc24_12.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt.loc24_12.2 => constants.%T.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Pass(constants.%T.2) { // CHECK:STDOUT: %T.loc25_9.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt.loc25_9.2 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Receive(@Pass.%T.loc25_9.2) { // CHECK:STDOUT: %T.loc24_12.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt.loc24_12.2 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_args.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Generic.type.1: type = generic_interface_type @Generic [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Generic: %Generic.type.1 = struct_value () [template] @@ -364,10 +391,12 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %Generic.type.3: type = interface_type @Generic, @Generic(%A) [template] // CHECK:STDOUT: %T.2: %Generic.type.3 = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.2: %Generic.type.3 = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %Generic.type.4: type = interface_type @Generic, @Generic(%B) [template] // CHECK:STDOUT: %T.3: %Generic.type.4 = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.3: %Generic.type.4 = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } @@ -381,35 +410,39 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Generic.decl: %Generic.type.1 = interface_decl @Generic [template = constants.%Generic] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_19.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_19.1, runtime_param [symbolic = %T.patt.loc4_19.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_19.2 (constants.%T.1)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_19.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: %Generic.type.3 = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc9_6.1: %Generic.type.3 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_6.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: %Generic.type.3 = param_pattern %T.patt.loc9_6.1, runtime_param [symbolic = %T.patt.loc9_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %Generic.ref: %Generic.type.1 = name_ref Generic, file.%Generic.decl [template = constants.%Generic] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %Generic.type: type = interface_type @Generic, @Generic(constants.%A) [template = constants.%Generic.type.3] -// CHECK:STDOUT: %T.param: %Generic.type.3 = param T, runtime_param -// CHECK:STDOUT: %T.loc9_6.1: %Generic.type.3 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc9_6.2 (constants.%T.2)] +// CHECK:STDOUT: %param: %Generic.type.3 = param runtime_param +// CHECK:STDOUT: %T.loc9_6.1: %Generic.type.3 = bind_symbolic_name T, 0, %param [symbolic = %T.loc9_6.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %T.patt: %Generic.type.4 = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc10_6.1: %Generic.type.4 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt.3)] +// CHECK:STDOUT: %T.param_patt: %Generic.type.4 = param_pattern %T.patt.loc10_6.1, runtime_param [symbolic = %T.patt.loc10_6.2 (constants.%T.patt.3)] // CHECK:STDOUT: } { // CHECK:STDOUT: %Generic.ref: %Generic.type.1 = name_ref Generic, file.%Generic.decl [template = constants.%Generic] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %Generic.type: type = interface_type @Generic, @Generic(constants.%B) [template = constants.%Generic.type.4] -// CHECK:STDOUT: %T.param: %Generic.type.4 = param T, runtime_param -// CHECK:STDOUT: %T.loc10_6.1: %Generic.type.4 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_6.2 (constants.%T.3)] +// CHECK:STDOUT: %param: %Generic.type.4 = param runtime_param +// CHECK:STDOUT: %T.loc10_6.1: %Generic.type.4 = bind_symbolic_name T, 0, %param [symbolic = %T.loc10_6.2 (constants.%T.3)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Generic(%T.loc4_19.1: type) { // CHECK:STDOUT: %T.loc4_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_19.2 (constants.%T.1)] +// CHECK:STDOUT: %T.patt.loc4_19.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Generic.type: type = interface_type @Generic, @Generic(%T.loc4_19.2) [symbolic = %Generic.type (constants.%Generic.type.2)] @@ -440,45 +473,53 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc9_6.1: %Generic.type.3) { // CHECK:STDOUT: %T.loc9_6.2: %Generic.type.3 = bind_symbolic_name T, 0 [symbolic = %T.loc9_6.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt.loc9_6.2: %Generic.type.3 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc9_6.1: %Generic.type.3); +// CHECK:STDOUT: fn(%T.param_patt: %Generic.type.3); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%T.loc10_6.1: %Generic.type.4) { // CHECK:STDOUT: %T.loc10_6.2: %Generic.type.4 = bind_symbolic_name T, 0 [symbolic = %T.loc10_6.2 (constants.%T.3)] +// CHECK:STDOUT: %T.patt.loc10_6.2: %Generic.type.4 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc10_6.1: %Generic.type.4) { +// CHECK:STDOUT: fn(%T.param_patt: %Generic.type.4) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %T.ref: %Generic.type.4 = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T.3)] -// CHECK:STDOUT: %.loc18: %Generic.type.3 = converted %T.ref, [template = ] +// CHECK:STDOUT: %.loc15: %Generic.type.3 = converted %T.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T.1) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(@Generic.%T.loc4_19.2) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%T.1 +// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%A) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%A +// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%A // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.2) { // CHECK:STDOUT: %T.loc9_6.2 => constants.%T.2 +// CHECK:STDOUT: %T.patt.loc9_6.2 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%B) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%B +// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T.3) { // CHECK:STDOUT: %T.loc10_6.2 => constants.%T.3 +// CHECK:STDOUT: %T.patt.loc10_6.2 => constants.%T.3 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/generic_binding_after_assoc_const.carbon b/toolchain/check/testdata/interface/no_prelude/generic_binding_after_assoc_const.carbon index 077dd6de871f..a57f57aa6d67 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_binding_after_assoc_const.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_binding_after_assoc_const.carbon @@ -22,6 +22,7 @@ interface I { // CHECK:STDOUT: %I.type: type = interface_type @I [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 1 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -29,6 +30,7 @@ interface I { // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %.4: type = assoc_entity_type %I.type, type [template] // CHECK:STDOUT: %.5: %.4 = assoc_entity element1, @I.%U [template] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.6: type = assoc_entity_type %I.type, %G.type [template] @@ -45,19 +47,21 @@ interface I { // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 1 +// CHECK:STDOUT: %T.patt.loc12_8.2: type = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc12_8.1 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc12_8.2, runtime_param [symbolic = %T.patt.loc12_8.1 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc12_8.1: type = bind_symbolic_name T, 1, %T.param [symbolic = %T.loc12_8.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc12_8.2: type = bind_symbolic_name T, 1, %param [symbolic = %T.loc12_8.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc12: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: %U: type = assoc_const_decl U [template] // CHECK:STDOUT: %.loc13: %.4 = assoc_entity element1, %U [template = constants.%.5] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 1 +// CHECK:STDOUT: %T.patt.loc16_8.2: type = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc16_8.1 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc16_8.2, runtime_param [symbolic = %T.patt.loc16_8.1 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc16_8.1: type = bind_symbolic_name T, 1, %T.param [symbolic = %T.loc16_8.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc16_8.2: type = bind_symbolic_name T, 1, %param [symbolic = %T.loc16_8.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16: %.6 = assoc_entity element2, %G.decl [template = constants.%.7] // CHECK:STDOUT: @@ -69,23 +73,27 @@ interface I { // CHECK:STDOUT: witness = (%F.decl, %U, %G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(@I.%Self: %I.type, %T.loc12_8.1: type) { -// CHECK:STDOUT: %T.loc12_8.2: type = bind_symbolic_name T, 1 [symbolic = %T.loc12_8.2 (constants.%T)] +// CHECK:STDOUT: generic fn @F(@I.%Self: %I.type, %T.loc12_8.2: type) { +// CHECK:STDOUT: %T.loc12_8.1: type = bind_symbolic_name T, 1 [symbolic = %T.loc12_8.1 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc12_8.1: type = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc12_8.1 (constants.%T.patt.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc12_8.1: type); +// CHECK:STDOUT: fn(%T.param_patt: type); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(@I.%Self: %I.type, %T.loc16_8.1: type) { -// CHECK:STDOUT: %T.loc16_8.2: type = bind_symbolic_name T, 1 [symbolic = %T.loc16_8.2 (constants.%T)] +// CHECK:STDOUT: generic fn @G(@I.%Self: %I.type, %T.loc16_8.2: type) { +// CHECK:STDOUT: %T.loc16_8.1: type = bind_symbolic_name T, 1 [symbolic = %T.loc16_8.1 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc16_8.1: type = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc16_8.1 (constants.%T.patt.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc16_8.1: type); +// CHECK:STDOUT: fn(%T.param_patt: type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self, constants.%T) { -// CHECK:STDOUT: %T.loc12_8.2 => constants.%T +// CHECK:STDOUT: %T.loc12_8.1 => constants.%T +// CHECK:STDOUT: %T.patt.loc12_8.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%Self, constants.%T) { -// CHECK:STDOUT: %T.loc16_8.2 => constants.%T +// CHECK:STDOUT: %T.loc16_8.1 => constants.%T +// CHECK:STDOUT: %T.patt.loc16_8.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon index 1a6d4b928341..2be2b8c69d90 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon @@ -31,6 +31,7 @@ impl C as AddWith(C) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %AddWith.type.1: type = generic_interface_type @AddWith [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %AddWith: %AddWith.type.1 = struct_value () [template] @@ -47,15 +48,17 @@ impl C as AddWith(C) { // CHECK:STDOUT: .AddWith = %AddWith.decl // CHECK:STDOUT: } // CHECK:STDOUT: %AddWith.decl: %AddWith.type.1 = interface_decl @AddWith [template = constants.%AddWith] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_19.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_19.1, runtime_param [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_19.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_19.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @AddWith(%T.loc4_19.1: type) { // CHECK:STDOUT: %T.loc4_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_19.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_19.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %AddWith.type: type = interface_type @AddWith, @AddWith(%T.loc4_19.2) [symbolic = %AddWith.type (constants.%AddWith.type.2)] @@ -84,12 +87,14 @@ impl C as AddWith(C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith(constants.%T) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%Self) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith(@AddWith.%T.loc4_19.2) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon @@ -104,6 +109,7 @@ impl C as AddWith(C) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %AddWith.type.2: type = interface_type @AddWith, @AddWith(%T) [symbolic] // CHECK:STDOUT: %Self.1: @AddWith.%AddWith.type (%AddWith.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Self.2: %AddWith.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @AddWith(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] @@ -120,11 +126,11 @@ impl C as AddWith(C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %AddWith.type.1 = import_ref Main//a, inst+5, loaded [template = constants.%AddWith] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+11, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+17, unloaded -// CHECK:STDOUT: %import_ref.4: @AddWith.%F.type (%F.type.1) = import_ref Main//a, inst+13, loaded [symbolic = @AddWith.%F (constants.%F.1)] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+13, unloaded +// CHECK:STDOUT: %import_ref.1: %AddWith.type.1 = import_ref Main//a, inst+7, loaded [template = constants.%AddWith] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+14, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+20, unloaded +// CHECK:STDOUT: %import_ref.4: @AddWith.%F.type (%F.type.1) = import_ref Main//a, inst+16, loaded [symbolic = @AddWith.%F (constants.%F.1)] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+16, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -144,6 +150,7 @@ impl C as AddWith(C) { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @AddWith(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %AddWith.type: type = interface_type @AddWith, @AddWith(%T) [symbolic = %AddWith.type (constants.%AddWith.type.2)] @@ -189,16 +196,19 @@ impl C as AddWith(C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith(@AddWith.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self.1) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith(constants.%C) { // CHECK:STDOUT: %T => constants.%C +// CHECK:STDOUT: %T.patt => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %AddWith.type => constants.%AddWith.type.3 diff --git a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon index 7857054e9f23..909b13ab38f6 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon @@ -34,7 +34,7 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:13: error: parameters of generic types must be constant // CHECK:STDERR: interface A[T: type]() {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: interface A[T: type]() {} @@ -44,7 +44,7 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:13: error: parameters of generic types must be constant // CHECK:STDERR: interface A(T: type) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~~~ interface A(T: type) {} // CHECK:STDOUT: --- params.carbon @@ -58,10 +58,12 @@ interface A(T: type) {} // CHECK:STDOUT: %NotGenericButParams.type.2: type = interface_type @NotGenericButParams [template] // CHECK:STDOUT: %Self.2: %NotGenericButParams.type.2 = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %GenericAndParams.type.1: type = generic_interface_type @GenericAndParams.1 [template] // CHECK:STDOUT: %GenericAndParams.1: %GenericAndParams.type.1 = struct_value () [template] // CHECK:STDOUT: %GenericAndParams.type.2: type = interface_type @GenericAndParams.1, @GenericAndParams.1(%T) [symbolic] // CHECK:STDOUT: %Self.3: %GenericAndParams.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%T) [symbolic] @@ -69,6 +71,7 @@ interface A(T: type) {} // CHECK:STDOUT: %GenericNoParams.type.2: type = interface_type @GenericNoParams, @GenericNoParams(%T) [symbolic] // CHECK:STDOUT: %Self.4: %GenericNoParams.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %GenericAndParams.type.3: type = generic_interface_type @GenericAndParams.2, @C(%T) [symbolic] // CHECK:STDOUT: %GenericAndParams.2: %GenericAndParams.type.3 = struct_value () [symbolic] // CHECK:STDOUT: %GenericAndParams.type.4: type = interface_type @GenericAndParams.2, @GenericAndParams.2(%T, %U) [symbolic] @@ -96,16 +99,18 @@ interface A(T: type) {} // CHECK:STDOUT: %NotGenericNoParams.decl: type = interface_decl @NotGenericNoParams [template = constants.%NotGenericNoParams.type] {} {} // CHECK:STDOUT: %NotGenericButParams.decl: %NotGenericButParams.type.1 = interface_decl @NotGenericButParams [template = constants.%NotGenericButParams] {} {} // CHECK:STDOUT: %GenericAndParams.decl: %GenericAndParams.type.1 = interface_decl @GenericAndParams.1 [template = constants.%GenericAndParams.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc6_28.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_28.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc6_28.1, runtime_param [symbolic = %T.patt.loc6_28.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc6_28.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_28.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc6_28.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc6_28.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_9.1, runtime_param [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_9.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { @@ -160,6 +165,7 @@ interface A(T: type) {} // CHECK:STDOUT: // CHECK:STDOUT: generic interface @GenericAndParams.1(%T.loc6_28.1: type) { // CHECK:STDOUT: %T.loc6_28.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_28.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_28.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_28.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GenericAndParams.type: type = interface_type @GenericAndParams.1, @GenericAndParams.1(%T.loc6_28.2) [symbolic = %GenericAndParams.type (constants.%GenericAndParams.type.2)] @@ -191,6 +197,7 @@ interface A(T: type) {} // CHECK:STDOUT: // CHECK:STDOUT: generic interface @GenericAndParams.2(@C.%T.loc8_9.1: type, %U.loc10_30.1: type) { // CHECK:STDOUT: %U.loc10_30.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc10_30.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc10_30.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc10_30.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] @@ -243,6 +250,7 @@ interface A(T: type) {} // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc8_9.1: type) { // CHECK:STDOUT: %T.loc8_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GenericAndParams.type: type = generic_interface_type @GenericAndParams.2, @C(%T.loc8_9.2) [symbolic = %GenericAndParams.type (constants.%GenericAndParams.type.3)] @@ -251,10 +259,11 @@ interface A(T: type) {} // CHECK:STDOUT: class { // CHECK:STDOUT: %GenericNoParams.decl: type = interface_decl @GenericNoParams [template = constants.%GenericNoParams.type.1] {} {} // CHECK:STDOUT: %GenericAndParams.decl: @C.%GenericAndParams.type (%GenericAndParams.type.3) = interface_decl @GenericAndParams.2 [symbolic = @C.%GenericAndParams (constants.%GenericAndParams.2)] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 +// CHECK:STDOUT: %U.patt.loc10_30.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc10_30.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc10_30.1, runtime_param [symbolic = %U.patt.loc10_30.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc10_30.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc10_30.2 (constants.%U)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc10_30.1: type = bind_symbolic_name U, 1, %param [symbolic = %U.loc10_30.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc11: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: @@ -274,14 +283,17 @@ interface A(T: type) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.1(constants.%T) { // CHECK:STDOUT: %T.loc6_28.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_28.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.1(@GenericAndParams.1.%T.loc6_28.2) { // CHECK:STDOUT: %T.loc6_28.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_28.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericNoParams(constants.%T) {} @@ -290,18 +302,22 @@ interface A(T: type) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.2(constants.%T, constants.%U) { // CHECK:STDOUT: %U.loc10_30.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc10_30.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.2(@GenericAndParams.2.%T, @GenericAndParams.2.%U.loc10_30.2) { // CHECK:STDOUT: %U.loc10_30.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc10_30.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(@C.%T.loc8_9.2) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.1(constants.%X) { // CHECK:STDOUT: %T.loc6_28.2 => constants.%X +// CHECK:STDOUT: %T.patt.loc6_28.2 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GenericAndParams.type => constants.%GenericAndParams.type.5 @@ -310,6 +326,7 @@ interface A(T: type) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%X +// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %GenericAndParams.type => constants.%GenericAndParams.type.6 @@ -318,6 +335,7 @@ interface A(T: type) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.2(constants.%X, constants.%X) { // CHECK:STDOUT: %U.loc10_30.2 => constants.%X +// CHECK:STDOUT: %U.patt.loc10_30.2 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T => constants.%X @@ -341,9 +359,10 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type.1 = interface_decl @A [template = constants.%A] { // CHECK:STDOUT: %T.patt: type = binding_pattern T +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt, runtime_param // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T: type = bind_name T, %T.param +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T: type = bind_name T, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -371,9 +390,10 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type.1 = interface_decl @A [template = constants.%A] { // CHECK:STDOUT: %T.patt: type = binding_pattern T +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt, runtime_param // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T: type = bind_name T, %T.param +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T: type = bind_name T, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/import.carbon b/toolchain/check/testdata/interface/no_prelude/import.carbon index 39fcf7ce1c6b..eb28df4fb129 100644 --- a/toolchain/check/testdata/interface/no_prelude/import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import.carbon @@ -213,24 +213,27 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %UseEmpty.decl: %UseEmpty.type = fn_decl @UseEmpty [template = constants.%UseEmpty] { // CHECK:STDOUT: %e.patt: %Empty.type = binding_pattern e +// CHECK:STDOUT: %e.param_patt: %Empty.type = param_pattern %e.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, imports.%import_ref.1 [template = constants.%Empty.type] -// CHECK:STDOUT: %e.param: %Empty.type = param e, runtime_param0 -// CHECK:STDOUT: %e: %Empty.type = bind_name e, %e.param +// CHECK:STDOUT: %param: %Empty.type = param runtime_param0 +// CHECK:STDOUT: %e: %Empty.type = bind_name e, %param // CHECK:STDOUT: } // CHECK:STDOUT: %UseBasic.decl: %UseBasic.type = fn_decl @UseBasic [template = constants.%UseBasic] { // CHECK:STDOUT: %e.patt: %Basic.type = binding_pattern e +// CHECK:STDOUT: %e.param_patt: %Basic.type = param_pattern %e.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Basic.ref: type = name_ref Basic, imports.%import_ref.2 [template = constants.%Basic.type] -// CHECK:STDOUT: %e.param: %Basic.type = param e, runtime_param0 -// CHECK:STDOUT: %e: %Basic.type = bind_name e, %e.param +// CHECK:STDOUT: %param: %Basic.type = param runtime_param0 +// CHECK:STDOUT: %e: %Basic.type = bind_name e, %param // CHECK:STDOUT: } // CHECK:STDOUT: %UseForwardDeclared.decl: %UseForwardDeclared.type = fn_decl @UseForwardDeclared [template = constants.%UseForwardDeclared] { // CHECK:STDOUT: %f.patt: %ForwardDeclared.type = binding_pattern f +// CHECK:STDOUT: %f.param_patt: %ForwardDeclared.type = param_pattern %f.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %ForwardDeclared.ref: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.type] -// CHECK:STDOUT: %f.param: %ForwardDeclared.type = param f, runtime_param0 -// CHECK:STDOUT: %f: %ForwardDeclared.type = bind_name f, %f.param +// CHECK:STDOUT: %param: %ForwardDeclared.type = param runtime_param0 +// CHECK:STDOUT: %f: %ForwardDeclared.type = bind_name f, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Basic.ref.loc10: type = name_ref Basic, imports.%import_ref.2 [template = constants.%Basic.type] // CHECK:STDOUT: %T.ref.loc10: %.2 = name_ref T, imports.%import_ref.7 [template = constants.%.3] @@ -272,17 +275,17 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: witness = (imports.%import_ref.14, imports.%import_ref.15) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseEmpty(%e: %Empty.type) { +// CHECK:STDOUT: fn @UseEmpty(%e.param_patt: %Empty.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseBasic(%e: %Basic.type) { +// CHECK:STDOUT: fn @UseBasic(%e.param_patt: %Basic.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseForwardDeclared(%f: %ForwardDeclared.type) { +// CHECK:STDOUT: fn @UseForwardDeclared(%f.param_patt: %ForwardDeclared.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/no_prelude/import_access.carbon index c84b596b1cc1..e0d20d2fee3c 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_access.carbon @@ -215,10 +215,11 @@ private interface Redecl {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %i.patt: %Def.type = binding_pattern i +// CHECK:STDOUT: %i.param_patt: %Def.type = param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Def.ref: type = name_ref Def, imports.%import_ref.1 [template = constants.%Def.type] -// CHECK:STDOUT: %i.param: %Def.type = param i, runtime_param0 -// CHECK:STDOUT: %i: %Def.type = bind_name i, %i.param +// CHECK:STDOUT: %param: %Def.type = param runtime_param0 +// CHECK:STDOUT: %i: %Def.type = bind_name i, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -228,7 +229,7 @@ private interface Redecl {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%i: %Def.type) { +// CHECK:STDOUT: fn @F(%i.param_patt: %Def.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -248,14 +249,15 @@ private interface Redecl {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %i.patt: = binding_pattern i +// CHECK:STDOUT: %i.param_patt: = param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] -// CHECK:STDOUT: %i.param: = param i, runtime_param0 -// CHECK:STDOUT: %i: = bind_name i, %i.param +// CHECK:STDOUT: %param: = param runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%i: ) { +// CHECK:STDOUT: fn @F(%i.param_patt: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -282,15 +284,16 @@ private interface Redecl {} // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %i.patt: = binding_pattern i +// CHECK:STDOUT: %i.param_patt: = param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] -// CHECK:STDOUT: %i.param: = param i, runtime_param0 -// CHECK:STDOUT: %i: = bind_name i, %i.param +// CHECK:STDOUT: %param: = param runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%i: ) { +// CHECK:STDOUT: fn @F(%i.param_patt: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -319,10 +322,11 @@ private interface Redecl {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %i.patt: %ForwardWithDef.type = binding_pattern i +// CHECK:STDOUT: %i.param_patt: %ForwardWithDef.type = param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %ForwardWithDef.ref: type = name_ref ForwardWithDef, imports.%import_ref.1 [template = constants.%ForwardWithDef.type] -// CHECK:STDOUT: %i.param: %ForwardWithDef.type = param i, runtime_param0 -// CHECK:STDOUT: %i: %ForwardWithDef.type = bind_name i, %i.param +// CHECK:STDOUT: %param: %ForwardWithDef.type = param runtime_param0 +// CHECK:STDOUT: %i: %ForwardWithDef.type = bind_name i, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -332,7 +336,7 @@ private interface Redecl {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%i: %ForwardWithDef.type) { +// CHECK:STDOUT: fn @F(%i.param_patt: %ForwardWithDef.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -352,14 +356,15 @@ private interface Redecl {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %i.patt: = binding_pattern i +// CHECK:STDOUT: %i.param_patt: = param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] -// CHECK:STDOUT: %i.param: = param i, runtime_param0 -// CHECK:STDOUT: %i: = bind_name i, %i.param +// CHECK:STDOUT: %param: = param runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%i: ) { +// CHECK:STDOUT: fn @F(%i.param_patt: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -386,15 +391,16 @@ private interface Redecl {} // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %i.patt: = binding_pattern i +// CHECK:STDOUT: %i.param_patt: = param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] -// CHECK:STDOUT: %i.param: = param i, runtime_param0 -// CHECK:STDOUT: %i: = bind_name i, %i.param +// CHECK:STDOUT: %param: = param runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%i: ) { +// CHECK:STDOUT: fn @F(%i.param_patt: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -418,11 +424,12 @@ private interface Redecl {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %i.patt: = binding_pattern i +// CHECK:STDOUT: %i.param_patt: = param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %.loc8: type = ptr_type [template = ] -// CHECK:STDOUT: %i.param: = param i, runtime_param0 -// CHECK:STDOUT: %i: = bind_name i, %i.param +// CHECK:STDOUT: %param: = param runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Forward.decl: type = interface_decl @Forward [template = constants.%Forward.type] {} {} // CHECK:STDOUT: } @@ -435,7 +442,7 @@ private interface Redecl {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%i: ) { +// CHECK:STDOUT: fn @F(%i.param_patt: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -455,15 +462,16 @@ private interface Redecl {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %i.patt: = binding_pattern i +// CHECK:STDOUT: %i.param_patt: = param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %.loc10: type = ptr_type [template = ] -// CHECK:STDOUT: %i.param: = param i, runtime_param0 -// CHECK:STDOUT: %i: = bind_name i, %i.param +// CHECK:STDOUT: %param: = param runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%i: ) { +// CHECK:STDOUT: fn @F(%i.param_patt: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -490,15 +498,16 @@ private interface Redecl {} // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %i.patt: = binding_pattern i +// CHECK:STDOUT: %i.param_patt: = param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %.loc9: type = ptr_type [template = ] -// CHECK:STDOUT: %i.param: = param i, runtime_param0 -// CHECK:STDOUT: %i: = bind_name i, %i.param +// CHECK:STDOUT: %param: = param runtime_param0 +// CHECK:STDOUT: %i: = bind_name i, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%i: ) { +// CHECK:STDOUT: fn @F(%i.param_patt: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/self.carbon b/toolchain/check/testdata/interface/no_prelude/self.carbon index 10051ce64828..590b411a5021 100644 --- a/toolchain/check/testdata/interface/no_prelude/self.carbon +++ b/toolchain/check/testdata/interface/no_prelude/self.carbon @@ -35,16 +35,17 @@ interface UseSelf { // CHECK:STDOUT: %Self: %UseSelf.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: @F.%Self (%Self) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.%Self (%Self) = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12_14: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @F.%Self (%Self) = param self, runtime_param0 -// CHECK:STDOUT: %self: @F.%Self (%Self) = bind_name self, %self.param // CHECK:STDOUT: %Self.ref.loc12_25: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_25.1: type = facet_type_access %Self.ref.loc12_25 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc12_25.2: type = converted %Self.ref.loc12_25, %.loc12_25.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %return: ref @F.%Self (%Self) = var +// CHECK:STDOUT: %param: @F.%Self (%Self) = param runtime_param0 +// CHECK:STDOUT: %self: @F.%Self (%Self) = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc12: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: @@ -57,7 +58,7 @@ interface UseSelf { // CHECK:STDOUT: generic fn @F(@UseSelf.%Self: %UseSelf.type) { // CHECK:STDOUT: %Self: %UseSelf.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @F.%Self (%Self)]() -> @F.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @F.%Self (%Self)]() -> @F.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self) { diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index 4f0f3334154d..c668c6dc148e 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -98,10 +98,10 @@ alias D = C; interface Foo(a:! C); // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:15: error: redeclaration differs at parameter 1 // CHECK:STDERR: interface Foo(b:! D) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~ // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:15: note: previous declaration's corresponding parameter here // CHECK:STDERR: interface Foo(a:! C); -// CHECK:STDERR: ^ +// CHECK:STDERR: ^~~~~ // CHECK:STDERR: interface Foo(b:! D) {} @@ -192,13 +192,17 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type.1: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type.1 = struct_value () [template] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type.2: type = interface_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %Self.1: %Foo.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %a.patt.3: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Bar.type.1: type = generic_interface_type @Bar [template] // CHECK:STDOUT: %Bar: %Bar.type.1 = struct_value () [template] +// CHECK:STDOUT: %a.patt.4: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Bar.type.2: type = interface_type @Bar, @Bar(%a) [symbolic] // CHECK:STDOUT: %Self.2: %Bar.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: } @@ -214,37 +218,42 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type.1 = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc7: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = %a.loc7_15.2 (constants.%a)] +// CHECK:STDOUT: %param.loc7: %C = param runtime_param +// CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %param.loc7 [symbolic = %a.loc7_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc8: %Foo.type.1 = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc8: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc8: %C = bind_symbolic_name a, 0, %a.param.loc8 [symbolic = constants.%a] +// CHECK:STDOUT: %param.loc8: %C = param runtime_param +// CHECK:STDOUT: %a.loc8: %C = bind_symbolic_name a, 0, %param.loc8 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc10: %Bar.type.1 = interface_decl @Bar [template = constants.%Bar] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc10_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc10_15.2 (constants.%a.patt.3)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc10_15.1, runtime_param [symbolic = %a.patt.loc10_15.2 (constants.%a.patt.3)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc10: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param.loc10: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc10_15.1: %C = bind_symbolic_name a, 0, %a.param.loc10 [symbolic = %a.loc10_15.2 (constants.%a)] +// CHECK:STDOUT: %param.loc10: %C = param runtime_param +// CHECK:STDOUT: %a.loc10_15.1: %C = bind_symbolic_name a, 0, %param.loc10 [symbolic = %a.loc10_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc11: %Bar.type.1 = interface_decl @Bar [template = constants.%Bar] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc10_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc10_15.2 (constants.%a.patt.3)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc10_15.1, runtime_param [symbolic = %a.patt.loc10_15.2 (constants.%a.patt.3)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param.loc11: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc11: %C = bind_symbolic_name a, 0, %a.param.loc11 [symbolic = constants.%a] +// CHECK:STDOUT: %param.loc11: %C = param runtime_param +// CHECK:STDOUT: %a.loc11: %C = bind_symbolic_name a, 0, %param.loc11 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(%a.loc7_15.1: %C) { // CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc7_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Foo.type: type = interface_type @Foo, @Foo(%a.loc7_15.2) [symbolic = %Foo.type (constants.%Foo.type.2)] @@ -261,6 +270,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Bar(%a.loc10_15.1: %C) { // CHECK:STDOUT: %a.loc10_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc10_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc10_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc10_15.2 (constants.%a.patt.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Bar.type: type = interface_type @Bar, @Bar(%a.loc10_15.2) [symbolic = %Bar.type (constants.%Bar.type.2)] @@ -284,18 +294,22 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc7_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(@Foo.%a.loc7_15.2) { // CHECK:STDOUT: %a.loc7_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { // CHECK:STDOUT: %a.loc10_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc10_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(@Bar.%a.loc10_15.2) { // CHECK:STDOUT: %a.loc10_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc10_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- spacing.carbon @@ -305,9 +319,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type.1: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type.1 = struct_value () [template] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type.2: type = interface_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %Self: %Foo.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: } @@ -319,23 +335,26 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type.1 = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc6_21.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_21.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc6_21.1, runtime_param [symbolic = %a.patt.loc6_21.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc6: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_21.1: %C = bind_symbolic_name a, 0, %a.param.loc6 [symbolic = %a.loc6_21.2 (constants.%a)] +// CHECK:STDOUT: %param.loc6: %C = param runtime_param +// CHECK:STDOUT: %a.loc6_21.1: %C = bind_symbolic_name a, 0, %param.loc6 [symbolic = %a.loc6_21.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type.1 = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc6_21.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_21.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc6_21.1, runtime_param [symbolic = %a.patt.loc6_21.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc7: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = constants.%a] +// CHECK:STDOUT: %param.loc7: %C = param runtime_param +// CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %param.loc7 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(%a.loc6_21.1: %C) { // CHECK:STDOUT: %a.loc6_21.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_21.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc6_21.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_21.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Foo.type: type = interface_type @Foo, @Foo(%a.loc6_21.2) [symbolic = %Foo.type (constants.%Foo.type.2)] @@ -359,10 +378,12 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc6_21.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6_21.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(@Foo.%a.loc6_21.2) { // CHECK:STDOUT: %a.loc6_21.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6_21.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_parens.carbon @@ -372,9 +393,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %.type.1: type = generic_interface_type @.1 [template] // CHECK:STDOUT: %.4: %.type.1 = struct_value () [template] // CHECK:STDOUT: %.type.2: type = interface_type @.1, @.1(%a) [symbolic] @@ -388,29 +411,33 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc6_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc6_15.1, runtime_param [symbolic = %a.patt.loc6_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc6_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc6_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type.1 = interface_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc14_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc14_15.2 (constants.%a.patt.2)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc14_15.1, runtime_param [symbolic = %a.patt.loc14_15.2 (constants.%a.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc14_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc14_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc14_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc14_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(%a.loc6_15.1: %C) { // CHECK:STDOUT: %a.loc6_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc6_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @.1(%a.loc14_15.1: %C) { // CHECK:STDOUT: %a.loc14_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc14_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc14_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc14_15.2 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.type: type = interface_type @.1, @.1(%a.loc14_15.2) [symbolic = %.type (constants.%.type.2)] @@ -434,14 +461,17 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc6_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { // CHECK:STDOUT: %a.loc14_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc14_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(@.1.%a.loc14_15.2) { // CHECK:STDOUT: %a.loc14_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc14_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- todo_fail_raw_identifier.carbon @@ -451,9 +481,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type.1: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type.1 = struct_value () [template] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type.2: type = interface_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %Self: %Foo.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: } @@ -465,23 +497,26 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type.1 = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc6_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc6_15.1, runtime_param [symbolic = %a.patt.loc6_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc6: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_15.1: %C = bind_symbolic_name a, 0, %a.param.loc6 [symbolic = %a.loc6_15.2 (constants.%a)] +// CHECK:STDOUT: %param.loc6: %C = param runtime_param +// CHECK:STDOUT: %a.loc6_15.1: %C = bind_symbolic_name a, 0, %param.loc6 [symbolic = %a.loc6_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type.1 = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc6_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc6_15.1, runtime_param [symbolic = %a.patt.loc6_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param.loc7: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = constants.%a] +// CHECK:STDOUT: %param.loc7: %C = param runtime_param +// CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %param.loc7 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(%a.loc6_15.1: %C) { // CHECK:STDOUT: %a.loc6_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc6_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Foo.type: type = interface_type @Foo, @Foo(%a.loc6_15.2) [symbolic = %Foo.type (constants.%Foo.type.2)] @@ -505,10 +540,12 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc6_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(@Foo.%a.loc6_15.2) { // CHECK:STDOUT: %a.loc6_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- two_file.carbon @@ -518,9 +555,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Bar.type: type = generic_interface_type @Bar [template] // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template] // CHECK:STDOUT: } @@ -536,29 +575,33 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc7_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = interface_decl @Bar [template = constants.%Bar] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc8_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc8_15.2 (constants.%a.patt.2)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc8_15.1, runtime_param [symbolic = %a.patt.loc8_15.2 (constants.%a.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc8_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc8_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc8_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc8_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(%a.loc7_15.1: %C) { // CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc7_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Bar(%a.loc8_15.1: %C) { // CHECK:STDOUT: %a.loc8_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc8_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc8_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc8_15.2 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } @@ -572,10 +615,12 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc7_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { // CHECK:STDOUT: %a.loc8_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc8_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_two_file.impl.carbon @@ -585,13 +630,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %.type.1: type = generic_interface_type @.1 [template] // CHECK:STDOUT: %.4: %.type.1 = struct_value () [template] // CHECK:STDOUT: %.type.2: type = interface_type @.1, @.1(%a) [symbolic] // CHECK:STDOUT: %Self.1: %.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %a.patt.3: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Bar.type: type = generic_interface_type @Bar [template] // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template] // CHECK:STDOUT: %.type.3: type = generic_interface_type @.2 [template] @@ -603,8 +651,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+13, loaded [template = constants.%Foo] -// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+22, loaded [template = constants.%Bar] +// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+15, loaded [template = constants.%Foo] +// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+27, loaded [template = constants.%Bar] // CHECK:STDOUT: %import_ref.5 = import_ref Main//two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -618,29 +666,33 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %.decl.loc12: %.type.1 = interface_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc12_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc12_15.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc12_15.1, runtime_param [symbolic = %a.patt.loc12_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc12_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc12_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc12_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc12_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl.loc21: %.type.3 = interface_decl @.2 [template = constants.%.5] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc21_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc21_15.2 (constants.%a.patt.3)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc21_15.1, runtime_param [symbolic = %a.patt.loc21_15.2 (constants.%a.patt.3)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc21_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc21_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc21_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc21_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(constants.%a: %C) { // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @.1(%a.loc12_15.1: %C) { // CHECK:STDOUT: %a.loc12_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc12_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc12_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc12_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.type: type = interface_type @.1, @.1(%a.loc12_15.2) [symbolic = %.type (constants.%.type.2)] @@ -657,12 +709,14 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Bar(constants.%a: %C) { // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @.2(%a.loc21_15.1: %C) { // CHECK:STDOUT: %a.loc21_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc21_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc21_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc21_15.2 (constants.%a.patt.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.type: type = interface_type @.2, @.2(%a.loc21_15.2) [symbolic = %.type (constants.%.type.4)] @@ -684,26 +738,32 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.patt => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { // CHECK:STDOUT: %a.loc12_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc12_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(@.1.%a.loc12_15.2) { // CHECK:STDOUT: %a.loc12_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc12_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { // CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.patt => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.2(constants.%a) { // CHECK:STDOUT: %a.loc21_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc21_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.2(@.2.%a.loc21_15.2) { // CHECK:STDOUT: %a.loc21_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc21_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_name_mismatch.carbon @@ -713,10 +773,12 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %b: %C = bind_symbolic_name b, 0 [symbolic] +// CHECK:STDOUT: %b.patt: %C = symbolic_binding_pattern b, 0 [symbolic] // CHECK:STDOUT: %.type.1: type = generic_interface_type @.1 [template] // CHECK:STDOUT: %.4: %.type.1 = struct_value () [template] // CHECK:STDOUT: %.type.2: type = interface_type @.1, @.1(%b) [symbolic] @@ -733,29 +795,33 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc7_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type.1 = interface_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %b.patt: %C = symbolic_binding_pattern b, 0 +// CHECK:STDOUT: %b.patt.loc15_15.1: %C = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc15_15.2 (constants.%b.patt)] +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt.loc15_15.1, runtime_param [symbolic = %b.patt.loc15_15.2 (constants.%b.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param -// CHECK:STDOUT: %b.loc15_15.1: %C = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc15_15.2 (constants.%b)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %b.loc15_15.1: %C = bind_symbolic_name b, 0, %param [symbolic = %b.loc15_15.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(%a.loc7_15.1: %C) { // CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc7_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @.1(%b.loc15_15.1: %C) { // CHECK:STDOUT: %b.loc15_15.2: %C = bind_symbolic_name b, 0 [symbolic = %b.loc15_15.2 (constants.%b)] +// CHECK:STDOUT: %b.patt.loc15_15.2: %C = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc15_15.2 (constants.%b.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.type: type = interface_type @.1, @.1(%b.loc15_15.2) [symbolic = %.type (constants.%.type.2)] @@ -779,14 +845,17 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc7_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%b) { // CHECK:STDOUT: %b.loc15_15.2 => constants.%b +// CHECK:STDOUT: %b.patt.loc15_15.2 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(@.1.%b.loc15_15.2) { // CHECK:STDOUT: %b.loc15_15.2 => constants.%b +// CHECK:STDOUT: %b.patt.loc15_15.2 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_alias.carbon @@ -796,9 +865,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %.type.1: type = generic_interface_type @.1 [template] // CHECK:STDOUT: %.4: %.type.1 = struct_value () [template] // CHECK:STDOUT: %.type.2: type = interface_type @.1, @.1(%a) [symbolic] @@ -815,29 +886,33 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc7_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type.1 = interface_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc15_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_15.2 (constants.%a.patt.2)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc15_15.1, runtime_param [symbolic = %a.patt.loc15_15.2 (constants.%a.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc15_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc15_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc15_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc15_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(%a.loc7_15.1: %C) { // CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc7_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @.1(%a.loc15_15.1: %C) { // CHECK:STDOUT: %a.loc15_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc15_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc15_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_15.2 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.type: type = interface_type @.1, @.1(%a.loc15_15.2) [symbolic = %.type (constants.%.type.2)] @@ -861,14 +936,17 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc7_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { // CHECK:STDOUT: %a.loc15_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc15_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(@.1.%a.loc15_15.2) { // CHECK:STDOUT: %a.loc15_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc15_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduced_alias.carbon @@ -878,9 +956,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %.type.1: type = generic_interface_type @.1 [template] // CHECK:STDOUT: %.4: %.type.1 = struct_value () [template] // CHECK:STDOUT: %.type.2: type = interface_type @.1, @.1(%a) [symbolic] @@ -897,29 +977,33 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [template = constants.%C] // CHECK:STDOUT: %Foo.decl: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc7_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type.1 = interface_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc15_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_15.2 (constants.%a.patt.2)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc15_15.1, runtime_param [symbolic = %a.patt.loc15_15.2 (constants.%a.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc15_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc15_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc15_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc15_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(%a.loc7_15.1: %C) { // CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc7_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @.1(%a.loc15_15.1: %C) { // CHECK:STDOUT: %a.loc15_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc15_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc15_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_15.2 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.type: type = interface_type @.1, @.1(%a.loc15_15.2) [symbolic = %.type (constants.%.type.2)] @@ -943,14 +1027,17 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc7_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc7_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { // CHECK:STDOUT: %a.loc15_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc15_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(@.1.%a.loc15_15.2) { // CHECK:STDOUT: %a.loc15_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc15_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- alias_two_file.carbon @@ -960,6 +1047,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] @@ -972,16 +1060,18 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc6_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc6_15.1, runtime_param [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc6_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc6_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc6_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(%a.loc6_15.1: %C) { // CHECK:STDOUT: %a.loc6_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc6_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } @@ -995,6 +1085,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc6_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_alias_two_file.impl.carbon @@ -1004,9 +1095,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] +// CHECK:STDOUT: %a.patt.2: %C = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %.type.1: type = generic_interface_type @.1 [template] // CHECK:STDOUT: %.4: %.type.1 = struct_value () [template] // CHECK:STDOUT: %.type.2: type = interface_type @.1, @.1(%a) [symbolic] @@ -1015,7 +1108,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+11, loaded [template = constants.%Foo] +// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+13, loaded [template = constants.%Foo] // CHECK:STDOUT: %import_ref.3 = import_ref Main//alias_two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1030,22 +1123,25 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %.decl: %.type.1 = interface_decl @.1 [template = constants.%.4] { -// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc17_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc17_15.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt.loc17_15.1, runtime_param [symbolic = %a.patt.loc17_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc17_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc17_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %C = param runtime_param +// CHECK:STDOUT: %a.loc17_15.1: %C = bind_symbolic_name a, 0, %param [symbolic = %a.loc17_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(constants.%a: %C) { // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: %a.patt: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @.1(%a.loc17_15.1: %C) { // CHECK:STDOUT: %a.loc17_15.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc17_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc17_15.2: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc17_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.type: type = interface_type @.1, @.1(%a.loc17_15.2) [symbolic = %.type (constants.%.type.2)] @@ -1067,14 +1163,17 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a => constants.%a +// CHECK:STDOUT: %a.patt => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { // CHECK:STDOUT: %a.loc17_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc17_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(@.1.%a.loc17_15.2) { // CHECK:STDOUT: %a.loc17_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc17_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_repeat_const.carbon @@ -1085,9 +1184,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %.3: type = const_type %C [template] // CHECK:STDOUT: %a: %.3 = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt.1: %.3 = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] // CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] +// CHECK:STDOUT: %a.patt.2: %.3 = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %.type.1: type = generic_interface_type @.1 [template] // CHECK:STDOUT: %.5: %.type.1 = struct_value () [template] // CHECK:STDOUT: %.type.2: type = interface_type @.1, @.1(%a) [symbolic] @@ -1101,32 +1202,36 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl: %Foo.type = interface_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: %.3 = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc6_15.1: %.3 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt.1)] +// CHECK:STDOUT: %a.param_patt: %.3 = param_pattern %a.patt.loc6_15.1, runtime_param [symbolic = %a.patt.loc6_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc6: type = const_type %C [template = constants.%.3] -// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param -// CHECK:STDOUT: %a.loc6_15.1: %.3 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %.3 = param runtime_param +// CHECK:STDOUT: %a.loc6_15.1: %.3 = bind_symbolic_name a, 0, %param [symbolic = %a.loc6_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type.1 = interface_decl @.1 [template = constants.%.5] { -// CHECK:STDOUT: %a.patt: %.3 = symbolic_binding_pattern a, 0 +// CHECK:STDOUT: %a.patt.loc17_15.1: %.3 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc17_15.2 (constants.%a.patt.2)] +// CHECK:STDOUT: %a.param_patt: %.3 = param_pattern %a.patt.loc17_15.1, runtime_param [symbolic = %a.patt.loc17_15.2 (constants.%a.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc17_26: type = const_type %C [template = constants.%.3] // CHECK:STDOUT: %.loc17_19: type = const_type %.3 [template = constants.%.3] -// CHECK:STDOUT: %a.param: %.3 = param a, runtime_param -// CHECK:STDOUT: %a.loc17_15.1: %.3 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc17_15.2 (constants.%a)] +// CHECK:STDOUT: %param: %.3 = param runtime_param +// CHECK:STDOUT: %a.loc17_15.1: %.3 = bind_symbolic_name a, 0, %param [symbolic = %a.loc17_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Foo(%a.loc6_15.1: %.3) { // CHECK:STDOUT: %a.loc6_15.2: %.3 = bind_symbolic_name a, 0 [symbolic = %a.loc6_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc6_15.2: %.3 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @.1(%a.loc17_15.1: %.3) { // CHECK:STDOUT: %a.loc17_15.2: %.3 = bind_symbolic_name a, 0 [symbolic = %a.loc17_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc17_15.2: %.3 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc17_15.2 (constants.%a.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.type: type = interface_type @.1, @.1(%a.loc17_15.2) [symbolic = %.type (constants.%.type.2)] @@ -1150,13 +1255,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { // CHECK:STDOUT: %a.loc6_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc6_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { // CHECK:STDOUT: %a.loc17_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc17_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(@.1.%a.loc17_15.2) { // CHECK:STDOUT: %a.loc17_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc17_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/todo_define_not_default.carbon b/toolchain/check/testdata/interface/todo_define_not_default.carbon index 234e2ef5cd6c..52bdf02a0d12 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -74,22 +74,24 @@ interface I { // CHECK:STDOUT: %.loc13: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: i32 = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc14_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32.loc14_11 [template = i32] // CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32.loc14_11, %.loc14_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc14_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_19.1: type = value_of_initializer %int.make_type_32.loc14_19 [template = i32] // CHECK:STDOUT: %.loc14_19.2: type = converted %int.make_type_32.loc14_19, %.loc14_19.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc14_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_27.1: type = value_of_initializer %int.make_type_32.loc14_27 [template = i32] // CHECK:STDOUT: %.loc14_27.2: type = converted %int.make_type_32.loc14_27, %.loc14_27.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param.loc14_8: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc14_8 +// CHECK:STDOUT: %param.loc14_16: i32 = param runtime_param1 +// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc14_16 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: %.4 = assoc_entity element1, %G.decl [template = constants.%.5] // CHECK:STDOUT: %int.make_type_32.loc18_19: init type = call constants.%Int32() [template = i32] @@ -131,7 +133,7 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(@I.%Self: %I.type) { // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a: i32, %b: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self) {} diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index a7d6d5bed224..c6b933e85ea7 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -290,6 +290,7 @@ impl i32 as Empty { // CHECK:STDOUT: %tuple.1: %.1 = tuple_value () [template] // CHECK:STDOUT: %.2: type = tuple_type (%.1) [template] // CHECK:STDOUT: %b: %.2 = bind_symbolic_name b, 0 [symbolic] +// CHECK:STDOUT: %b.patt: %.2 = symbolic_binding_pattern b, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.3: type = tuple_type (%.1, %.1, %.1) [template] @@ -334,14 +335,15 @@ impl i32 as Empty { // CHECK:STDOUT: %.loc9_18: %.1 = converted %.loc9_17, %tuple.loc9 [template = constants.%tuple.1] // CHECK:STDOUT: %a: %.1 = bind_name a, %.loc9_18 // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %b.patt: %.2 = symbolic_binding_pattern b, 0 +// CHECK:STDOUT: %b.patt.loc10_8.2: %.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc10_8.1 (constants.%b.patt)] +// CHECK:STDOUT: %b.param_patt: %.2 = param_pattern %b.patt.loc10_8.2, runtime_param [symbolic = %b.patt.loc10_8.1 (constants.%b.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc10_14: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_16.1: %.2 = tuple_literal (%.loc10_14) // CHECK:STDOUT: %.loc10_16.2: type = converted %.loc10_14, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc10_16.3: type = converted %.loc10_16.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %b.param: %.2 = param b, runtime_param -// CHECK:STDOUT: %b.loc10_8.1: %.2 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc10_8.2 (constants.%b)] +// CHECK:STDOUT: %param: %.2 = param runtime_param +// CHECK:STDOUT: %b.loc10_8.2: %.2 = bind_symbolic_name b, 0, %param [symbolic = %b.loc10_8.1 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22_13: %.1 = tuple_literal () // CHECK:STDOUT: %.loc22_17: %.1 = tuple_literal () @@ -373,13 +375,14 @@ impl i32 as Empty { // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%b.loc10_8.1: %.2) { -// CHECK:STDOUT: %b.loc10_8.2: %.2 = bind_symbolic_name b, 0 [symbolic = %b.loc10_8.2 (constants.%b)] +// CHECK:STDOUT: generic fn @F(%b.loc10_8.2: %.2) { +// CHECK:STDOUT: %b.loc10_8.1: %.2 = bind_symbolic_name b, 0 [symbolic = %b.loc10_8.1 (constants.%b)] +// CHECK:STDOUT: %b.patt.loc10_8.1: %.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc10_8.1 (constants.%b.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %c.loc11_9.2: %.7 = bind_symbolic_name c, 1 [symbolic = %c.loc11_9.2 (constants.%c)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%b.loc10_8.1: %.2) { +// CHECK:STDOUT: fn(%b.param_patt: %.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc11_15: %.1 = tuple_literal () // CHECK:STDOUT: %.loc11_19: %.1 = tuple_literal () @@ -411,7 +414,7 @@ impl i32 as Empty { // CHECK:STDOUT: %.loc14_17.3: type = converted %.loc14_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %b1.var: ref %.2 = var b1 // CHECK:STDOUT: %b1: ref %.2 = bind_name b1, %b1.var -// CHECK:STDOUT: %b.ref: %.2 = name_ref b, %b.loc10_8.1 [symbolic = %b.loc10_8.2 (constants.%b)] +// CHECK:STDOUT: %b.ref: %.2 = name_ref b, %b.loc10_8.2 [symbolic = %b.loc10_8.1 (constants.%b)] // CHECK:STDOUT: %.loc14_21.1: %.1 = tuple_access %b.ref, element0 // CHECK:STDOUT: %.loc14_21.2: ref %.1 = tuple_access %b1.var, element0 // CHECK:STDOUT: %.loc14_21.3: init %.1 = tuple_init () to %.loc14_21.2 [template = constants.%tuple.1] @@ -470,7 +473,8 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%b) { -// CHECK:STDOUT: %b.loc10_8.2 => constants.%b +// CHECK:STDOUT: %b.loc10_8.1 => constants.%b +// CHECK:STDOUT: %b.patt.loc10_8.1 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_invalid_let_after.carbon @@ -665,6 +669,7 @@ impl i32 as Empty { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.3: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -696,12 +701,12 @@ impl i32 as Empty { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -739,6 +744,7 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -763,7 +769,7 @@ impl i32 as Empty { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(@I.%Self: %I.type) { @@ -773,14 +779,17 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.2) { @@ -791,6 +800,7 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 1a6e558e89b1..f8e6a773e6e2 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -43,6 +43,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -75,12 +76,12 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -91,21 +92,23 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc12_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %int.make_type_32.loc12_9 [template = i32] // CHECK:STDOUT: %.loc12_9.2: type = converted %int.make_type_32.loc12_9, %.loc12_9.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc12_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_17.1: type = value_of_initializer %int.make_type_32.loc12_17 [template = i32] // CHECK:STDOUT: %.loc12_17.2: type = converted %int.make_type_32.loc12_17, %.loc12_17.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -125,7 +128,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a: i32) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] @@ -151,19 +154,22 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -174,6 +180,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%T) { // CHECK:STDOUT: %Dest => constants.%T +// CHECK:STDOUT: %Dest.patt => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -186,6 +193,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 diff --git a/toolchain/check/testdata/let/local.carbon b/toolchain/check/testdata/let/local.carbon index b1b251a2281d..f787e8e80e36 100644 --- a/toolchain/check/testdata/let/local.carbon +++ b/toolchain/check/testdata/let/local.carbon @@ -46,22 +46,23 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11_9, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32] // CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32.loc11_17, %.loc11_17.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a: i32) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index 8e8521249a85..07d647c79a21 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -48,22 +48,23 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11_9, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0 -// CHECK:STDOUT: %a.loc11: i32 = bind_name a, %a.param // CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32] // CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32.loc11_17, %.loc11_17.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %a.loc11: i32 = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a.loc11: i32) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index de30fc56327e..63ef369f983a 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -47,6 +47,8 @@ fn D(T:! type).F() {} // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: } @@ -82,19 +84,19 @@ fn D(T:! type).F() {} // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc24_16.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc24_16.2: type = converted %int.make_type_32, %.loc24_16.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %param.loc24: i32 = param runtime_param +// CHECK:STDOUT: %n: i32 = bind_name n, %param.loc24 // CHECK:STDOUT: %B: = namespace [template] {} -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] // CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T] -// CHECK:STDOUT: %x.param: %T = param x, runtime_param -// CHECK:STDOUT: %x: %T = bind_name x, %x.param +// CHECK:STDOUT: %param.loc30_13: type = param runtime_param +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %param.loc30_13 [symbolic = constants.%T] +// CHECK:STDOUT: %param.loc30_23: %T = param runtime_param +// CHECK:STDOUT: %x: %T = bind_name x, %param.loc30_23 // CHECK:STDOUT: %C: = namespace [template] {} // CHECK:STDOUT: %D: = namespace [template] {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc39_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc39_6.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc39_6.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc39_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -107,6 +109,7 @@ fn D(T:! type).F() {} // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(%T.loc39_6.1: type) { // CHECK:STDOUT: %T.loc39_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc39_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -118,5 +121,6 @@ fn D(T:! type).F() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T) { // CHECK:STDOUT: %T.loc39_6.2 => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/and.carbon b/toolchain/check/testdata/operators/builtin/and.carbon index d8da8c74be56..c70dc4c1af5a 100644 --- a/toolchain/check/testdata/operators/builtin/and.carbon +++ b/toolchain/check/testdata/operators/builtin/and.carbon @@ -93,12 +93,13 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} {} // CHECK:STDOUT: %PartialConstant.decl: %PartialConstant.type = fn_decl @PartialConstant [template = constants.%PartialConstant] { // CHECK:STDOUT: %x.patt: bool = binding_pattern x +// CHECK:STDOUT: %x.param_patt: bool = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc25: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc25_23.1: type = value_of_initializer %bool.make_type.loc25 [template = bool] // CHECK:STDOUT: %.loc25_23.2: type = converted %bool.make_type.loc25, %.loc25_23.1 [template = bool] -// CHECK:STDOUT: %x.param: bool = param x, runtime_param0 -// CHECK:STDOUT: %x: bool = bind_name x, %x.param +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %x: bool = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -264,7 +265,7 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @PartialConstant(%x: bool) { +// CHECK:STDOUT: fn @PartialConstant(%x.param_patt: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc26_13: bool = bool_literal false [template = constants.%.3] // CHECK:STDOUT: %.loc26_19.1: bool = bool_literal false [template = constants.%.3] diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon index 373de6f8b3a9..a46a456fcdaf 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon @@ -74,12 +74,12 @@ var or_: F(true or true); // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: %.loc42_17: bool = block_arg [template = constants.%.3] -// CHECK:STDOUT: %F.call: init type = call .inst+61.loc42_10(%.loc42_17) +// CHECK:STDOUT: %.loc42_17: bool = block_arg [template = constants.%.3] +// CHECK:STDOUT: %F.call: init type = call .inst+64.loc42_10(%.loc42_17) // CHECK:STDOUT: %.loc42_24.1: type = value_of_initializer %F.call // CHECK:STDOUT: %.loc42_24.2: type = converted %F.call, %.loc42_24.1 // CHECK:STDOUT: %or_.var: ref = var or_ @@ -88,9 +88,9 @@ var or_: F(true or true); // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%b: bool) -> type { +// CHECK:STDOUT: fn @F(%b.param_patt: bool) -> type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_ref b, %b +// CHECK:STDOUT: %b.ref: bool = name_ref b, .inst+13.loc12_6 // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: @@ -113,5 +113,5 @@ var or_: F(true or true); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon index e1068ae15406..cdd5199a6bbf 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon @@ -78,18 +78,19 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %PartialConstant.decl: %PartialConstant.type = fn_decl @PartialConstant [template = constants.%PartialConstant] { // CHECK:STDOUT: %x.patt: bool = binding_pattern x +// CHECK:STDOUT: %x.param_patt: bool = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc4: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc4_23.1: type = value_of_initializer %bool.make_type.loc4 [template = bool] // CHECK:STDOUT: %.loc4_23.2: type = converted %bool.make_type.loc4, %.loc4_23.1 [template = bool] -// CHECK:STDOUT: %x.param: bool = param x, runtime_param0 -// CHECK:STDOUT: %x: bool = bind_name x, %x.param +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %x: bool = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @PartialConstant(%x: bool) { +// CHECK:STDOUT: fn @PartialConstant(%x.param_patt: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc9_13: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: %.loc9_18.1: bool = bool_literal false [template = constants.%.3] @@ -184,18 +185,19 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %KnownValueButNonConstantCondition.decl: %KnownValueButNonConstantCondition.type = fn_decl @KnownValueButNonConstantCondition [template = constants.%KnownValueButNonConstantCondition] { // CHECK:STDOUT: %x.patt: bool = binding_pattern x +// CHECK:STDOUT: %x.param_patt: bool = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc4: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc4_41.1: type = value_of_initializer %bool.make_type.loc4 [template = bool] // CHECK:STDOUT: %.loc4_41.2: type = converted %bool.make_type.loc4, %.loc4_41.1 [template = bool] -// CHECK:STDOUT: %x.param: bool = param x, runtime_param0 -// CHECK:STDOUT: %x: bool = bind_name x, %x.param +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %x: bool = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @KnownValueButNonConstantCondition(%x: bool) { +// CHECK:STDOUT: fn @KnownValueButNonConstantCondition(%x.param_patt: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref.loc11: bool = name_ref x, %x // CHECK:STDOUT: %.loc11_15.1: bool = bool_literal false [template = constants.%.2] diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index fbeecc8d715a..e8a6928a1ff1 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -32,6 +32,7 @@ fn Main() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -59,12 +60,12 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -78,6 +79,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -119,19 +121,22 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -142,6 +147,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(bool) { // CHECK:STDOUT: %Dest => bool +// CHECK:STDOUT: %Dest.patt => bool // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index bbf9858596be..bc3734b001be 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -34,6 +34,7 @@ fn Main() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -61,12 +62,12 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -80,6 +81,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -123,19 +125,22 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -146,6 +151,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon index dae32aea361d..d67eeae6042c 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -55,9 +55,9 @@ fn Main() -> i32 { // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%Add.type] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: %.4 = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+21, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+21, unloaded +// CHECK:STDOUT: %import_ref.4: %.4 = import_ref Core//prelude/operators/arithmetic, inst+29, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+23, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+23, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -96,7 +96,7 @@ fn Main() -> i32 { // CHECK:STDOUT: generic fn @Op(constants.%Self: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.%Self (%Self)](%other: @Op.%Self (%Self)) -> @Op.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Op.%Self (%Self)](%other.param_patt: @Op.%Self (%Self)) -> @Op.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op(constants.%Self) { diff --git a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon index f06a98519af9..46246ceab5af 100644 --- a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon @@ -49,9 +49,9 @@ fn Main() -> i32 { // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%Add.type] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: %.4 = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+21, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+21, unloaded +// CHECK:STDOUT: %import_ref.4: %.4 = import_ref Core//prelude/operators/arithmetic, inst+29, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+23, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+23, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -88,7 +88,7 @@ fn Main() -> i32 { // CHECK:STDOUT: generic fn @Op(constants.%Self: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.%Self (%Self)](%other: @Op.%Self (%Self)) -> @Op.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Op.%Self (%Self)](%other.param_patt: @Op.%Self (%Self)) -> @Op.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op(constants.%Self) { diff --git a/toolchain/check/testdata/operators/builtin/or.carbon b/toolchain/check/testdata/operators/builtin/or.carbon index fa85b897238b..de4aacd4d08f 100644 --- a/toolchain/check/testdata/operators/builtin/or.carbon +++ b/toolchain/check/testdata/operators/builtin/or.carbon @@ -93,12 +93,13 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} {} // CHECK:STDOUT: %PartialConstant.decl: %PartialConstant.type = fn_decl @PartialConstant [template = constants.%PartialConstant] { // CHECK:STDOUT: %x.patt: bool = binding_pattern x +// CHECK:STDOUT: %x.param_patt: bool = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc25: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc25_23.1: type = value_of_initializer %bool.make_type.loc25 [template = bool] // CHECK:STDOUT: %.loc25_23.2: type = converted %bool.make_type.loc25, %.loc25_23.1 [template = bool] -// CHECK:STDOUT: %x.param: bool = param x, runtime_param0 -// CHECK:STDOUT: %x: bool = bind_name x, %x.param +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %x: bool = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -265,7 +266,7 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @PartialConstant(%x: bool) { +// CHECK:STDOUT: fn @PartialConstant(%x.param_patt: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc26_13: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: %.loc26_18.1: bool = not %.loc26_13 [template = constants.%.3] diff --git a/toolchain/check/testdata/operators/builtin/unary_op.carbon b/toolchain/check/testdata/operators/builtin/unary_op.carbon index 12ae69dafdf6..0cd213e390e2 100644 --- a/toolchain/check/testdata/operators/builtin/unary_op.carbon +++ b/toolchain/check/testdata/operators/builtin/unary_op.carbon @@ -61,16 +61,17 @@ fn Constant() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Not.decl: %Not.type = fn_decl @Not [template = constants.%Not] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc11_11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11_11 [template = bool] // CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type.loc11_11, %.loc11_11.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type.loc11_20: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_20.1: type = value_of_initializer %bool.make_type.loc11_20 [template = bool] // CHECK:STDOUT: %.loc11_20.2: type = converted %bool.make_type.loc11_20, %.loc11_20.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: %bool.make_type.loc15: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc15_15.1: type = value_of_initializer %bool.make_type.loc15 [template = bool] @@ -83,7 +84,7 @@ fn Constant() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Not(%b: bool) -> bool { +// CHECK:STDOUT: fn @Not(%b.param_patt: bool) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: %.loc12: bool = not %b.ref diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index b23e58cdb4a1..bf8d4a46fbe5 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -81,14 +81,14 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%Add.type] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+21, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+29, loaded [template = constants.%AddAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+31, unloaded -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/arithmetic, inst+54, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+48, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+21, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+48, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+29, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+23, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+31, loaded [template = constants.%AddAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+33, unloaded +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/arithmetic, inst+58, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+23, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+52, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -112,28 +112,32 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc26_11: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc26_11 +// CHECK:STDOUT: %param.loc26_17: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc26_17 // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %a.patt: %.6 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.6 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %a.param: %.6 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.6 = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param.loc30_15: %.6 = param runtime_param0 +// CHECK:STDOUT: %a: %.6 = bind_name a, %param.loc30_15 +// CHECK:STDOUT: %param.loc30_22: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc30_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,16 +158,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.1: %C.ref as %Add.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc18_9: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc18_9 +// CHECK:STDOUT: %param.loc18_18: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc18_18 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -175,16 +181,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.2: %C.ref as %AddAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.6 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.6 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %self.param: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.6 = bind_name self, %self.param -// CHECK:STDOUT: %.loc23_9: %.6 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc23_14: %.6 = param runtime_param0 +// CHECK:STDOUT: %self: %.6 = bind_name self, %param.loc23_14 +// CHECK:STDOUT: %param.loc23_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc23_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -200,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -211,10 +219,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.1)](%other.param_patt: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.6](%other: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.6](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -223,10 +231,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Self: %AddAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+90: @Op.4.%.2 (%.7)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C, %b.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -238,7 +246,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.6, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %.6, %b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.6 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index 1fccea0d815f..d9c9f4e1d1ce 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -79,16 +79,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+23, loaded [template = constants.%BitAnd.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+25, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/bitwise, inst+48, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+43, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+50, loaded [template = constants.%BitAndAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/bitwise, inst+75, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+69, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+43, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+69, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+24, loaded [template = constants.%BitAnd.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+26, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/bitwise, inst+51, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+46, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+53, loaded [template = constants.%BitAndAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+55, unloaded +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/bitwise, inst+80, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+74, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+46, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+74, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -112,28 +112,32 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc26_11: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc26_11 +// CHECK:STDOUT: %param.loc26_17: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc26_17 // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %a.patt: %.6 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.6 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %a.param: %.6 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.6 = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param.loc30_15: %.6 = param runtime_param0 +// CHECK:STDOUT: %a: %.6 = bind_name a, %param.loc30_15 +// CHECK:STDOUT: %param.loc30_22: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc30_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,16 +158,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.1: %C.ref as %BitAnd.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc18_9: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc18_9 +// CHECK:STDOUT: %param.loc18_18: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc18_18 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -175,16 +181,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.2: %C.ref as %BitAndAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.6 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.6 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %self.param: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.6 = bind_name self, %self.param -// CHECK:STDOUT: %.loc23_9: %.6 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc23_14: %.6 = param runtime_param0 +// CHECK:STDOUT: %self: %.6 = bind_name self, %param.loc23_14 +// CHECK:STDOUT: %param.loc23_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc23_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -200,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -211,10 +219,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %BitAnd.type) { // CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.1)](%other.param_patt: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.6](%other: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.6](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -223,10 +231,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Self: %BitAndAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+90: @Op.4.%.2 (%.7)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C, %b.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -238,7 +246,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.6, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %.6, %b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.6 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index 5271770c1d5e..37ee156bdc68 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -60,9 +60,9 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+1, loaded [template = constants.%BitComplement.type] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/bitwise, inst+21, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+15, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/bitwise, inst+15, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/bitwise, inst+22, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+16, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/bitwise, inst+16, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -80,12 +80,13 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -99,12 +100,13 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: impl @impl: %C.ref as %BitComplement.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -120,7 +122,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C]() -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C]() -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -131,10 +133,10 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: generic fn @Op.2(constants.%Self: %BitComplement.type) { // CHECK:STDOUT: %Self: %BitComplement.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self)]() -> @Op.2.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self)]() -> @Op.2.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %Op.ref: %.6 = name_ref Op, imports.%import_ref.3 [template = constants.%.7] diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index 6528cb13d5bd..e67211671f61 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -79,16 +79,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+77, loaded [template = constants.%BitOr.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+79, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/bitwise, inst+102, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+97, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+104, loaded [template = constants.%BitOrAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+106, unloaded -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/bitwise, inst+129, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+123, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+97, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+123, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+82, loaded [template = constants.%BitOr.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+84, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/bitwise, inst+109, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+104, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+111, loaded [template = constants.%BitOrAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+113, unloaded +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/bitwise, inst+138, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+132, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+104, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+132, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -112,28 +112,32 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc26_11: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc26_11 +// CHECK:STDOUT: %param.loc26_17: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc26_17 // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %a.patt: %.6 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.6 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %a.param: %.6 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.6 = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param.loc30_15: %.6 = param runtime_param0 +// CHECK:STDOUT: %a: %.6 = bind_name a, %param.loc30_15 +// CHECK:STDOUT: %param.loc30_22: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc30_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,16 +158,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.1: %C.ref as %BitOr.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc18_9: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc18_9 +// CHECK:STDOUT: %param.loc18_18: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc18_18 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -175,16 +181,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.2: %C.ref as %BitOrAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.6 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.6 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %self.param: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.6 = bind_name self, %self.param -// CHECK:STDOUT: %.loc23_9: %.6 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc23_14: %.6 = param runtime_param0 +// CHECK:STDOUT: %self: %.6 = bind_name self, %param.loc23_14 +// CHECK:STDOUT: %param.loc23_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc23_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -200,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -211,10 +219,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %BitOr.type) { // CHECK:STDOUT: %Self: %BitOr.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.1)](%other.param_patt: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.6](%other: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.6](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -223,10 +231,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Self: %BitOrAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+90: @Op.4.%.2 (%.7)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C, %b.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -238,7 +246,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.6, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %.6, %b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.6 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index 14d5d5673af7..fcf8050133ef 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -79,16 +79,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+131, loaded [template = constants.%BitXor.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+133, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/bitwise, inst+156, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+151, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+158, loaded [template = constants.%BitXorAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+160, unloaded -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/bitwise, inst+183, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+177, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+151, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+177, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+140, loaded [template = constants.%BitXor.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+142, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/bitwise, inst+167, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+162, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+169, loaded [template = constants.%BitXorAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+171, unloaded +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/bitwise, inst+196, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+190, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+162, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+190, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -112,28 +112,32 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc26_11: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc26_11 +// CHECK:STDOUT: %param.loc26_17: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc26_17 // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %a.patt: %.6 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.6 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %a.param: %.6 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.6 = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param.loc30_15: %.6 = param runtime_param0 +// CHECK:STDOUT: %a: %.6 = bind_name a, %param.loc30_15 +// CHECK:STDOUT: %param.loc30_22: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc30_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,16 +158,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.1: %C.ref as %BitXor.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc18_9: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc18_9 +// CHECK:STDOUT: %param.loc18_18: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc18_18 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -175,16 +181,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.2: %C.ref as %BitXorAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.6 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.6 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %self.param: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.6 = bind_name self, %self.param -// CHECK:STDOUT: %.loc23_9: %.6 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc23_14: %.6 = param runtime_param0 +// CHECK:STDOUT: %self: %.6 = bind_name self, %param.loc23_14 +// CHECK:STDOUT: %param.loc23_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc23_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -200,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -211,10 +219,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %BitXor.type) { // CHECK:STDOUT: %Self: %BitXor.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.1)](%other.param_patt: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.6](%other: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.6](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -223,10 +231,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Self: %BitXorAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+90: @Op.4.%.2 (%.7)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C, %b.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -238,7 +246,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.6, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %.6, %b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.6 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 0dd66e1e600c..b1623a6958dd 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -59,11 +59,11 @@ fn TestOp() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+152, loaded [template = constants.%Dec.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+154, unloaded -// CHECK:STDOUT: %import_ref.3: %.8 = import_ref Core//prelude/operators/arithmetic, inst+171, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+165, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+165, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+162, loaded [template = constants.%Dec.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+164, unloaded +// CHECK:STDOUT: %import_ref.3: %.8 = import_ref Core//prelude/operators/arithmetic, inst+182, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+176, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+176, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -92,12 +92,13 @@ fn TestOp() { // CHECK:STDOUT: impl @impl: %C.ref as %Dec.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.3 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc18_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc18_21: type = ptr_type %C [template = constants.%.3] -// CHECK:STDOUT: %self.param: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.3 = bind_name self, %self.param -// CHECK:STDOUT: %.loc18_9: %.3 = addr_pattern %self +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %self: %.3 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.6] // CHECK:STDOUT: @@ -113,13 +114,13 @@ fn TestOp() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr %self: %.3](); +// CHECK:STDOUT: fn @Op.1[addr %self.param_patt: %.3](); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self: %Dec.type) { // CHECK:STDOUT: %Self: %Dec.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.2: type = ptr_type @Op.2.%Self (%Self) [symbolic = %.2 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.2.%.2 (%.5)](); +// CHECK:STDOUT: fn[addr .inst+38: @Op.2.%.2 (%.5)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp() { diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index 47d1c042281d..54be9495a9f6 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -79,16 +79,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+227, loaded [template = constants.%Div.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+229, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+252, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+247, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+254, loaded [template = constants.%DivAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+256, unloaded -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/arithmetic, inst+279, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+273, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+247, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+273, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+242, loaded [template = constants.%Div.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+244, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+269, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+264, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+271, loaded [template = constants.%DivAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+273, unloaded +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/arithmetic, inst+298, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+292, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+264, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+292, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -112,28 +112,32 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc26_11: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc26_11 +// CHECK:STDOUT: %param.loc26_17: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc26_17 // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %a.patt: %.6 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.6 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %a.param: %.6 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.6 = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param.loc30_15: %.6 = param runtime_param0 +// CHECK:STDOUT: %a: %.6 = bind_name a, %param.loc30_15 +// CHECK:STDOUT: %param.loc30_22: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc30_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,16 +158,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.1: %C.ref as %Div.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc18_9: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc18_9 +// CHECK:STDOUT: %param.loc18_18: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc18_18 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -175,16 +181,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.2: %C.ref as %DivAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.6 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.6 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %self.param: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.6 = bind_name self, %self.param -// CHECK:STDOUT: %.loc23_9: %.6 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc23_14: %.6 = param runtime_param0 +// CHECK:STDOUT: %self: %.6 = bind_name self, %param.loc23_14 +// CHECK:STDOUT: %param.loc23_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc23_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -200,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -211,10 +219,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %Div.type) { // CHECK:STDOUT: %Self: %Div.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.1)](%other.param_patt: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.6](%other: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.6](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -223,10 +231,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Self: %DivAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+90: @Op.4.%.2 (%.7)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C, %b.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -238,7 +246,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.6, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %.6, %b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.6 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 7ba9500392c7..5b8d0f1d56d9 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -62,12 +62,12 @@ impl C as Core.Eq { } fn TestRhsBad(a: C, b: D) -> bool { - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+10]]:10: error: cannot implicitly convert from `D` to `C` + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+10]]:15: error: cannot implicitly convert from `D` to `C` // CHECK:STDERR: return a == b; - // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+7]]:10: note: type `D` does not implement interface `ImplicitAs` + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+7]]:15: note: type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: return a == b; - // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: ^ // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE-11]]:3: note: initializing parameter 1 of function declared here // CHECK:STDERR: fn Equal[self: C](other: C) -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -128,13 +128,13 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%Eq.type] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+33, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+56, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+28, loaded [template = constants.%Equal.2] -// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+51, loaded [template = constants.%NotEqual.2] +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+35, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+60, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+30, loaded [template = constants.%Equal.2] +// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+55, loaded [template = constants.%NotEqual.2] // CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+28, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+51, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+30, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+55, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -153,33 +153,37 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [template = constants.%TestEqual] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc11_17: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc11_23: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_29.2: type = converted %bool.make_type, %.loc11_29.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc11_14: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc11_14 +// CHECK:STDOUT: %param.loc11_20: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc11_20 // CHECK:STDOUT: } // CHECK:STDOUT: %TestNotEqual.decl: %TestNotEqual.type = fn_decl @TestNotEqual [template = constants.%TestNotEqual] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc15_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc15_26: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc15_32.2: type = converted %bool.make_type, %.loc15_32.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc15_17: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc15_17 +// CHECK:STDOUT: %param.loc15_23: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc15_23 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -194,33 +198,37 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: impl @impl: %C.ref as %Eq.ref { // CHECK:STDOUT: %Equal.decl: %Equal.type.1 = fn_decl @Equal.1 [template = constants.%Equal.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc7_28: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc7_34.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc7_34.2: type = converted %bool.make_type, %.loc7_34.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc7_12: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc7_12 +// CHECK:STDOUT: %param.loc7_21: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc7_21 // CHECK:STDOUT: } // CHECK:STDOUT: %NotEqual.decl: %NotEqual.type.1 = fn_decl @NotEqual.1 [template = constants.%NotEqual.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc8_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc8_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc8_37.2: type = converted %bool.make_type, %.loc8_37.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc8_15: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc8_15 +// CHECK:STDOUT: %param.loc8_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc8_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc6: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -239,23 +247,23 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Equal.1[%self: %C](%other: %C) -> bool; +// CHECK:STDOUT: fn @Equal.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NotEqual.1[%self: %C](%other: %C) -> bool; +// CHECK:STDOUT: fn @NotEqual.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Equal.2(constants.%Self: %Eq.type) { // CHECK:STDOUT: %Self: %Eq.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Equal.2.%Self (%Self)](%other: @Equal.2.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @Equal.2.%Self (%Self)](%other.param_patt: @Equal.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @NotEqual.2(constants.%Self: %Eq.type) { // CHECK:STDOUT: %Self: %Eq.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @NotEqual.2.%Self (%Self)](%other: @NotEqual.2.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @NotEqual.2.%Self (%Self)](%other.param_patt: @NotEqual.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestEqual(%a: %C, %b: %C) -> bool { +// CHECK:STDOUT: fn @TestEqual(%a.param_patt: %C, %b.param_patt: %C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -268,7 +276,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: return %.loc12_16.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestNotEqual(%a: %C, %b: %C) -> bool { +// CHECK:STDOUT: fn @TestNotEqual(%a.param_patt: %C, %b.param_patt: %C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -339,12 +347,12 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%Eq.type] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/comparison, inst+33, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5: %.7 = import_ref Core//prelude/operators/comparison, inst+56, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/comparison, inst+28, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/comparison, inst+51, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+28, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+51, unloaded +// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/comparison, inst+35, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: %.7 = import_ref Core//prelude/operators/comparison, inst+60, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/comparison, inst+30, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/comparison, inst+55, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+30, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+55, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -358,33 +366,37 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [template = constants.%TestEqual] { // CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %D = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %D = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %D = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc6_17: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %a.param: %D = param a, runtime_param0 -// CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %D.ref.loc6_23: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %b.param: %D = param b, runtime_param1 -// CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc6_29.2: type = converted %bool.make_type, %.loc6_29.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc6_14: %D = param runtime_param0 +// CHECK:STDOUT: %a: %D = bind_name a, %param.loc6_14 +// CHECK:STDOUT: %param.loc6_20: %D = param runtime_param1 +// CHECK:STDOUT: %b: %D = bind_name b, %param.loc6_20 // CHECK:STDOUT: } // CHECK:STDOUT: %TestNotEqual.decl: %TestNotEqual.type = fn_decl @TestNotEqual [template = constants.%TestNotEqual] { // CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %D = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %D = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %D = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc14_20: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %a.param: %D = param a, runtime_param0 -// CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %D.ref.loc14_26: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %b.param: %D = param b, runtime_param1 -// CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_32.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc14_32.2: type = converted %bool.make_type, %.loc14_32.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc14_17: %D = param runtime_param0 +// CHECK:STDOUT: %a: %D = bind_name a, %param.loc14_17 +// CHECK:STDOUT: %param.loc14_23: %D = param runtime_param1 +// CHECK:STDOUT: %b: %D = bind_name b, %param.loc14_23 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -405,7 +417,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestEqual(%a: %D, %b: %D) -> bool { +// CHECK:STDOUT: fn @TestEqual(%a.param_patt: %D, %b.param_patt: %D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b @@ -416,10 +428,10 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: generic fn @Equal(constants.%Self: %Eq.type) { // CHECK:STDOUT: %Self: %Eq.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Equal.%Self (%Self)](%other: @Equal.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @Equal.%Self (%Self)](%other.param_patt: @Equal.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestNotEqual(%a: %D, %b: %D) -> bool { +// CHECK:STDOUT: fn @TestNotEqual(%a.param_patt: %D, %b.param_patt: %D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b @@ -430,7 +442,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: generic fn @NotEqual(constants.%Self: %Eq.type) { // CHECK:STDOUT: %Self: %Eq.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @NotEqual.%Self (%Self)](%other: @NotEqual.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @NotEqual.%Self (%Self)](%other.param_patt: @NotEqual.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Equal(constants.%Self) { @@ -472,6 +484,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.3: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -505,19 +518,19 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%Eq.type] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+33, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %.13 = import_ref Core//prelude/operators/comparison, inst+56, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+28, loaded [template = constants.%Equal.2] -// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+51, loaded [template = constants.%NotEqual.2] +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+35, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %.13 = import_ref Core//prelude/operators/comparison, inst+60, loaded [template = constants.%.14] +// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+30, loaded [template = constants.%Equal.2] +// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+55, loaded [template = constants.%NotEqual.2] // CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+28, unloaded -// CHECK:STDOUT: %import_ref.9: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.11: @ImplicitAs.%.1 (%.8) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.12)] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+51, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+30, unloaded +// CHECK:STDOUT: %import_ref.9: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.11: @ImplicitAs.%.1 (%.8) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.12)] +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+55, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -538,33 +551,37 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %TestRhsBad.decl: %TestRhsBad.type = fn_decl @TestRhsBad [template = constants.%TestRhsBad] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %D = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %D = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %b.param: %D = param b, runtime_param1 -// CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_30.2: type = converted %bool.make_type, %.loc12_30.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc12_15: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc12_15 +// CHECK:STDOUT: %param.loc12_21: %D = param runtime_param1 +// CHECK:STDOUT: %b: %D = bind_name b, %param.loc12_21 // CHECK:STDOUT: } // CHECK:STDOUT: %TestLhsBad.decl: %TestLhsBad.type = fn_decl @TestLhsBad [template = constants.%TestLhsBad] { // CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %D = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %a.param: %D = param a, runtime_param0 -// CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc26_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc26_30.2: type = converted %bool.make_type, %.loc26_30.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc26_15: %D = param runtime_param0 +// CHECK:STDOUT: %a: %D = bind_name a, %param.loc26_15 +// CHECK:STDOUT: %param.loc26_21: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc26_21 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -578,6 +595,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -598,33 +616,37 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: impl @impl: %C.ref as %Eq.ref { // CHECK:STDOUT: %Equal.decl: %Equal.type.1 = fn_decl @Equal.1 [template = constants.%Equal.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc8_28: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc8_34.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc8_34.2: type = converted %bool.make_type, %.loc8_34.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc8_12: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc8_12 +// CHECK:STDOUT: %param.loc8_21: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc8_21 // CHECK:STDOUT: } // CHECK:STDOUT: %NotEqual.decl: %NotEqual.type.1 = fn_decl @NotEqual.1 [template = constants.%NotEqual.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc9_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc9_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc9_37.2: type = converted %bool.make_type, %.loc9_37.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc9_15: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc9_15 +// CHECK:STDOUT: %param.loc9_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc9_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc7: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -650,23 +672,23 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Equal.1[%self: %C](%other: %C) -> bool; +// CHECK:STDOUT: fn @Equal.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NotEqual.1[%self: %C](%other: %C) -> bool; +// CHECK:STDOUT: fn @NotEqual.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Equal.2(constants.%Self.1: %Eq.type) { // CHECK:STDOUT: %Self: %Eq.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Equal.2.%Self (%Self.1)](%other: @Equal.2.%Self (%Self.1)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @Equal.2.%Self (%Self.1)](%other.param_patt: @Equal.2.%Self (%Self.1)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @NotEqual.2(constants.%Self.1: %Eq.type) { // CHECK:STDOUT: %Self: %Eq.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @NotEqual.2.%Self (%Self.1)](%other: @NotEqual.2.%Self (%Self.1)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @NotEqual.2.%Self (%Self.1)](%other.param_patt: @NotEqual.2.%Self (%Self.1)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestRhsBad(%a: %C, %b: %D) -> bool { +// CHECK:STDOUT: fn @TestRhsBad(%a.param_patt: %C, %b.param_patt: %D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b @@ -674,9 +696,9 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %.loc23_12.1: %Equal.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Equal.1] // CHECK:STDOUT: %.loc23_12.2: = bound_method %a.ref, %.loc23_12.1 // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc23_12.3: %.10 = specific_constant imports.%import_ref.11, @ImplicitAs(constants.%C) [template = constants.%.11] -// CHECK:STDOUT: %Convert.ref: %.10 = name_ref Convert, %.loc23_12.3 [template = constants.%.11] -// CHECK:STDOUT: %.loc23_12.4: %C = converted %b.ref, [template = ] +// CHECK:STDOUT: %.loc23_15.1: %.10 = specific_constant imports.%import_ref.11, @ImplicitAs(constants.%C) [template = constants.%.11] +// CHECK:STDOUT: %Convert.ref: %.10 = name_ref Convert, %.loc23_15.1 [template = constants.%.11] +// CHECK:STDOUT: %.loc23_15.2: %C = converted %b.ref, [template = ] // CHECK:STDOUT: %Equal.call: init bool = call %.loc23_12.2() [template = ] // CHECK:STDOUT: %.loc23_16.1: bool = value_of_initializer %Equal.call [template = ] // CHECK:STDOUT: %.loc23_16.2: bool = converted %Equal.call, %.loc23_16.1 [template = ] @@ -688,10 +710,10 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestLhsBad(%a: %D, %b: %C) -> bool { +// CHECK:STDOUT: fn @TestLhsBad(%a.param_patt: %D, %b.param_patt: %C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -717,14 +739,17 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.2) { @@ -735,6 +760,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%C) { // CHECK:STDOUT: %Dest => constants.%C +// CHECK:STDOUT: %Dest.patt => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index ed3c7d1c6595..f0138491b3ec 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -20,23 +20,23 @@ impl C as Core.AddAssign { } fn TestIncNonRef(a: C) { - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+7]]:3: error: `addr self` method cannot be invoked on a value + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+7]]:5: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: ++a; - // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-10]]:14: note: initializing `addr self` parameter of method declared here + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-10]]:9: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn Op[addr self: C*](); - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: ++a; } fn TestAddAssignNonRef(a: C, b: C) { - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+6]]:5: error: `addr self` method cannot be invoked on a value + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+6]]:3: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: a += b; - // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-18]]:14: note: initializing `addr self` parameter of method declared here + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-18]]:9: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn Op[addr self: C*](other: C); - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: ^~~~~~~~~~~~~ a += b; } @@ -88,16 +88,16 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+56, loaded [template = constants.%Inc.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+58, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+75, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+69, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+29, loaded [template = constants.%AddAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+31, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+54, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+48, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+69, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+48, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+60, loaded [template = constants.%Inc.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+62, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+80, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+74, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+31, loaded [template = constants.%AddAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+33, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+58, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+52, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -121,21 +121,24 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestIncNonRef.decl: %TestIncNonRef.type = fn_decl @TestIncNonRef [template = constants.%TestIncNonRef] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAddAssignNonRef.decl: %TestAddAssignNonRef.type = fn_decl @TestAddAssignNonRef [template = constants.%TestAddAssignNonRef] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc33_27: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc33_33: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param.loc33_24: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc33_24 +// CHECK:STDOUT: %param.loc33_30: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc33_30 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -156,12 +159,13 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: impl @impl.1: %C.ref as %Inc.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.3 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc16_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc16_21: type = ptr_type %C [template = constants.%.3] -// CHECK:STDOUT: %self.param: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.3 = bind_name self, %self.param -// CHECK:STDOUT: %.loc16_9: %.3 = addr_pattern %self +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %self: %.3 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15: = interface_witness (%Op.decl) [template = constants.%.6] // CHECK:STDOUT: @@ -173,16 +177,18 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: impl @impl.2: %C.ref as %AddAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.3 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc19_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc19_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc19_21: type = ptr_type %C [template = constants.%.3] -// CHECK:STDOUT: %self.param: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.3 = bind_name self, %self.param -// CHECK:STDOUT: %.loc19_9: %.3 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc19_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc19_14: %.3 = param runtime_param0 +// CHECK:STDOUT: %self: %.3 = bind_name self, %param.loc19_14 +// CHECK:STDOUT: %param.loc19_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc19_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc18: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -198,25 +204,25 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr %self: %.3](); +// CHECK:STDOUT: fn @Op.1[addr %self.param_patt: %.3](); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %Inc.type) { // CHECK:STDOUT: %Self: %Inc.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: %.2: type = ptr_type @Op.2.%Self (%Self.1) [symbolic = %.2 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.2.%.2 (%.5)](); +// CHECK:STDOUT: fn[addr .inst+38: @Op.2.%.2 (%.5)](); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.3](%other: %C); +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.3](%other.param_patt: %C); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %AddAssign.type) { // CHECK:STDOUT: %Self: %AddAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+77: @Op.4.%.2 (%.7)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestIncNonRef(%a: %C) { +// CHECK:STDOUT: fn @TestIncNonRef(%a.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] @@ -226,7 +232,7 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAddAssignNonRef(%a: %C, %b: %C) { +// CHECK:STDOUT: fn @TestAddAssignNonRef(%a.param_patt: %C, %b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index e99da989cc2b..fac71b58a25c 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -99,26 +99,26 @@ fn TestRef(b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+77, loaded [template = constants.%Negate.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+79, unloaded -// CHECK:STDOUT: %import_ref.3: %.5 = import_ref Core//prelude/operators/arithmetic, inst+96, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/arithmetic, inst+91, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+91, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+82, loaded [template = constants.%Negate.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+84, unloaded +// CHECK:STDOUT: %import_ref.3: %.5 = import_ref Core//prelude/operators/arithmetic, inst+102, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/arithmetic, inst+97, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+97, unloaded // CHECK:STDOUT: %import_ref.6: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%Add.type] // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.8: %.7 = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+21, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+21, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+29, loaded [template = constants.%AddAssign.type] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+31, unloaded -// CHECK:STDOUT: %import_ref.13: %.10 = import_ref Core//prelude/operators/arithmetic, inst+54, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/arithmetic, inst+48, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/arithmetic, inst+48, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/arithmetic, inst+56, loaded [template = constants.%Inc.type] -// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/arithmetic, inst+58, unloaded -// CHECK:STDOUT: %import_ref.18: %.13 = import_ref Core//prelude/operators/arithmetic, inst+75, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.19 = import_ref Core//prelude/operators/arithmetic, inst+69, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Core//prelude/operators/arithmetic, inst+69, unloaded +// CHECK:STDOUT: %import_ref.8: %.7 = import_ref Core//prelude/operators/arithmetic, inst+29, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+23, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+23, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+31, loaded [template = constants.%AddAssign.type] +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+33, unloaded +// CHECK:STDOUT: %import_ref.13: %.10 = import_ref Core//prelude/operators/arithmetic, inst+58, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/arithmetic, inst+52, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/arithmetic, inst+52, unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/arithmetic, inst+60, loaded [template = constants.%Inc.type] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/arithmetic, inst+62, unloaded +// CHECK:STDOUT: %import_ref.18: %.13 = import_ref Core//prelude/operators/arithmetic, inst+80, loaded [template = constants.%.14] +// CHECK:STDOUT: %import_ref.19 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -133,32 +133,36 @@ fn TestRef(b: C) { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %TestUnary.decl: %TestUnary.type = fn_decl @TestUnary [template = constants.%TestUnary] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc15_17: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc15_23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: %TestBinary.decl: %TestBinary.type = fn_decl @TestBinary [template = constants.%TestBinary] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc23_24: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc23_30: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc23_15: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc23_15 +// CHECK:STDOUT: %param.loc23_21: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc23_21 // CHECK:STDOUT: } // CHECK:STDOUT: %TestRef.decl: %TestRef.type = fn_decl @TestRef [template = constants.%TestRef] { // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param0 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %b: %C = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -197,7 +201,7 @@ fn TestRef(b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestUnary(%a: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestUnary(%a.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %Op.ref: %.5 = name_ref Op, imports.%import_ref.3 [template = constants.%.6] @@ -207,10 +211,10 @@ fn TestRef(b: C) { // CHECK:STDOUT: generic fn @Op.1(constants.%Self.1: %Negate.type) { // CHECK:STDOUT: %Self: %Negate.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.1.%Self (%Self.1)]() -> @Op.1.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self (%Self.1)]() -> @Op.1.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestBinary(%a: %C, %b: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestBinary(%a.param_patt: %C, %b.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -221,10 +225,10 @@ fn TestRef(b: C) { // CHECK:STDOUT: generic fn @Op.2(constants.%Self.2: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.2)](%other: @Op.2.%Self (%Self.2)) -> @Op.2.%Self (%Self.2); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.2)](%other.param_patt: @Op.2.%Self (%Self.2)) -> @Op.2.%Self (%Self.2); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestRef(%b: %C) { +// CHECK:STDOUT: fn @TestRef(%b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc32: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.var: ref %C = var a @@ -245,14 +249,14 @@ fn TestRef(b: C) { // CHECK:STDOUT: %Self: %AddAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.2: type = ptr_type @Op.3.%Self (%Self.3) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.3.%.2 (%.9)](%other: @Op.3.%Self (%Self.3)); +// CHECK:STDOUT: fn[addr .inst+116: @Op.3.%.2 (%.9)](%other.param_patt: @Op.3.%Self (%Self.3)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.4(constants.%Self.4: %Inc.type) { // CHECK:STDOUT: %Self: %Inc.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.4)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.4) [symbolic = %.2 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.12)](); +// CHECK:STDOUT: fn[addr .inst+143: @Op.4.%.2 (%.12)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%Self.1) { diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index 8da4291adfac..54c18e4d144d 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -21,12 +21,12 @@ impl C as Core.AddAssign { } fn Test(a: C, b: D) -> C { - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+10]]:10: error: cannot implicitly convert from `D` to `C` + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+10]]:14: error: cannot implicitly convert from `D` to `C` // CHECK:STDERR: return a + b; - // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+7]]:10: note: type `D` does not implement interface `ImplicitAs` + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+7]]:14: note: type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: return a + b; - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: ^ // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-13]]:3: note: initializing parameter 1 of function declared here // CHECK:STDERR: fn Op[self: C](other: C) -> C; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -36,12 +36,12 @@ fn Test(a: C, b: D) -> C { fn TestAssign(b: D) { var a: C = {}; - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `D` to `C` + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+9]]:8: error: cannot implicitly convert from `D` to `C` // CHECK:STDERR: a += b; - // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+6]]:3: note: type `D` does not implement interface `ImplicitAs` + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+6]]:8: note: type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: a += b; - // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: ^ // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-25]]:3: note: initializing parameter 1 of function declared here // CHECK:STDERR: fn Op[addr self: C*](other: C); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -82,6 +82,7 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.3: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.4: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -116,20 +117,20 @@ fn TestAssign(b: D) { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%Add.type] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+21, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+29, loaded [template = constants.%AddAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+31, unloaded -// CHECK:STDOUT: %import_ref.7: %.16 = import_ref Core//prelude/operators/arithmetic, inst+54, loaded [template = constants.%.17] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+48, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+21, unloaded -// CHECK:STDOUT: %import_ref.10: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.12: @ImplicitAs.%.1 (%.11) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.15)] -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/arithmetic, inst+48, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+29, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+23, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+31, loaded [template = constants.%AddAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+33, unloaded +// CHECK:STDOUT: %import_ref.7: %.16 = import_ref Core//prelude/operators/arithmetic, inst+58, loaded [template = constants.%.17] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+23, unloaded +// CHECK:STDOUT: %import_ref.10: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.12: @ImplicitAs.%.1 (%.11) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.15)] +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/arithmetic, inst+52, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -155,23 +156,26 @@ fn TestAssign(b: D) { // CHECK:STDOUT: } // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %D = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %D = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_12: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %b.param: %D = param b, runtime_param1 -// CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc23_24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc23_9: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc23_9 +// CHECK:STDOUT: %param.loc23_15: %D = param runtime_param1 +// CHECK:STDOUT: %b: %D = bind_name b, %param.loc23_15 // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %b.patt: %D = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %D = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %b.param: %D = param b, runtime_param0 -// CHECK:STDOUT: %b: %D = bind_name b, %b.param +// CHECK:STDOUT: %param: %D = param runtime_param0 +// CHECK:STDOUT: %b: %D = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -191,6 +195,7 @@ fn TestAssign(b: D) { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -211,16 +216,18 @@ fn TestAssign(b: D) { // CHECK:STDOUT: impl @impl.1: %C.ref as %Add.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc17_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc17_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %C.ref.loc17_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc17_9: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc17_9 +// CHECK:STDOUT: %param.loc17_18: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc17_18 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -232,16 +239,18 @@ fn TestAssign(b: D) { // CHECK:STDOUT: impl @impl.2: %C.ref as %AddAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.5 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.5 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc20_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc20_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc20_21: type = ptr_type %C [template = constants.%.5] -// CHECK:STDOUT: %self.param: %.5 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.5 = bind_name self, %self.param -// CHECK:STDOUT: %.loc20_9: %.5 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc20_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc20_14: %.5 = param runtime_param0 +// CHECK:STDOUT: %self: %.5 = bind_name self, %param.loc20_14 +// CHECK:STDOUT: %param.loc20_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc20_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19: = interface_witness (%Op.decl) [template = constants.%.7] // CHECK:STDOUT: @@ -264,24 +273,24 @@ fn TestAssign(b: D) { // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %C; +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %C; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.1)](%other.param_patt: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.5](%other: %C); +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.5](%other.param_patt: %C); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %AddAssign.type) { // CHECK:STDOUT: %Self: %AddAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.6)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.6)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+87: @Op.4.%.2 (%.6)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Test(%a: %C, %b: %D) -> %return: %C { +// CHECK:STDOUT: fn @Test(%a.param_patt: %C, %b.param_patt: %D) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b @@ -290,9 +299,9 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %.loc34_12.2: = bound_method %a.ref, %.loc34_12.1 // CHECK:STDOUT: %.loc34_12.3: ref %C = temporary_storage // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc34_12.4: %.13 = specific_constant imports.%import_ref.12, @ImplicitAs(constants.%C) [template = constants.%.14] -// CHECK:STDOUT: %Convert.ref: %.13 = name_ref Convert, %.loc34_12.4 [template = constants.%.14] -// CHECK:STDOUT: %.loc34_12.5: %C = converted %b.ref, [template = ] +// CHECK:STDOUT: %.loc34_14.1: %.13 = specific_constant imports.%import_ref.12, @ImplicitAs(constants.%C) [template = constants.%.14] +// CHECK:STDOUT: %Convert.ref: %.13 = name_ref Convert, %.loc34_14.1 [template = constants.%.14] +// CHECK:STDOUT: %.loc34_14.2: %C = converted %b.ref, [template = ] // CHECK:STDOUT: %Op.call: init %C = call %.loc34_12.2() [template = ] // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } @@ -302,10 +311,10 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.4)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.4)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%b: %D) { +// CHECK:STDOUT: fn @TestAssign(%b.param_patt: %D) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.var: ref %C = var a @@ -321,9 +330,9 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %.loc48_5.2: = bound_method %a.ref, %.loc48_5.1 // CHECK:STDOUT: %.loc48_3: %.5 = addr_of %a.ref // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc48_5.3: %.13 = specific_constant imports.%import_ref.12, @ImplicitAs(constants.%C) [template = constants.%.14] -// CHECK:STDOUT: %Convert.ref: %.13 = name_ref Convert, %.loc48_5.3 [template = constants.%.14] -// CHECK:STDOUT: %.loc48_5.4: %C = converted %b.ref, [template = ] +// CHECK:STDOUT: %.loc48_8.1: %.13 = specific_constant imports.%import_ref.12, @ImplicitAs(constants.%C) [template = constants.%.14] +// CHECK:STDOUT: %Convert.ref: %.13 = name_ref Convert, %.loc48_8.1 [template = constants.%.14] +// CHECK:STDOUT: %.loc48_8.2: %C = converted %b.ref, [template = ] // CHECK:STDOUT: %Op.call: init %.3 = call %.loc48_5.2() [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -348,14 +357,17 @@ fn TestAssign(b: D) { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.3) { @@ -366,6 +378,7 @@ fn TestAssign(b: D) { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%C) { // CHECK:STDOUT: %Dest => constants.%C +// CHECK:STDOUT: %Dest.patt => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index e71dd99d607f..fe00ca6443fb 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -46,6 +46,7 @@ fn Test() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -73,6 +74,7 @@ fn Test() { // CHECK:STDOUT: %Sink_X.type: type = fn_type @Sink_X [template] // CHECK:STDOUT: %Sink_X: %Sink_X.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Source.type: type = fn_type @Source [template] // CHECK:STDOUT: %Source: %Source.type = struct_value () [template] // CHECK:STDOUT: %.14: = specific_function %Source, @Source(%T) [symbolic] @@ -97,12 +99,12 @@ fn Test() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.16)] -// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%Convert.type (%Convert.type.1) = import_ref Core//prelude/operators/as, inst+56, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.16)] +// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%Convert.type (%Convert.type.1) = import_ref Core//prelude/operators/as, inst+64, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -136,33 +138,37 @@ fn Test() { // CHECK:STDOUT: } // CHECK:STDOUT: %Sink_i32.decl: %Sink_i32.type = fn_decl @Sink_i32 [template = constants.%Sink_i32] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc25_16.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc25_16.2: type = converted %int.make_type_32, %.loc25_16.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Sink_X.decl: %Sink_X.type = fn_decl @Sink_X [template = constants.%Sink_X] { // CHECK:STDOUT: %x.patt: %X = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %X = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %x.param: %X = param x, runtime_param0 -// CHECK:STDOUT: %x: %X = bind_name x, %x.param +// CHECK:STDOUT: %param: %X = param runtime_param0 +// CHECK:STDOUT: %x: %X = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: %Source.decl: %Source.type = fn_decl @Source [template = constants.%Source] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc27_11.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc27_11.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc27_11.1, runtime_param [symbolic = %T.patt.loc27_11.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc27_11.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc27_11.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc27_24: type = name_ref T, %T.loc27_11.1 [symbolic = %T.loc27_11.2 (constants.%T)] // CHECK:STDOUT: %return: ref @Source.%T.loc27_11.2 (%T) = var +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc27_11.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc27_11.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -183,14 +189,15 @@ fn Test() { // CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %ImplicitAs.type { // CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] { // CHECK:STDOUT: %self.patt: i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: i32 = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_20.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc16_20.2: type = converted %int.make_type_32, %.loc16_20.1 [template = i32] -// CHECK:STDOUT: %self.param: i32 = param self, runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %return: ref %X = var +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %self: i32 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc15_32: = interface_witness (%Convert.decl) [template = constants.%.9] // CHECK:STDOUT: @@ -202,14 +209,15 @@ fn Test() { // CHECK:STDOUT: impl @impl.2: %X.ref as %ImplicitAs.type { // CHECK:STDOUT: %Convert.decl: %Convert.type.4 = fn_decl @Convert.3 [template = constants.%Convert.4] { // CHECK:STDOUT: %self.patt: %X = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %X = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %self.param: %X = param self, runtime_param0 -// CHECK:STDOUT: %self: %X = bind_name self, %self.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_28.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc20_28.2: type = converted %int.make_type_32, %.loc20_28.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: %X = param runtime_param0 +// CHECK:STDOUT: %self: %X = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc19_32: = interface_witness (%Convert.decl) [template = constants.%.13] // CHECK:STDOUT: @@ -237,10 +245,10 @@ fn Test() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[%self: i32]() -> %return: %X { +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: i32]() -> %return: %X { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: i32 = name_ref self, %self // CHECK:STDOUT: %.loc16_51.1: %.3 = struct_literal (%self.ref) @@ -251,7 +259,7 @@ fn Test() { // CHECK:STDOUT: return %.loc16_52 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.3[%self: %X]() -> i32 { +// CHECK:STDOUT: fn @Convert.3[%self.param_patt: %X]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %X = name_ref self, %self // CHECK:STDOUT: %n.ref: %.2 = name_ref n, @X.%.loc12_8 [template = @X.%.loc12_8] @@ -260,17 +268,18 @@ fn Test() { // CHECK:STDOUT: return %.loc20_45.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sink_i32(%n: i32); +// CHECK:STDOUT: fn @Sink_i32(%n.param_patt: i32); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sink_X(%x: %X); +// CHECK:STDOUT: fn @Sink_X(%x.param_patt: %X); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Source(%T.loc27_11.1: type) { // CHECK:STDOUT: %T.loc27_11.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc27_11.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc27_11.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc27_11.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc27_35.2: = specific_function constants.%Source, @Source(%T.loc27_11.2) [symbolic = %.loc27_35.2 (constants.%.14)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc27_11.1: type) -> @Source.%T.loc27_11.2 (%T) { +// CHECK:STDOUT: fn(%T.param_patt: type) -> @Source.%T.loc27_11.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Source.ref: %Source.type = name_ref Source, file.%Source.decl [template = constants.%Source] // CHECK:STDOUT: %T.ref.loc27_42: type = name_ref T, %T.loc27_11.1 [symbolic = %T.loc27_11.2 (constants.%T)] @@ -291,18 +300,18 @@ fn Test() { // CHECK:STDOUT: %.loc30_18.1: ref %X = temporary_storage // CHECK:STDOUT: %Source.call.loc30: init %X = call %.loc30_12() to %.loc30_18.1 // CHECK:STDOUT: %ImplicitAs.type.loc30: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %.loc30_11.1: %.11 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.12] -// CHECK:STDOUT: %Convert.ref.loc30: %.11 = name_ref Convert, %.loc30_11.1 [template = constants.%.12] -// CHECK:STDOUT: %.loc30_18.2: ref %X = temporary %.loc30_18.1, %Source.call.loc30 -// CHECK:STDOUT: %.loc30_11.2: %Convert.type.5 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.4] -// CHECK:STDOUT: %.loc30_11.3: = bound_method %.loc30_18.2, %.loc30_11.2 -// CHECK:STDOUT: %.loc30_18.3: %X = bind_value %.loc30_18.2 -// CHECK:STDOUT: %Convert.call.loc30: init i32 = call %.loc30_11.3(%.loc30_18.3) -// CHECK:STDOUT: %.loc30_11.4: init i32 = converted %Source.call.loc30, %Convert.call.loc30 -// CHECK:STDOUT: %.loc30_11.5: ref i32 = temporary_storage -// CHECK:STDOUT: %.loc30_11.6: ref i32 = temporary %.loc30_11.5, %.loc30_11.4 -// CHECK:STDOUT: %.loc30_11.7: %X = bind_value %.loc30_11.6 -// CHECK:STDOUT: %Sink_i32.call: init %.1 = call %Sink_i32.ref(%.loc30_11.7) +// CHECK:STDOUT: %.loc30_18.2: %.11 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.12] +// CHECK:STDOUT: %Convert.ref.loc30: %.11 = name_ref Convert, %.loc30_18.2 [template = constants.%.12] +// CHECK:STDOUT: %.loc30_18.3: ref %X = temporary %.loc30_18.1, %Source.call.loc30 +// CHECK:STDOUT: %.loc30_18.4: %Convert.type.5 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.4] +// CHECK:STDOUT: %.loc30_18.5: = bound_method %.loc30_18.3, %.loc30_18.4 +// CHECK:STDOUT: %.loc30_18.6: %X = bind_value %.loc30_18.3 +// CHECK:STDOUT: %Convert.call.loc30: init i32 = call %.loc30_18.5(%.loc30_18.6) +// CHECK:STDOUT: %.loc30_18.7: init i32 = converted %Source.call.loc30, %Convert.call.loc30 +// CHECK:STDOUT: %.loc30_18.8: ref i32 = temporary_storage +// CHECK:STDOUT: %.loc30_18.9: ref i32 = temporary %.loc30_18.8, %.loc30_18.7 +// CHECK:STDOUT: %.loc30_18.10: %X = bind_value %.loc30_18.9 +// CHECK:STDOUT: %Sink_i32.call: init %.1 = call %Sink_i32.ref(%.loc30_18.10) // CHECK:STDOUT: %Sink_X.ref: %Sink_X.type = name_ref Sink_X, file.%Sink_X.decl [template = constants.%Sink_X] // CHECK:STDOUT: %Source.ref.loc31: %Source.type = name_ref Source, file.%Source.decl [template = constants.%Source] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -311,32 +320,35 @@ fn Test() { // CHECK:STDOUT: %.loc31_10: = specific_function %Source.ref.loc31, @Source(i32) [template = constants.%.17] // CHECK:STDOUT: %Source.call.loc31: init i32 = call %.loc31_10() // CHECK:STDOUT: %ImplicitAs.type.loc31: type = interface_type @ImplicitAs, @ImplicitAs(constants.%X) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc31_9.1: %.7 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%X) [template = constants.%.8] -// CHECK:STDOUT: %Convert.ref.loc31: %.7 = name_ref Convert, %.loc31_9.1 [template = constants.%.8] -// CHECK:STDOUT: %.loc31_16.3: ref i32 = temporary_storage -// CHECK:STDOUT: %.loc31_16.4: ref i32 = temporary %.loc31_16.3, %Source.call.loc31 -// CHECK:STDOUT: %.loc31_9.2: %Convert.type.3 = interface_witness_access constants.%.9, element0 [template = constants.%Convert.2] -// CHECK:STDOUT: %.loc31_9.3: = bound_method %.loc31_16.4, %.loc31_9.2 -// CHECK:STDOUT: %.loc31_9.4: ref %X = temporary_storage -// CHECK:STDOUT: %.loc31_16.5: i32 = bind_value %.loc31_16.4 -// CHECK:STDOUT: %Convert.call.loc31: init %X = call %.loc31_9.3(%.loc31_16.5) to %.loc31_9.4 -// CHECK:STDOUT: %.loc31_9.5: init %X = converted %Source.call.loc31, %Convert.call.loc31 -// CHECK:STDOUT: %.loc31_9.6: ref %X = temporary %.loc31_9.4, %.loc31_9.5 -// CHECK:STDOUT: %.loc31_9.7: i32 = bind_value %.loc31_9.6 -// CHECK:STDOUT: %Sink_X.call: init %.1 = call %Sink_X.ref(%.loc31_9.7) +// CHECK:STDOUT: %.loc31_16.3: %.7 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%X) [template = constants.%.8] +// CHECK:STDOUT: %Convert.ref.loc31: %.7 = name_ref Convert, %.loc31_16.3 [template = constants.%.8] +// CHECK:STDOUT: %.loc31_16.4: ref i32 = temporary_storage +// CHECK:STDOUT: %.loc31_16.5: ref i32 = temporary %.loc31_16.4, %Source.call.loc31 +// CHECK:STDOUT: %.loc31_16.6: %Convert.type.3 = interface_witness_access constants.%.9, element0 [template = constants.%Convert.2] +// CHECK:STDOUT: %.loc31_16.7: = bound_method %.loc31_16.5, %.loc31_16.6 +// CHECK:STDOUT: %.loc31_16.8: ref %X = temporary_storage +// CHECK:STDOUT: %.loc31_16.9: i32 = bind_value %.loc31_16.5 +// CHECK:STDOUT: %Convert.call.loc31: init %X = call %.loc31_16.7(%.loc31_16.9) to %.loc31_16.8 +// CHECK:STDOUT: %.loc31_16.10: init %X = converted %Source.call.loc31, %Convert.call.loc31 +// CHECK:STDOUT: %.loc31_16.11: ref %X = temporary %.loc31_16.8, %.loc31_16.10 +// CHECK:STDOUT: %.loc31_16.12: i32 = bind_value %.loc31_16.11 +// CHECK:STDOUT: %Sink_X.call: init %.1 = call %Sink_X.ref(%.loc31_16.12) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { @@ -347,6 +359,7 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%X) { // CHECK:STDOUT: %Dest => constants.%X +// CHECK:STDOUT: %Dest.patt => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -365,6 +378,7 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 @@ -383,6 +397,7 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Source(constants.%T) { // CHECK:STDOUT: %T.loc27_11.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc27_35.2 => constants.%.14 @@ -390,10 +405,12 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Source(@Source.%T.loc27_11.2) { // CHECK:STDOUT: %T.loc27_11.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Source(constants.%X) { // CHECK:STDOUT: %T.loc27_11.2 => constants.%X +// CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc27_35.2 => constants.%.15 @@ -401,6 +418,7 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Source(i32) { // CHECK:STDOUT: %T.loc27_11.2 => i32 +// CHECK:STDOUT: %T.patt.loc27_11.2 => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %.loc27_35.2 => constants.%.17 diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 280d41d31443..90a153efd317 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -59,11 +59,11 @@ fn TestOp() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+56, loaded [template = constants.%Inc.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+58, unloaded -// CHECK:STDOUT: %import_ref.3: %.8 = import_ref Core//prelude/operators/arithmetic, inst+75, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+69, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+69, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+60, loaded [template = constants.%Inc.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+62, unloaded +// CHECK:STDOUT: %import_ref.3: %.8 = import_ref Core//prelude/operators/arithmetic, inst+80, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+74, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -92,12 +92,13 @@ fn TestOp() { // CHECK:STDOUT: impl @impl: %C.ref as %Inc.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.3 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc18_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc18_21: type = ptr_type %C [template = constants.%.3] -// CHECK:STDOUT: %self.param: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.3 = bind_name self, %self.param -// CHECK:STDOUT: %.loc18_9: %.3 = addr_pattern %self +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %self: %.3 = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.6] // CHECK:STDOUT: @@ -113,13 +114,13 @@ fn TestOp() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr %self: %.3](); +// CHECK:STDOUT: fn @Op.1[addr %self.param_patt: %.3](); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.2(constants.%Self: %Inc.type) { // CHECK:STDOUT: %Self: %Inc.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.2: type = ptr_type @Op.2.%Self (%Self) [symbolic = %.2 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.2.%.2 (%.5)](); +// CHECK:STDOUT: fn[addr .inst+38: @Op.2.%.2 (%.5)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp() { diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index 2d9fb529ad06..cb4b4a4cf7e8 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -79,16 +79,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+185, loaded [template = constants.%LeftShift.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+187, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/bitwise, inst+210, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+205, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+212, loaded [template = constants.%LeftShiftAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+214, unloaded -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/bitwise, inst+237, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+231, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+205, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+231, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+198, loaded [template = constants.%LeftShift.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+200, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/bitwise, inst+225, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+220, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+227, loaded [template = constants.%LeftShiftAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+229, unloaded +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/bitwise, inst+254, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+248, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+220, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+248, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -112,28 +112,32 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc26_11: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc26_11 +// CHECK:STDOUT: %param.loc26_17: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc26_17 // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %a.patt: %.6 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.6 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %a.param: %.6 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.6 = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param.loc30_15: %.6 = param runtime_param0 +// CHECK:STDOUT: %a: %.6 = bind_name a, %param.loc30_15 +// CHECK:STDOUT: %param.loc30_22: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc30_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,16 +158,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.1: %C.ref as %LeftShift.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc18_9: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc18_9 +// CHECK:STDOUT: %param.loc18_18: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc18_18 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -175,16 +181,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.2: %C.ref as %LeftShiftAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.6 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.6 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %self.param: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.6 = bind_name self, %self.param -// CHECK:STDOUT: %.loc23_9: %.6 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc23_14: %.6 = param runtime_param0 +// CHECK:STDOUT: %self: %.6 = bind_name self, %param.loc23_14 +// CHECK:STDOUT: %param.loc23_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc23_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -200,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -211,10 +219,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %LeftShift.type) { // CHECK:STDOUT: %Self: %LeftShift.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.1)](%other.param_patt: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.6](%other: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.6](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -223,10 +231,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Self: %LeftShiftAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+90: @Op.4.%.2 (%.7)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C, %b.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -238,7 +246,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.6, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %.6, %b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.6 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index b7e3895e65ae..6d4ae6b1e2d7 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -79,16 +79,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+281, loaded [template = constants.%Mod.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+283, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+306, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+301, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+308, loaded [template = constants.%ModAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+310, unloaded -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/arithmetic, inst+333, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+327, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+301, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+327, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+300, loaded [template = constants.%Mod.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+302, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+327, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+322, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+329, loaded [template = constants.%ModAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+331, unloaded +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/arithmetic, inst+356, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+350, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+322, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+350, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -112,28 +112,32 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc26_11: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc26_11 +// CHECK:STDOUT: %param.loc26_17: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc26_17 // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %a.patt: %.6 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.6 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %a.param: %.6 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.6 = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param.loc30_15: %.6 = param runtime_param0 +// CHECK:STDOUT: %a: %.6 = bind_name a, %param.loc30_15 +// CHECK:STDOUT: %param.loc30_22: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc30_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,16 +158,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.1: %C.ref as %Mod.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc18_9: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc18_9 +// CHECK:STDOUT: %param.loc18_18: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc18_18 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -175,16 +181,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.2: %C.ref as %ModAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.6 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.6 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %self.param: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.6 = bind_name self, %self.param -// CHECK:STDOUT: %.loc23_9: %.6 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc23_14: %.6 = param runtime_param0 +// CHECK:STDOUT: %self: %.6 = bind_name self, %param.loc23_14 +// CHECK:STDOUT: %param.loc23_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc23_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -200,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -211,10 +219,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %Mod.type) { // CHECK:STDOUT: %Self: %Mod.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.1)](%other.param_patt: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.6](%other: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.6](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -223,10 +231,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Self: %ModAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+90: @Op.4.%.2 (%.7)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C, %b.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -238,7 +246,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.6, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %.6, %b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.6 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index f12fa19660c5..99ac8e3e8562 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -79,16 +79,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+173, loaded [template = constants.%Mul.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+175, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+198, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+193, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+200, loaded [template = constants.%MulAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+202, unloaded -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/arithmetic, inst+225, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+219, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+193, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+219, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+184, loaded [template = constants.%Mul.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+186, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+211, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+206, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+213, loaded [template = constants.%MulAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+215, unloaded +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/arithmetic, inst+240, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+234, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+206, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+234, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -112,28 +112,32 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc26_11: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc26_11 +// CHECK:STDOUT: %param.loc26_17: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc26_17 // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %a.patt: %.6 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.6 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %a.param: %.6 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.6 = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param.loc30_15: %.6 = param runtime_param0 +// CHECK:STDOUT: %a: %.6 = bind_name a, %param.loc30_15 +// CHECK:STDOUT: %param.loc30_22: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc30_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,16 +158,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.1: %C.ref as %Mul.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc18_9: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc18_9 +// CHECK:STDOUT: %param.loc18_18: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc18_18 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -175,16 +181,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.2: %C.ref as %MulAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.6 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.6 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %self.param: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.6 = bind_name self, %self.param -// CHECK:STDOUT: %.loc23_9: %.6 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc23_14: %.6 = param runtime_param0 +// CHECK:STDOUT: %self: %.6 = bind_name self, %param.loc23_14 +// CHECK:STDOUT: %param.loc23_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc23_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -200,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -211,10 +219,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %Mul.type) { // CHECK:STDOUT: %Self: %Mul.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.1)](%other.param_patt: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.6](%other: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.6](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -223,10 +231,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Self: %MulAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+90: @Op.4.%.2 (%.7)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C, %b.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -238,7 +246,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.6, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %.6, %b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.6 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index ff7f7a27e2b9..b02834fd4e11 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -58,11 +58,11 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+77, loaded [template = constants.%Negate.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+79, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/arithmetic, inst+96, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+91, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+91, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+82, loaded [template = constants.%Negate.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+84, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/arithmetic, inst+102, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+97, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+97, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -80,12 +80,13 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -99,12 +100,13 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: impl @impl: %C.ref as %Negate.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -120,7 +122,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C]() -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C]() -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -131,10 +133,10 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: generic fn @Op.2(constants.%Self: %Negate.type) { // CHECK:STDOUT: %Self: %Negate.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self)]() -> @Op.2.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self)]() -> @Op.2.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %Op.ref: %.6 = name_ref Op, imports.%import_ref.3 [template = constants.%.7] diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index 7a4c3d900eae..f903fb06bb42 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -134,21 +134,21 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+58, loaded [template = constants.%Ordered.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+60, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+83, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+106, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5: %.10 = import_ref Core//prelude/operators/comparison, inst+129, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.6: %.12 = import_ref Core//prelude/operators/comparison, inst+152, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.7: %Less.type.2 = import_ref Core//prelude/operators/comparison, inst+78, loaded [template = constants.%Less.2] -// CHECK:STDOUT: %import_ref.8: %LessOrEquivalent.type.2 = import_ref Core//prelude/operators/comparison, inst+101, loaded [template = constants.%LessOrEquivalent.2] -// CHECK:STDOUT: %import_ref.9: %Greater.type.2 = import_ref Core//prelude/operators/comparison, inst+124, loaded [template = constants.%Greater.2] -// CHECK:STDOUT: %import_ref.10: %GreaterOrEquivalent.type.2 = import_ref Core//prelude/operators/comparison, inst+147, loaded [template = constants.%GreaterOrEquivalent.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+62, loaded [template = constants.%Ordered.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+64, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+89, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+114, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.5: %.10 = import_ref Core//prelude/operators/comparison, inst+139, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.6: %.12 = import_ref Core//prelude/operators/comparison, inst+164, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %Less.type.2 = import_ref Core//prelude/operators/comparison, inst+84, loaded [template = constants.%Less.2] +// CHECK:STDOUT: %import_ref.8: %LessOrEquivalent.type.2 = import_ref Core//prelude/operators/comparison, inst+109, loaded [template = constants.%LessOrEquivalent.2] +// CHECK:STDOUT: %import_ref.9: %Greater.type.2 = import_ref Core//prelude/operators/comparison, inst+134, loaded [template = constants.%Greater.2] +// CHECK:STDOUT: %import_ref.10: %GreaterOrEquivalent.type.2 = import_ref Core//prelude/operators/comparison, inst+159, loaded [template = constants.%GreaterOrEquivalent.2] // CHECK:STDOUT: %import_ref.11: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/comparison, inst+78, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/comparison, inst+101, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/comparison, inst+124, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+147, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/comparison, inst+84, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/comparison, inst+109, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/comparison, inst+134, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+159, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -169,63 +169,71 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [template = constants.%TestLess] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc13_16: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc13_22: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc13_28.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc13_28.2: type = converted %bool.make_type, %.loc13_28.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc13_13: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc13_13 +// CHECK:STDOUT: %param.loc13_19: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc13_19 // CHECK:STDOUT: } // CHECK:STDOUT: %TestLessEqual.decl: %TestLessEqual.type = fn_decl @TestLessEqual [template = constants.%TestLessEqual] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc17_21: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc17_27: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc17_33.2: type = converted %bool.make_type, %.loc17_33.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc17_18: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc17_18 +// CHECK:STDOUT: %param.loc17_24: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc17_24 // CHECK:STDOUT: } // CHECK:STDOUT: %TestGreater.decl: %TestGreater.type = fn_decl @TestGreater [template = constants.%TestGreater] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc21_19: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc21_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc21_31.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc21_31.2: type = converted %bool.make_type, %.loc21_31.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc21_16: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc21_16 +// CHECK:STDOUT: %param.loc21_22: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc21_22 // CHECK:STDOUT: } // CHECK:STDOUT: %TestGreaterEqual.decl: %TestGreaterEqual.type = fn_decl @TestGreaterEqual [template = constants.%TestGreaterEqual] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc25_24: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc25_30: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc25_36.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc25_36.2: type = converted %bool.make_type, %.loc25_36.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc25_21: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc25_21 +// CHECK:STDOUT: %param.loc25_27: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc25_27 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -242,63 +250,71 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: impl @impl: %C.ref as %Ordered.ref { // CHECK:STDOUT: %Less.decl: %Less.type.1 = fn_decl @Less.1 [template = constants.%Less.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc7_17: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc7_27: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc7_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc7_33.2: type = converted %bool.make_type, %.loc7_33.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc7_11: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc7_11 +// CHECK:STDOUT: %param.loc7_20: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc7_20 // CHECK:STDOUT: } // CHECK:STDOUT: %LessOrEquivalent.decl: %LessOrEquivalent.type.1 = fn_decl @LessOrEquivalent.1 [template = constants.%LessOrEquivalent.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc8_39: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc8_45.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc8_45.2: type = converted %bool.make_type, %.loc8_45.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc8_23: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc8_23 +// CHECK:STDOUT: %param.loc8_32: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc8_32 // CHECK:STDOUT: } // CHECK:STDOUT: %Greater.decl: %Greater.type.1 = fn_decl @Greater.1 [template = constants.%Greater.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc9_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc9_30: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc9_36.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc9_36.2: type = converted %bool.make_type, %.loc9_36.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc9_14: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc9_14 +// CHECK:STDOUT: %param.loc9_23: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc9_23 // CHECK:STDOUT: } // CHECK:STDOUT: %GreaterOrEquivalent.decl: %GreaterOrEquivalent.type.1 = fn_decl @GreaterOrEquivalent.1 [template = constants.%GreaterOrEquivalent.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc10_32: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc10_42: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc10_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc10_48.2: type = converted %bool.make_type, %.loc10_48.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc10_26: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc10_26 +// CHECK:STDOUT: %param.loc10_35: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc10_35 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc6: = interface_witness (%Less.decl, %LessOrEquivalent.decl, %Greater.decl, %GreaterOrEquivalent.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -319,39 +335,39 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Less.1[%self: %C](%other: %C) -> bool; +// CHECK:STDOUT: fn @Less.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @LessOrEquivalent.1[%self: %C](%other: %C) -> bool; +// CHECK:STDOUT: fn @LessOrEquivalent.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Greater.1[%self: %C](%other: %C) -> bool; +// CHECK:STDOUT: fn @Greater.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GreaterOrEquivalent.1[%self: %C](%other: %C) -> bool; +// CHECK:STDOUT: fn @GreaterOrEquivalent.1[%self.param_patt: %C](%other.param_patt: %C) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Less.2(constants.%Self: %Ordered.type) { // CHECK:STDOUT: %Self: %Ordered.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Less.2.%Self (%Self)](%other: @Less.2.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @Less.2.%Self (%Self)](%other.param_patt: @Less.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @LessOrEquivalent.2(constants.%Self: %Ordered.type) { // CHECK:STDOUT: %Self: %Ordered.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @LessOrEquivalent.2.%Self (%Self)](%other: @LessOrEquivalent.2.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @LessOrEquivalent.2.%Self (%Self)](%other.param_patt: @LessOrEquivalent.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Greater.2(constants.%Self: %Ordered.type) { // CHECK:STDOUT: %Self: %Ordered.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Greater.2.%Self (%Self)](%other: @Greater.2.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @Greater.2.%Self (%Self)](%other.param_patt: @Greater.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @GreaterOrEquivalent.2(constants.%Self: %Ordered.type) { // CHECK:STDOUT: %Self: %Ordered.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @GreaterOrEquivalent.2.%Self (%Self)](%other: @GreaterOrEquivalent.2.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @GreaterOrEquivalent.2.%Self (%Self)](%other.param_patt: @GreaterOrEquivalent.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestLess(%a: %C, %b: %C) -> bool { +// CHECK:STDOUT: fn @TestLess(%a.param_patt: %C, %b.param_patt: %C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -364,7 +380,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: return %.loc14_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestLessEqual(%a: %C, %b: %C) -> bool { +// CHECK:STDOUT: fn @TestLessEqual(%a.param_patt: %C, %b.param_patt: %C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -377,7 +393,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: return %.loc18_16.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestGreater(%a: %C, %b: %C) -> bool { +// CHECK:STDOUT: fn @TestGreater(%a.param_patt: %C, %b.param_patt: %C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -390,7 +406,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: return %.loc22_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestGreaterEqual(%a: %C, %b: %C) -> bool { +// CHECK:STDOUT: fn @TestGreaterEqual(%a.param_patt: %C, %b.param_patt: %C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -487,20 +503,20 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+58, loaded [template = constants.%Ordered.type] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+60, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/comparison, inst+83, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5: %.7 = import_ref Core//prelude/operators/comparison, inst+106, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.6: %.9 = import_ref Core//prelude/operators/comparison, inst+129, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/comparison, inst+152, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+78, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+101, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/comparison, inst+124, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/comparison, inst+147, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/comparison, inst+78, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/comparison, inst+101, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/comparison, inst+124, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+147, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+62, loaded [template = constants.%Ordered.type] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+64, unloaded +// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/comparison, inst+89, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: %.7 = import_ref Core//prelude/operators/comparison, inst+114, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.6: %.9 = import_ref Core//prelude/operators/comparison, inst+139, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/comparison, inst+164, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+84, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+109, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/comparison, inst+134, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/comparison, inst+159, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/comparison, inst+84, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/comparison, inst+109, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/comparison, inst+134, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+159, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -516,63 +532,71 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [template = constants.%TestLess] { // CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %D = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %D = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %D = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc6_16: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %a.param: %D = param a, runtime_param0 -// CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %D.ref.loc6_22: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %b.param: %D = param b, runtime_param1 -// CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc6_28.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc6_28.2: type = converted %bool.make_type, %.loc6_28.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc6_13: %D = param runtime_param0 +// CHECK:STDOUT: %a: %D = bind_name a, %param.loc6_13 +// CHECK:STDOUT: %param.loc6_19: %D = param runtime_param1 +// CHECK:STDOUT: %b: %D = bind_name b, %param.loc6_19 // CHECK:STDOUT: } // CHECK:STDOUT: %TestLessEqual.decl: %TestLessEqual.type = fn_decl @TestLessEqual [template = constants.%TestLessEqual] { // CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %D = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %D = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %D = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc14_21: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %a.param: %D = param a, runtime_param0 -// CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %D.ref.loc14_27: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %b.param: %D = param b, runtime_param1 -// CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc14_33.2: type = converted %bool.make_type, %.loc14_33.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc14_18: %D = param runtime_param0 +// CHECK:STDOUT: %a: %D = bind_name a, %param.loc14_18 +// CHECK:STDOUT: %param.loc14_24: %D = param runtime_param1 +// CHECK:STDOUT: %b: %D = bind_name b, %param.loc14_24 // CHECK:STDOUT: } // CHECK:STDOUT: %TestGreater.decl: %TestGreater.type = fn_decl @TestGreater [template = constants.%TestGreater] { // CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %D = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %D = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %D = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc22_19: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %a.param: %D = param a, runtime_param0 -// CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %D.ref.loc22_25: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %b.param: %D = param b, runtime_param1 -// CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc22_31.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc22_31.2: type = converted %bool.make_type, %.loc22_31.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc22_16: %D = param runtime_param0 +// CHECK:STDOUT: %a: %D = bind_name a, %param.loc22_16 +// CHECK:STDOUT: %param.loc22_22: %D = param runtime_param1 +// CHECK:STDOUT: %b: %D = bind_name b, %param.loc22_22 // CHECK:STDOUT: } // CHECK:STDOUT: %TestGreaterEqual.decl: %TestGreaterEqual.type = fn_decl @TestGreaterEqual [template = constants.%TestGreaterEqual] { // CHECK:STDOUT: %a.patt: %D = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %D = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %D = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %D = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref.loc30_24: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %a.param: %D = param a, runtime_param0 -// CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %D.ref.loc30_30: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %b.param: %D = param b, runtime_param1 -// CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc30_36.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc30_36.2: type = converted %bool.make_type, %.loc30_36.1 [template = bool] // CHECK:STDOUT: %return: ref bool = var +// CHECK:STDOUT: %param.loc30_21: %D = param runtime_param0 +// CHECK:STDOUT: %a: %D = bind_name a, %param.loc30_21 +// CHECK:STDOUT: %param.loc30_27: %D = param runtime_param1 +// CHECK:STDOUT: %b: %D = bind_name b, %param.loc30_27 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -595,7 +619,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestLess(%a: %D, %b: %D) -> bool { +// CHECK:STDOUT: fn @TestLess(%a.param_patt: %D, %b.param_patt: %D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b @@ -606,10 +630,10 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: generic fn @Less(constants.%Self: %Ordered.type) { // CHECK:STDOUT: %Self: %Ordered.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Less.%Self (%Self)](%other: @Less.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @Less.%Self (%Self)](%other.param_patt: @Less.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestLessEqual(%a: %D, %b: %D) -> bool { +// CHECK:STDOUT: fn @TestLessEqual(%a.param_patt: %D, %b.param_patt: %D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b @@ -620,10 +644,10 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: generic fn @LessOrEquivalent(constants.%Self: %Ordered.type) { // CHECK:STDOUT: %Self: %Ordered.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @LessOrEquivalent.%Self (%Self)](%other: @LessOrEquivalent.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @LessOrEquivalent.%Self (%Self)](%other.param_patt: @LessOrEquivalent.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestGreater(%a: %D, %b: %D) -> bool { +// CHECK:STDOUT: fn @TestGreater(%a.param_patt: %D, %b.param_patt: %D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b @@ -634,10 +658,10 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: generic fn @Greater(constants.%Self: %Ordered.type) { // CHECK:STDOUT: %Self: %Ordered.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Greater.%Self (%Self)](%other: @Greater.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @Greater.%Self (%Self)](%other.param_patt: @Greater.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestGreaterEqual(%a: %D, %b: %D) -> bool { +// CHECK:STDOUT: fn @TestGreaterEqual(%a.param_patt: %D, %b.param_patt: %D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b @@ -648,7 +672,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: generic fn @GreaterOrEquivalent(constants.%Self: %Ordered.type) { // CHECK:STDOUT: %Self: %Ordered.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @GreaterOrEquivalent.%Self (%Self)](%other: @GreaterOrEquivalent.%Self (%Self)) -> bool; +// CHECK:STDOUT: fn[%self.param_patt: @GreaterOrEquivalent.%Self (%Self)](%other.param_patt: @GreaterOrEquivalent.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Less(constants.%Self) { diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index c6dec11cf002..df77c46115a7 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -79,16 +79,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+239, loaded [template = constants.%RightShift.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+241, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/bitwise, inst+264, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+259, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+266, loaded [template = constants.%RightShiftAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+268, unloaded -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/bitwise, inst+291, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+285, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+259, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+285, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+256, loaded [template = constants.%RightShift.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+258, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/bitwise, inst+283, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+278, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+285, loaded [template = constants.%RightShiftAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+287, unloaded +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/bitwise, inst+312, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+306, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+278, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+306, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -112,28 +112,32 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc26_11: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc26_11 +// CHECK:STDOUT: %param.loc26_17: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc26_17 // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %a.patt: %.6 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.6 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %a.param: %.6 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.6 = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param.loc30_15: %.6 = param runtime_param0 +// CHECK:STDOUT: %a: %.6 = bind_name a, %param.loc30_15 +// CHECK:STDOUT: %param.loc30_22: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc30_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,16 +158,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.1: %C.ref as %RightShift.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc18_9: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc18_9 +// CHECK:STDOUT: %param.loc18_18: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc18_18 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -175,16 +181,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.2: %C.ref as %RightShiftAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.6 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.6 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %self.param: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.6 = bind_name self, %self.param -// CHECK:STDOUT: %.loc23_9: %.6 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc23_14: %.6 = param runtime_param0 +// CHECK:STDOUT: %self: %.6 = bind_name self, %param.loc23_14 +// CHECK:STDOUT: %param.loc23_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc23_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -200,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -211,10 +219,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %RightShift.type) { // CHECK:STDOUT: %Self: %RightShift.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.1)](%other.param_patt: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.6](%other: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.6](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -223,10 +231,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Self: %RightShiftAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+90: @Op.4.%.2 (%.7)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C, %b.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -238,7 +246,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.6, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %.6, %b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.6 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 0fb92a20f28e..4baf0c58d972 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -79,16 +79,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+98, loaded [template = constants.%Sub.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+100, unloaded -// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+123, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+118, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+125, loaded [template = constants.%SubAssign.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+127, unloaded -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/arithmetic, inst+150, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+144, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+118, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+144, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+104, loaded [template = constants.%Sub.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+106, unloaded +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+131, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+126, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+133, loaded [template = constants.%SubAssign.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+135, unloaded +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/arithmetic, inst+160, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+154, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+126, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+154, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -112,28 +112,32 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %C = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %a.param: %C = param a, runtime_param0 -// CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc26_11: %C = param runtime_param0 +// CHECK:STDOUT: %a: %C = bind_name a, %param.loc26_11 +// CHECK:STDOUT: %param.loc26_17: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc26_17 // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %a.patt: %.6 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %.6 = param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %C = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %C = param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %a.param: %.6 = param a, runtime_param0 -// CHECK:STDOUT: %a: %.6 = bind_name a, %a.param // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %b.param: %C = param b, runtime_param1 -// CHECK:STDOUT: %b: %C = bind_name b, %b.param +// CHECK:STDOUT: %param.loc30_15: %.6 = param runtime_param0 +// CHECK:STDOUT: %a: %.6 = bind_name a, %param.loc30_15 +// CHECK:STDOUT: %param.loc30_22: %C = param runtime_param1 +// CHECK:STDOUT: %b: %C = bind_name b, %param.loc30_22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,16 +158,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.1: %C.ref as %Sub.ref { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return: ref %C = var +// CHECK:STDOUT: %param.loc18_9: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param.loc18_9 +// CHECK:STDOUT: %param.loc18_18: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc18_18 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] // CHECK:STDOUT: @@ -175,16 +181,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl @impl.2: %C.ref as %SubAssign.ref { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %.6 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.6 = param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %C = param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %self.param: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self: %.6 = bind_name self, %self.param -// CHECK:STDOUT: %.loc23_9: %.6 = addr_pattern %self // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %other.param: %C = param other, runtime_param1 -// CHECK:STDOUT: %other: %C = bind_name other, %other.param +// CHECK:STDOUT: %param.loc23_14: %.6 = param runtime_param0 +// CHECK:STDOUT: %self: %.6 = bind_name self, %param.loc23_14 +// CHECK:STDOUT: %param.loc23_24: %C = param runtime_param1 +// CHECK:STDOUT: %other: %C = bind_name other, %param.loc23_24 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: @@ -200,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self: %C](%other: %C) -> %return: %C { +// CHECK:STDOUT: fn @Op.1[%self.param_patt: %C](%other.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc19_13.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%struct] @@ -211,10 +219,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %Sub.type) { // CHECK:STDOUT: %Self: %Sub.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self.1)](%other.param_patt: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr %self: %.6](%other: %C) { +// CHECK:STDOUT: fn @Op.3[addr %self.param_patt: %.6](%other.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -223,10 +231,10 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Self: %SubAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr .inst+90: @Op.4.%.2 (%.7)](%other.param_patt: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { +// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C, %b.param_patt: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -238,7 +246,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.6, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a.param_patt: %.6, %b.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.6 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon index e01bf31ee0ba..ed2abc1feac1 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -257,15 +257,16 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %x.patt: %.1 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %.1 = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc4_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_10.2: type = converted %.loc4_10.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.param: %.1 = param x, runtime_param0 -// CHECK:STDOUT: %x: %.1 = bind_name x, %x.param +// CHECK:STDOUT: %param: %.1 = param runtime_param0 +// CHECK:STDOUT: %x: %.1 = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%x: %.1) { +// CHECK:STDOUT: fn @F(%x.param_patt: %.1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -450,7 +451,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: import Other//other_fn_conflict // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//other_fn, inst+1, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//other_fn_conflict, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Other//other_fn_conflict, inst+8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon index e51b037138a4..513222e0bfbc 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon @@ -32,10 +32,12 @@ export C2(T:! type); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C1.type: type = generic_class_type @C1 [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C1.1: %C1.type = struct_value () [template] // CHECK:STDOUT: %C1.2: type = class_type @C1, @C1(%T) [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C2.type: type = generic_class_type @C2 [template] // CHECK:STDOUT: %C2.1: %C2.type = struct_value () [template] // CHECK:STDOUT: %C2.2: type = class_type @C2, @C2(%T) [symbolic] @@ -47,37 +49,43 @@ export C2(T:! type); // CHECK:STDOUT: .C2 = %C2.decl // CHECK:STDOUT: } // CHECK:STDOUT: %C1.decl: %C1.type = class_decl @C1 [template = constants.%C1.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc4_10.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_10.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_10.1, runtime_param [symbolic = %T.patt.loc4_10.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_10.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_10.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc4_10.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_10.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %C2.decl: %C2.type = class_decl @C2 [template = constants.%C2.1] { -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc5_10.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_10.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc5_10.1, runtime_param [symbolic = %T.patt.loc5_10.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T.loc5_10.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc5_10.2 (constants.%T)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T.loc5_10.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc5_10.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C1(%T.loc4_10.1: type) { // CHECK:STDOUT: %T.loc4_10.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_10.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_10.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_10.2 (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C2(%T.loc5_10.1: type) { // CHECK:STDOUT: %T.loc5_10.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_10.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc5_10.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_10.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C1(constants.%T) { // CHECK:STDOUT: %T.loc4_10.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_10.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C2(constants.%T) { // CHECK:STDOUT: %T.loc5_10.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc5_10.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_b.carbon @@ -88,14 +96,16 @@ export C2(T:! type); // CHECK:STDOUT: %C1.1: %C1.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %C1.2: type = class_type @C1, @C1(%T) [symbolic] +// CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C2.type: type = generic_class_type @C2 [template] // CHECK:STDOUT: %C2.1: %C2.type = struct_value () [template] // CHECK:STDOUT: %C2.2: type = class_type @C2, @C2(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %C1.type = import_ref Foo//a, inst+5, loaded [template = constants.%C1.1] -// CHECK:STDOUT: %import_ref.2: %C2.type = import_ref Foo//a, inst+14, loaded [template = constants.%C2.1] +// CHECK:STDOUT: %import_ref.1: %C1.type = import_ref Foo//a, inst+7, loaded [template = constants.%C1.1] +// CHECK:STDOUT: %import_ref.2: %C2.type = import_ref Foo//a, inst+19, loaded [template = constants.%C2.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -105,28 +115,32 @@ export C2(T:! type); // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %C1: %C1.type = export C1, imports.%import_ref.1 [template = constants.%C1.1] -// CHECK:STDOUT: %T.param: type = param T, runtime_param -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %param [symbolic = constants.%T] // CHECK:STDOUT: %C2: %C2.type = export C2, imports.%import_ref.2 [template = constants.%C2.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C1(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C2(constants.%T: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C1(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C2(constants.%T) { // CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/arrow.carbon b/toolchain/check/testdata/pointer/arrow.carbon index 365221109afb..8f9c24f2e820 100644 --- a/toolchain/check/testdata/pointer/arrow.carbon +++ b/toolchain/check/testdata/pointer/arrow.carbon @@ -62,21 +62,23 @@ fn Foo(ptr: C*) { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %ptr.patt: %.2 = binding_pattern ptr +// CHECK:STDOUT: %ptr.param_patt: %.2 = param_pattern %ptr.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc16: type = ptr_type %C [template = constants.%.2] -// CHECK:STDOUT: %ptr.param: %.2 = param ptr, runtime_param0 -// CHECK:STDOUT: %ptr: %.2 = bind_name ptr, %ptr.param +// CHECK:STDOUT: %param: %.2 = param runtime_param0 +// CHECK:STDOUT: %ptr: %.2 = bind_name ptr, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %Member.decl: %Member.type = fn_decl @Member [template = constants.%Member] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %self.param: %C = param self, runtime_param0 -// CHECK:STDOUT: %self: %C = bind_name self, %self.param +// CHECK:STDOUT: %param: %C = param runtime_param0 +// CHECK:STDOUT: %self: %C = bind_name self, %param // CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc13_15: type = ptr_type %C [template = constants.%.2] @@ -89,9 +91,9 @@ fn Foo(ptr: C*) { // CHECK:STDOUT: .field = %.loc13_12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Member[%self: %C](); +// CHECK:STDOUT: fn @Member[%self.param_patt: %C](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%ptr: %.2) { +// CHECK:STDOUT: fn @Foo(%ptr.param_patt: %.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ptr.ref.loc17: %.2 = name_ref ptr, %ptr // CHECK:STDOUT: %.loc17_4.1: ref %C = deref %ptr.ref.loc17 diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index 889f208c4df6..ec3fe34d19b2 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -191,12 +191,13 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: %AddressOfTupleElementValue.decl: %AddressOfTupleElementValue.type = fn_decl @AddressOfTupleElementValue [template = constants.%AddressOfTupleElementValue] {} {} // CHECK:STDOUT: %AddressOfParam.decl: %AddressOfParam.type = fn_decl @AddressOfParam [template = constants.%AddressOfParam] { // CHECK:STDOUT: %param.patt: i32 = binding_pattern param +// CHECK:STDOUT: %param.param_patt: i32 = param_pattern %param.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc95: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc95_26.1: type = value_of_initializer %int.make_type_32.loc95 [template = i32] // CHECK:STDOUT: %.loc95_26.2: type = converted %int.make_type_32.loc95, %.loc95_26.1 [template = i32] -// CHECK:STDOUT: %param.param: i32 = param param, runtime_param0 -// CHECK:STDOUT: %param: i32 = bind_name param, %param.param +// CHECK:STDOUT: %param.loc95_19.1: i32 = param runtime_param0 +// CHECK:STDOUT: %param.loc95_19.2: i32 = bind_name param, %param.loc95_19.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -285,7 +286,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddressOfParam(%param: i32) { +// CHECK:STDOUT: fn @AddressOfParam(%param.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc99: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc99_22.1: type = value_of_initializer %int.make_type_32.loc99 [template = i32] @@ -293,7 +294,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: %.loc99_22.3: type = ptr_type i32 [template = constants.%.4] // CHECK:STDOUT: %param_addr.var: ref %.4 = var param_addr // CHECK:STDOUT: %param_addr: ref %.4 = bind_name param_addr, %param_addr.var -// CHECK:STDOUT: %param.ref: i32 = name_ref param, %param +// CHECK:STDOUT: %param.ref: i32 = name_ref param, %param.loc95_19.2 // CHECK:STDOUT: %.loc99_26: %.4 = addr_of [template = ] // CHECK:STDOUT: assign %param_addr.var, %.loc99_26 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index a72d37be1239..90732d8f9c58 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -76,18 +76,19 @@ fn Deref(n: i32) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Deref.decl: %Deref.type = fn_decl @Deref [template = constants.%Deref] { // CHECK:STDOUT: %n.patt: i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: i32 = param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32, %.loc11_13.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %param: i32 = param runtime_param0 +// CHECK:STDOUT: %n: i32 = bind_name n, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Deref(%n: i32) { +// CHECK:STDOUT: fn @Deref(%n.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref.loc16: i32 = name_ref n, %n // CHECK:STDOUT: %.loc16: ref = deref %n.ref.loc16 diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index 93bc2730cfc8..8be1d30de651 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -34,6 +34,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -59,12 +60,12 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.7) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.11)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.7) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.11)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,23 +76,25 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ConstMismatch.decl: %ConstMismatch.type = fn_decl @ConstMismatch [template = constants.%ConstMismatch] { // CHECK:STDOUT: %p.patt: %.3 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.3 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc11_28: %.1 = struct_literal () // CHECK:STDOUT: %.loc11_21.1: type = converted %.loc11_28, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc11_21.2: type = const_type %.1 [template = constants.%.2] // CHECK:STDOUT: %.loc11_29: type = ptr_type %.2 [template = constants.%.3] -// CHECK:STDOUT: %p.param: %.3 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.3 = bind_name p, %p.param // CHECK:STDOUT: %.loc11_43: %.1 = struct_literal () // CHECK:STDOUT: %.loc11_44.1: type = converted %.loc11_43, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc11_44.2: type = ptr_type %.1 [template = constants.%.4] // CHECK:STDOUT: %.loc11_35: type = const_type %.4 [template = constants.%.5] // CHECK:STDOUT: %return: ref %.5 = var +// CHECK:STDOUT: %param: %.3 = param runtime_param0 +// CHECK:STDOUT: %p: %.3 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -109,7 +112,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConstMismatch(%p: %.3) -> %.5 { +// CHECK:STDOUT: fn @ConstMismatch(%p.param_patt: %.3) -> %.5 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.3 = name_ref p, %p // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.5) [template = constants.%ImplicitAs.type.3] @@ -124,19 +127,22 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -147,6 +153,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.5) { // CHECK:STDOUT: %Dest => constants.%.5 +// CHECK:STDOUT: %Dest.patt => constants.%.5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/pointer/nested_const.carbon b/toolchain/check/testdata/pointer/nested_const.carbon index 15bdd986200f..f675c989c9c3 100644 --- a/toolchain/check/testdata/pointer/nested_const.carbon +++ b/toolchain/check/testdata/pointer/nested_const.carbon @@ -51,6 +51,7 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %p.patt: %.6 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.6 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc12_29: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_23.1: type = value_of_initializer %int.make_type_32.loc12_29 [template = i32] @@ -60,19 +61,19 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: %.loc12_16: type = const_type %.3 [template = constants.%.4] // CHECK:STDOUT: %.loc12_34: type = ptr_type %.4 [template = constants.%.5] // CHECK:STDOUT: %.loc12_9: type = const_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %p.param: %.6 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.6 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32.loc12_47: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_41.1: type = value_of_initializer %int.make_type_32.loc12_47 [template = i32] // CHECK:STDOUT: %.loc12_41.2: type = converted %int.make_type_32.loc12_47, %.loc12_41.1 [template = i32] // CHECK:STDOUT: %.loc12_41.3: type = const_type i32 [template = constants.%.2] // CHECK:STDOUT: %return: ref %.2 = var +// CHECK:STDOUT: %param: %.6 = param runtime_param0 +// CHECK:STDOUT: %p: %.6 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%p: %.6) -> %.2 { +// CHECK:STDOUT: fn @F(%p.param_patt: %.6) -> %.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.6 = name_ref p, %p // CHECK:STDOUT: %.loc13_11.1: ref %.4 = deref %p.ref diff --git a/toolchain/check/testdata/pointer/types.carbon b/toolchain/check/testdata/pointer/types.carbon index 831415ab1d71..cb4fcc0254f7 100644 --- a/toolchain/check/testdata/pointer/types.carbon +++ b/toolchain/check/testdata/pointer/types.carbon @@ -55,47 +55,49 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Ptr.decl: %Ptr.type = fn_decl @Ptr [template = constants.%Ptr] { // CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.2 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11_11, %.loc11_14.1 [template = i32] // CHECK:STDOUT: %.loc11_14.3: type = ptr_type i32 [template = constants.%.2] -// CHECK:STDOUT: %p.param: %.2 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.2 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32.loc11_20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_32.loc11_20 [template = i32] // CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_32.loc11_20, %.loc11_23.1 [template = i32] // CHECK:STDOUT: %.loc11_23.3: type = ptr_type i32 [template = constants.%.2] // CHECK:STDOUT: %return: ref %.2 = var +// CHECK:STDOUT: %param: %.2 = param runtime_param0 +// CHECK:STDOUT: %p: %.2 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: %ConstPtr.decl: %ConstPtr.type = fn_decl @ConstPtr [template = constants.%ConstPtr] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc15_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_32.loc15_22 [template = i32] // CHECK:STDOUT: %.loc15_16.2: type = converted %int.make_type_32.loc15_22, %.loc15_16.1 [template = i32] // CHECK:STDOUT: %.loc15_16.3: type = const_type i32 [template = constants.%.3] // CHECK:STDOUT: %.loc15_25: type = ptr_type %.3 [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = param p, runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param // CHECK:STDOUT: %int.make_type_32.loc15_38: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %int.make_type_32.loc15_38 [template = i32] // CHECK:STDOUT: %.loc15_32.2: type = converted %int.make_type_32.loc15_38, %.loc15_32.1 [template = i32] // CHECK:STDOUT: %.loc15_32.3: type = const_type i32 [template = constants.%.3] // CHECK:STDOUT: %.loc15_42: type = ptr_type %.3 [template = constants.%.4] // CHECK:STDOUT: %return: ref %.4 = var +// CHECK:STDOUT: %param: %.4 = param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Ptr(%p: %.2) -> %.2 { +// CHECK:STDOUT: fn @Ptr(%p.param_patt: %.2) -> %.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.2 = name_ref p, %p // CHECK:STDOUT: return %p.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConstPtr(%p: %.4) -> %.4 { +// CHECK:STDOUT: fn @ConstPtr(%p.param_patt: %.4) -> %.4 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: return %p.ref diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 6ba0276af1a4..1ca199958a36 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -62,16 +62,17 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type, %.loc11_9.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_32, %.loc11_18.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -79,7 +80,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%b: bool) -> i32 { +// CHECK:STDOUT: fn @F(%b.param_patt: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc12: i32 = int_literal 0 [template = constants.%.2] // CHECK:STDOUT: return %.loc12 diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index b876d3e47eb5..4dc152364742 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -47,7 +47,7 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -78,5 +78,5 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index 8419f7bc08b7..17a75508dfa4 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -32,6 +32,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -59,12 +60,12 @@ fn Main() -> i32 { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -83,6 +84,7 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -117,19 +119,22 @@ fn Main() -> i32 { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -140,6 +145,7 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index 095da601b295..4df48132a85d 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -76,16 +76,17 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %EnclosingButAfter.decl: %EnclosingButAfter.type = fn_decl @EnclosingButAfter [template = constants.%EnclosingButAfter] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc21_25.2: type = converted %bool.make_type, %.loc21_25.1 [template = bool] -// CHECK:STDOUT: %b.param: bool = param b, runtime_param0 -// CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_34.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] // CHECK:STDOUT: %.loc21_34.2: type = converted %int.make_type_32.loc21, %.loc21_34.1 [template = i32] // CHECK:STDOUT: %return: ref i32 = var +// CHECK:STDOUT: %param: bool = param runtime_param0 +// CHECK:STDOUT: %b: bool = bind_name b, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -127,7 +128,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @EnclosingButAfter(%b: bool) -> i32 { +// CHECK:STDOUT: fn @EnclosingButAfter(%b.param_patt: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index 6a817cdbf118..83d60f6b609c 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -41,7 +41,7 @@ var y: i32 = x.b; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -66,7 +66,7 @@ var y: i32 = x.b; // CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index bf4a32fce6c2..eef95831ee79 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -28,6 +28,7 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -55,12 +56,12 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -79,6 +80,7 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -103,7 +105,7 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -122,14 +124,17 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -140,6 +145,7 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.2) { // CHECK:STDOUT: %Dest => constants.%.2 +// CHECK:STDOUT: %Dest.patt => constants.%.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index c6316743e3d2..a54dc01f2588 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -27,6 +27,7 @@ var x: {.a = 1}; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -53,12 +54,12 @@ var x: {.a = 1}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -81,6 +82,7 @@ var x: {.a = 1}; // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -103,19 +105,22 @@ var x: {.a = 1}; // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -126,6 +131,7 @@ var x: {.a = 1}; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index fbbe32457e6a..5e90e4379e72 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -30,13 +30,9 @@ var c: C({.a = 1, .b = 2}) = F(); // --- fail_bad_type.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error: missing value for field `a` in struct initialization +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+4]]:14: error: missing value for field `a` in struct initialization // CHECK:STDERR: var c_bad: C({.c = 1, .d = 2}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-4]]:6: in import -// CHECK:STDERR: implicit.carbon:8:9: note: initializing generic parameter `S` declared here -// CHECK:STDERR: class C(S:! {.a: i32, .b: i32}) {} -// CHECK:STDERR: ^ // CHECK:STDERR: var c_bad: C({.c = 1, .d = 2}) = F(); @@ -72,6 +68,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %struct.3: %.7 = struct_value (%struct.2, %.3) [template] // CHECK:STDOUT: %.11: type = struct_type {.a: i32, .b: i32} [template] // CHECK:STDOUT: %S: %.11 = bind_symbolic_name S, 0 [symbolic] +// CHECK:STDOUT: %S.patt: %.11 = symbolic_binding_pattern S, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic] @@ -132,7 +129,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %b_ref.var: ref %.7 = var b_ref // CHECK:STDOUT: %b_ref: ref %.7 = bind_name b_ref, %b_ref.var // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %S.patt: %.11 = symbolic_binding_pattern S, 0 +// CHECK:STDOUT: %S.patt.loc8_9.1: %.11 = symbolic_binding_pattern S, 0 [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] +// CHECK:STDOUT: %S.param_patt: %.11 = param_pattern %S.patt.loc8_9.1, runtime_param [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc8_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_18.1: type = value_of_initializer %int.make_type_32.loc8_18 [template = i32] @@ -141,8 +139,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc8_27.1: type = value_of_initializer %int.make_type_32.loc8_27 [template = i32] // CHECK:STDOUT: %.loc8_27.2: type = converted %int.make_type_32.loc8_27, %.loc8_27.1 [template = i32] // CHECK:STDOUT: %.loc8_30: type = struct_type {.a: i32, .b: i32} [template = constants.%.11] -// CHECK:STDOUT: %S.param: %.11 = param S, runtime_param -// CHECK:STDOUT: %S.loc8_9.1: %.11 = bind_symbolic_name S, 0, %S.param [symbolic = %S.loc8_9.2 (constants.%S)] +// CHECK:STDOUT: %param: %.11 = param runtime_param +// CHECK:STDOUT: %S.loc8_9.1: %.11 = bind_symbolic_name S, 0, %param [symbolic = %S.loc8_9.2 (constants.%S)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] @@ -158,6 +156,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%S.loc8_9.1: %.11) { // CHECK:STDOUT: %S.loc8_9.2: %.11 = bind_symbolic_name S, 0 [symbolic = %S.loc8_9.2 (constants.%S)] +// CHECK:STDOUT: %S.patt.loc8_9.2: %.11 = symbolic_binding_pattern S, 0 [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -205,10 +204,12 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%S) { // CHECK:STDOUT: %S.loc8_9.2 => constants.%S +// CHECK:STDOUT: %S.patt.loc8_9.2 => constants.%S // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%struct.4) { // CHECK:STDOUT: %S.loc8_9.2 => constants.%struct.4 +// CHECK:STDOUT: %S.patt.loc8_9.2 => constants.%struct.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- implicit.impl.carbon @@ -232,6 +233,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.12: type = struct_type {.a: i32, .b: i32} [template] // CHECK:STDOUT: %S: %.12 = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic] +// CHECK:STDOUT: %S.patt: %.12 = symbolic_binding_pattern S, 0 [symbolic] // CHECK:STDOUT: %.13: i32 = int_literal 1 [template] // CHECK:STDOUT: %.14: i32 = int_literal 2 [template] // CHECK:STDOUT: %.15: type = ptr_type %.12 [template] @@ -245,8 +247,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: ref %.2 = import_ref Implicit//default, inst+17, loaded // CHECK:STDOUT: %import_ref.2: ref %.6 = import_ref Implicit//default, inst+57, loaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+100, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+123, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+102, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+126, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude @@ -259,7 +261,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+104, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+107, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -310,6 +312,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%S: %.12) { // CHECK:STDOUT: %S: %.12 = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] +// CHECK:STDOUT: %S.patt: %.12 = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -363,10 +366,12 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%S) { // CHECK:STDOUT: %S => constants.%S +// CHECK:STDOUT: %S.patt => constants.%S // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%struct) { // CHECK:STDOUT: %S => constants.%struct +// CHECK:STDOUT: %S.patt => constants.%struct // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -382,6 +387,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.4: type = struct_type {.a: i32, .b: i32} [template] // CHECK:STDOUT: %S: %.4 = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic] +// CHECK:STDOUT: %S.patt: %.4 = symbolic_binding_pattern S, 0 [symbolic] // CHECK:STDOUT: %.5: i32 = int_literal 1 [template] // CHECK:STDOUT: %.6: i32 = int_literal 2 [template] // CHECK:STDOUT: %.7: type = struct_type {.c: i32, .d: i32} [template] @@ -396,8 +402,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+100, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+123, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+102, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+126, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -408,7 +414,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+104, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+107, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -424,15 +430,16 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc11_20: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_28: i32 = int_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %.loc11_29: %.7 = struct_literal (%.loc11_20, %.loc11_28) +// CHECK:STDOUT: %.loc7_20: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc7_28: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc7_29: %.7 = struct_literal (%.loc7_20, %.loc7_28) // CHECK:STDOUT: %c_bad.var: ref = var c_bad // CHECK:STDOUT: %c_bad: ref = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%S: %.4) { // CHECK:STDOUT: %S: %.4 = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] +// CHECK:STDOUT: %S.patt: %.4 = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -447,18 +454,20 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] -// CHECK:STDOUT: %.loc11: ref %C.3 = temporary_storage -// CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc11 +// CHECK:STDOUT: %.loc7: ref %C.3 = temporary_storage +// CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc7 // CHECK:STDOUT: assign file.%c_bad.var, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%S) { // CHECK:STDOUT: %S => constants.%S +// CHECK:STDOUT: %S.patt => constants.%S // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%struct) { // CHECK:STDOUT: %S => constants.%struct +// CHECK:STDOUT: %S.patt => constants.%struct // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -474,6 +483,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.4: type = struct_type {.a: i32, .b: i32} [template] // CHECK:STDOUT: %S: %.4 = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic] +// CHECK:STDOUT: %S.patt: %.4 = symbolic_binding_pattern S, 0 [symbolic] // CHECK:STDOUT: %.5: i32 = int_literal 3 [template] // CHECK:STDOUT: %.6: i32 = int_literal 4 [template] // CHECK:STDOUT: %.7: type = ptr_type %.4 [template] @@ -491,6 +501,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -507,8 +518,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+100, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+123, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+102, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+126, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude @@ -520,13 +531,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+104, unloaded -// CHECK:STDOUT: %import_ref.6: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.8: @ImplicitAs.%.1 (%.11) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.15)] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+107, unloaded +// CHECK:STDOUT: %import_ref.6: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.8: @ImplicitAs.%.1 (%.11) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.15)] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -554,6 +565,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -573,6 +585,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%S: %.4) { // CHECK:STDOUT: %S: %.4 = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] +// CHECK:STDOUT: %S.patt: %.4 = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -589,7 +602,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -608,30 +621,36 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%S) { // CHECK:STDOUT: %S => constants.%S +// CHECK:STDOUT: %S.patt => constants.%S // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%struct.1) { // CHECK:STDOUT: %S => constants.%struct.1 +// CHECK:STDOUT: %S.patt => constants.%struct.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%struct.2) { // CHECK:STDOUT: %S => constants.%struct.2 +// CHECK:STDOUT: %S.patt => constants.%struct.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -642,6 +661,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%C.3) { // CHECK:STDOUT: %Dest => constants.%C.3 +// CHECK:STDOUT: %Dest.patt => constants.%C.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 1bf69a59f538..046107443d95 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -41,7 +41,7 @@ var z: i32 = y; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -75,7 +75,7 @@ var z: i32 = y; // CHECK:STDOUT: %z: ref i32 = bind_name z, %z.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index bd422af85325..f490de5235b8 100644 --- a/toolchain/check/testdata/struct/reorder_fields.carbon +++ b/toolchain/check/testdata/struct/reorder_fields.carbon @@ -52,7 +52,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+38, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -93,7 +93,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: // CHECK:STDOUT: fn @MakeI32() -> i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @MakeF64() -> f64; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index 7ba5b4a62db2..bb77e049601d 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -49,11 +49,11 @@ var b: i32 = a.(-10); // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+77, loaded [template = constants.%Negate.type] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+79, unloaded -// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/arithmetic, inst+96, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+91, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+91, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+82, loaded [template = constants.%Negate.type] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+84, unloaded +// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/arithmetic, inst+102, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+97, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+97, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -92,7 +92,7 @@ var b: i32 = a.(-10); // CHECK:STDOUT: generic fn @Op(constants.%Self: %Negate.type) { // CHECK:STDOUT: %Self: %Negate.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Op.%Self (%Self)]() -> @Op.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Op.%Self (%Self)]() -> @Op.%Self (%Self); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index b40ab5e7c87d..54c857ef69a8 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -35,6 +35,7 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -62,12 +63,12 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.8) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.12)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.8) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.12)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -96,6 +97,7 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -120,7 +122,7 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -147,14 +149,17 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -165,6 +170,7 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index 865ca9935f77..7fcd0a17e367 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -33,6 +33,7 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -60,12 +61,12 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.8) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.12)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.8) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.12)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -88,6 +89,7 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -112,7 +114,7 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -132,14 +134,17 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -150,6 +155,7 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/tuple/fail_type_assign.carbon b/toolchain/check/testdata/tuple/fail_type_assign.carbon index a3b005fc2e45..101309c84f3b 100644 --- a/toolchain/check/testdata/tuple/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuple/fail_type_assign.carbon @@ -29,6 +29,7 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -56,12 +57,12 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -81,6 +82,7 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -105,7 +107,7 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -124,14 +126,17 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -142,6 +147,7 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { // CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/tuple/fail_value_as_type.carbon b/toolchain/check/testdata/tuple/fail_value_as_type.carbon index c7b7de785d0a..69d1459fd1ed 100644 --- a/toolchain/check/testdata/tuple/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuple/fail_value_as_type.carbon @@ -27,6 +27,7 @@ var x: (1, ); // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -52,12 +53,12 @@ var x: (1, ); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -78,6 +79,7 @@ var x: (1, ); // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -100,19 +102,22 @@ var x: (1, ); // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -123,6 +128,7 @@ var x: (1, ); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 4425f16752bc..04dafd11d0a7 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -31,13 +31,9 @@ var c: C((1, 2)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error: cannot initialize tuple of 2 element(s) from tuple with 3 element(s). +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+4]]:14: error: cannot initialize tuple of 2 element(s) from tuple with 3 element(s). // CHECK:STDERR: var c_bad: C((1, 2, 3)) = F(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: implicit.carbon:7:9: note: initializing generic parameter `X` declared here -// CHECK:STDERR: class C(X:! (i32, i32)) {} -// CHECK:STDERR: ^ // CHECK:STDERR: var c_bad: C((1, 2, 3)) = F(); @@ -80,6 +76,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %tuple.3: %.9 = tuple_value (%.16, %.17) [template] // CHECK:STDOUT: %tuple.4: %.10 = tuple_value (%tuple.2, %tuple.3) [template] // CHECK:STDOUT: %X: %.9 = bind_symbolic_name X, 0 [symbolic] +// CHECK:STDOUT: %X.patt: %.9 = symbolic_binding_pattern X, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [symbolic] @@ -145,7 +142,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %b_ref.var: ref %.10 = var b_ref // CHECK:STDOUT: %b_ref: ref %.10 = bind_name b_ref, %b_ref.var // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %X.patt: %.9 = symbolic_binding_pattern X, 0 +// CHECK:STDOUT: %X.patt.loc7_9.1: %.9 = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)] +// CHECK:STDOUT: %X.param_patt: %.9 = param_pattern %X.patt.loc7_9.1, runtime_param [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc7_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] @@ -155,8 +153,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc7_22.4: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] // CHECK:STDOUT: %.loc7_22.5: type = converted %int.make_type_32.loc7_19, %.loc7_22.4 [template = i32] // CHECK:STDOUT: %.loc7_22.6: type = converted %.loc7_22.1, constants.%.9 [template = constants.%.9] -// CHECK:STDOUT: %X.param: %.9 = param X, runtime_param -// CHECK:STDOUT: %X.loc7_9.1: %.9 = bind_symbolic_name X, 0, %X.param [symbolic = %X.loc7_9.2 (constants.%X)] +// CHECK:STDOUT: %param: %.9 = param runtime_param +// CHECK:STDOUT: %X.loc7_9.1: %.9 = bind_symbolic_name X, 0, %param [symbolic = %X.loc7_9.2 (constants.%X)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] @@ -172,6 +170,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%X.loc7_9.1: %.9) { // CHECK:STDOUT: %X.loc7_9.2: %.9 = bind_symbolic_name X, 0 [symbolic = %X.loc7_9.2 (constants.%X)] +// CHECK:STDOUT: %X.patt.loc7_9.2: %.9 = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -226,10 +225,12 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { // CHECK:STDOUT: %X.loc7_9.2 => constants.%X +// CHECK:STDOUT: %X.patt.loc7_9.2 => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%tuple.5) { // CHECK:STDOUT: %X.loc7_9.2 => constants.%tuple.5 +// CHECK:STDOUT: %X.patt.loc7_9.2 => constants.%tuple.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- implicit.impl.carbon @@ -256,6 +257,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.15: = complete_type_witness %.14 [template] // CHECK:STDOUT: %X: %.8 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [symbolic] +// CHECK:STDOUT: %X.patt: %.8 = symbolic_binding_pattern X, 0 [symbolic] // CHECK:STDOUT: %.16: i32 = int_literal 1 [template] // CHECK:STDOUT: %.17: i32 = int_literal 2 [template] // CHECK:STDOUT: %tuple: %.8 = tuple_value (%.16, %.17) [template] @@ -268,8 +270,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: ref %.3 = import_ref Implicit//default, inst+17, loaded // CHECK:STDOUT: %import_ref.2: ref %.9 = import_ref Implicit//default, inst+57, loaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+104, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+122, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+106, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+125, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude @@ -282,7 +284,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+108, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+111, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -341,6 +343,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%X: %.8) { // CHECK:STDOUT: %X: %.8 = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)] +// CHECK:STDOUT: %X.patt: %.8 = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -402,10 +405,12 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { // CHECK:STDOUT: %X => constants.%X +// CHECK:STDOUT: %X.patt => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%tuple) { // CHECK:STDOUT: %X => constants.%tuple +// CHECK:STDOUT: %X.patt => constants.%tuple // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -421,6 +426,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.4: type = tuple_type (i32, i32) [template] // CHECK:STDOUT: %X: %.4 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [symbolic] +// CHECK:STDOUT: %X.patt: %.4 = symbolic_binding_pattern X, 0 [symbolic] // CHECK:STDOUT: %.5: i32 = int_literal 1 [template] // CHECK:STDOUT: %.6: i32 = int_literal 2 [template] // CHECK:STDOUT: %.7: i32 = int_literal 3 [template] @@ -436,8 +442,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+104, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+122, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+106, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+125, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -448,7 +454,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+108, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+111, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -464,16 +470,17 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc12_15: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc12_18: i32 = int_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %.loc12_21: i32 = int_literal 3 [template = constants.%.7] -// CHECK:STDOUT: %.loc12_22: %.8 = tuple_literal (%.loc12_15, %.loc12_18, %.loc12_21) +// CHECK:STDOUT: %.loc8_15: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc8_18: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc8_21: i32 = int_literal 3 [template = constants.%.7] +// CHECK:STDOUT: %.loc8_22: %.8 = tuple_literal (%.loc8_15, %.loc8_18, %.loc8_21) // CHECK:STDOUT: %c_bad.var: ref = var c_bad // CHECK:STDOUT: %c_bad: ref = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%X: %.4) { // CHECK:STDOUT: %X: %.4 = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)] +// CHECK:STDOUT: %X.patt: %.4 = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -488,18 +495,20 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] -// CHECK:STDOUT: %.loc12: ref %C.3 = temporary_storage -// CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc12 +// CHECK:STDOUT: %.loc8: ref %C.3 = temporary_storage +// CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc8 // CHECK:STDOUT: assign file.%c_bad.var, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { // CHECK:STDOUT: %X => constants.%X +// CHECK:STDOUT: %X.patt => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%tuple) { // CHECK:STDOUT: %X => constants.%tuple +// CHECK:STDOUT: %X.patt => constants.%tuple // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -515,6 +524,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.4: type = tuple_type (i32, i32) [template] // CHECK:STDOUT: %X: %.4 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [symbolic] +// CHECK:STDOUT: %X.patt: %.4 = symbolic_binding_pattern X, 0 [symbolic] // CHECK:STDOUT: %.5: i32 = int_literal 3 [template] // CHECK:STDOUT: %.6: i32 = int_literal 4 [template] // CHECK:STDOUT: %.7: type = ptr_type %.4 [template] @@ -532,6 +542,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -548,8 +559,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+104, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+122, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+106, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+125, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude @@ -561,13 +572,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+108, unloaded -// CHECK:STDOUT: %import_ref.6: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.8: @ImplicitAs.%.1 (%.11) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.15)] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+111, unloaded +// CHECK:STDOUT: %import_ref.6: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.8: @ImplicitAs.%.1 (%.11) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.15)] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -595,6 +606,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -614,6 +626,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%X: %.4) { // CHECK:STDOUT: %X: %.4 = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)] +// CHECK:STDOUT: %X.patt: %.4 = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -630,7 +643,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -649,30 +662,36 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { // CHECK:STDOUT: %X => constants.%X +// CHECK:STDOUT: %X.patt => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%tuple.1) { // CHECK:STDOUT: %X => constants.%tuple.1 +// CHECK:STDOUT: %X.patt => constants.%tuple.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%tuple.2) { // CHECK:STDOUT: %X => constants.%tuple.2 +// CHECK:STDOUT: %X.patt => constants.%tuple.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -683,6 +702,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%C.3) { // CHECK:STDOUT: %Dest => constants.%C.3 +// CHECK:STDOUT: %Dest.patt => constants.%C.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index 5bee9b2cec70..3a4566647916 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -64,10 +64,11 @@ fn F(x: X) { // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %x.patt: %X = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %X = param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref.loc14: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %x.param: %X = param x, runtime_param0 -// CHECK:STDOUT: %x: %X = bind_name x, %x.param +// CHECK:STDOUT: %param: %X = param runtime_param0 +// CHECK:STDOUT: %x: %X = bind_name x, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -78,7 +79,7 @@ fn F(x: X) { // CHECK:STDOUT: .Self = constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%x: %X) { +// CHECK:STDOUT: fn @F(%x.param_patt: %X) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.var: ref String = var s // CHECK:STDOUT: %s: ref String = bind_name s, %s.var diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index a737254807f6..d758b0a7c57b 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -30,6 +30,7 @@ fn Main() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -55,12 +56,12 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -74,6 +75,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -110,19 +112,22 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -133,6 +138,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index dea941a0518b..62aaf6086d2b 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -128,16 +128,12 @@ impl C as J {} // TODO: Should report that `C` does not meet the constraint. fn DoesNotImplI() { - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+11]]:3: error: cannot implicitly convert from `type` to `J` + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `type` to `J` // CHECK:STDERR: Impls(C); // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+8]]:3: note: type `type` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+4]]:3: note: type `type` does not implement interface `ImplicitAs` // CHECK:STDERR: Impls(C); // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE-14]]:1: in import - // CHECK:STDERR: state_constraints.carbon:13:10: note: initializing generic parameter `V` declared here - // CHECK:STDERR: fn Impls(V:! J where .Self impls I); - // CHECK:STDERR: ^ // CHECK:STDERR: Impls(C); } @@ -146,15 +142,12 @@ fn EmptyStruct(Y:! J where .Self == {}); // TODO: Should report that `C` does not meeet the constraint. fn NotEmptyStruct() { - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `type` to `J` + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `type` to `J` // CHECK:STDERR: EmptyStruct(C); // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+6]]:3: note: type `type` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+3]]:3: note: type `type` does not implement interface `ImplicitAs` // CHECK:STDERR: EmptyStruct(C); // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE-10]]:16: note: initializing generic parameter `Y` declared here - // CHECK:STDERR: fn EmptyStruct(Y:! J where .Self == {}); - // CHECK:STDERR: ^ EmptyStruct(C); } @@ -172,13 +165,16 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.5: %.4 = assoc_entity element1, @I.%Second [template] // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self, 0 [symbolic] // CHECK:STDOUT: %U: %I.type = bind_symbolic_name U, 0 [symbolic] +// CHECK:STDOUT: %U.patt: %I.type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %EqualEqual.type: type = fn_type @EqualEqual [template] // CHECK:STDOUT: %EqualEqual: %EqualEqual.type = struct_value () [template] // CHECK:STDOUT: %.Self.2: %J.type = bind_symbolic_name .Self, 0 [symbolic] // CHECK:STDOUT: %V: %J.type = bind_symbolic_name V, 0 [symbolic] +// CHECK:STDOUT: %V.patt: %J.type = symbolic_binding_pattern V, 0 [symbolic] // CHECK:STDOUT: %Impls.type: type = fn_type @Impls [template] // CHECK:STDOUT: %Impls: %Impls.type = struct_value () [template] // CHECK:STDOUT: %W: %I.type = bind_symbolic_name W, 0 [symbolic] +// CHECK:STDOUT: %W.patt: %I.type = symbolic_binding_pattern W, 0 [symbolic] // CHECK:STDOUT: %And.type: type = fn_type @And [template] // CHECK:STDOUT: %And: %And.type = struct_value () [template] // CHECK:STDOUT: } @@ -209,7 +205,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%J.type] {} {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: %EqualEqual.decl: %EqualEqual.type = fn_decl @EqualEqual [template = constants.%EqualEqual] { -// CHECK:STDOUT: %U.patt: %I.type = symbolic_binding_pattern U, 0 +// CHECK:STDOUT: %U.patt.loc11_15.1: %I.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_15.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: %I.type = param_pattern %U.patt.loc11_15.1, runtime_param [symbolic = %U.patt.loc11_15.2 (constants.%U.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self.1] @@ -218,11 +215,12 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.loc11_21: type = where_expr %.Self [template = constants.%I.type] { // CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc11_37 // CHECK:STDOUT: } -// CHECK:STDOUT: %U.param: %I.type = param U, runtime_param -// CHECK:STDOUT: %U.loc11_15.1: %I.type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc11_15.2 (constants.%U)] +// CHECK:STDOUT: %param: %I.type = param runtime_param +// CHECK:STDOUT: %U.loc11_15.1: %I.type = bind_symbolic_name U, 0, %param [symbolic = %U.loc11_15.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %Impls.decl: %Impls.type = fn_decl @Impls [template = constants.%Impls] { -// CHECK:STDOUT: %V.patt: %J.type = symbolic_binding_pattern V, 0 +// CHECK:STDOUT: %V.patt.loc13_10.1: %J.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc13_10.2 (constants.%V.patt)] +// CHECK:STDOUT: %V.param_patt: %J.type = param_pattern %V.patt.loc13_10.1, runtime_param [symbolic = %V.patt.loc13_10.2 (constants.%V.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self.2] @@ -233,11 +231,12 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.loc13_16: type = where_expr %.Self [template = constants.%J.type] { // CHECK:STDOUT: requirement_impls %.loc13_22.2, %I.ref // CHECK:STDOUT: } -// CHECK:STDOUT: %V.param: %J.type = param V, runtime_param -// CHECK:STDOUT: %V.loc13_10.1: %J.type = bind_symbolic_name V, 0, %V.param [symbolic = %V.loc13_10.2 (constants.%V)] +// CHECK:STDOUT: %param: %J.type = param runtime_param +// CHECK:STDOUT: %V.loc13_10.1: %J.type = bind_symbolic_name V, 0, %param [symbolic = %V.loc13_10.2 (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { -// CHECK:STDOUT: %W.patt: %I.type = symbolic_binding_pattern W, 0 +// CHECK:STDOUT: %W.patt.loc15_8.1: %I.type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc15_8.2 (constants.%W.patt)] +// CHECK:STDOUT: %W.param_patt: %I.type = param_pattern %W.patt.loc15_8.1, runtime_param [symbolic = %W.patt.loc15_8.2 (constants.%W.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self.1] @@ -252,8 +251,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: requirement_impls %.loc15_20.2, %J.ref // CHECK:STDOUT: requirement_equivalent %Member.ref, %.loc15_50 // CHECK:STDOUT: } -// CHECK:STDOUT: %W.param: %I.type = param W, runtime_param -// CHECK:STDOUT: %W.loc15_8.1: %I.type = bind_symbolic_name W, 0, %W.param [symbolic = %W.loc15_8.2 (constants.%W)] +// CHECK:STDOUT: %param: %I.type = param runtime_param +// CHECK:STDOUT: %W.loc15_8.1: %I.type = bind_symbolic_name W, 0, %param [symbolic = %W.loc15_8.2 (constants.%W)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -282,32 +281,38 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @EqualEqual(%U.loc11_15.1: %I.type) { // CHECK:STDOUT: %U.loc11_15.2: %I.type = bind_symbolic_name U, 0 [symbolic = %U.loc11_15.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc11_15.2: %I.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_15.2 (constants.%U.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.loc11_15.1: %I.type); +// CHECK:STDOUT: fn(%U.param_patt: %I.type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Impls(%V.loc13_10.1: %J.type) { // CHECK:STDOUT: %V.loc13_10.2: %J.type = bind_symbolic_name V, 0 [symbolic = %V.loc13_10.2 (constants.%V)] +// CHECK:STDOUT: %V.patt.loc13_10.2: %J.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc13_10.2 (constants.%V.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%V.loc13_10.1: %J.type); +// CHECK:STDOUT: fn(%V.param_patt: %J.type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @And(%W.loc15_8.1: %I.type) { // CHECK:STDOUT: %W.loc15_8.2: %I.type = bind_symbolic_name W, 0 [symbolic = %W.loc15_8.2 (constants.%W)] +// CHECK:STDOUT: %W.patt.loc15_8.2: %I.type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc15_8.2 (constants.%W.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%W.loc15_8.1: %I.type); +// CHECK:STDOUT: fn(%W.param_patt: %I.type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @EqualEqual(constants.%U) { // CHECK:STDOUT: %U.loc11_15.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc11_15.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Impls(constants.%V) { // CHECK:STDOUT: %V.loc13_10.2 => constants.%V +// CHECK:STDOUT: %V.patt.loc13_10.2 => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @And(constants.%W) { // CHECK:STDOUT: %W.loc15_8.2 => constants.%W +// CHECK:STDOUT: %W.patt.loc15_8.2 => constants.%W // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_equal_constraint.carbon @@ -325,6 +330,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.3: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -338,6 +344,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.9: %.5 = assoc_entity element0, imports.%import_ref.6 [symbolic] // CHECK:STDOUT: %struct: %.4 = struct_value () [template] // CHECK:STDOUT: %T: %N.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: %N.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [template] // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [template] // CHECK:STDOUT: } @@ -354,12 +361,12 @@ fn NotEmptyStruct() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -371,7 +378,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %N.decl: type = interface_decl @N [template = constants.%N.type] {} {} // CHECK:STDOUT: %Equal.decl: %Equal.type = fn_decl @Equal [template = constants.%Equal] { -// CHECK:STDOUT: %T.patt: %N.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc15_10.1: %N.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_10.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: %N.type = param_pattern %T.patt.loc15_10.1, runtime_param [symbolic = %T.patt.loc15_10.2 (constants.%T.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %N.ref: type = name_ref N, file.%N.decl [template = constants.%N.type] // CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] @@ -387,8 +395,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.loc15_16: type = where_expr %.Self [template = constants.%N.type] { // CHECK:STDOUT: requirement_rewrite %P.ref, // CHECK:STDOUT: } -// CHECK:STDOUT: %T.param: %N.type = param T, runtime_param -// CHECK:STDOUT: %T.loc15_10.1: %N.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc15_10.2 (constants.%T)] +// CHECK:STDOUT: %param: %N.type = param runtime_param +// CHECK:STDOUT: %T.loc15_10.1: %N.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc15_10.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -405,6 +413,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -427,25 +436,29 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Equal(%T.loc15_10.1: %N.type) { // CHECK:STDOUT: %T.loc15_10.2: %N.type = bind_symbolic_name T, 0 [symbolic = %T.loc15_10.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc15_10.2: %N.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_10.2 (constants.%T.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc15_10.1: %N.type); +// CHECK:STDOUT: fn(%T.param_patt: %N.type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.2) { @@ -456,6 +469,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.1) { // CHECK:STDOUT: %Dest => constants.%.1 +// CHECK:STDOUT: %Dest.patt => constants.%.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -468,6 +482,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Equal(constants.%T) { // CHECK:STDOUT: %T.loc15_10.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc15_10.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_associated_type_impls.carbon @@ -488,6 +503,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.4: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.5: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -500,6 +516,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] // CHECK:STDOUT: %W: %K.type = bind_symbolic_name W, 0 [symbolic] +// CHECK:STDOUT: %W.patt: %K.type = symbolic_binding_pattern W, 0 [symbolic] // CHECK:STDOUT: %AssociatedTypeImpls.type: type = fn_type @AssociatedTypeImpls [template] // CHECK:STDOUT: %AssociatedTypeImpls: %AssociatedTypeImpls.type = struct_value () [template] // CHECK:STDOUT: } @@ -516,12 +533,12 @@ fn NotEmptyStruct() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -537,7 +554,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %M.decl: type = interface_decl @M [template = constants.%M.type] {} {} // CHECK:STDOUT: %K.decl: type = interface_decl @K [template = constants.%K.type] {} {} // CHECK:STDOUT: %AssociatedTypeImpls.decl: %AssociatedTypeImpls.type = fn_decl @AssociatedTypeImpls [template = constants.%AssociatedTypeImpls] { -// CHECK:STDOUT: %W.patt: %K.type = symbolic_binding_pattern W, 0 +// CHECK:STDOUT: %W.patt.loc18_24.1: %K.type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc18_24.2 (constants.%W.patt)] +// CHECK:STDOUT: %W.param_patt: %K.type = param_pattern %W.patt.loc18_24.1, runtime_param [symbolic = %W.patt.loc18_24.2 (constants.%W.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [template = constants.%K.type] // CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] @@ -551,8 +569,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.loc18_30: type = where_expr %.Self [template = constants.%K.type] { // CHECK:STDOUT: requirement_impls , %M.ref // CHECK:STDOUT: } -// CHECK:STDOUT: %W.param: %K.type = param W, runtime_param -// CHECK:STDOUT: %W.loc18_24.1: %K.type = bind_symbolic_name W, 0, %W.param [symbolic = %W.loc18_24.2 (constants.%W)] +// CHECK:STDOUT: %param: %K.type = param runtime_param +// CHECK:STDOUT: %W.loc18_24.1: %K.type = bind_symbolic_name W, 0, %param [symbolic = %W.loc18_24.2 (constants.%W)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -586,6 +604,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -608,25 +627,29 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.5)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.5)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @AssociatedTypeImpls(%W.loc18_24.1: %K.type) { // CHECK:STDOUT: %W.loc18_24.2: %K.type = bind_symbolic_name W, 0 [symbolic = %W.loc18_24.2 (constants.%W)] +// CHECK:STDOUT: %W.patt.loc18_24.2: %K.type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc18_24.2 (constants.%W.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%W.loc18_24.1: %K.type); +// CHECK:STDOUT: fn(%W.param_patt: %K.type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.4) { @@ -637,6 +660,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -649,6 +673,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: specific @AssociatedTypeImpls(constants.%W) { // CHECK:STDOUT: %W.loc18_24.2 => constants.%W +// CHECK:STDOUT: %W.patt.loc18_24.2 => constants.%W // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_check_rewrite_constraints.carbon @@ -666,6 +691,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.3: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -678,6 +704,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.16 [template] // CHECK:STDOUT: %.9: %.5 = assoc_entity element0, imports.%import_ref.17 [symbolic] // CHECK:STDOUT: %X: %I.type = bind_symbolic_name X, 0 [symbolic] +// CHECK:STDOUT: %X.patt: %I.type = symbolic_binding_pattern X, 0 [symbolic] // CHECK:STDOUT: %RewriteTypeMismatch.type: type = fn_type @RewriteTypeMismatch [template] // CHECK:STDOUT: %RewriteTypeMismatch: %RewriteTypeMismatch.type = struct_value () [template] // CHECK:STDOUT: } @@ -685,9 +712,9 @@ fn NotEmptyStruct() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//state_constraints, inst+3, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref Main//state_constraints, inst+7, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//state_constraints, inst+32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//state_constraints, inst+49, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//state_constraints, inst+69, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//state_constraints, inst+34, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//state_constraints, inst+54, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//state_constraints, inst+77, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.12 // CHECK:STDOUT: import Core//prelude @@ -705,12 +732,12 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %import_ref.9 = import_ref Main//state_constraints, inst+11, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Main//state_constraints, inst+17, unloaded // CHECK:STDOUT: %import_ref.11 = import_ref Main//state_constraints, inst+11, unloaded -// CHECK:STDOUT: %import_ref.12: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.14: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.12: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.14: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -726,7 +753,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %RewriteTypeMismatch.decl: %RewriteTypeMismatch.type = fn_decl @RewriteTypeMismatch [template = constants.%RewriteTypeMismatch] { -// CHECK:STDOUT: %X.patt: %I.type = symbolic_binding_pattern X, 0 +// CHECK:STDOUT: %X.patt.loc16_24.1: %I.type = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc16_24.2 (constants.%X.patt)] +// CHECK:STDOUT: %X.param_patt: %I.type = param_pattern %X.patt.loc16_24.1, runtime_param [symbolic = %X.patt.loc16_24.2 (constants.%X.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.2 [template = constants.%I.type] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] @@ -740,8 +768,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.loc16_30: type = where_expr %.Self [template = constants.%I.type] { // CHECK:STDOUT: requirement_rewrite %Member.ref, // CHECK:STDOUT: } -// CHECK:STDOUT: %X.param: %I.type = param X, runtime_param -// CHECK:STDOUT: %X.loc16_24.1: %I.type = bind_symbolic_name X, 0, %X.param [symbolic = %X.loc16_24.2 (constants.%X)] +// CHECK:STDOUT: %param: %I.type = param runtime_param +// CHECK:STDOUT: %X.loc16_24.1: %I.type = bind_symbolic_name X, 0, %param [symbolic = %X.loc16_24.2 (constants.%X)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -755,6 +783,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -777,25 +806,29 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @RewriteTypeMismatch(%X.loc16_24.1: %I.type) { // CHECK:STDOUT: %X.loc16_24.2: %I.type = bind_symbolic_name X, 0 [symbolic = %X.loc16_24.2 (constants.%X)] +// CHECK:STDOUT: %X.patt.loc16_24.2: %I.type = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc16_24.2 (constants.%X.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%X.loc16_24.1: %I.type); +// CHECK:STDOUT: fn(%X.param_patt: %I.type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.2) { @@ -806,6 +839,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%.2) { // CHECK:STDOUT: %Dest => constants.%.2 +// CHECK:STDOUT: %Dest.patt => constants.%.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -818,6 +852,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: specific @RewriteTypeMismatch(constants.%X) { // CHECK:STDOUT: %X.loc16_24.2 => constants.%X +// CHECK:STDOUT: %X.patt.loc16_24.2 => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_left_of_impls_non_type.carbon @@ -831,6 +866,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -843,6 +879,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %NonTypeImpls.type: type = fn_type @NonTypeImpls [template] // CHECK:STDOUT: %NonTypeImpls: %NonTypeImpls.type = struct_value () [template] // CHECK:STDOUT: } @@ -859,12 +896,12 @@ fn NotEmptyStruct() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -874,7 +911,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NonTypeImpls.decl: %NonTypeImpls.type = fn_decl @NonTypeImpls [template = constants.%NonTypeImpls] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 +// CHECK:STDOUT: %U.patt.loc11_17.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_17.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc11_17.1, runtime_param [symbolic = %U.patt.loc11_17.2 (constants.%U.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] // CHECK:STDOUT: %.loc11_32.1: i32 = int_literal 7 [template = constants.%.1] @@ -885,13 +923,14 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.loc11_26: type = where_expr %.Self [template = type] { // CHECK:STDOUT: requirement_impls , type // CHECK:STDOUT: } -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc11_17.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc11_17.2 (constants.%U)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc11_17.1: type = bind_symbolic_name U, 0, %param [symbolic = %U.loc11_17.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -914,25 +953,29 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @NonTypeImpls(%U.loc11_17.1: type) { // CHECK:STDOUT: %U.loc11_17.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc11_17.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc11_17.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_17.2 (constants.%U.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.loc11_17.1: type); +// CHECK:STDOUT: fn(%U.param_patt: type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -943,6 +986,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -955,6 +999,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: specific @NonTypeImpls(constants.%U) { // CHECK:STDOUT: %U.loc11_17.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc11_17.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_right_of_impls_non_type.carbon @@ -968,6 +1013,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -980,6 +1026,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %ImplsNonType.type: type = fn_type @ImplsNonType [template] // CHECK:STDOUT: %ImplsNonType: %ImplsNonType.type = struct_value () [template] // CHECK:STDOUT: } @@ -996,12 +1043,12 @@ fn NotEmptyStruct() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1011,7 +1058,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ImplsNonType.decl: %ImplsNonType.type = fn_decl @ImplsNonType [template = constants.%ImplsNonType] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 +// CHECK:STDOUT: %U.patt.loc11_17.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_17.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc11_17.1, runtime_param [symbolic = %U.patt.loc11_17.2 (constants.%U.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] // CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self] @@ -1023,13 +1071,14 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.loc11_26: type = where_expr %.Self [template = type] { // CHECK:STDOUT: requirement_impls %.Self.ref, // CHECK:STDOUT: } -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc11_17.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc11_17.2 (constants.%U)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc11_17.1: type = bind_symbolic_name U, 0, %param [symbolic = %U.loc11_17.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -1052,25 +1101,29 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ImplsNonType(%U.loc11_17.1: type) { // CHECK:STDOUT: %U.loc11_17.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc11_17.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc11_17.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_17.2 (constants.%U.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.loc11_17.1: type); +// CHECK:STDOUT: fn(%U.param_patt: type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -1081,6 +1134,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(type) { // CHECK:STDOUT: %Dest => type +// CHECK:STDOUT: %Dest.patt => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -1093,6 +1147,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplsNonType(constants.%U) { // CHECK:STDOUT: %U.loc11_17.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc11_17.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_right_of_impls_non_facet_type.carbon @@ -1103,6 +1158,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] +// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %ImplsOfNonFacetType.type: type = fn_type @ImplsOfNonFacetType [template] // CHECK:STDOUT: %ImplsOfNonFacetType: %ImplsOfNonFacetType.type = struct_value () [template] // CHECK:STDOUT: } @@ -1129,7 +1185,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ImplsOfNonFacetType.decl: %ImplsOfNonFacetType.type = fn_decl @ImplsOfNonFacetType [template = constants.%ImplsOfNonFacetType] { -// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 +// CHECK:STDOUT: %U.patt.loc8_24.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc8_24.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc8_24.1, runtime_param [symbolic = %U.patt.loc8_24.2 (constants.%U.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] // CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self] @@ -1139,8 +1196,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.loc8_33: type = where_expr %.Self [template = type] { // CHECK:STDOUT: requirement_impls %.Self.ref, // CHECK:STDOUT: } -// CHECK:STDOUT: %U.param: type = param U, runtime_param -// CHECK:STDOUT: %U.loc8_24.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc8_24.2 (constants.%U)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %U.loc8_24.1: type = bind_symbolic_name U, 0, %param [symbolic = %U.loc8_24.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1148,12 +1205,14 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ImplsOfNonFacetType(%U.loc8_24.1: type) { // CHECK:STDOUT: %U.loc8_24.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc8_24.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc8_24.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc8_24.2 (constants.%U.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.loc8_24.1: type); +// CHECK:STDOUT: fn(%U.param_patt: type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplsOfNonFacetType(constants.%U) { // CHECK:STDOUT: %U.loc8_24.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc8_24.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_enforce_constraint.carbon @@ -1171,11 +1230,13 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Impls.type: type = fn_type @Impls [template] // CHECK:STDOUT: %Impls: %Impls.type = struct_value () [template] // CHECK:STDOUT: %V: %J.type = bind_symbolic_name V, 0 [symbolic] +// CHECK:STDOUT: %V.patt: %J.type = symbolic_binding_pattern V, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.3: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -1189,6 +1250,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.9: %.5 = assoc_entity element0, imports.%import_ref.12 [symbolic] // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self, 0 [symbolic] // CHECK:STDOUT: %Y: %J.type = bind_symbolic_name Y, 0 [symbolic] +// CHECK:STDOUT: %Y.patt: %J.type = symbolic_binding_pattern Y, 0 [symbolic] // CHECK:STDOUT: %EmptyStruct.type: type = fn_type @EmptyStruct [template] // CHECK:STDOUT: %EmptyStruct: %EmptyStruct.type = struct_value () [template] // CHECK:STDOUT: %NotEmptyStruct.type: type = fn_type @NotEmptyStruct [template] @@ -1198,9 +1260,9 @@ fn NotEmptyStruct() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//state_constraints, inst+3, loaded [template = constants.%J.type] // CHECK:STDOUT: %import_ref.2 = import_ref Main//state_constraints, inst+7, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//state_constraints, inst+32, unloaded -// CHECK:STDOUT: %import_ref.4: %Impls.type = import_ref Main//state_constraints, inst+49, loaded [template = constants.%Impls] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//state_constraints, inst+69, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//state_constraints, inst+34, unloaded +// CHECK:STDOUT: %import_ref.4: %Impls.type = import_ref Main//state_constraints, inst+54, loaded [template = constants.%Impls] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//state_constraints, inst+77, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.7 // CHECK:STDOUT: import Core//prelude @@ -1213,12 +1275,12 @@ fn NotEmptyStruct() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.6 = import_ref Main//state_constraints, inst+5, unloaded -// CHECK:STDOUT: %import_ref.7: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.9: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.7: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.9: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1243,17 +1305,18 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: %DoesNotImplI.decl: %DoesNotImplI.type = fn_decl @DoesNotImplI [template = constants.%DoesNotImplI] {} {} // CHECK:STDOUT: %EmptyStruct.decl: %EmptyStruct.type = fn_decl @EmptyStruct [template = constants.%EmptyStruct] { -// CHECK:STDOUT: %Y.patt: %J.type = symbolic_binding_pattern Y, 0 +// CHECK:STDOUT: %Y.patt.loc22_16.1: %J.type = symbolic_binding_pattern Y, 0 [symbolic = %Y.patt.loc22_16.2 (constants.%Y.patt)] +// CHECK:STDOUT: %Y.param_patt: %J.type = param_pattern %Y.patt.loc22_16.1, runtime_param [symbolic = %Y.patt.loc22_16.2 (constants.%Y.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %J.ref: type = name_ref J, imports.%import_ref.1 [template = constants.%J.type] // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.loc26_38: %.1 = struct_literal () -// CHECK:STDOUT: %.loc26_22: type = where_expr %.Self [template = constants.%J.type] { -// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc26_38 +// CHECK:STDOUT: %.loc22_38: %.1 = struct_literal () +// CHECK:STDOUT: %.loc22_22: type = where_expr %.Self [template = constants.%J.type] { +// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc22_38 // CHECK:STDOUT: } -// CHECK:STDOUT: %Y.param: %J.type = param Y, runtime_param -// CHECK:STDOUT: %Y.loc26_16.1: %J.type = bind_symbolic_name Y, 0, %Y.param [symbolic = %Y.loc26_16.2 (constants.%Y)] +// CHECK:STDOUT: %param: %J.type = param runtime_param +// CHECK:STDOUT: %Y.loc22_16.1: %J.type = bind_symbolic_name Y, 0, %param [symbolic = %Y.loc22_16.2 (constants.%Y)] // CHECK:STDOUT: } // CHECK:STDOUT: %NotEmptyStruct.decl: %NotEmptyStruct.type = fn_decl @NotEmptyStruct [template = constants.%NotEmptyStruct] {} {} // CHECK:STDOUT: } @@ -1266,6 +1329,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -1302,16 +1366,17 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Impls.ref: %Impls.type = name_ref Impls, imports.%import_ref.4 [template = constants.%Impls] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%J.type) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc23_8.1: %.7 = specific_constant imports.%import_ref.9, @ImplicitAs(constants.%J.type) [template = constants.%.8] -// CHECK:STDOUT: %Convert.ref: %.7 = name_ref Convert, %.loc23_8.1 [template = constants.%.8] -// CHECK:STDOUT: %.loc23_8.2: %J.type = converted %C.ref, [template = ] +// CHECK:STDOUT: %.loc19_8.1: %.7 = specific_constant imports.%import_ref.9, @ImplicitAs(constants.%J.type) [template = constants.%.8] +// CHECK:STDOUT: %Convert.ref: %.7 = name_ref Convert, %.loc19_8.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc19_8.2: %J.type = converted %C.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Impls(constants.%V: %J.type) { -// CHECK:STDOUT: %V.2: %J.type = bind_symbolic_name V, 0 [symbolic = %V.2 (constants.%V)] +// CHECK:STDOUT: %V: %J.type = bind_symbolic_name V, 0 [symbolic = %V (constants.%V)] +// CHECK:STDOUT: %V.patt: %J.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt (constants.%V.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%V.1: %J.type); +// CHECK:STDOUT: fn(%V.param_patt: %J.type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { @@ -1319,13 +1384,14 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @EmptyStruct(%Y.loc26_16.1: %J.type) { -// CHECK:STDOUT: %Y.loc26_16.2: %J.type = bind_symbolic_name Y, 0 [symbolic = %Y.loc26_16.2 (constants.%Y)] +// CHECK:STDOUT: generic fn @EmptyStruct(%Y.loc22_16.1: %J.type) { +// CHECK:STDOUT: %Y.loc22_16.2: %J.type = bind_symbolic_name Y, 0 [symbolic = %Y.loc22_16.2 (constants.%Y)] +// CHECK:STDOUT: %Y.patt.loc22_16.2: %J.type = symbolic_binding_pattern Y, 0 [symbolic = %Y.patt.loc22_16.2 (constants.%Y.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%Y.loc26_16.1: %J.type); +// CHECK:STDOUT: fn(%Y.param_patt: %J.type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @NotEmptyStruct() { @@ -1333,26 +1399,30 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %EmptyStruct.ref: %EmptyStruct.type = name_ref EmptyStruct, file.%EmptyStruct.decl [template = constants.%EmptyStruct] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%J.type) [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %.loc39_14.1: %.7 = specific_constant imports.%import_ref.9, @ImplicitAs(constants.%J.type) [template = constants.%.8] -// CHECK:STDOUT: %Convert.ref: %.7 = name_ref Convert, %.loc39_14.1 [template = constants.%.8] -// CHECK:STDOUT: %.loc39_14.2: %J.type = converted %C.ref, [template = ] +// CHECK:STDOUT: %.loc32_14.1: %.7 = specific_constant imports.%import_ref.9, @ImplicitAs(constants.%J.type) [template = constants.%.8] +// CHECK:STDOUT: %Convert.ref: %.7 = name_ref Convert, %.loc32_14.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc32_14.2: %J.type = converted %C.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Impls(constants.%V) { -// CHECK:STDOUT: %V.2 => constants.%V +// CHECK:STDOUT: %V => constants.%V +// CHECK:STDOUT: %V.patt => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.2) { @@ -1363,6 +1433,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%J.type) { // CHECK:STDOUT: %Dest => constants.%J.type +// CHECK:STDOUT: %Dest.patt => constants.%J.type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -1374,6 +1445,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @EmptyStruct(constants.%Y) { -// CHECK:STDOUT: %Y.loc26_16.2 => constants.%Y +// CHECK:STDOUT: %Y.loc22_16.2 => constants.%Y +// CHECK:STDOUT: %Y.patt.loc22_16.2 => constants.%Y // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/designator.carbon b/toolchain/check/testdata/where_expr/designator.carbon index 31a60588aac4..52b8b749d238 100644 --- a/toolchain/check/testdata/where_expr/designator.carbon +++ b/toolchain/check/testdata/where_expr/designator.carbon @@ -96,13 +96,16 @@ class D { // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self, 0 [symbolic] // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %T: %I.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: %I.type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %PeriodSelf.type: type = fn_type @PeriodSelf [template] // CHECK:STDOUT: %PeriodSelf: %PeriodSelf.type = struct_value () [template] // CHECK:STDOUT: %U: %I.type = bind_symbolic_name U, 0 [symbolic] +// CHECK:STDOUT: %U.patt: %I.type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %PeriodMember.type: type = fn_type @PeriodMember [template] // CHECK:STDOUT: %PeriodMember: %PeriodMember.type = struct_value () [template] // CHECK:STDOUT: %.Self.2: type = bind_symbolic_name .Self, 0 [symbolic] // CHECK:STDOUT: %V: type = bind_symbolic_name V, 0 [symbolic] +// CHECK:STDOUT: %V.patt: type = symbolic_binding_pattern V, 0 [symbolic] // CHECK:STDOUT: %TypeSelfImpls.type: type = fn_type @TypeSelfImpls [template] // CHECK:STDOUT: %TypeSelfImpls: %TypeSelfImpls.type = struct_value () [template] // CHECK:STDOUT: } @@ -131,7 +134,8 @@ class D { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: %PeriodSelf.decl: %PeriodSelf.type = fn_decl @PeriodSelf [template = constants.%PeriodSelf] { -// CHECK:STDOUT: %T.patt: %I.type = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc8_15.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_15.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: %I.type = param_pattern %T.patt.loc8_15.1, runtime_param [symbolic = %T.patt.loc8_15.2 (constants.%T.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self.1] @@ -140,11 +144,12 @@ class D { // CHECK:STDOUT: %.loc8_21: type = where_expr %.Self [template = constants.%I.type] { // CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc8_37 // CHECK:STDOUT: } -// CHECK:STDOUT: %T.param: %I.type = param T, runtime_param -// CHECK:STDOUT: %T.loc8_15.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: %param: %I.type = param runtime_param +// CHECK:STDOUT: %T.loc8_15.1: %I.type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_15.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %PeriodMember.decl: %PeriodMember.type = fn_decl @PeriodMember [template = constants.%PeriodMember] { -// CHECK:STDOUT: %U.patt: %I.type = symbolic_binding_pattern U, 0 +// CHECK:STDOUT: %U.patt.loc10_17.1: %I.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc10_17.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: %I.type = param_pattern %U.patt.loc10_17.1, runtime_param [symbolic = %U.patt.loc10_17.2 (constants.%U.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self.1] @@ -154,11 +159,12 @@ class D { // CHECK:STDOUT: %.loc10_23: type = where_expr %.Self [template = constants.%I.type] { // CHECK:STDOUT: requirement_equivalent %Member.ref, %.loc10_41 // CHECK:STDOUT: } -// CHECK:STDOUT: %U.param: %I.type = param U, runtime_param -// CHECK:STDOUT: %U.loc10_17.1: %I.type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc10_17.2 (constants.%U)] +// CHECK:STDOUT: %param: %I.type = param runtime_param +// CHECK:STDOUT: %U.loc10_17.1: %I.type = bind_symbolic_name U, 0, %param [symbolic = %U.loc10_17.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %TypeSelfImpls.decl: %TypeSelfImpls.type = fn_decl @TypeSelfImpls [template = constants.%TypeSelfImpls] { -// CHECK:STDOUT: %V.patt: type = symbolic_binding_pattern V, 0 +// CHECK:STDOUT: %V.patt.loc12_18.1: type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc12_18.2 (constants.%V.patt)] +// CHECK:STDOUT: %V.param_patt: type = param_pattern %V.patt.loc12_18.1, runtime_param [symbolic = %V.patt.loc12_18.2 (constants.%V.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self.2] // CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self.2] @@ -166,8 +172,8 @@ class D { // CHECK:STDOUT: %.loc12: type = where_expr %.Self [template = type] { // CHECK:STDOUT: requirement_impls %.Self.ref, %I.ref // CHECK:STDOUT: } -// CHECK:STDOUT: %V.param: type = param V, runtime_param -// CHECK:STDOUT: %V.loc12_18.1: type = bind_symbolic_name V, 0, %V.param [symbolic = %V.loc12_18.2 (constants.%V)] +// CHECK:STDOUT: %param: type = param runtime_param +// CHECK:STDOUT: %V.loc12_18.1: type = bind_symbolic_name V, 0, %param [symbolic = %V.loc12_18.2 (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -184,32 +190,38 @@ class D { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @PeriodSelf(%T.loc8_15.1: %I.type) { // CHECK:STDOUT: %T.loc8_15.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_15.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_15.2 (constants.%T.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc8_15.1: %I.type); +// CHECK:STDOUT: fn(%T.param_patt: %I.type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @PeriodMember(%U.loc10_17.1: %I.type) { // CHECK:STDOUT: %U.loc10_17.2: %I.type = bind_symbolic_name U, 0 [symbolic = %U.loc10_17.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc10_17.2: %I.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc10_17.2 (constants.%U.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.loc10_17.1: %I.type); +// CHECK:STDOUT: fn(%U.param_patt: %I.type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @TypeSelfImpls(%V.loc12_18.1: type) { // CHECK:STDOUT: %V.loc12_18.2: type = bind_symbolic_name V, 0 [symbolic = %V.loc12_18.2 (constants.%V)] +// CHECK:STDOUT: %V.patt.loc12_18.2: type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc12_18.2 (constants.%V.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%V.loc12_18.1: type); +// CHECK:STDOUT: fn(%V.param_patt: type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @PeriodSelf(constants.%T) { // CHECK:STDOUT: %T.loc8_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @PeriodMember(constants.%U) { // CHECK:STDOUT: %U.loc10_17.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc10_17.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TypeSelfImpls(constants.%V) { // CHECK:STDOUT: %V.loc12_18.2 => constants.%V +// CHECK:STDOUT: %V.patt.loc12_18.2 => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_wrong_member.carbon @@ -223,6 +235,7 @@ class D { // CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %.4: type = struct_type {} [template] // CHECK:STDOUT: %W: %J.type = bind_symbolic_name W, 0 [symbolic] +// CHECK:STDOUT: %W.patt: %J.type = symbolic_binding_pattern W, 0 [symbolic] // CHECK:STDOUT: %PeriodMismatch.type: type = fn_type @PeriodMismatch [template] // CHECK:STDOUT: %PeriodMismatch: %PeriodMismatch.type = struct_value () [template] // CHECK:STDOUT: } @@ -249,7 +262,8 @@ class D { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%J.type] {} {} // CHECK:STDOUT: %PeriodMismatch.decl: %PeriodMismatch.type = fn_decl @PeriodMismatch [template = constants.%PeriodMismatch] { -// CHECK:STDOUT: %W.patt: %J.type = symbolic_binding_pattern W, 0 +// CHECK:STDOUT: %W.patt.loc12_19.1: %J.type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc12_19.2 (constants.%W.patt)] +// CHECK:STDOUT: %W.param_patt: %J.type = param_pattern %W.patt.loc12_19.1, runtime_param [symbolic = %W.patt.loc12_19.2 (constants.%W.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] @@ -259,8 +273,8 @@ class D { // CHECK:STDOUT: %.loc12_25: type = where_expr %.Self [template = constants.%J.type] { // CHECK:STDOUT: requirement_rewrite %Mismatch.ref, // CHECK:STDOUT: } -// CHECK:STDOUT: %W.param: %J.type = param W, runtime_param -// CHECK:STDOUT: %W.loc12_19.1: %J.type = bind_symbolic_name W, 0, %W.param [symbolic = %W.loc12_19.2 (constants.%W)] +// CHECK:STDOUT: %param: %J.type = param runtime_param +// CHECK:STDOUT: %W.loc12_19.1: %J.type = bind_symbolic_name W, 0, %param [symbolic = %W.loc12_19.2 (constants.%W)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -277,12 +291,14 @@ class D { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @PeriodMismatch(%W.loc12_19.1: %J.type) { // CHECK:STDOUT: %W.loc12_19.2: %J.type = bind_symbolic_name W, 0 [symbolic = %W.loc12_19.2 (constants.%W)] +// CHECK:STDOUT: %W.patt.loc12_19.2: %J.type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc12_19.2 (constants.%W.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%W.loc12_19.1: %J.type); +// CHECK:STDOUT: fn(%W.param_patt: %J.type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @PeriodMismatch(constants.%W) { // CHECK:STDOUT: %W.loc12_19.2 => constants.%W +// CHECK:STDOUT: %W.patt.loc12_19.2 => constants.%W // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_designator_matches_var.carbon diff --git a/toolchain/check/testdata/where_expr/fail_not_facet.carbon b/toolchain/check/testdata/where_expr/fail_not_facet.carbon index 4f745552d91d..95816e0bb816 100644 --- a/toolchain/check/testdata/where_expr/fail_not_facet.carbon +++ b/toolchain/check/testdata/where_expr/fail_not_facet.carbon @@ -27,6 +27,7 @@ fn F(T:! i32 where .Self == bool); // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %T: = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } @@ -55,7 +56,8 @@ fn F(T:! i32 where .Self == bool); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt: = symbolic_binding_pattern T, 0 +// CHECK:STDOUT: %T.patt.loc7_6.1: = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: = param_pattern %T.patt.loc7_6.1, runtime_param [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -66,8 +68,8 @@ fn F(T:! i32 where .Self == bool); // CHECK:STDOUT: %.loc7_14: type = where_expr %.Self [template = ] { // CHECK:STDOUT: requirement_equivalent %.Self.ref, %bool.make_type // CHECK:STDOUT: } -// CHECK:STDOUT: %T.param: = param T, runtime_param -// CHECK:STDOUT: %T.loc7_6.1: = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %param: = param runtime_param +// CHECK:STDOUT: %T.loc7_6.1: = bind_symbolic_name T, 0, %param [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -77,11 +79,13 @@ fn F(T:! i32 where .Self == bool); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc7_6.1: ) { // CHECK:STDOUT: %T.loc7_6.2: = bind_symbolic_name T, 0 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc7_6.2: = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc7_6.1: ); +// CHECK:STDOUT: fn(%T.param_patt: ); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/non_generic.carbon b/toolchain/check/testdata/where_expr/non_generic.carbon index 37cf9064dd26..d099f801e5b5 100644 --- a/toolchain/check/testdata/where_expr/non_generic.carbon +++ b/toolchain/check/testdata/where_expr/non_generic.carbon @@ -53,6 +53,7 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: %NotGenericF.decl: %NotGenericF.type = fn_decl @NotGenericF [template = constants.%NotGenericF] { // CHECK:STDOUT: %U.patt: %I.type = binding_pattern U +// CHECK:STDOUT: %U.param_patt: %I.type = param_pattern %U.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] @@ -62,8 +63,8 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: %.loc14: type = where_expr %.Self [template = constants.%I.type] { // CHECK:STDOUT: requirement_equivalent %T.ref, %int.make_type_32 // CHECK:STDOUT: } -// CHECK:STDOUT: %U.param: %I.type = param U, runtime_param0 -// CHECK:STDOUT: %U: %I.type = bind_name U, %U.param +// CHECK:STDOUT: %param: %I.type = param runtime_param0 +// CHECK:STDOUT: %U: %I.type = bind_name U, %param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -80,7 +81,7 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NotGenericF(%U: %I.type) { +// CHECK:STDOUT: fn @NotGenericF(%U.param_patt: %I.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/while/fail_bad_condition.carbon b/toolchain/check/testdata/while/fail_bad_condition.carbon index 5ccb16bd6fb5..2d7f28befeff 100644 --- a/toolchain/check/testdata/while/fail_bad_condition.carbon +++ b/toolchain/check/testdata/while/fail_bad_condition.carbon @@ -31,6 +31,7 @@ fn While() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] @@ -56,12 +57,12 @@ fn While() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,6 +76,7 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] @@ -116,19 +118,22 @@ fn While() { // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { @@ -139,6 +144,7 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(bool) { // CHECK:STDOUT: %Dest => bool +// CHECK:STDOUT: %Dest.patt => bool // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/diagnostics/diagnostic_kind.def b/toolchain/diagnostics/diagnostic_kind.def index 5542d306c3fd..1bc2e2dad560 100644 --- a/toolchain/diagnostics/diagnostic_kind.def +++ b/toolchain/diagnostics/diagnostic_kind.def @@ -281,6 +281,7 @@ CARBON_DIAGNOSTIC_KIND(AbstractTypeInVarDecl) CARBON_DIAGNOSTIC_KIND(AddrOfEphemeralRef) CARBON_DIAGNOSTIC_KIND(AddrOfNonRef) CARBON_DIAGNOSTIC_KIND(AddrOnNonSelfParam) +CARBON_DIAGNOSTIC_KIND(AddrOnNonPointerType) CARBON_DIAGNOSTIC_KIND(ArrayBoundTooLarge) CARBON_DIAGNOSTIC_KIND(ArrayBoundNegative) CARBON_DIAGNOSTIC_KIND(ArrayIndexOutOfBounds) diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 3c333b803e96..7d9b36adab5b 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -207,10 +207,11 @@ auto FileContext::BuildFunctionDecl(SemIR::FunctionId function_id, SemIR::ReturnTypeInfo::ForFunction(sem_ir(), function, specific_id); CARBON_CHECK(return_info.is_valid(), "Should not lower invalid functions."); - auto implicit_param_refs = - sem_ir().inst_blocks().GetOrEmpty(function.implicit_param_refs_id); + auto implicit_param_patterns = + sem_ir().inst_blocks().GetOrEmpty(function.implicit_param_patterns_id); // TODO: Include parameters corresponding to positional parameters. - auto param_refs = sem_ir().inst_blocks().GetOrEmpty(function.param_refs_id); + auto param_patterns = + sem_ir().inst_blocks().GetOrEmpty(function.param_patterns_id); auto* return_type = return_info.type_id.is_valid() ? GetType(return_info.type_id) : nullptr; @@ -222,22 +223,23 @@ auto FileContext::BuildFunctionDecl(SemIR::FunctionId function_id, // demand. llvm::SmallVector param_inst_ids; auto max_llvm_params = (return_info.has_return_slot() ? 1 : 0) + - implicit_param_refs.size() + param_refs.size(); + implicit_param_patterns.size() + param_patterns.size(); param_types.reserve(max_llvm_params); param_inst_ids.reserve(max_llvm_params); if (return_info.has_return_slot()) { param_types.push_back(return_type->getPointerTo()); param_inst_ids.push_back(function.return_storage_id); } - for (auto param_ref_id : - llvm::concat(implicit_param_refs, param_refs)) { - auto param_info = - SemIR::Function::GetParamFromParamRefId(sem_ir(), param_ref_id); - if (!param_info.inst.runtime_index.is_valid()) { + for (auto param_pattern_id : llvm::concat( + implicit_param_patterns, param_patterns)) { + auto param_pattern = SemIR::Function::GetParamPatternInfoFromPatternId( + sem_ir(), param_pattern_id) + .inst; + if (!param_pattern.runtime_index.is_valid()) { continue; } - auto param_type_id = SemIR::GetTypeInSpecific(sem_ir(), specific_id, - param_info.inst.type_id); + auto param_type_id = + SemIR::GetTypeInSpecific(sem_ir(), specific_id, param_pattern.type_id); switch (auto value_rep = SemIR::ValueRepr::ForType(sem_ir(), param_type_id); value_rep.kind) { case SemIR::ValueRepr::Unknown: @@ -248,7 +250,7 @@ auto FileContext::BuildFunctionDecl(SemIR::FunctionId function_id, case SemIR::ValueRepr::Custom: case SemIR::ValueRepr::Pointer: param_types.push_back(GetType(value_rep.type_id)); - param_inst_ids.push_back(param_ref_id); + param_inst_ids.push_back(param_pattern_id); break; } } @@ -283,8 +285,9 @@ auto FileContext::BuildFunctionDecl(SemIR::FunctionId function_id, arg.addAttr( llvm::Attribute::getWithStructRetType(llvm_context(), return_type)); } else { - name_id = SemIR::Function::GetParamFromParamRefId(sem_ir(), inst_id) - .GetNameId(sem_ir()); + name_id = + SemIR::Function::GetParamPatternInfoFromPatternId(sem_ir(), inst_id) + .GetNameId(sem_ir()); } arg.setName(sem_ir().names().GetIRBaseName(name_id)); } @@ -355,10 +358,6 @@ auto FileContext::BuildFunctionDefinition(SemIR::FunctionId function_id) // // TODO: Support general patterns here. auto bind_name_id = param_ref_id; - if (auto addr = - sem_ir().insts().TryGetAs(param_ref_id)) { - bind_name_id = addr->inner_id; - } auto bind_name = sem_ir().insts().Get(bind_name_id); CARBON_CHECK(bind_name.Is()); function_lowering.SetLocal(bind_name_id, param_value); @@ -416,7 +415,8 @@ static auto BuildTypeForInst(FileContext& context, SemIR::BuiltinInst inst) -> llvm::Type* { switch (inst.builtin_inst_kind) { case SemIR::BuiltinInstKind::Invalid: - CARBON_FATAL("Unexpected builtin type in lowering."); + case SemIR::BuiltinInstKind::AutoType: + CARBON_FATAL("Unexpected builtin type in lowering: {0}", inst); case SemIR::BuiltinInstKind::Error: // This is a complete type but uses of it should never be lowered. return nullptr; diff --git a/toolchain/lower/handle.cpp b/toolchain/lower/handle.cpp index f06ab81a3a5f..4f6e8b8c7d6b 100644 --- a/toolchain/lower/handle.cpp +++ b/toolchain/lower/handle.cpp @@ -24,11 +24,6 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, context.SetLocal(inst_id, context.GetValue(inst.lvalue_id)); } -auto HandleInst(FunctionContext& /*context*/, SemIR::InstId /*inst_id*/, - SemIR::AddrPattern /*inst*/) -> void { - CARBON_FATAL("`addr` should be lowered by `BuildFunctionDefinition`"); -} - auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, SemIR::ArrayIndex inst) -> void { auto* array_value = context.GetValue(inst.array_id); diff --git a/toolchain/lower/testdata/array/function_param.carbon b/toolchain/lower/testdata/array/function_param.carbon index 6ddec2e2fe99..3bca4f6c7dcd 100644 --- a/toolchain/lower/testdata/array/function_param.carbon +++ b/toolchain/lower/testdata/array/function_param.carbon @@ -19,7 +19,7 @@ fn G() -> i32 { // CHECK:STDOUT: ; ModuleID = 'function_param.carbon' // CHECK:STDOUT: source_filename = "function_param.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @array.loc16_11.1 = internal constant [3 x i32] [i32 1, i32 2, i32 3] +// CHECK:STDOUT: @array.loc16_20.13 = internal constant [3 x i32] [i32 1, i32 2, i32 3] // CHECK:STDOUT: // CHECK:STDOUT: define i32 @_CF.Main(ptr %arr, i32 %i) !dbg !4 { // CHECK:STDOUT: entry: @@ -34,7 +34,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc16_20.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.2.temp, i32 0, i32 0, !dbg !10 // CHECK:STDOUT: %.loc16_20.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.2.temp, i32 0, i32 1, !dbg !10 // CHECK:STDOUT: %.loc16_20.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.2.temp, i32 0, i32 2, !dbg !10 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc16_20.2.temp, ptr align 4 @array.loc16_11.1, i64 12, i1 false), !dbg !11 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc16_20.2.temp, ptr align 4 @array.loc16_20.13, i64 12, i1 false), !dbg !10 // CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr %.loc16_20.2.temp, i32 1), !dbg !11 // CHECK:STDOUT: ret i32 %F.call, !dbg !12 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/function/call/struct_param.carbon b/toolchain/lower/testdata/function/call/struct_param.carbon index c7e0ef7f6745..c1d708b2f05c 100644 --- a/toolchain/lower/testdata/function/call/struct_param.carbon +++ b/toolchain/lower/testdata/function/call/struct_param.carbon @@ -17,7 +17,7 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'struct_param.carbon' // CHECK:STDOUT: source_filename = "struct_param.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @struct.3.loc14_4.3 = internal constant { i32, i32 } { i32 2, i32 3 } +// CHECK:STDOUT: @struct.3.loc14_34.2 = internal constant { i32, i32 } { i32 2, i32 3 } // CHECK:STDOUT: // CHECK:STDOUT: define void @_CF.Main({ i32 } %b, ptr %c) !dbg !4 { // CHECK:STDOUT: entry: @@ -26,7 +26,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main({ i32 } { i32 1 }, ptr @struct.3.loc14_4.3), !dbg !9 +// CHECK:STDOUT: call void @_CF.Main({ i32 } { i32 1 }, ptr @struct.3.loc14_34.2), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/tuple_param.carbon b/toolchain/lower/testdata/function/call/tuple_param.carbon index 5ad45eaf9e73..fea4246e7291 100644 --- a/toolchain/lower/testdata/function/call/tuple_param.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param.carbon @@ -17,7 +17,7 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'tuple_param.carbon' // CHECK:STDOUT: source_filename = "tuple_param.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @tuple.3.loc14_4.3 = internal constant { i32, i32 } { i32 2, i32 3 } +// CHECK:STDOUT: @tuple.3.loc14_20.2 = internal constant { i32, i32 } { i32 2, i32 3 } // CHECK:STDOUT: // CHECK:STDOUT: define void @_CF.Main({ i32 } %b, ptr %c) !dbg !4 { // CHECK:STDOUT: entry: @@ -26,7 +26,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main({ i32 } { i32 1 }, ptr @tuple.3.loc14_4.3), !dbg !9 +// CHECK:STDOUT: call void @_CF.Main({ i32 } { i32 1 }, ptr @tuple.3.loc14_20.2), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon index 13c11206d45b..89715764c063 100644 --- a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon @@ -19,7 +19,7 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'tuple_param_with_return_slot.carbon' // CHECK:STDOUT: source_filename = "tuple_param_with_return_slot.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @tuple.3.loc16_4.4 = internal constant { i32, i32 } { i32 2, i32 3 } +// CHECK:STDOUT: @tuple.3.loc16_20.2 = internal constant { i32, i32 } { i32 2, i32 3 } // CHECK:STDOUT: // CHECK:STDOUT: define void @_CF.Main(ptr sret({ i32, i32, i32 }) %return, { i32 } %b, ptr %c) !dbg !4 { // CHECK:STDOUT: entry: @@ -40,7 +40,7 @@ fn Main() { // CHECK:STDOUT: define void @_CMain.Main() !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc16_4.1.temp = alloca { i32, i32, i32 }, align 8, !dbg !13 -// CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_4.1.temp, { i32 } { i32 1 }, ptr @tuple.3.loc16_4.4), !dbg !13 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_4.1.temp, { i32 } { i32 1 }, ptr @tuple.3.loc16_20.2), !dbg !13 // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/sem_ir/builtin_inst_kind.def b/toolchain/sem_ir/builtin_inst_kind.def index caad3419ec41..57d20ffdd7eb 100644 --- a/toolchain/sem_ir/builtin_inst_kind.def +++ b/toolchain/sem_ir/builtin_inst_kind.def @@ -46,6 +46,9 @@ CARBON_SEM_IR_BUILTIN_INST_KIND(TypeType, "type") // need to issue further diagnostics. CARBON_SEM_IR_BUILTIN_INST_KIND(Error, "") +// Used for the type of patterns that do not match a fixed type. +CARBON_SEM_IR_BUILTIN_INST_KIND(AutoType, "auto") + // ----------------------------------------------------------------------------- // TODO: Below types are all placeholders. While the above may last, the below // are expected to need to change in order to better reflect Carbon's design. diff --git a/toolchain/sem_ir/entity_with_params_base.h b/toolchain/sem_ir/entity_with_params_base.h index e2f17cae9199..abbe839444e7 100644 --- a/toolchain/sem_ir/entity_with_params_base.h +++ b/toolchain/sem_ir/entity_with_params_base.h @@ -46,7 +46,9 @@ struct EntityWithParamsBase { last_param_node_id = definition.last_param_node_id; pattern_block_id = definition.pattern_block_id; implicit_param_refs_id = definition.implicit_param_refs_id; + implicit_param_patterns_id = definition.implicit_param_patterns_id; param_refs_id = definition.param_refs_id; + param_patterns_id = definition.param_patterns_id; definition_id = definition.definition_id; } @@ -72,7 +74,8 @@ struct EntityWithParamsBase { // Determines whether this entity has any parameter lists. auto has_parameters() const -> bool { - return implicit_param_refs_id.is_valid() || param_refs_id.is_valid(); + return implicit_param_patterns_id.is_valid() || + param_patterns_id.is_valid(); } // The following members always have values, and do not change throughout the @@ -91,10 +94,22 @@ struct EntityWithParamsBase { Parse::NodeId last_param_node_id; // A block containing the pattern insts for the parameter lists. InstBlockId pattern_block_id; - // A block containing a single reference instruction per implicit parameter. + // A block containing, for each implicit parameter, a reference to the + // instruction in the entity's declaration block that depends on all other + // pattern-match insts pertaining to that parameter. InstBlockId implicit_param_refs_id; - // A block containing a single reference instruction per parameter. + // A block containing, for each implicit parameter, a reference to the + // instruction in the entity's pattern block that depends on all other + // pattern insts pertaining to that parameter. + InstBlockId implicit_param_patterns_id; + // A block containing, for each explicit parameter, a reference to the + // instruction in the entity's declaration block that depends on all other + // pattern-match insts pertaining to that parameter. InstBlockId param_refs_id; + // A block containing, for each explicit parameter, a reference to the + // instruction in the entity's pattern block that depends on all other + // pattern insts pertaining to that parameter. + InstBlockId param_patterns_id; // True if declarations are `extern`. bool is_extern; // For an `extern library` declaration, the library name. diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index afd3c09a0dcd..7df7c6d94b2d 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -184,6 +184,7 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { auto untyped_inst = ir->insts().Get(inst_id); CARBON_KIND_SWITCH(untyped_inst) { case AdaptDecl::Kind: + case AddrPattern::Kind: case Assign::Kind: case BaseDecl::Kind: case BindingPattern::Kind: @@ -200,7 +201,6 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case Return::Kind: case ReturnExpr::Kind: case StructTypeField::Kind: - case SymbolicBindingPattern::Kind: return ExprCategory::NotExpr; case ImportRefUnloaded::Kind: @@ -241,7 +241,6 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { } case AddrOf::Kind: - case AddrPattern::Kind: case ArrayType::Kind: case AssociatedConstantDecl::Kind: case AssociatedEntity::Kind: @@ -269,11 +268,13 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case IntLiteral::Kind: case IntType::Kind: case Param::Kind: + case ParamPattern::Kind: case PointerType::Kind: case SpecificFunction::Kind: case StringLiteral::Kind: case StructValue::Kind: case StructType::Kind: + case SymbolicBindingPattern::Kind: case TupleValue::Kind: case TupleType::Kind: case UnaryOperatorNot::Kind: diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index a5cc37f2f3cb..97b15508a5f3 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -284,8 +284,8 @@ class FormatterImpl { llvm::SaveAndRestore function_scope(scope_, inst_namer_->GetScopeFor(id)); - FormatParamList(fn.implicit_param_refs_id, /*is_implicit=*/true); - FormatParamList(fn.param_refs_id, /*is_implicit=*/false); + FormatParamList(fn.implicit_param_patterns_id, /*is_implicit=*/true); + FormatParamList(fn.param_patterns_id, /*is_implicit=*/false); if (fn.return_storage_id.is_valid()) { out_ << " -> "; @@ -452,15 +452,16 @@ class FormatterImpl { // Formats parameters, eliding them completely if they're empty. Wraps in // parentheses or square brackets based on whether these are implicit // parameters. - auto FormatParamList(InstBlockId param_refs_id, bool is_implicit) -> void { - if (!param_refs_id.is_valid()) { + auto FormatParamList(InstBlockId param_patterns_id, bool is_implicit) + -> void { + if (!param_patterns_id.is_valid()) { return; } out_ << (is_implicit ? "[" : "("); llvm::ListSeparator sep; - for (InstId param_id : sem_ir_.inst_blocks().Get(param_refs_id)) { + for (InstId param_id : sem_ir_.inst_blocks().Get(param_patterns_id)) { out_ << sep; if (!param_id.is_valid()) { out_ << "invalid"; @@ -885,7 +886,19 @@ class FormatterImpl { auto FormatArgs(Args... args) -> void { out_ << ' '; llvm::ListSeparator sep; - ((out_ << sep, FormatArg(args)), ...); + FormatArgsImpl(sep, args...); + } + + auto FormatArgsImpl(llvm::ListSeparator& /* sep */) -> void {} + + template + auto FormatArgsImpl(llvm::ListSeparator& sep, Arg arg, Args... args) -> void { + // Suppress printing MatchingInstIds, which aren't really operands. + if constexpr (!std::is_same_v) { + out_ << sep; + FormatArg(arg); + } + FormatArgsImpl(sep, args...); } // FormatArg variants handling printing instruction arguments. Several things diff --git a/toolchain/sem_ir/function.cpp b/toolchain/sem_ir/function.cpp index 9a80ffc2cc2a..98ace1e97356 100644 --- a/toolchain/sem_ir/function.cpp +++ b/toolchain/sem_ir/function.cpp @@ -49,19 +49,43 @@ auto GetCalleeFunction(const File& sem_ir, InstId callee_id) -> CalleeFunction { return result; } +auto Function::ParamPatternInfo::GetNameId(const File& sem_ir) -> NameId { + return sem_ir.entity_names().Get(entity_name_id).name_id; +} + +auto Function::GetParamPatternInfoFromPatternId(const File& sem_ir, + InstId pattern_id) + -> ParamPatternInfo { + auto inst_id = pattern_id; + auto inst = sem_ir.insts().Get(inst_id); + + if (auto addr_pattern = inst.TryAs()) { + inst_id = addr_pattern->inner_id; + inst = sem_ir.insts().Get(inst_id); + } + + auto param_pattern_id = inst_id; + auto param_pattern_inst = inst.As(); + + inst_id = param_pattern_inst.subpattern_id; + inst = sem_ir.insts().Get(inst_id); + + auto binding_pattern = inst.As(); + return {.inst_id = param_pattern_id, + .inst = param_pattern_inst, + .entity_name_id = binding_pattern.entity_name_id}; +} + auto Function::GetParamFromParamRefId(const File& sem_ir, InstId param_ref_id) -> ParamInfo { auto ref = sem_ir.insts().Get(param_ref_id); - if (auto addr_pattern = ref.TryAs()) { - param_ref_id = addr_pattern->inner_id; - ref = sem_ir.insts().Get(param_ref_id); - } - auto bind_name = ref.TryAs(); if (bind_name) { param_ref_id = bind_name->value_id; ref = sem_ir.insts().Get(param_ref_id); + } else { + CARBON_FATAL(); } return {param_ref_id, ref.As(), bind_name}; } diff --git a/toolchain/sem_ir/function.h b/toolchain/sem_ir/function.h index 34d64affa4d4..eee3c40a5026 100644 --- a/toolchain/sem_ir/function.h +++ b/toolchain/sem_ir/function.h @@ -64,6 +64,22 @@ struct Function : public EntityWithParamsBase, out << "}"; } + // Given an instruction from `param_patterns_id` or + // `implicit_param_patterns_id`, returns a `ParamPatternInfo` value with the + // corresponding instruction, its ID, and the entity_name_id of the underlying + // binding pattern. + struct ParamPatternInfo { + InstId inst_id; + ParamPattern inst; + EntityNameId entity_name_id; + + auto GetNameId(const File& sem_ir) -> NameId; + }; + + static auto GetParamPatternInfoFromPatternId(const File& sem_ir, + InstId param_pattern_id) + -> ParamPatternInfo; + // Given a parameter reference instruction from `param_refs_id` or // `implicit_param_refs_id`, returns a `ParamInfo` value with the // corresponding instruction, its ID, and the name binding, if present. diff --git a/toolchain/sem_ir/id_kind.h b/toolchain/sem_ir/id_kind.h index ba0547508e51..a7d59e1c0602 100644 --- a/toolchain/sem_ir/id_kind.h +++ b/toolchain/sem_ir/id_kind.h @@ -120,11 +120,11 @@ using IdKind = TypeEnum< // From base/value_store.h. IntId, RealId, FloatId, StringLiteralValueId, // From sem_ir/id.h. - InstId, AbsoluteInstId, ConstantId, EntityNameId, CompileTimeBindIndex, - RuntimeParamIndex, FunctionId, ClassId, InterfaceId, ImplId, GenericId, - SpecificId, ImportIRId, ImportIRInstId, LocId, BoolValue, IntKind, NameId, - NameScopeId, InstBlockId, TypeId, TypeBlockId, ElementIndex, LibraryNameId, - FloatKind>; + InstId, AbsoluteInstId, MatchingInstId, ConstantId, EntityNameId, + CompileTimeBindIndex, RuntimeParamIndex, FunctionId, ClassId, InterfaceId, + ImplId, GenericId, SpecificId, ImportIRId, ImportIRInstId, LocId, BoolValue, + IntKind, NameId, NameScopeId, InstBlockId, TypeId, TypeBlockId, + ElementIndex, LibraryNameId, FloatKind>; } // namespace Carbon::SemIR diff --git a/toolchain/sem_ir/ids.h b/toolchain/sem_ir/ids.h index fbff82af245d..099dccbdd5ab 100644 --- a/toolchain/sem_ir/ids.h +++ b/toolchain/sem_ir/ids.h @@ -105,6 +105,29 @@ class AbsoluteInstId : public InstId { using InstId::InstId; }; +// An ID of an instruction that is the pattern-match counterpart of a pattern +// inst. This should only be used as the type of a field within a typed +// instruction class that represents a pattern. +// +// In SemIR, a given pattern is represented by one or more pattern insts, which +// describe the pattern itself, and typically by one or more pattern-match +// insts, which describe the process of matching the pattern against the +// scrutinee. The pattern insts are emitted while traversing the parse tree, +// and then the pattern-match insts are emitted by traversing the pattern +// insts, but in some cases it's necessary to precompute the pattern-match +// insts during that first phase. In such a case, the precomputed inst is stored +// as a MatchingInstId member of the pattern inst, so that it's available when +// the pattern inst is later traversed. +class MatchingInstId : public InstId { + public: + // Support implicit conversion from InstId so that InstId and MatchingInstId + // have the same interface. + // NOLINTNEXTLINE(google-explicit-constructor) + constexpr MatchingInstId(InstId inst_id) : InstId(inst_id) {} + + using InstId::InstId; +}; + // The package namespace will be the instruction after builtins. constexpr InstId InstId::PackageNamespace = InstId(BuiltinInstKind::ValidCount); @@ -679,6 +702,9 @@ struct TypeId : public IdBase, public Printable { // The builtin TypeType. static const TypeId TypeType; + // The builtin placeholder type for patterns with deduced types. + static const TypeId AutoType; + // The builtin Error. static const TypeId Error; @@ -701,6 +727,8 @@ struct TypeId : public IdBase, public Printable { out << "type"; if (*this == TypeType) { out << "TypeType"; + } else if (*this == AutoType) { + out << "AutoType"; } else if (*this == Error) { out << "Error"; } else { @@ -713,6 +741,8 @@ struct TypeId : public IdBase, public Printable { constexpr TypeId TypeId::TypeType = TypeId::ForTypeConstant( ConstantId::ForTemplateConstant(InstId::BuiltinTypeType)); +constexpr TypeId TypeId::AutoType = TypeId::ForTypeConstant( + ConstantId::ForTemplateConstant(InstId::BuiltinAutoType)); constexpr TypeId TypeId::Error = TypeId::ForTypeConstant(ConstantId::Error); constexpr TypeId TypeId::Invalid = TypeId(InvalidIndex); diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index c1a9c022c936..40613bf6f782 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -73,6 +73,7 @@ CARBON_SEM_IR_INST_KIND(IntType) CARBON_SEM_IR_INST_KIND(NameRef) CARBON_SEM_IR_INST_KIND(Namespace) CARBON_SEM_IR_INST_KIND(Param) +CARBON_SEM_IR_INST_KIND(ParamPattern) CARBON_SEM_IR_INST_KIND(PointerType) CARBON_SEM_IR_INST_KIND(RequirementRewrite) CARBON_SEM_IR_INST_KIND(RequirementEquivalent) diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index 6fe9ddaf69f9..f9d7e704f7a3 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -46,8 +46,8 @@ InstNamer::InstNamer(const Lex::TokenizedBuffer& tokenized_buffer, auto fn_loc = Parse::NodeId::Invalid; GetScopeInfo(fn_scope).name = globals_.AllocateName( *this, fn_loc, sem_ir.names().GetIRBaseName(fn.name_id).str()); - CollectNamesInBlock(fn_scope, fn.implicit_param_refs_id); - CollectNamesInBlock(fn_scope, fn.param_refs_id); + CollectNamesInBlock(fn_scope, fn.implicit_param_patterns_id); + CollectNamesInBlock(fn_scope, fn.param_patterns_id); if (fn.return_storage_id.is_valid()) { insts_[fn.return_storage_id.index] = { fn_scope, @@ -401,14 +401,6 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } CARBON_KIND_SWITCH(untyped_inst) { - case CARBON_KIND(AddrPattern inst): { - // TODO: We need to assign names to parameters that appear in - // function declarations, which may be nested within a pattern. For - // now, just look through `addr`, but we should find a better way to - // visit parameters. - CollectNamesInBlock(scope_id, inst.inner_id); - break; - } case CARBON_KIND(AssociatedConstantDecl inst): { add_inst_name_id(inst.name_id); continue; @@ -538,10 +530,18 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, add_inst_name_id(sem_ir_.name_scopes().Get(inst.name_scope_id).name_id); continue; } - case CARBON_KIND(Param inst): { - add_inst_name_id(inst.name_id, ".param"); + case InstKind::Param: { + // TODO: Find a way to use the name of the enclosing bind inst here. + add_inst_name("param"); continue; } + case InstKind::ParamPattern: { + add_inst_name_id( + SemIR::Function::GetParamPatternInfoFromPatternId(sem_ir_, inst_id) + .GetNameId(sem_ir_), + ".param_patt"); + break; + } case CARBON_KIND(SpliceBlock inst): { CollectNamesInBlock(scope_id, inst.block_id); break; diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index 647253cd047c..4180226a6e13 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -300,6 +300,7 @@ auto StringifyTypeExpr(const SemIR::File& outer_sem_ir, InstId outer_inst_id) case IntLiteral::Kind: case Namespace::Kind: case Param::Kind: + case ParamPattern::Kind: case RequirementEquivalent::Kind: case RequirementImpls::Kind: case RequirementRewrite::Kind: diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 52887a9f8d3d..d94df0583ec9 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -65,10 +65,10 @@ struct AddrOf { }; // An `addr` pattern, such as `addr self: Self*`. Structurally, `inner_id` will -// generally be one of `AnyBindName`. +// generally be a pattern inst. struct AddrPattern { - static constexpr auto Kind = - InstKind::AddrPattern.Define({.ir_name = "addr_pattern"}); + static constexpr auto Kind = InstKind::AddrPattern.Define( + {.ir_name = "addr_pattern", .is_lowered = false}); TypeId type_id; // The `self` binding. @@ -296,6 +296,7 @@ struct AnyBindingPattern { InstKind kind; TypeId type_id; EntityNameId entity_name_id; + MatchingInstId bind_name_id; }; // Represents a non-symbolic binding pattern. @@ -305,16 +306,25 @@ struct BindingPattern { TypeId type_id; EntityNameId entity_name_id; + MatchingInstId bind_name_id; }; // Represents a symbolic binding pattern. +// +// TODO: Consider dropping this and AnyBindingPattern, using BindingPattern +// everywhere and relying on the kind of .bind_name_id to differentiate them. struct SymbolicBindingPattern { static constexpr auto Kind = - InstKind::SymbolicBindingPattern.Define( - {.ir_name = "symbolic_binding_pattern", .is_lowered = false}); + InstKind::SymbolicBindingPattern.Define({ + .ir_name = "symbolic_binding_pattern", + .is_type = InstIsType::Never, + .constant_kind = InstConstantKind::SymbolicOnly, + .is_lowered = false, + }); TypeId type_id; EntityNameId entity_name_id; + MatchingInstId bind_name_id; }; // Reads an argument from `BranchWithArg`. @@ -822,7 +832,18 @@ struct Param { InstKind::Param.Define({.ir_name = "param"}); TypeId type_id; - NameId name_id; + RuntimeParamIndex runtime_index; +}; + +// A pattern that represents a parameter. It matches the same values as +// `subpattern_id`. +struct ParamPattern { + // TODO: Make Parse::NodeId more specific. + static constexpr auto Kind = InstKind::ParamPattern.Define( + {.ir_name = "param_pattern", .is_lowered = false}); + + TypeId type_id; + InstId subpattern_id; RuntimeParamIndex runtime_index; }; diff --git a/toolchain/sem_ir/yaml_test.cpp b/toolchain/sem_ir/yaml_test.cpp index 34456d1c4eb7..d767e09aa582 100644 --- a/toolchain/sem_ir/yaml_test.cpp +++ b/toolchain/sem_ir/yaml_test.cpp @@ -94,7 +94,8 @@ TEST(SemIRTest, YAML) { Pair("import_refs", Yaml::Mapping(IsEmpty())), Pair("global_init", Yaml::Mapping(IsEmpty())), Pair("block4", Yaml::Mapping(Each(Pair(_, inst_id)))), - Pair("block5", Yaml::Mapping(Each(Pair(_, inst_id))))))))); + Pair("block5", Yaml::Mapping(Each(Pair(_, inst_id)))), + Pair("block6", Yaml::Mapping(Each(Pair(_, inst_id))))))))); auto root = Yaml::Sequence(ElementsAre(Yaml::Mapping( ElementsAre(Pair("filename", "test.carbon"), Pair("sem_ir", file)))));